This pice of code work correcty in masm32, but
compiling with tasm no!.
HOOKPROC PROC ncode:dword, param:dword, lpram:dword
LOCAL _MSG: MSGSTRUCT
nop
nop
nop
cmp ncode, HC_ACTION
jnz _MOD_0
or STOPFLAG, 0
jz _EXIT
mov eax, lparam
cmp dword ptr , WM_KEYDOWN
jnz _EXIT
mov _MSG.msMESSAGE, WM_KEYDOWN
push dword ptr
pop _MSG.msWPARAM
push dword ptr
pop _MSG.msLPARAM
push dHandleWindow
pop _MSG.msHWND
lea edx, dword ptr _MSG
push edx
call TranslateMessage
lea edx, dword ptr sBufferCaptura
push edx
push 2
push WM_GETTEXT
push
call SendMessageA
or byte ptr , 0
jz _ZERO
nop
nop
push 1
lea edx, dword ptr sBufferCaptura
push edx
push
call _lwrite
compiling with tasm no!.
HOOKPROC PROC ncode:dword, param:dword, lpram:dword
LOCAL _MSG: MSGSTRUCT
nop
nop
nop
cmp ncode, HC_ACTION
jnz _MOD_0
or STOPFLAG, 0
jz _EXIT
mov eax, lparam
cmp dword ptr , WM_KEYDOWN
jnz _EXIT
mov _MSG.msMESSAGE, WM_KEYDOWN
push dword ptr
pop _MSG.msWPARAM
push dword ptr
pop _MSG.msLPARAM
push dHandleWindow
pop _MSG.msHWND
lea edx, dword ptr _MSG
push edx
call TranslateMessage
lea edx, dword ptr sBufferCaptura
push edx
push 2
push WM_GETTEXT
push
call SendMessageA
or byte ptr , 0
jz _ZERO
nop
nop
push 1
lea edx, dword ptr sBufferCaptura
push edx
push
call _lwrite
Actually there are some difference between Tasm and Masm, In there coding for some programs
I'm not sure about this, since I haven't tried creating a hook program under TASM. But I'll try.
[color=blue];HOOKPROC PROC ncode:dword, param:dword, lpram:dword[/color]
PROC HOOKPROC
[color=blue]LOCAL _MSG: MSGSTRUCT[/color] ;try declaring this on the dataseg
nop
nop
nop
[color=blue];cmp ncode, HC_ACTION[/color]
cmp DWORD PTR [esp+4], HC_ACTION
jnz _MOD_0
or STOPFLAG, 0
jz _EXIT
[color=blue];mov eax, lparam[/color]
mov eax, DWORD PTR [esp+12]
cmp dword ptr [eax], WM_KEYDOWN
jnz _EXIT
....
ENDP HOOKPROC
The blue ones are the original code. I commented it out and replaced it.Originally posted by stryker
The blue ones are the original code. I commented it out and replaced it.
The blue ones are the original code. I commented it out and replaced it.
why would you want to remove the parameters and locals? still using tasm 1.0? ;)
lol@tasm 1.0 ... I'm not sure but I'm ensuring backwards compatibility... :grin: