#include <iostream>
#include <Windows.h>
#pragma section("runstuff", read, execute)
__declspec(allocate("runstuff"))
const unsigned char compare_code[] = {
0x55,
0x89, 0xE5,
0x8B, 0x45, 0x08,
0x3B, 0x45, 0x0C,
0x7C, 0x06,
0xB8, 0x01, 0x00, 0x00, 0x00,
0xEB, 0x02,
0xB8, 0xFF, 0xFF, 0xFF, 0xFF,
0xC3,
0x90,
0x90
};
int main() {
DWORD oldProtect;
VirtualProtect(&compare_code[0], sizeof(compare_code), PAGE_EXECUTE_READ, &oldProtect);
int(*compare_func)(int, int) = reinterpret_cast<int(*)(int, int)>(&compare_code[0]);
std::cout << compare_func(5, 3) << std::endl;
return 0;
}