As the following picture shows , I can get the code buff with asm in x86 platform. Has anyone know how to do this in x64 platform???
bool CheckCodeSnipeCrc32()
{
DWORD addr1, addr2, size;
_asm mov addr1, offset codeBegin;
_asm mov addr2, offset codeEnd;
codeBegin:
//OutputDebugString(L"test");
//OutputDebugString(L"test0");
//OutputDebugString(L"test1");
int a = 0;
a = a + 1;
a = a - 1;
codeEnd:
size = addr2 - addr1;
DWORD curcrc32 = Crc32_ComputeBuf((void*)addr1, size);
DWORD oldCrc32 = 0xbcf07446;
assert(oldCrc32 == curcrc32);
}