Hey guys, here is my question:
I want to invoke an API, however, its not defined, so i use GetProcAddress. How i can use "invoke" on the result, instead of pushing all parameters by hand and then call the address.
I want to use it like this:
mov UndocumentedApi,rv(GetProcAddress,hModule,"ApiName")
invoke UndocumentedApi,param1,param2,param3,paramX
Thanks (:
ApiName PROTO :DWORD,:DWORD,:DWORD,:DWORD
I get "error A2001: immediate operand not allowed" on the "mov UndocumentedApi,rv(GetProcAddress,hModule,"ApiName")" line.
yah - i have seen this before
let me see if i can find an example...
here is an example of something similar
http://www.masm32.com/board/index.php?topic=11772.msg89003#msg89003
he creates a jmp table entry
func db 0FFh,025h ; define a jump entry
dd pFunc
then...
SetConsoleIcon EQU <pr1 PTR func>
"pr1" is used because the function has 1 parameter
use "pr4" for 4 parameters, etc
after that, the function can be invoked
Alex,
Have a look at "Specialised Prototypes" in the "High Level Macro Help file in MASM32. Write the prototype, place the address of the function in the appropriate variable then "invoke" the function like normal.
Thank you both, i used the SPROTO macro, and its working fine :U