--- Daodan/src/Daodan_Patch.c 2014/03/16 20:06:52 983 +++ Daodan/src/Daodan_Patch.c 2014/04/02 00:48:54 990 @@ -167,6 +167,12 @@ void* DDrPatch_MakeDetour(void* from, vo DDrPatch_MakeJump(&trampoline[pos], (void*)disasm.EIP); DDrPatch_NOOP(from, (void*)disasm.EIP - from); + + DWORD oldp; + if (!VirtualProtect(trampoline, 40, PAGE_EXECUTE_READWRITE, &oldp)) { + DDrStartupMessage("Daodan: Detour: Could not mark page for trampoline as executable: from address 0x%08x", from); + return (void*)-1; + } DDrPatch_MakeJump(from, to); /* memset (&MyDisasm, 0, sizeof(DISASM)); @@ -212,7 +218,8 @@ void* DDrPatch_MakeDetour(void* from, vo DDrStartupMessage(""); DDrStartupMessage(""); DDrStartupMessage(""); - */ +*/ + return trampoline; }