ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Patch.c
(Generate patch)

Comparing Daodan/src/Daodan_Patch.c (file contents):
Revision 983 by alloc, Sun Mar 16 20:06:52 2014 UTC vs.
Revision 990 by alloc, Wed Apr 2 00:48:54 2014 UTC

# Line 167 | Line 167 | void* DDrPatch_MakeDetour(void* from, vo
167  
168          DDrPatch_MakeJump(&trampoline[pos], (void*)disasm.EIP);
169          DDrPatch_NOOP(from, (void*)disasm.EIP - from);
170 +
171 +        DWORD oldp;
172 +        if (!VirtualProtect(trampoline, 40, PAGE_EXECUTE_READWRITE, &oldp)) {
173 +                DDrStartupMessage("Daodan: Detour: Could not mark page for trampoline as executable: from address 0x%08x", from);
174 +                return (void*)-1;
175 +        }
176          DDrPatch_MakeJump(from, to);
177   /*
178      memset (&MyDisasm, 0, sizeof(DISASM));
# Line 212 | Line 218 | void* DDrPatch_MakeDetour(void* from, vo
218      DDrStartupMessage("");
219      DDrStartupMessage("");
220      DDrStartupMessage("");
221 <     */
221 > */
222 >
223          return trampoline;
224   }
225  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)