News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

invoke macro

Started by ragdog, June 07, 2007, 07:12:37 PM

Previous topic - Next topic

ragdog

hi @all

i seach a invoke call function for dll´s  macro
can you me please send a good macro for this??

ProtoDef            typedef proto :dword,:DWORD,:DWORD,:DWORD
lpProc              typedef ptr ProtoDef


.data
szLoadPlugin        db "LoadPlugin", 0
szExecutePlugin   db "ExecutePlugin", 0

.data?

hPlugin                dd ?
ExecutePlugin       lpProc    ?

invoke LoadLibrary,addr szPlugin
mov hPlugin, eax
invoke GetProcAddress,hPlugin,addr szExecutePlugin
mov ExecutePlugin,eax
invoke ExecutePlugin,hWnd

greets
ragdog

u

Please use a smaller graphic in your signature.

Vortex


u

The "nicety" of that is why I created the IFunc macros :). Nothing beats self-documenting code  :toothy
Please use a smaller graphic in your signature.

ragdog

thanks ultrano and vortex

where I get the jump of entries ago??


MsgBox      db 0FFh,025h   ; define manually a jump entry
         dd pMessageBox

Vortex

FFh & 25h = machine code symbols of  jump DWORD PTR [xxxx]

xxxx = 32-bit address

u

^^"  these are simply opcodes for a far-jump, and then 4 bytes - the address of the proc. And Vortex accented on Sinsi's method, which is actually what you had already done and wanted to get away from (apart from having the error of specifying 4 :DWORD instead of 1 in ProtoDef).
Oh well, I'm sticking to using macros to save as much trouble, typing and time as possible.
Please use a smaller graphic in your signature.

ragdog

I understand in this way

MsgBox      db 0FFh,025h   ; jump to dword pointer ------- 
                                                                                   -
                                                                                   -
          dd pMessageBox   <<----------------------------------                   

correctly??                                   


Vortex

Quote from: ragdog on June 07, 2007, 08:02:42 PM
I understand in this way

MsgBox      db 0FFh,025h   ; jump to dword pointer ------- 
                                                                                   -
                                                                                   -
          dd pMessageBox   <<----------------------------------                   

correctly??                                   



Yes, exactly as you said. It's a jump to an address stored in pMessageBox

ragdog

thanks :U

I experiment with it only times


regards

ragdog