| 7 |
|
#include "Daodan_Cheater.h" |
| 8 |
|
#include "Daodan_Persistence.h" |
| 9 |
|
#include "Daodan_BSL.h" |
| 10 |
+ |
#include "Daodan_Console.h" |
| 11 |
|
|
| 12 |
|
#include "Daodan_WindowHack.h" |
| 13 |
|
|
| 40 |
|
bool patch_cheattable = true; |
| 41 |
|
bool patch_argb8888 = true; |
| 42 |
|
bool patch_killvtune = true; |
| 43 |
+ |
bool patch_getcmdline = true; |
| 44 |
+ |
bool patch_disablecmdline = true; |
| 45 |
|
|
| 46 |
|
bool patch_safeprintf = true; |
| 47 |
|
bool patch_daodandisplayenum = true; |
| 48 |
|
bool patch_usegettickcount = true; |
| 49 |
|
bool patch_cheatsenabled = true; |
| 50 |
< |
bool patch_usedaodangl = false; |
| 51 |
< |
bool patch_windowhack = true; |
| 50 |
> |
bool patch_usedaodangl = true; |
| 51 |
> |
bool patch_windowhack = false; |
| 52 |
|
bool patch_daodaninit = true; |
| 53 |
|
bool patch_bsl = true; |
| 54 |
|
bool patch_cheater = true; |
| 55 |
|
|
| 56 |
+ |
// bool patch_newweapon = true; |
| 57 |
+ |
|
| 58 |
|
bool opt_usedaodanbsl = true; |
| 59 |
+ |
bool opt_border = true; |
| 60 |
+ |
bool opt_shadow = false; |
| 61 |
+ |
bool opt_topmost = false; |
| 62 |
|
|
| 63 |
|
bool DDrPatch_Init() |
| 64 |
|
{ |
| 176 |
|
DDrPatch_Byte (OniExe + 0x00135af0, 0x07); |
| 177 |
|
DDrPatch_Byte (OniExe + 0x00135af4, 0x0B); |
| 178 |
|
} |
| 179 |
+ |
|
| 180 |
+ |
//Test newweap patch |
| 181 |
+ |
// if (patch_newweapon) { |
| 182 |
+ |
|
| 183 |
+ |
//Makes it always say "Recieved weapon_name." |
| 184 |
+ |
//Needs check for loc_4DFC66 |
| 185 |
+ |
DDrPatch_NOOP( OniExe + 0x000E4DF8,2); |
| 186 |
+ |
|
| 187 |
+ |
//Adds Weapon name and ammo meter to pickup autoprompt |
| 188 |
+ |
DDrPatch_NOOP( OniExe + 0x000FAC73, 9); |
| 189 |
+ |
DDrPatch_NOOP( OniExe + 0x000FAC80, 5); |
| 190 |
+ |
DDrPatch_MakeCall( OniExe + 0xFAC85, DDrWeapon2Message); |
| 191 |
+ |
|
| 192 |
+ |
//Moves location of colors |
| 193 |
+ |
DDrPatch_Int32( OniExe + 0x0002E3D5, (int)&DDrDSayColors[0].Char ); |
| 194 |
+ |
DDrPatch_Int32( OniExe + 0x0002E3DA, (int)&DDrDSayColors[0].Char ); |
| 195 |
+ |
// } |
| 196 |
|
|
| 197 |
|
// Disable loading the vtuneapi.dll |
| 198 |
|
if (patch_killvtune) |
| 199 |
|
DDrPatch_Byte (OniExe + 0x00026340, 0xC3); |
| 200 |
|
|
| 201 |
+ |
// Disable Oni's internal CLrGetCommandLine function (to eventually replace it with our own) |
| 202 |
+ |
if (patch_getcmdline) |
| 203 |
+ |
DDrPatch_NOOP (OniExe + 0x000d3280, 51); |
| 204 |
+ |
|
| 205 |
+ |
// Disable Oni's command line parser so it doesn't interfere with ours |
| 206 |
+ |
if (patch_disablecmdline) |
| 207 |
+ |
DDrPatch_Int32 (OniExe + 0x000d3570, 0xc3c03366); |
| 208 |
+ |
|
| 209 |
|
return true; |
| 210 |
|
} |
| 211 |
|
|
| 226 |
|
else |
| 227 |
|
{ |
| 228 |
|
ini_section = s_unknown; |
| 229 |
< |
DDrStartupMessage("unrecognised ini section \"%s\"", section); |
| 229 |
> |
DDrStartupMessage("unrecognised section \"%s\"", section); |
| 230 |
|
} |
| 231 |
|
} |
| 232 |
|
|
| 235 |
|
case s_options: |
| 236 |
|
if (!stricmp(name, "usedaodanbsl")) |
| 237 |
|
opt_usedaodanbsl = !stricmp(inifile_cleanstr(value), "true"); |
| 238 |
+ |
else if (!stricmp(name, "border")) |
| 239 |
+ |
opt_border = !stricmp(inifile_cleanstr(value), "true"); |
| 240 |
+ |
else if (!stricmp(name, "shadow")) |
| 241 |
+ |
opt_shadow = !stricmp(inifile_cleanstr(value), "true"); |
| 242 |
+ |
else if (!stricmp(name, "topmost")) |
| 243 |
+ |
opt_topmost = !stricmp(inifile_cleanstr(value), "true"); |
| 244 |
+ |
else if (!stricmp(name, "multibyte")) |
| 245 |
+ |
patch_multibyte = !stricmp(inifile_cleanstr(value), "true"); |
| 246 |
+ |
else if (!stricmp(name, "debug")) |
| 247 |
+ |
AKgDebug_DebugMaps = !stricmp(inifile_cleanstr(value), "true"); |
| 248 |
+ |
else if (!stricmp(name, "debugfiles")) |
| 249 |
+ |
BFgDebugFileEnable = !stricmp(inifile_cleanstr(value), "true"); |
| 250 |
+ |
else if (!stricmp(name, "findsounds")) |
| 251 |
+ |
SSgSearchOnDisk = !stricmp(inifile_cleanstr(value), "true"); |
| 252 |
+ |
else if (!stricmp(name, "ignore_private_data")) |
| 253 |
+ |
opt_ignore_private_data = !stricmp(inifile_cleanstr(value), "true"); |
| 254 |
+ |
else if (!stricmp(name, "sound")) |
| 255 |
+ |
opt_sound = !stricmp(inifile_cleanstr(value), "true"); |
| 256 |
+ |
else if (!stricmp(name, "switch")) |
| 257 |
+ |
M3gResolutionSwitch = !stricmp(inifile_cleanstr(value), "true"); |
| 258 |
+ |
else |
| 259 |
+ |
DDrStartupMessage("unrecognised option \"%s\"", name); |
| 260 |
|
break; |
| 261 |
|
case s_patch: |
| 262 |
|
if (!stricmp(name, "fonttexturecache")) |
| 291 |
|
patch_argb8888 = !stricmp(inifile_cleanstr(value), "true"); |
| 292 |
|
else if (!stricmp(name, "killvtune")) |
| 293 |
|
patch_killvtune = !stricmp(inifile_cleanstr(value), "true"); |
| 294 |
+ |
else if (!stricmp(name, "getcmdline")) |
| 295 |
+ |
patch_getcmdline = !stricmp(inifile_cleanstr(value), "true"); |
| 296 |
+ |
else if (!stricmp(name, "disablecmdline")) |
| 297 |
+ |
patch_disablecmdline = !stricmp(inifile_cleanstr(value), "true"); |
| 298 |
|
else if (!stricmp(name, "safeprintf")) |
| 299 |
|
patch_safeprintf = !stricmp(inifile_cleanstr(value), "true"); |
| 300 |
|
else if (!stricmp(name, "daodandisplayenum")) |
| 460 |
|
void __cdecl DDrMain(int argc, char* argv[]) |
| 461 |
|
{ |
| 462 |
|
DDrStartupMessage("daodan attached!"); |
| 463 |
+ |
|
| 464 |
+ |
opt_ignore_private_data = false; |
| 465 |
+ |
opt_sound = true; |
| 466 |
+ |
|
| 467 |
|
DDrConfig(); |
| 468 |
+ |
DDrStartupMessage("parsing command line..."); |
| 469 |
+ |
int i; |
| 470 |
+ |
char* section; |
| 471 |
+ |
char* option; |
| 472 |
+ |
bool falseoption; |
| 473 |
+ |
for (i = 1; i < argc; i ++) |
| 474 |
+ |
{ |
| 475 |
+ |
if (argv[i][0] == '-') |
| 476 |
+ |
{ |
| 477 |
+ |
section = argv[i] + 1; |
| 478 |
+ |
if ((option = strchr(argv[i], '.'))) |
| 479 |
+ |
{ |
| 480 |
+ |
*option = '\0'; |
| 481 |
+ |
falseoption = (option[1] == 'n' || option[1] == 'N') && (option[2] = 'o' || option[2] == 'O'); |
| 482 |
+ |
if (i < (argc - 1) && argv[i + 1][0] != '-') |
| 483 |
+ |
DDrIniCallback(section, true, option + 1, argv[++i]); |
| 484 |
+ |
else |
| 485 |
+ |
DDrIniCallback(section, true, option + (falseoption ? 3 : 1), (falseoption ? "false" : "true")); |
| 486 |
+ |
*option = '.'; |
| 487 |
+ |
} |
| 488 |
+ |
else |
| 489 |
+ |
{ |
| 490 |
+ |
falseoption = (section[0] == 'n' || section[0] == 'N') && (section[1] = 'o' || section[1] == 'O'); |
| 491 |
+ |
ini_section = s_options; |
| 492 |
+ |
if (i < (argc - 1) && argv[i + 1][0] != '-') |
| 493 |
+ |
DDrIniCallback(NULL, false, section, argv[++i]); |
| 494 |
+ |
else |
| 495 |
+ |
DDrIniCallback(NULL, false, section + (falseoption ? 2 : 0), (falseoption ? "false" : "true")); |
| 496 |
+ |
} |
| 497 |
+ |
} |
| 498 |
+ |
else |
| 499 |
+ |
{ |
| 500 |
+ |
DDrStartupMessage("parse error \"%s\"", argv[i]); |
| 501 |
+ |
break; |
| 502 |
+ |
} |
| 503 |
+ |
} |
| 504 |
+ |
DDrStartupMessage("finished parsing"); |
| 505 |
|
DDrPatch_Init(); |
| 506 |
|
|
| 507 |
|
// Safe startup message printer |