flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > [c] call eax |
Author |
|
asmrox 19 Feb 2008, 08:39
how do i call eax in c?
Code: #include <windows.h> int main(){ GetProcAddress(LoadLibrary("x.dll"),1); asm("call %eax"); } i belive thers a better way. |
|||
19 Feb 2008, 08:39 |
|
dap 19 Feb 2008, 17:17
Simply use pointers to functions :
Code: int main (void) { /* defines a pointer to function */ void (*func)(const char*) = NULL; /* retrieves the address of the function and assigns it to the pointer */ func = (void(*)(const char*))GetProcAddress (LoadLibrary ("msvcrt.dll"), "puts"); /* calls the function through the pointer */ func ("pouet"); return 0; } You may skip the list of parameters in the cast I guess. |
|||
19 Feb 2008, 17:17 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.