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 677 by alloc, Sat Mar 2 23:46:33 2013 UTC vs.
Revision 689 by alloc, Mon Mar 4 15:52:19 2013 UTC

# Line 9 | Line 9 | bool DDrPatch_MakeJump(void* from, void*
9          
10          if (VirtualProtect(from, 5, PAGE_EXECUTE_READWRITE, &oldp))
11          {
12 <                *((char*)from) = 0xe9; // jmp rel32
12 >                *((unsigned char*)from) = 0xe9; // jmp rel32
13                  from = (char*)from + 1;
14                  *(int*)from = (unsigned int)to - (unsigned int)from - 4;
15                  VirtualProtect(from, 5, oldp, &oldp);
# Line 25 | Line 25 | bool DDrPatch_MakeCall(void* from, void*
25          
26          if (VirtualProtect(from, 5, PAGE_EXECUTE_READWRITE, &oldp))
27          {
28 <                *((char*)from) = 0xe8; // call rel32
28 >                *((unsigned char*)from) = 0xe8; // call rel32
29                  from = (char*)from + 1;
30                  *(int*)from = (unsigned int)to - (unsigned int)from - 4;
31                  VirtualProtect(from, 5, oldp, &oldp);
# Line 35 | Line 35 | bool DDrPatch_MakeCall(void* from, void*
35                  return false;
36   }
37  
38 < bool DDrPatch_String(char* dest, const char* string, int length)
38 > bool DDrPatch_String(char* dest, const unsigned char* string, int length)
39   {
40          DWORD oldp;
41          
# Line 49 | Line 49 | bool DDrPatch_String(char* dest, const c
49                  return false;
50   }
51  
52 < bool DDrPatch_Byte(char* dest, char value)
52 > bool DDrPatch_Byte(char* dest, unsigned char value)
53   {
54          DWORD oldp;
55          
# Line 63 | Line 63 | bool DDrPatch_Byte(char* dest, char valu
63                  return false;
64   }
65  
66 < bool DDrPatch_Int32(int* dest, int value)
66 > bool DDrPatch_Int32(int* dest, unsigned int value)
67   {
68          DWORD oldp;
69          
# Line 77 | Line 77 | bool DDrPatch_Int32(int* dest, int value
77                  return false;
78   }
79  
80 < bool DDrPatch_Int16(short* dest, short value)
80 > bool DDrPatch_Int16(short* dest, unsigned short value)
81   {
82          DWORD oldp;
83          

Diff Legend

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