.code
MACRO(DEFINE_WRAPPER_FUNC, n, off, x)
+#ifdef _M_IX86
PUBLIC _wrapper_func_&n&
_wrapper_func_&n&:
-mov eax, [esp+4]
-mov eax, [eax+4]
-mov [esp+4], eax
-mov eax, [eax]
-jmp dword ptr [eax+off]
+ mov eax, [esp+4]
+ mov eax, [eax+4]
+ mov [esp+4], eax
+ mov eax, [eax]
+ jmp dword ptr [eax+off]
+#elif defined(_M_AMD64)
+PUBLIC wrapper_func_&n&
+wrapper_func_&n&:
+ mov rcx, [rcx+4]
+ mov rax, [rcx]
+ jmp qword ptr [rax+off]
+#else
+#error Unimplemented
+#endif
ENDM
DEFINE_WRAPPER_FUNC 3, 12, 24
# @ cdecl ??_U@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg
@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCRT_operator_delete
@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCRT_operator_delete
-@ cdecl -arch=win64 -norelay __uncaught_exception(ptr)
+@ cdecl -norelay __uncaught_exception(ptr)
@ cdecl -arch=win32 -norelay ?_query_new_handler@@YAP6AHI@ZXZ() MSVCRT__query_new_handler
@ cdecl -arch=win64 -norelay ?_query_new_handler@@YAP6AH_K@ZXZ() MSVCRT__query_new_handler
@ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode
@ cdecl __threadhandle() kernel32.GetCurrentThread
@ cdecl __threadid() kernel32.GetCurrentThreadId
@ cdecl __toascii(long)
-@ cdecl __uncaught_exception()
@ cdecl __unDName(ptr str long ptr ptr long)
@ cdecl __unDNameEx(ptr str long ptr ptr ptr long)
@ extern __unguarded_readlc_active