From 9c408e3c30978ef0aa30089aa034497b47cf3399 Mon Sep 17 00:00:00 2001 From: Bobby Dilley Date: Tue, 16 Jan 2024 15:52:12 +0000 Subject: [PATCH] Add work from last night --- src/lindbergh/config.c | 16 ++ src/lindbergh/config.h | 2 + src/lindbergh/input.c | 2 + src/lindbergh/lindbergh.c | 2 +- src/lindbergh/patch.c | 429 +++++++++++++++++--------------------- 5 files changed, 211 insertions(+), 240 deletions(-) diff --git a/src/lindbergh/config.c b/src/lindbergh/config.c index 3fab6ca..b9522b9 100644 --- a/src/lindbergh/config.c +++ b/src/lindbergh/config.c @@ -121,6 +121,12 @@ static int detectGame(uint32_t elf_crc) return 0; } + if(elf_crc == 0x157B0576) { + config.game = VIRTUA_FIGHTER_5_EXPORT; + config.gameStatus = WORKING; + return 0; + } + if (elf_crc == 0xd4726d61) { config.game = LETS_GO_JUNGLE; @@ -228,6 +234,12 @@ static int detectGame(uint32_t elf_crc) return 0; } + if(elf_crc == 0xC4B05D40) { + config.game = VIRTUA_FIGHTER_5_REVE; + config.gameStatus = NOT_WORKING; + return 0; + } + if (elf_crc == 0x3CC635EE) { config.game = SEGABOOT_2_4; @@ -313,6 +325,8 @@ char *getGameName() return "Let's Go Jungle! Lost on the Island of Spice!"; case LETS_GO_JUNGLE_SPECIAL: return "Let's Go Jungle! Special!"; + case VIRTUA_FIGHTER_5_EXPORT: + return "Virtua Fighter 5 Export"; case OUTRUN_2_SP_SDX: return "Outrun 2 SP SDX"; case OUTRUN_2_SP_SDX_REVA: @@ -367,6 +381,8 @@ char *getGameName() return "Virtua Fighter 5 Rev B"; case VIRTUA_FIGHTER_5_REVC: return "Virtua Fighter 5 Rev C"; + case VIRTUA_FIGHTER_5_REVE: + return "Virtua Fighter 5 Rev E"; case VIRTUA_FIGHTER_5_R_REVD: return "Virtua Fighter 5 Rev D"; case VIRTUA_TENNIS_3: diff --git a/src/lindbergh/config.h b/src/lindbergh/config.h index 48e79cd..fdf459a 100644 --- a/src/lindbergh/config.h +++ b/src/lindbergh/config.h @@ -51,6 +51,8 @@ typedef enum VIRTUA_FIGHTER_5_REVA, VIRTUA_FIGHTER_5_REVB, VIRTUA_FIGHTER_5_REVC, + VIRTUA_FIGHTER_5_REVE, + VIRTUA_FIGHTER_5_EXPORT, VIRTUA_FIGHTER_5_R_REVD, VIRTUA_TENNIS_3, VIRTUA_TENNIS_3_TEST diff --git a/src/lindbergh/input.c b/src/lindbergh/input.c index 32264f8..8c88f23 100644 --- a/src/lindbergh/input.c +++ b/src/lindbergh/input.c @@ -210,6 +210,7 @@ int XNextEvent(Display *display, XEvent *event_return) case OUTRUN_2_SP_SDX_REVA: case OUTRUN_2_SP_SDX_REVA_TEST: case SEGA_RACE_TV: + case HUMMER_EXTREME: case R_TUNED: return XNextEventDriving(display, event_return, returnValue); break; @@ -233,6 +234,7 @@ int XNextEvent(Display *display, XEvent *event_return) case VIRTUA_TENNIS_3: case VIRTUA_TENNIS_3_TEST: case VIRTUA_FIGHTER_5: // TODO: Add in all the other VFs + case VIRTUA_FIGHTER_5_EXPORT: default: return XNextEventShooting(display, event_return, returnValue); diff --git a/src/lindbergh/lindbergh.c b/src/lindbergh/lindbergh.c index e4e7012..708fd81 100644 --- a/src/lindbergh/lindbergh.c +++ b/src/lindbergh/lindbergh.c @@ -8,7 +8,7 @@ #define PRELOAD_FILE_NAME "lindbergh.so" // List of all lindbergh executables known, not including the test executables -char *games[] = {"drive.elf", "chopperM.elf", "vsg", "Jennifer", "segaboot", "amiM.elf", "abc", "hod4M.elf", "lgj_final", "vt3", "id4.elf", "id5.elf", "lgjsp_app", "gsevo", "vf5", "apacheM.elf", "END"}; +char *games[] = {"hummer_Master.elf", "drive.elf", "chopperM.elf", "vsg", "Jennifer", "amiM.elf", "abc", "hod4M.elf", "lgj_final", "vt3", "id4.elf", "id5.elf", "lgjsp_app", "gsevo", "vf5", "apacheM.elf", "segaboot", "END"}; /** * Tests if the game uses a seperate elf for test mode diff --git a/src/lindbergh/patch.c b/src/lindbergh/patch.c index 54f0f42..c928268 100644 --- a/src/lindbergh/patch.c +++ b/src/lindbergh/patch.c @@ -79,7 +79,7 @@ static void detourFunction(uint32_t address, void *function) uint32_t jumpAddress = ((uint32_t)function - address) - 5; // Build the assembly to make the function jump - char cave[5] = {0xE9, 0x0, 0x00, 0x00, 0x00}; + char cave[5] = {0xE9, 0x00, 0x00, 0x00, 0x00}; cave[4] = (jumpAddress >> (8 * 3)) & 0xFF; cave[3] = (jumpAddress >> (8 * 2)) & 0xFF; cave[2] = (jumpAddress >> (8 * 1)) & 0xFF; @@ -98,6 +98,16 @@ int stubRetOne() return 1; } +int stubRetMinusOne() +{ + return -1; +} + +char stubRetZeroChar() +{ + return 0x00; +} + int amDongleInit() { return 0; @@ -116,48 +126,29 @@ int amDongleUpdate() int amDongleUserInfoEx(int a, int b, char *_arcadeContext) { if (getConfig()->game == INITIALD_4_REVE) - memcpy(_arcadeContext, "SBNK",4); + memcpy(_arcadeContext, "SBNK", 4); else if (getConfig()->game == INITIALD_5) - memcpy(_arcadeContext, "SBPF",4); + memcpy(_arcadeContext, "SBPF", 4); else if (getConfig()->game == HUMMER_EXTREME) - memcpy(_arcadeContext, "SBST",4); - return 0; -} - -int amLibInit() -{ - uint32_t *amLibContext = (uint32_t *)0x080986c0; // 0x0809cb00; - *amLibContext = 1; - uint32_t *amLibInitialized = (uint32_t *)0x080986c4; // 0x0809cb04; - uint16_t *amLibPort1 = (uint16_t *)(0x080986c4 + 4); //(0x0809cb04 + 4); - uint16_t *amLibPort2 = (uint16_t *)(0x080986c4 + 6); //(0x0809cb04 + 6); - uint32_t *bcLibInitialized = (uint32_t *)(0x080986c4 + 8); // 0x0809cb0c; - *amLibInitialized = 1; - *amLibPort1 = 0xd000; - *amLibPort2 = 0x0004; - *bcLibInitialized = 0; - int res = ((int (*)(void))0x084dedc4)(); // 0x08065d80)(); IDK what it was. - if (res == 1) - *bcLibInitialized = 1; + memcpy(_arcadeContext, "SBST", 4); return 0; } int amDipswInit() { - //uint32_t *amDipswContext = (uint32_t *)0x080980e8; // 0x0809c12c; - //uint32_t *amDipswContext1 = (uint32_t *)(0x080980e8 + 4); //(0x0809c12c + 4); - //uint32_t *amDipswContext2 = (uint32_t *)(0x080980e8 + 8); //(0x0809c12c + 8); - //uint32_t *amDipswContext3 = (uint32_t *)(0x080980e8 + 12); //(0x0809c12c + 12); - // typedef void *(*___constant_c_and_count_memset)(uint32_t *, int, size_t); - //___constant_c_and_count_memset func = (___constant_c_and_count_memset)//0x0805c3d5; - // func(amDipswContext, 0, 4); - //*amDipswContext = 1; - //*amDipswContext1 = 1; - //*amDipswContext2 = 1; - //*amDipswContext3 = 1; return 0; } +int amDipswSetLed() +{ + return 0; +} + +int amDongleIsDevelop() +{ + return 1; +} + void print_binary(unsigned int number) { if (number >> 1) @@ -266,7 +257,7 @@ int initPatch() detourFunction(0x084d45f9, amDongleIsAvailable); detourFunction(0x084d4fef, amDongleUpdate); // Fixes - detourFunction(0x084d44fc, stubRetZero); // Stub amDipswSetLed + detourFunction(0x084d44fc, amDipswSetLed); detourFunction(0x084d4485, amDipswGetData); } break; @@ -294,9 +285,7 @@ int initPatch() detourFunction(0x081e4bfa, amDongleUpdate); // Fixes detourFunction(0x081e48b6, amDipswGetData); - detourFunction(0x081e492e, stubRetZero); // Stub amDipswSetLed - // Does not work - // setVariable(0x08061c31, 0x0000000c); // Force HD resolution + detourFunction(0x081e492e, amDipswSetLed); } break; case AFTER_BURNER_CLIMAX_REVB: @@ -323,7 +312,7 @@ int initPatch() detourFunction(0x081e369e, amDongleUpdate); // Fixes detourFunction(0x081e335a, amDipswGetData); - detourFunction(0x081e33d2, stubRetZero); // Stub amDipswSetLed + detourFunction(0x081e33d2, amDipswSetLed); } break; case AFTER_BURNER_CLIMAX_SDX: @@ -336,7 +325,7 @@ int initPatch() patchMemory(0x08064dca, "00"); // Fixes detourFunction(0x081e489e, amDipswGetData); - detourFunction(0x081e4916, stubRetZero); // Stub amDipswSetLed + detourFunction(0x081e4916, amDipswSetLed); } break; case AFTER_BURNER_CLIMAX_CE: @@ -349,7 +338,7 @@ int initPatch() patchMemory(0x08064d04, "00"); // Fixes detourFunction(0x081e338e, amDipswGetData); - detourFunction(0x081e3406, stubRetZero); // Stub amDipswSetLed + detourFunction(0x081e3406, amDipswSetLed); } break; case OUTRUN_2_SP_SDX_REVA: @@ -374,19 +363,17 @@ int initPatch() detourFunction(0x08190e80, amDongleInit); detourFunction(0x08191201, amDongleIsAvailable); detourFunction(0x08191125, amDongleUpdate); - detourFunction(0x08191221, stubRetOne); + detourFunction(0x08191221, amDongleIsDevelop); // Fixes detourFunction(0x08190ca4, amDipswInit); detourFunction(0x08190db6, amDipswGetData); - detourFunction(0x08190e2e, stubRetZero); // Stub amDipswSetLed + detourFunction(0x08190e2e, amDipswSetLed); - // Not sure what this does + // Taken from original patched OUTRUN 2 SP SDX by Android patchMemory(0x8105317, "909090909090909090909090909090909090909090909090909090909090909090909090"); patchMemory(0x8048000 + 0x000C1593, "9090"); patchMemory(0x8048000 + 0x000C1597, "9090"); patchMemory(0x8048000 + 0x000C159D, "77"); - - } break; case OUTRUN_2_SP_SDX_REVA_TEST: @@ -397,7 +384,7 @@ int initPatch() detourFunction(0x080664c5, amDongleUpdate); // Fixes detourFunction(0x08066156, amDipswGetData); - detourFunction(0x080661ce, stubRetZero); // Stub amDipswSetLed + detourFunction(0x080661ce, amDipswSetLed); // Stub amDipswSetLed detourFunction(0x08066044, amDipswInit); } break; @@ -427,7 +414,8 @@ int initPatch() detourFunction(0x083203c0, amDongleUpdate); // Fixes detourFunction(0x0831ddd7, amDipswGetData); - detourFunction(0x0831de4f, stubRetZero); // Stub amDipswSetLed + detourFunction(0x0831de4f, amDipswSetLed); + // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -445,7 +433,8 @@ int initPatch() detourFunction(0x0831af7e, amDongleUpdate); // Fixes detourFunction(0x0831875f, amDipswGetData); - detourFunction(0x083187d7, stubRetZero); // Stub amDipswSetLed + detourFunction(0x083187d7, amDipswSetLed); + // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -462,7 +451,8 @@ int initPatch() detourFunction(0x080679e8, amDongleUpdate); // Fixes detourFunction(0x08067653, amDipswGetData); - detourFunction(0x080676cb, stubRetZero); // Stub amDipswSetLed + detourFunction(0x080676cb, amDipswSetLed); + // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -481,7 +471,8 @@ int initPatch() patchMemory(0x081f9499, "01"); // Fixes detourFunction(0x08360e93, amDipswGetData); - detourFunction(0x08360f0b, stubRetZero); // Stub amDipswSetLed + detourFunction(0x08360f0b, amDipswSetLed); + // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -498,7 +489,8 @@ int initPatch() detourFunction(0x0806eb8e, amDongleUpdate); // Fixes detourFunction(0x0806e7c7, amDipswGetData); - detourFunction(0x0806e83f, stubRetZero); // Stub amDipswSetLed + detourFunction(0x0806e83f, amDipswSetLed); + // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -515,7 +507,8 @@ int initPatch() detourFunction(0x084b9d37, amDongleUpdate); // Fixes detourFunction(0x084b6a69, amDipswGetData); - detourFunction(0x084b6adf, stubRetZero); // Stub amDipswSetLed + detourFunction(0x084b6adf, amDipswSetLed); + // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -532,7 +525,8 @@ int initPatch() detourFunction(0x08077e47, amDongleUpdate); // Fixes detourFunction(0x080772dd, amDipswGetData); - detourFunction(0x08077353, stubRetZero); // Stub amDipswSetLed + detourFunction(0x08077353, amDipswSetLed); + // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -548,14 +542,29 @@ int initPatch() detourFunction(0x085c6010, amDongleInit); detourFunction(0x085c63cc, amDongleIsAvailable); detourFunction(0x085c62f0, amDongleUpdate); + // Fixes and patches to bypss network check detourFunction(0x085c5f46, amDipswGetData); - detourFunction(0x085c5fbe, stubRetZero); // Stub amDipswSetLed - detourFunction(0x080b3426, stubRetZero); // Stub returns 0 - detourFunction(0x080cb6d4, stubRetZero); // Stub returns 0 - detourFunction(0x0840889e, stubRetZero); // Stub returns 0 - detourFunction(0x0840ab90, stubRetZero); // Stub returns 0 - patchMemory(0x080e17af, "b800000000"); // Patch IDK what + detourFunction(0x085c5fbe, amDipswSetLed); // Stub amDipswSetLed + detourFunction(0x080b3426, stubRetZero); // Stub returns 0 + detourFunction(0x080cb6d4, stubRetZero); // Stub returns 0 + detourFunction(0x0840889e, stubRetZero); // Stub returns 0 + detourFunction(0x0840ab90, stubRetZero); // Stub returns 0 + patchMemory(0x080e17af, "b800000000"); // Patch IDK what + } + break; + + case VIRTUA_FIGHTER_5_EXPORT: + { + // Security + detourFunction(0x084fca4c, amDongleInit); + detourFunction(0x084fcd2c, amDongleUpdate); + detourFunction(0x084fce08, amDongleIsAvailable); + detourFunction(0x084fce28, amDongleIsDevelop); + + // Fixes and patches to bypss network check + detourFunction(0x084fc982, amDipswGetData); + detourFunction(0x084fc9fa, amDipswSetLed); } break; @@ -568,8 +577,8 @@ int initPatch() patchMemory(0x0807b86a, "9090"); // Patch initializeArcadeBackup // Fixes detourFunction(0x084e9ef2, amDipswGetData); - detourFunction(0x084e9f6a, stubRetZero); // Stub amDipswSetLed - patchMemory(0x0840d858, "9090"); // No more Full Screen from the Game + detourFunction(0x084e9f6a, amDipswSetLed); + patchMemory(0x0840d858, "9090"); // No full screen } case LETS_GO_JUNGLE: @@ -598,16 +607,8 @@ int initPatch() patchMemory(0x0807b76a, "9090"); // Patch initializeArcadeBackup // Fixes detourFunction(0x084e500e, amDipswGetData); - detourFunction(0x084e5086, stubRetZero); // Stub amDipswSetLed - patchMemory(0x084125f0, "9090"); // No more Full Screen from the Game - // Set Resolution - // setVariable(0x082E006b, 0x00000780); // Set ResX - // setVariable(0x082E0078, 0x00000438); // Set ResY - - // From Teknoparrot AMDFIX - // setVariable(0x083ef701, 0x00036ee9); // AMDFIX - // setVariable(0x084032e0, 0x8b90c933); // fix shader compilation with AMD GPUs - // setVariable(0x08523950, 0x000000c3); // Remove ADXM_SetupFramework (Not necessary) + detourFunction(0x084e5086, amDipswSetLed); + patchMemory(0x084125f0, "9090"); // No full screen } break; @@ -637,11 +638,8 @@ int initPatch() patchMemory(0x0807e609, "909090909090"); // Fixes detourFunction(0x08510256, amDipswGetData); - detourFunction(0x085102ce, stubRetZero); // Stub amDipswSetLed - patchMemory(0x08438954, "9090"); // No more Full Screen from the Game - // Set Resolution - // setVariable(0x08303C4B, 0x00000780); // Set ResX - // setVariable(0x08303C58, 0x00000438); // Set ResY + detourFunction(0x085102ce, amDipswSetLed); + patchMemory(0x08438954, "9090"); // No full screen } break; @@ -649,20 +647,20 @@ int initPatch() { if (config->showDebugMessages == 1) { - setVariable(0x08d71750, 2); // amBackupDebugLevel - setVariable(0x08d71760, 2); // amCreditDebugLevel - setVariable(0x08d719b8, 2); // amDipswDebugLevel - setVariable(0x08d719bc, 2); // amDongleDebugLevel - setVariable(0x08d719c0, 2); // amEepromDebugLevel - setVariable(0x08d719c4, 2); // amHwmonitorDebugLevel - setVariable(0x08d719c8, 2); // amJvsDebugLevel - setVariable(0x08d719cc, 2); // amLibDebugLevel - setVariable(0x08d719d0, 2); // amMiscDebugLevel - setVariable(0x08d719d8, 2); // amSysDataDebugLevel - setVariable(0x08d719e0, 2); // bcLibDebugLevel - setVariable(0x08d719d4, 2); // amOsinfoDebugLevel - setVariable(0x08d719e4, 0x0FFFFFFF); // s_logMask - //detourFunction(0x0808f9a8, _putConsole); // Crashes the game sometimes. + setVariable(0x08d71750, 2); // amBackupDebugLevel + setVariable(0x08d71760, 2); // amCreditDebugLevel + setVariable(0x08d719b8, 2); // amDipswDebugLevel + setVariable(0x08d719bc, 2); // amDongleDebugLevel + setVariable(0x08d719c0, 2); // amEepromDebugLevel + setVariable(0x08d719c4, 2); // amHwmonitorDebugLevel + setVariable(0x08d719c8, 2); // amJvsDebugLevel + setVariable(0x08d719cc, 2); // amLibDebugLevel + setVariable(0x08d719d0, 2); // amMiscDebugLevel + setVariable(0x08d719d8, 2); // amSysDataDebugLevel + setVariable(0x08d719e0, 2); // bcLibDebugLevel + setVariable(0x08d719d4, 2); // amOsinfoDebugLevel + setVariable(0x08d719e4, 0x0FFFFFFF); // s_logMask + // detourFunction(0x0808f9a8, _putConsole); // Crashes the game sometimes. } // Security detourFunction(0x086e2336, amDongleInit); @@ -670,122 +668,82 @@ int initPatch() detourFunction(0x086e17e5, amDongleUpdate); // Fixes detourFunction(0x086e0c0d, amDipswGetData); - detourFunction(0x086e0c84, stubRetZero); // amDipswSetLED - detourFunction(0x0821e6dc, stubRetOne); // isEthLinkUp - patchMemory(0x082cb412, "c0270900"); // tickInitStoreNetwork - patchMemory(0x082cb6d9, "e950010000"); // tickWaitDHCP - // Set Resolution - patchMemory(0x0835664d, "e9f000"); // Force resolution set - //setVariable(0x08356743, 0x00000780); // Set ResX - //setVariable(0x08356748, 0x00000438); // Set ResY + detourFunction(0x086e0c84, amDipswSetLed); // amDipswSetLED - // AMDFIX - //uint32_t a = (uint32_t)glProgramEnvParameters4fvEXT; - //uint32_t b = ((a & 0xFF) << 24) | (((a >> 8) & 0xFF) << 16) | (((a >> 16) & 0xFF) << 8) | ((a >> 24) & 0xFF); + detourFunction(0x0821e6dc, stubRetOne); // isEthLinkUp + patchMemory(0x082cb412, "c0270900"); // tickInitStoreNetwork + patchMemory(0x082cb6d9, "e950010000"); // tickWaitDHCP - //printf("Address Orig = %p - Address in a = %08x\n", (void*)glProgramEnvParameters4fvEXT, b); - //printf("Address %08x\n", (uint32_t)glProgramEnvParameters4fvEXT); - - //const char *glProgramEnvParameters4fvEXT = "glProgramEnvParameters4fvEXT"; - //memset((void*)0x08813035,0, 28); patchMemory(0x08812fcc, "676C50726F6772616D456E76506172616D657465727334667645585400"); - //setVariable(0x08524247, 0x08813035); - patchMemory(0x08524247, "CC2F8108"); // glProgramParameters4fvNV - patchMemory(0x08524258, "9090"); // jnz - patchMemory(0x0852443a, "CC2F8108"); // glProgramParameters4fvNV - //setVariable(0x0852443a, a); - patchMemory(0x0852444a, "CC2F8108"); // glProgramParameters4fvNV - //setVariable(0x0852444a, a); - - //FILE *f = fopen("dump.elf", "w+b"); - //fwrite((void*)0x8048000, 0xc23632, 1, f); - //fclose(f); - - // FrameBuffer Resolution (No effect that I know) - /* - setVariable(0x08248037, 0x00000780); // Set ResX - setVariable(0x0824802f, 0x00000438); // Set ResY - setVariable(0x082480f7, 0x00000780); // Set ResX - setVariable(0x082480ef, 0x00000438); // Set ResY - setVariable(0x082481b7, 0x00000780); // Set ResX - setVariable(0x082481af, 0x00000438); // Set ResY - setVariable(0x08248216, 0x00000780); // Set ResX - setVariable(0x0824820e, 0x00000438); // Set ResY - - setVariable(0x082489a7, 0x00000780); // Set ResX - setVariable(0x0824899f, 0x00000438); // Set ResY - setVariable(0x08248a32, 0x00000780); // Set ResX - setVariable(0x08248a2a, 0x00000438); // Set ResY - */ - - // IDK if the following work (taken from TP) - // setVariable(0x08548ef3, 0x8990c031); // Shader Compiler - // setVariable(0x08799d8c, 0x082c9f52); // childTerminationHanlder + patchMemory(0x08524247, "CC2F8108"); // glProgramParameters4fvNV + patchMemory(0x08524258, "9090"); // jnz + patchMemory(0x0852443a, "CC2F8108"); // glProgramParameters4fvNV + patchMemory(0x0852444a, "CC2F8108"); // glProgramParameters4fvNV } break; case INITIALD_4_REVE: { if (config->showDebugMessages == 1) { - setVariable(0x08d972d0, 2); // amBackupDebugLevel - setVariable(0x08d972e0, 2); // amCreditDebugLevel - setVariable(0x08d97538, 2); // amDipswDebugLevel - setVariable(0x08d9753c, 2); // amDongleDebugLevel - setVariable(0x08d97540, 2); // amEepromDebugLevel - setVariable(0x08d97544, 2); // amHwmonitorDebugLevel - setVariable(0x08d97548, 2); // amJvsDebugLevel - setVariable(0x08d9754c, 2); // amLibDebugLevel - setVariable(0x08d97550, 2); // amMiscDebugLevel - setVariable(0x08d97554, 2); // amSysDataDebugLevel - setVariable(0x08d97558, 2); // bcLibDebugLevel - setVariable(0x08d97560, 2); // amOsinfoDebugLevel - setVariable(0x08d97564, 0x0FFFFFFF); // s_logMask - //detourFunction(0x08090478, _putConsole); // Crashes the game sometimes. + setVariable(0x08d972d0, 2); // amBackupDebugLevel + setVariable(0x08d972e0, 2); // amCreditDebugLevel + setVariable(0x08d97538, 2); // amDipswDebugLevel + setVariable(0x08d9753c, 2); // amDongleDebugLevel + setVariable(0x08d97540, 2); // amEepromDebugLevel + setVariable(0x08d97544, 2); // amHwmonitorDebugLevel + setVariable(0x08d97548, 2); // amJvsDebugLevel + setVariable(0x08d9754c, 2); // amLibDebugLevel + setVariable(0x08d97550, 2); // amMiscDebugLevel + setVariable(0x08d97554, 2); // amSysDataDebugLevel + setVariable(0x08d97558, 2); // bcLibDebugLevel + setVariable(0x08d97560, 2); // amOsinfoDebugLevel + setVariable(0x08d97564, 0x0FFFFFFF); // s_logMask + // detourFunction(0x08090478, _putConsole); // Crashes the game sometimes. } // Security detourFunction(0x087106e6, amDongleInit); detourFunction(0x0870f131, amDongleIsAvailable); detourFunction(0x0870fb95, amDongleUpdate); + detourFunction(0x087105ad, amDongleUserInfoEx); + // Fixes detourFunction(0x0870efbd, amDipswGetData); detourFunction(0x0870f034, stubRetZero); // amDipswSetLed detourFunction(0x08230fde, stubRetOne); // isEthLinkUp patchMemory(0x082df87d, "e954010000"); // tickWaitDHCP patchMemory(0x082e0ec9, "eb60"); // tickInitAddress - setVariable(0x08580979, 0x000126e9); // Avoid Full Screen set from Game + setVariable(0x08580979, 0x000126e9); // Avoid Full Screen set from Game // Set Resolution - setVariable(0x0837b12d, 0x0000f0e9); // Force set resolution - setVariable(0x0837b223, 0x00000550); // Set ResX - setVariable(0x0837b228, 0x00000300); // Set ResY + setVariable(0x0837b12d, 0x0000f0e9); // Force set resolution + setVariable(0x0837b223, 0x00000550); // Set ResX + setVariable(0x0837b228, 0x00000300); // Set ResY // setVariable(0x085700d3, 0x8990c031); // Fix something with the Shaders?? - //Tests - patchMemory(0x081944e7, "9090909090"); // Closedir - patchMemory(0x082082e8, "88fa79"); // ~cRealCardIF - patchMemory(0x087beb6c, "5b"); // seqInitCard::typeinfo - patchMemory(0x087beb7c, "d4"); // seqInitCard::typeinfo - - detourFunction(0x087105ad, amDongleUserInfoEx); + // Tests + patchMemory(0x081944e7, "9090909090"); // Closedir + patchMemory(0x082082e8, "88fa79"); // ~cRealCardIF + patchMemory(0x087beb6c, "5b"); // seqInitCard::typeinfo + patchMemory(0x087beb7c, "d4"); // seqInitCard::typeinfo } break; case INITIALD_5: { - + if (config->showDebugMessages == 1) { - setVariable(0x093f6fa0, 2); // amBackupDebugLevel - setVariable(0x093f6fc0, 2); // amCreditDebugLevel - setVariable(0x093f7218, 2); // amDipswDebugLevel - setVariable(0x093f721c, 2); // amDongleDebugLevel - setVariable(0x093f7220, 2); // amEepromDebugLevel - setVariable(0x093f7224, 2); // amHwmonitorDebugLevel - setVariable(0x093f7228, 2); // amJvsDebugLevel - setVariable(0x093f722c, 2); // amLibDebugLevel - setVariable(0x093f7230, 2); // amMiscDebugLevel - setVariable(0x093f7238, 2); // amSysDataDebugLevel - setVariable(0x093f7240, 2); // bcLibDebugLevel - setVariable(0x093f7234, 2); // amOsinfoDebugLevel - setVariable(0x093f7244, 0x0FFFFFFF); // s_logMask - // detourFunction(0x0808f9a8, _putConsole); // Crashes the game sometimes. + setVariable(0x093f6fa0, 2); // amBackupDebugLevel + setVariable(0x093f6fc0, 2); // amCreditDebugLevel + setVariable(0x093f7218, 2); // amDipswDebugLevel + setVariable(0x093f721c, 2); // amDongleDebugLevel + setVariable(0x093f7220, 2); // amEepromDebugLevel + setVariable(0x093f7224, 2); // amHwmonitorDebugLevel + setVariable(0x093f7228, 2); // amJvsDebugLevel + setVariable(0x093f722c, 2); // amLibDebugLevel + setVariable(0x093f7230, 2); // amMiscDebugLevel + setVariable(0x093f7238, 2); // amSysDataDebugLevel + setVariable(0x093f7240, 2); // bcLibDebugLevel + setVariable(0x093f7234, 2); // amOsinfoDebugLevel + setVariable(0x093f7244, 0x0FFFFFFF); // s_logMask + // detourFunction(0x0808f9a8, _putConsole); // Crashes the game sometimes. patchMemory(0x08942d91, "E912ffffff"); patchMemory(0x0894375b, "EB29"); } @@ -803,25 +761,24 @@ int initPatch() detourFunction(0x08943eb6, stubRetZero); // amOsinfoExecDhcpNic detourFunction(0x085135e0, stubRetZero); // isUseServerBox // Set Resolution - patchMemory(0x0855a48d, "E9f000"); // Accept different Resolutions - setVariable(0x0855a583, 0x00000550); // Set ResX - setVariable(0x0855a588, 0x00000300); // Set ResY + patchMemory(0x0855a48d, "E9f000"); // Accept different Resolutions + setVariable(0x0855a583, 0x00000550); // Set ResX + setVariable(0x0855a588, 0x00000300); // Set ResY // Tests - patchMemory(0x08a0f78c, "95"); // seqInitialize::childTerminationHandler - patchMemory(0x082923ad, "4851"); // ~cRealCardIF - patchMemory(0x081d7f69, "9090909090"); // closedir function skiped???? + patchMemory(0x08a0f78c, "95"); // seqInitialize::childTerminationHandler + patchMemory(0x082923ad, "4851"); // ~cRealCardIF + patchMemory(0x081d7f69, "9090909090"); // closedir function skiped???? // amsInit patchMemory(0x08938437, "00"); // Avoids strBBBlackList patchMemory(0x089385cb, "e9e7000000"); // Eliminate Dongle Challenges - patchMemory(0x0893871e, "74"); // // Returns 1 + patchMemory(0x0893871e, "74"); // // Returns 1 patchMemory(0x0893871a, "01000000"); // Returns 1 // amsCheckKeyDataVerify - patchMemory(0x08939696, "00000000"); // amsCheckKeyDataVerify - patchMemory(0x0893962b, "00000000"); // amsCheckKeyDataVerify + patchMemory(0x08939696, "00000000"); // amsCheckKeyDataVerify + patchMemory(0x0893962b, "00000000"); // amsCheckKeyDataVerify detourFunction(0x0893dbeb, amDongleUserInfoEx); - } break; case SEGABOOT_2_4_SYM: @@ -878,7 +835,7 @@ int initPatch() detourFunction(0x0815f88a, amDongleUpdate); // Fixes detourFunction(0x0815d06b, amDipswGetData); - detourFunction(0x0815d0e3, stubRetZero); + detourFunction(0x0815d0e3, amDipswSetLed); } break; case RAMBO: @@ -889,7 +846,7 @@ int initPatch() detourFunction(0x082c3bf7, amDongleUpdate); // Fixes detourFunction(0x082c308d, amDipswGetData); - detourFunction(0x082c3103, stubRetZero); + detourFunction(0x082c3103, amDipswSetLed); } break; case TOO_SPICY: @@ -900,7 +857,7 @@ int initPatch() detourFunction(0x0831c3b1, amDongleUpdate); // Fixes detourFunction(0x0831907d, amDipswGetData); - detourFunction(0x083190f4, stubRetZero); + detourFunction(0x083190f4, amDipswSetLed); // CPU patch to support AMD processors if (strcmp("AuthenticAMD", cpu_vendor.cpuid) == 0) { @@ -922,16 +879,15 @@ int initPatch() detourFunction(0x0814012c, stubRetZero); patchMemory(0x08052cb2, "9090909090"); patchMemory(0x0805206a, "00"); - //test - //patchMemory(0x0804d8be, "909090909090909090909090909090"); - //patchMemory(0x0804e5cf, "909090909090909090909090909090"); - //Res - //setVariable(0x0805af8b, 0x00000438); - //setVariable(0x0805af93, 0x000003c0); - //setVariable(0x0805afa2, 0x000003c0); - //setVariable(0x0805b0ed, 0x00000438); - //setVariable(0x0805aff5, 0x000003c0); - + // test + // patchMemory(0x0804d8be, "909090909090909090909090909090"); + // patchMemory(0x0804e5cf, "909090909090909090909090909090"); + // Res + // setVariable(0x0805af8b, 0x00000438); + // setVariable(0x0805af93, 0x000003c0); + // setVariable(0x0805afa2, 0x000003c0); + // setVariable(0x0805b0ed, 0x00000438); + // setVariable(0x0805aff5, 0x000003c0); } break; case GHOST_SQUAD_EVOLUTION: @@ -948,58 +904,53 @@ int initPatch() // Fixes detourFunction(0x0818191d, amDipswGetData); detourFunction(0x08181994, stubRetZero); - //patchMemory(0x807c9ec, "01"); - //detourFunction(0x080f3f94, stubRetZero); //eliminates init_heap function. + // patchMemory(0x807c9ec, "01"); + // detourFunction(0x080f3f94, stubRetZero); //eliminates init_heap function. } break; case HUMMER_EXTREME: { - /* if (config->showDebugMessages == 1) + if (config->showDebugMessages == 1) { - setVariable(0x093f6fa0, 2); // amBackupDebugLevel - setVariable(0x093f6fc0, 2); // amCreditDebugLevel - setVariable(0x093f7218, 2); // amDipswDebugLevel - setVariable(0x093f721c, 2); // amDongleDebugLevel - setVariable(0x093f7220, 2); // amEepromDebugLevel - setVariable(0x093f7224, 2); // amHwmonitorDebugLevel - setVariable(0x093f7228, 2); // amJvsDebugLevel - setVariable(0x093f722c, 2); // amLibDebugLevel - setVariable(0x093f7230, 2); // amMiscDebugLevel - setVariable(0x093f7238, 2); // amSysDataDebugLevel - setVariable(0x093f7240, 2); // bcLibDebugLevel - setVariable(0x093f7234, 2); // amOsinfoDebugLevel - setVariable(0x093f7244, 0x0FFFFFFF); // s_logMask - // detourFunction(0x0808f9a8, _putConsole); // Crashes the game sometimes. - patchMemory(0x08942d91, "E912ffffff"); - patchMemory(0x0894375b, "EB29"); - }*/ + setVariable(0x0a79a834, 2); // amAdtecDebugLevel + setVariable(0x0a79a838, 2); // amAtaDebugLevel + setVariable(0x0a79a83c, 2); // amBackupDebugLevel + setVariable(0x0a79a840, 2); // amCreditDebugLevel + setVariable(0x0a79aa98, 2); // amDipswDebugLevel + setVariable(0x0a79aa9c, 2); // amDongleDebugLevel + setVariable(0x0a79aaa0, 2); // amEepromDebugLevel + setVariable(0x0a79aaa4, 2); // amHwmonitorDebugLevel + setVariable(0x0a79aaa8, 2); // amJvsDebugLevel + setVariable(0x0a79aaac, 2); // amLibDebugLevel + setVariable(0x0a79aab0, 2); // amMiscDebugLevel + setVariable(0x0a79aab4, 2); // amOsinfoDebugLevel + setVariable(0x0a79a830, 2); // amsLibDebugLevel + setVariable(0x0a79aab8, 2); // amSysDataDebugLevel + setVariable(0x0a79aac0, 2); // bcLibDebugLevel + } + // Security detourFunction(0x0831c0d1, amDongleInit); detourFunction(0x0831a95d, amDongleIsAvailable); detourFunction(0x0831b47e, amDongleUpdate); - // Fixes - detourFunction(0x0831a7e9, amDipswGetData); - detourFunction(0x0831a85f, stubRetZero); // amDipswSetLed - - // from TP - //patchMemory(0x080a0ef8, "C3000000"); // smpGlxSetCursos - //patchMemory(0x080a872b, "909090909090909090909090909090"); // glShaderSource - patchMemory(0x080cf7b8, "C3000000"); // iserror - patchMemory(0x080e8b40, "C3000000"); // clSteerErrorDisp::run - patchMemory(0x08171396, "C3000000"); // clErrorDisp::update_ - detourFunction(0x08322dec, stubRetZero); // amOsinfoModifyNetworkAdrNic - detourFunction(0x083238a8, stubRetZero); // amOsinfoGetNetworkPropertyNicEx - patchMemory(0x08361aff, "C3000000"); // ADXM_SetupFramework - patchMemory(0x0836fa92, "C3000000"); // LXSYNC_Init - + detourFunction(0x0831a97a, amDongleIsDevelop); detourFunction(0x0831bf97, amDongleUserInfoEx); + detourFunction(0x0831668c, stubRetZero); // amsInit + detourFunction(0x08170654, stubRetMinusOne); // checkError - //Force Test for debug - patchMemory(0x0807d4cf, "01"); + // Security Board + detourFunction(0x0831a7e9, amDipswGetData); + detourFunction(0x0831a85f, amDipswSetLed); + + // Networking + detourFunction(0x08323886, stubRetZero); // amOsinfoModifyNetworkAdr + detourFunction(0x0832386b, stubRetZero); // amOsinfoModifyNetworkProperty + + // While we can't get into the test menu, immidiately return from the call to clSteerErrorDisp::run that complains about the calibration values. + patchMemory(0x080e8b40, "C3"); } break; default: - // Don't do any patches for random games break; } return 0;