need help asm to pb
Posted: Fri Jun 06, 2008 7:42 am
Anyone could help me my pb translation is not working right
Your help would be much appreciated
org asm code
my PBcode
Thanks!!!
Your help would be much appreciated
org asm code
Code: Select all
ProcInstallHook proc uses ebx edi esi hookProc:DWORD, targetProc:DWORD, patchLen:DWORD
mov esi, patchLen
mov edi, targetProc
mov eax, esi
add eax, 5
invoke Alloc, eax
mov ebx, eax
invoke MemCopy, edi, eax, esi
invoke VirtualProtect, edi, 5, PAGE_EXECUTE_READWRITE, ADDR targetProc
mov eax, hookProc
sub eax, edi
sub eax, 5
mov BYTE PTR [edi], 0E9h
mov [edi + 1], eax
invoke VirtualProtect, edi, 5, targetProc, ADDR targetProc
sub edi, ebx
add esi, ebx
sub edi, 5
mov BYTE PTR [esi], 0E9h
mov [esi + 1], edi
return ebx
ProcInstallHook endp
my PBcode
Code: Select all
Procedure ProcInstallHook(hookProc.l, targetProc.l, patchLen.l)
myESI.l = patchLen
myEDI.l = targetProc
myEAX = myESI
myEAX+5
myEBX.l = AllocateMemory(myEAX)
CopyMemory(@myEDI, @myEAX, myESI)
VirtualProtect_(@myEDI, 5, PAGE_EXECUTE_READWRITE, @targetProc)
myEAX = hookProc
myEAX-myEDI
myEAX-5
PokeB(@myEDI, $E9)
PokeL(@myEDI + 1, eax)
VirtualProtect_(@myEDI, 5, targetProc, @targetProc)
myEDI-myEBX
myESI+myEBX
myEDI-5
PokeB(@myESI, $E9)
PokeL(@myESI + 1, edi)
ProcedureReturn myEBX
EndProcedure