hotmouse How do I cheat?
Reputation: 0
Joined: 18 Jul 2022 Posts: 1
|
Posted: Fri Aug 18, 2023 12:14 am Post subject: only "__cdecl" in $C? |
|
|
in $C, how to use "__stdcall"?
Code: |
[ENABLE]
alloc(allocMem,$1000)
allocMem:
{$C}
extern __cdecl void* malloc(const int size);
//error: extern __stdcall void OutputDebugStringA(const char* str);
extern void OutputDebugStringA(const char* str);
static void test() {
malloc(8);
/*
mov eax,00000008 { 8 }
push eax
call 00A90368 { ->ucrtbase.malloc }
add esp,04
*/
OutputDebugStringA("");
/*
mov eax,L.1 { (0) }
push eax
call 00A903A8 { ->KERNEL32.OutputDebugStringA }
add esp,04
*/
}
{$ASM}
[DISABLE]
dealloc(allocMem)
|
|
|