Fixed calls BeginHook() procedures.

This commit is contained in:
Mr.Stalin
2018-06-24 00:24:27 +03:00
parent d4a501d813
commit 841e741e91
2 changed files with 23 additions and 19 deletions
+3 -3
View File
@@ -211,8 +211,8 @@ static void __fastcall GlobalVarHookScript(DWORD number, int value) {
static void __declspec(naked) SetGlobalVarHook() {
__asm {
pushad;
mov ecx, eax; // number
call GlobalVarHookScript; // edx value
mov ecx, eax; // number
call GlobalVarHookScript; // edx - value
popad;
cmp cRet, 1;
cmovae edx, dword ptr rets[0];
@@ -225,12 +225,12 @@ static void _stdcall RestTimerHookScript() {
DWORD addrHook;
__asm {
mov addrHook, ebx;
HookBegin;
mov args[0], eax;
mov args[8], ecx;
mov args[12], edx;
}
BeginHook();
argCount = 4;
addrHook -= 5;
if (addrHook == 0x499CA1 || addrHook == 0x499B63) {
+20 -16
View File
@@ -76,30 +76,34 @@ end:
}
}
static void __fastcall UseAnimateObjHook_Script(DWORD critter, DWORD animCode, DWORD object) {
BeginHook();
argCount = 3;
args[0] = critter;
args[1] = object;
args[2] = animCode;
RunHookScript(HOOK_USEANIMOBJ);
EndHook();
if (cRet > 0 && static_cast<long>(rets[0]) > 64) cRet = 0;
}
// Before animation of using map object
static void __declspec(naked) UseAnimateObjHook() {
__asm {
mov args[0], eax; // source critter
mov args[8], edx; // anim code
//
cmp dword ptr [esp], 0x412292 + 5;
pushad;
jne contr;
mov args[4], ebp; // map object
push ebp; // map object
jmp next;
contr:
mov args[4], edi;
push edi; // map object
next:
pushad;
}
BeginHook();
argCount = 3;
RunHookScript(HOOK_USEANIMOBJ);
EndHook();
if (cRet > 0 && static_cast<long>(rets[0]) > 64) cRet = 0;
__asm {
mov ecx, eax; // source critter
call UseAnimateObjHook_Script; // edx - anim code
popad;
cmp cRet, 0;
jle skip;