为什么在这一行上给出这个错误?
*(BYTE*)(dwAddr + 5) = 0xC3;
Main.cpp(34):错误C2297:'*':非法,右操作数的类型为'BYTE *'
void PushRetHook(DWORD dwAddr, LPVOID dwNew, int size)
{
DWORD OldProt;
VirtualProtect((void*)dwAddr, size, PAGE_EXECUTE_READWRITE, &OldProt);
memset((void*)(dwAddr), 0x90, size);
*(BYTE*)dwAddr = 0x68;
*(DWORD*)(dwAddr + 1) = (DWORD)dwNew
*(BYTE*)(dwAddr + 5) = 0xC3;
VirtualProtect((void*)(dwAddr), size, OldProt, &OldProt);
}
答案 0 :(得分:6)
您缺少分号
*(DWORD*)(dwAddr + 1) = (DWORD)dwNew // <== missing semicolon
*(BYTE*)(dwAddr + 5) = 0xC3;