Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Created July 20, 2015 21:30
Show Gist options
  • Save kumatti1/6cee5c950b83ebfbdcff to your computer and use it in GitHub Desktop.
Save kumatti1/6cee5c950b83ebfbdcff to your computer and use it in GitHub Desktop.
インラインアセンブラ
#include <windows.h>
void WINAPI hoge();
FARPROC func = (FARPROC)&hoge;
int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
_In_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nCmdShow
)
{
__asm{
push func
ret
}
return 0;
}
void WINAPI hoge()
{
MessageBoxA(0,"","", MB_OK);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment