Free call function....

sample:
invoke GetProcAddress,hDll,CTXT("MsgBox")
fcall eax,hWnd,CTXT("Welcome"),MB_OK
... ...

wise's macro:
fcall eax,addr info
... ...
error:addr overwrite eax

fcall MACRO FunArgs:VARARG
LOCAL txt, arg,curr,addrarg,buseeax
txt TEXTEQU <>
buseeax = 0
%FOR arg, <FunArgs>
  txt CATSTR <arg>, <!,>, txt
ENDM
txt SUBSTR  txt, 1, @SizeStr( %txt ) - 1
:PushNext
curr INSTR 1,txt,<!,>
IF curr NE 0
arg  SUBSTR txt,1,curr-1
txt  SUBSTR txt,curr+1,@SizeStr(% txt)-curr
IF @SizeStr(% txt) GE 1
curr INSTR 1,arg,<!addr>
IF curr NE 0
arg SUBSTR arg,6,@SizeStr(% arg)-5
buseeax=1
lea eax,arg
push eax
ELSE
IF buseeax EQ 1
ifidn arg,<!eax>
.err <addr overwrite eax>
else
push arg
endif
;check eax
ELSE
push arg
ENDIF
ENDIF
goto PushNext
ENDIF
ENDIF
IF buseeax EQ 1
ifidn txt,<!eax>
.err <addr overwrite eax> ;show error information,use eax and addr
else
call txt
endif
ELSE
call txt
ENDIF
ENDM
Posted on 2005-03-13 05:30:05 by AoGo