1) Yes, CDetour does have issues with x64, as in it cannot compile for x64 platforms......................
2) On 64-bit platforms, Gunz isn't ran in an "emulator"; though it is running under "emulation mode", using what you could call a pseudo-emulator at best.
3) What..? Remove the proper CDetour definitions and use the Microsoft Detours build? That changes the library entirely, making it a hybrid of MS Detours and CDetour, unless you mean to exclude all CDetour files and just use Microsoft's detours library.
4) Why would that
only happen for structures or classes? Calling convention isn't the issue.
5) It works without using a run-length disassembler, which adds forward-compatibility when newer instructions are introduced and used in function prologue code.
EDIT:
Using the example:
Code:
#include "example.h"
PBYTE MBA_Prologue;
void MBA_Hook( )
{
_Prologue( MBA_Prologue );
MessageBoxA( 0, "Hooked!", "", MB_OK );
_Epilogue( MBA_Hook );
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
MBA_Prologue = Detour( ( PBYTE ) MessageBoxA + 5, ( PBYTE ) &MBA_Hook );
MessageBoxA( 0, "Works fine", "???", MB_OK );
return( 0 );
}