VC6 内嵌汇编,怎么动态修改常量??
本帖最后由 xuson 于 2020-7-30 19:34 编辑由于游戏版本不同导致基址不一,我已经找其它版本的基址信息,现在想多版本支持,却不知道怎么动态修改下面那些红色标记的常量
024329CCh
02F53190h
01EBA270h
01E8708Ch
01DB96E0h
01D40B50h
01DB96E0h
//===================================================================================================
NAKED void EV_SetTraceHull(int hull)
{
__asm
{
MOV ECX,DWORD PTR DS: ; hl.02D5FE20
MOV EAX,DWORD PTR SS:
MOV DWORD PTR DS:,EAX
RETN
}
}
//===================================================================================================
NAKED model_s* GetModelByIndex(int index)
{
__asm
{
SUB ESP,10h
PUSH ESI
PUSH EDI
MOV EDI,DWORD PTR SS:
MOV ESI,DWORD PTR DS:
TEST ESI,ESI
JNZ label_01
POP EDI
XOR EAX,EAX
POP ESI
ADD ESP,10h
RETN
label_01:
MOV EAX,DWORD PTR DS:
CMP EAX,01h
JE label_02
CMP EAX,02h
JNZ label_03
label_02:
FLD DWORD PTR DS:
FCOMP DWORD PTR DS:
FSTSW AX
TEST AH,44h
JPO label_04
MOV EAX,01DB96E0h
CALL EAX
FSTP QWORD PTR SS:
PUSH 00h
PUSH 00h
PUSH ESI
MOV EAX,01D40B50h
CALL EAX
MOV EAX,01DB96E0h
CALL EAX
FSTP QWORD PTR SS:
FLD QWORD PTR SS:
FSUB QWORD PTR SS:
ADD ESP,04h
FSTP DWORD PTR SS:
FLD DWORD PTR SS:
FSTP QWORD PTR SS:
PUSH ESI
PUSH 01EBC26Ch ; ASCII "fs_precache_timings: loaded model %s in time %.3f sec"
MOV EAX,01D2F960h
CALL EAX
MOV EAX,DWORD PTR DS:
ADD ESP,10h
POP EDI
POP ESI
ADD ESP,10h
RETN
label_04:
PUSH 00h
PUSH 00h
PUSH ESI
MOV EAX,01D40B50h
CALL EAX
ADD ESP,0Ch
label_03:
MOV EAX,DWORD PTR DS:
POP EDI
POP ESI
ADD ESP,10h
RETN
}
} 可以先把常量指向的数据写到其他地址,在把这个地址写入代码 罗萨 发表于 2020-7-30 19:54
可以先把常量指向的数据写到其他地址,在把这个地址写入代码
不是很懂,能举个例子么?
页:
[1]