# | 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 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines (old) |
> | Changed lines (new) |