im trying to write a simple JMP (E9) hook for a source engine game so i can log the parameters passed to a certain function. here is my source (MASM),
Code:
hook proc from:dword, to:dword
push 40h
push 1000h
push 4h
push 0
call VirtualAlloc
mov [oldProt], eax
push [oldProt]
push 40h
push 5h
push from
call VirtualProtect
push eax
push edx
mov edx, from
mov eax, to
sub eax, edx
sub eax, 5
mov dword ptr ds:[from], 0E9h
inc from
mov dword ptr ds:[from], eax
pop edx
pop eax
ret 8
hook endp
anyways it dosent seem to do anything.
i call it like this:
Code:
push 605AB298
lea eax, newfunc
push eax