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
Posted on 2002-03-24 22:52:48 by leaedx2002
Actually there are some difference between Tasm and Masm, In there coding for some programs
Posted on 2002-03-24 23:46:53 by amr
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.
Posted on 2002-03-25 00:14:59 by stryker
Originally posted by stryker
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? ;)
Posted on 2002-03-25 09:31:47 by Tola
lol@tasm 1.0 ... I'm not sure but I'm ensuring backwards compatibility... :grin:
Posted on 2002-03-25 10:30:29 by stryker