--- Daodan/src/Daodan_Patch.c 2009/06/09 12:00:41 346 +++ Daodan/src/Daodan_Patch.c 2009/06/13 01:13:36 351 @@ -1,5 +1,6 @@ #include "Daodan_Patch.h" #include +#include #include bool DDrPatch_MakeJump(void* from, void* to) @@ -99,5 +100,19 @@ bool DDrPatch_StrDup(int* dest, const ch return true; } else + return false; +} + +bool DDrPatch_NOOP(char* dest, unsigned int length) +{ + DWORD oldp; + + if (VirtualProtect(dest, length, PAGE_EXECUTE_READWRITE, &oldp)) + { + memset(dest, 0x90, length); + VirtualProtect(dest, length, oldp, &oldp); + return true; + } + else return false; }