From 625720904d94ac474990cd30b52f7e23fd8aa68c Mon Sep 17 00:00:00 2001 From: Silent Date: Tue, 20 Jun 2017 16:20:59 +0200 Subject: [PATCH] Only patch IMG sizes if FLA isn't doing so already --- SilentPatchSA/SilentPatchSA.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index 4f05a88..1e214a1 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -2310,7 +2310,20 @@ BOOL InjectDelayedPatches_10() } #endif + if ( *(DWORD*)0x4065BB == 0x3B0BE1C1 ) + { + // Handle IMGs bigger than 4GB + Nop( 0x4065BB, 3 ); + Nop( 0x4065C2, 1 ); + InjectHook( 0x4065C2+1, CdStreamThreadHighSize, PATCH_CALL ); + Patch( 0x406620+2, &pCdStreamSetFilePointer ); + } + FLAUtils::Init(); + + const uint8_t bytes[] = { 0x8B, 0x4C, 0x24, 0x64, 0x51 }; + memcpy((void*)0x5B6FCC, bytes, sizeof(bytes)); + return FALSE; } return TRUE; @@ -3150,12 +3163,6 @@ void Patch_SA_10() strcpy(pScannerNames + (8*113), "WESTP"); strcpy(pScannerNames + (8*134), "????"); - // Handle IMGs bigger than 4GB - Nop( 0x4065BB, 3 ); - Nop( 0x4065C2, 1 ); - InjectHook( 0x4065C2+1, CdStreamThreadHighSize, PATCH_CALL ); - Patch( 0x406620+2, &pCdStreamSetFilePointer ); - // AI accuracy issue Nop(0x73B3AE, 1);