Changeset 1008 for Daodan/src
- Timestamp:
- Aug 26, 2014, 1:21:09 AM (10 years ago)
- Location:
- Daodan/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan_Config.c
r1007 r1008 48 48 } }, 49 49 { "gameplay", "Gameplay", { 50 { "characterawareness", 51 "Makes AI remember the player.", 52 C_BOOL, 53 {.intBoolVal = true}, 54 {.intBoolVal = true} }, 50 55 { "cheatsenabled", 51 56 "Enables cheats without having to beat the game first.", -
Daodan/src/Daodan_Patch.c
r995 r1008 242 242 } 243 243 244 void* DDrPatch_ExecutableASM(char* from, char* nextInst, const unsigned char* code, int length) 245 { 246 char* newCode = malloc(length+5); 247 if (!DDrPatch_NOOP(newCode, length+5)) 248 return (void*)-1; 249 250 memcpy(newCode, code, length); 251 if (!DDrPatch_MakeJump(&newCode[length], nextInst)) 252 return (void*)-1; 253 254 DWORD oldp; 255 if (!VirtualProtect(newCode, length+5, PAGE_EXECUTE_READWRITE, &oldp)) { 256 STARTUPMESSAGE("ExecASM: Could not mark page for new code as executable: from address 0x%08x", from); 257 return (void*)-1; 258 } 259 260 if (!DDrPatch_MakeJump(from, newCode)) 261 return (void*)-1; 262 263 return newCode; 264 } 244 265 245 266 void DDrPatch_PrintDisasm(void* addr, int instLimit, int sizeLimit) -
Daodan/src/Daodan_Patch.h
r994 r1008 16 16 bool DDrPatch_Int16(short* dest, unsigned short value); 17 17 bool DDrPatch_NOOP(char* dest, unsigned int length); 18 void* DDrPatch_ExecutableASM(char* from, char* nextInst, const unsigned char* code, int length); 18 19 19 20 void DDrPatch_PrintDisasm(void* addr, int instLimit, int sizeLimit); -
Daodan/src/Patches/Patches.c
r1000 r1008 278 278 279 279 280 280 void DD_Patch_CharacterAwareness() 281 { 282 const unsigned char patch[] = 283 { 284 0x52, // 0: push edx 285 0xBA, 0xA0, 0x16, 0x00, 0x00, // 1: mov edx,0x16a0 286 0x89, 0xF8, // 6: mov eax,edi 287 0xF7, 0xE2, // 8: mul edx 288 0x89, 0xC2, // a: mov edx,eax 289 0xE8, 0x00, 0x00, 0x00, 0x00, // c: call ONrGameState_LivingCharacterList_Get (-> OniExe + 0x000fca90) 290 0x8B, 0x00, // 11: mov eax,[eax] 291 0x01, 0xD0, // 13: add eax,edx 292 0x89, 0xC6, // 15: mov esi,eax 293 0x5A, // 17: pop edx 294 0x8B, 0x46, 0x04, // 18: (ORIG) mov eax, dword [ds:esi+0x4] 295 0xF6, 0xC4, 0x80 // 1b: (ORIG) test ah, 0x80 296 }; 297 void* newCode = DDrPatch_ExecutableASM((char*)(OniExe + 0x0009A609), (char*)(OniExe + 0x0009A60F), patch, sizeof(patch)); 298 if ((int)newCode > 0) { 299 DDrPatch_MakeCall((char*)(newCode+0xC), (char*)(OniExe + 0x000FCA90)); 300 DDrPatch_NOOP((char*)(OniExe + 0x0009A60E), 1); 301 } 302 } 281 303 282 304 … … 321 343 if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal) 322 344 DD_Patch_Regeneration(); 345 346 if (DDrConfig_GetOptOfType("gameplay.characterawareness", C_BOOL)->value.intBoolVal) 347 DD_Patch_CharacterAwareness(); 323 348 324 349 // Cheats always enabled -
Daodan/src/_Version.h
r1007 r1008 6 6 7 7 #define DAODAN_VERSION_MAJOR 3 8 #define DAODAN_VERSION_MINOR 88 #define DAODAN_VERSION_MINOR 9 9 9 #define DAODAN_VERSION_STRING STRINGIZE(DAODAN_VERSION_MAJOR) "." STRINGIZE(DAODAN_VERSION_MINOR) 10 10
Note:
See TracChangeset
for help on using the changeset viewer.