From 03a6c9796f9a5925a06d9e9a48b3184e997a6683 Mon Sep 17 00:00:00 2001 From: echo000 <08finncam@gmail.com> Date: Fri, 31 Mar 2023 00:55:42 +0100 Subject: [PATCH 1/2] Fixes crash with vanguard hashed sounds Fixes crash with vanguard hashed sounds --- src/WraithXCOD/WraithXCOD/GameVanguard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WraithXCOD/WraithXCOD/GameVanguard.cpp b/src/WraithXCOD/WraithXCOD/GameVanguard.cpp index 2074be7..3d4683e 100644 --- a/src/WraithXCOD/WraithXCOD/GameVanguard.cpp +++ b/src/WraithXCOD/WraithXCOD/GameVanguard.cpp @@ -387,7 +387,7 @@ bool GameVanguard::LoadAssets() // Log it - CoDAssets::LogXAsset("Sound", NameResult->second); + CoDAssets::LogXAsset("Sound", FileSystems::CombinePath(LoadedSound->FullPath, LoadedSound->AssetName)); #if _DEBUG Writer.WriteLineFmt("%llx,%s", Entry.Key, FileSystems::CombinePath(LoadedSound->FullPath, LoadedSound->AssetName)); From 222db848160b65f160fdc1db24a727b6ceedfac3 Mon Sep 17 00:00:00 2001 From: echo000 <08finncam@gmail.com> Date: Wed, 5 Apr 2023 13:54:05 +0100 Subject: [PATCH 2/2] Prevent heap allocation that is never cleared delete[] is never called for Decryption table, and is allocated to the heap, so will leak. Does not seem to be used outside of BlackOps4.cpp, removing the pointer, and instead allocating on the stack without the new keywork stops this memory leak and doesn't seem to break any of the functionality of it. --- src/WraithXCOD/WraithXCOD/GameBlackOps4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WraithXCOD/WraithXCOD/GameBlackOps4.cpp b/src/WraithXCOD/WraithXCOD/GameBlackOps4.cpp index 45974fb..5c5e7f0 100644 --- a/src/WraithXCOD/WraithXCOD/GameBlackOps4.cpp +++ b/src/WraithXCOD/WraithXCOD/GameBlackOps4.cpp @@ -21,7 +21,7 @@ WraithNameIndex GameBlackOps4::AssetNameCache = WraithNameIndex(); // -- Initialize Decryption Table -uint32_t* DecryptionTable = new uint32_t[4082] +uint32_t DecryptionTable[4082] { 0x024FCAAE, 0x02E543B3, 0x001C94DD, 0x051D15E4, 0x00FB831A, 0x01E16CA9, 0x0285BE0A, 0x05910248, 0x022CDDE4, 0x05C224AE, 0x00A9ADC0, 0x00B04EB8, 0x037AC36C, 0x05E6572A, 0x00486B19, 0x01049B4E,