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 272 by rossy, Tue Mar 17 09:06:00 2009 UTC vs.
Revision 346 by rossy, Tue Jun 9 12:00:41 2009 UTC

# Line 1 | Line 1
1   #include "Daodan_Patch.h"
2   #include <windows.h>
3 + #include <string.h>
4  
5   bool DDrPatch_MakeJump(void* from, void* to)
6   {
# Line 84 | Line 85 | bool DDrPatch_Int16(short* dest, short v
85                  return true;
86          }
87          else
88 +                return false;
89 + }
90 +
91 + bool DDrPatch_StrDup(int* dest, const char* value)
92 + {
93 +        DWORD oldp;
94 +        
95 +        if (VirtualProtect(dest, 4, PAGE_EXECUTE_READWRITE, &oldp))
96 +        {
97 +                *dest = (int)strdup(value);
98 +                VirtualProtect(dest, 4, oldp, &oldp);
99 +                return true;
100 +        }
101 +        else
102                  return false;
103   }

Diff Legend

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