flat assembler
Message board for the users of flat assembler.
Index
> Windows > C -> ASM Conversion |
Author |
|
revolution 29 Jul 2010, 06:13
Code: invoke LoadLibrary,'MyLibrary.DLL' invoke GetProcAddress,eax,'MyFunctionName' stdcall eax,1,2 |
|||
29 Jul 2010, 06:13 |
|
LocoDelAssembly 29 Jul 2010, 06:14
Code: include 'win32ax.inc' proc start local Func: DWORD,\ hInst: DWORD invoke LoadLibrary, "MyLibrary.DLL" mov [hInst], eax invoke GetProcAddress, [hInst], "MyFunctionName" mov [Func], eax invoke Func, 1, 2 ; If the function is not stdcall but cdecl then use cinvoke instead ; Alternate form: stdcall [Func], 1, 2 (or "ccall [Func], 1, 2" if it is cdecl) invoke ExitProcess, 0 endp .end start |
|||
29 Jul 2010, 06:14 |
|
typedef 29 Jul 2010, 06:30
thanks.....and btw, bfore i posted my question i tried the second one (without the procedure though) and i got windows error 'mem at such such addr could not be read' lol...i like the 1st one by revolution. i can understand it better. the second one is uhmm...fair..lol
otherwise i would say question answered and thanks to you guys. peace |
|||
29 Jul 2010, 06:30 |
|
LocoDelAssembly 29 Jul 2010, 19:59
Forgot to tell yesterday, revolution version is indeed easily to see but take in mind that it is equivalent to this:
Code: typedef int( *tempFunc )(int a, int b); (tempFunc)GetProcAddress(LoadLibrary("MyLibrary.DLL"), " MyFunctionName")(1, 2); |
|||
29 Jul 2010, 19:59 |
|
revolution 30 Jul 2010, 02:09
Yes, my example was merely to illustrate how to get the handle and procedure address. Any extra requirements like saving and closing handles will need to be added.
|
|||
30 Jul 2010, 02:09 |
|
typedef 30 Jul 2010, 03:14
LocoDelAssembly wrote: Forgot to tell yesterday, revolution version is indeed easily to see but take in mind that it is equivalent to this: Oh! I see what you mean, i get it. thanks man. big time. |
|||
30 Jul 2010, 03:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.