Refactor: Update decompression logic for WiiU platform.
This commit is contained in:
parent
13af32ed2d
commit
2fdbe74a4a
@ -115,7 +115,7 @@ bool FastFile_COD10_WiiU::Load(const QByteArray aData) {
|
|||||||
if (GetPlatform() == "360") {
|
if (GetPlatform() == "360") {
|
||||||
//decompressedData = Compressor::cod9_decryptFastFile(aData);
|
//decompressedData = Compressor::cod9_decryptFastFile(aData);
|
||||||
} else if (GetPlatform() == "PC") {
|
} else if (GetPlatform() == "PC") {
|
||||||
decompressedData = Encryption::decryptFastFile_BO2(aData);
|
//decompressedData = Encryption::decryptFastFile_BO2(aData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For COD9, write out the complete decompressed zone for testing.
|
// For COD9, write out the complete decompressed zone for testing.
|
||||||
|
|||||||
@ -115,7 +115,7 @@ bool FastFile_COD9_WiiU::Load(const QByteArray aData) {
|
|||||||
if (GetPlatform() == "360") {
|
if (GetPlatform() == "360") {
|
||||||
//decompressedData = Compressor::cod9_decryptFastFile(aData);
|
//decompressedData = Compressor::cod9_decryptFastFile(aData);
|
||||||
} else if (GetPlatform() == "PC") {
|
} else if (GetPlatform() == "PC") {
|
||||||
decompressedData = Encryption::decryptFastFile_BO2(aData);
|
//decompressedData = Encryption::decryptFastFile_BO2(aData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For COD9, write out the complete decompressed zone for testing.
|
// For COD9, write out the complete decompressed zone for testing.
|
||||||
|
|||||||
@ -267,7 +267,7 @@ FastFile* FastFile::Open(const QString &aFilePath) {
|
|||||||
const QString fastFileStem = aFilePath.section("/", -1, -1);
|
const QString fastFileStem = aFilePath.section("/", -1, -1);
|
||||||
LogManager::instance().addEntry(QString("Stem: %1").arg(fastFileStem));
|
LogManager::instance().addEntry(QString("Stem: %1").arg(fastFileStem));
|
||||||
|
|
||||||
FastFile* fastFile = FastFileFactory::Create(data);
|
FastFile* fastFile = FastFileFactory::Create(data, fastFileStem);
|
||||||
fastFile->SetStem(fastFileStem);
|
fastFile->SetStem(fastFileStem);
|
||||||
|
|
||||||
return fastFile;
|
return fastFile;
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
#include "360/fastfile_cod5_360.h"
|
#include "360/fastfile_cod5_360.h"
|
||||||
#include "360/fastfile_cod6_360.h"
|
#include "360/fastfile_cod6_360.h"
|
||||||
#include "360/fastfile_cod7_360.h"
|
#include "360/fastfile_cod7_360.h"
|
||||||
|
#include "360/fastfile_cod7_5_360.h"
|
||||||
#include "360/fastfile_cod8_360.h"
|
#include "360/fastfile_cod8_360.h"
|
||||||
#include "360/fastfile_cod9_360.h"
|
#include "360/fastfile_cod9_360.h"
|
||||||
#include "360/fastfile_cod10_360.h"
|
#include "360/fastfile_cod10_360.h"
|
||||||
@ -66,11 +67,12 @@ enum FastFile_Game {
|
|||||||
GAME_COD5 = 0x03,
|
GAME_COD5 = 0x03,
|
||||||
GAME_COD6 = 0x04,
|
GAME_COD6 = 0x04,
|
||||||
GAME_COD7 = 0x05,
|
GAME_COD7 = 0x05,
|
||||||
GAME_COD8 = 0x06,
|
GAME_COD7_5 = 0x06,
|
||||||
GAME_COD9 = 0x07,
|
GAME_COD8 = 0x07,
|
||||||
GAME_COD10 = 0x08,
|
GAME_COD9 = 0x08,
|
||||||
GAME_COD11 = 0x09,
|
GAME_COD10 = 0x09,
|
||||||
GAME_COD12 = 0x010
|
GAME_COD11 = 0x10,
|
||||||
|
GAME_COD12 = 0x11
|
||||||
};
|
};
|
||||||
|
|
||||||
class FastFileFactory {
|
class FastFileFactory {
|
||||||
@ -185,83 +187,86 @@ public:
|
|||||||
|
|
||||||
if (aPlatform == PLATFORM_360) {
|
if (aPlatform == PLATFORM_360) {
|
||||||
if (aGame == GAME_COD2) {
|
if (aGame == GAME_COD2) {
|
||||||
resultFF = new FastFile_COD2_360(aData);
|
resultFF = new FastFile_COD2_360();
|
||||||
} else if (aGame == GAME_COD4) {
|
} else if (aGame == GAME_COD4) {
|
||||||
resultFF = new FastFile_COD4_360(aData);
|
resultFF = new FastFile_COD4_360();
|
||||||
} else if (aGame == GAME_COD5) {
|
} else if (aGame == GAME_COD5) {
|
||||||
resultFF = new FastFile_COD5_360(aData);
|
resultFF = new FastFile_COD5_360();
|
||||||
} else if (aGame == GAME_COD6) {
|
} else if (aGame == GAME_COD6) {
|
||||||
resultFF = new FastFile_COD6_360(aData);
|
resultFF = new FastFile_COD6_360();
|
||||||
} else if (aGame == GAME_COD7) {
|
} else if (aGame == GAME_COD7) {
|
||||||
resultFF = new FastFile_COD7_360(aData);
|
resultFF = new FastFile_COD7_360();
|
||||||
|
} else if (aGame == GAME_COD7_5) {
|
||||||
|
resultFF = new FastFile_COD7_5_360();
|
||||||
} else if (aGame == GAME_COD8) {
|
} else if (aGame == GAME_COD8) {
|
||||||
resultFF = new FastFile_COD8_360(aData);
|
resultFF = new FastFile_COD8_360();
|
||||||
} else if (aGame == GAME_COD9) {
|
} else if (aGame == GAME_COD9) {
|
||||||
resultFF = new FastFile_COD9_360(aData);
|
resultFF = new FastFile_COD9_360();
|
||||||
} else if (aGame == GAME_COD10) {
|
} else if (aGame == GAME_COD10) {
|
||||||
resultFF = new FastFile_COD10_360(aData);
|
resultFF = new FastFile_COD10_360();
|
||||||
} else if (aGame == GAME_COD11) {
|
} else if (aGame == GAME_COD11) {
|
||||||
resultFF = new FastFile_COD11_360(aData);
|
resultFF = new FastFile_COD11_360();
|
||||||
} else if (aGame == GAME_COD12) {
|
} else if (aGame == GAME_COD12) {
|
||||||
resultFF = new FastFile_COD12_360(aData);
|
resultFF = new FastFile_COD12_360();
|
||||||
}
|
}
|
||||||
} else if (aPlatform == PLATFORM_PC) {
|
} else if (aPlatform == PLATFORM_PC) {
|
||||||
if (aGame == GAME_COD4) {
|
if (aGame == GAME_COD4) {
|
||||||
resultFF = new FastFile_COD4_PC(aData);
|
resultFF = new FastFile_COD4_PC();
|
||||||
} else if (aGame == GAME_COD5) {
|
} else if (aGame == GAME_COD5) {
|
||||||
resultFF = new FastFile_COD5_PC(aData);
|
resultFF = new FastFile_COD5_PC();
|
||||||
} else if (aGame == GAME_COD6) {
|
} else if (aGame == GAME_COD6) {
|
||||||
resultFF = new FastFile_COD6_PC(aData);
|
resultFF = new FastFile_COD6_PC();
|
||||||
} else if (aGame == GAME_COD7) {
|
} else if (aGame == GAME_COD7) {
|
||||||
resultFF = new FastFile_COD7_PC(aData);
|
resultFF = new FastFile_COD7_PC();
|
||||||
} else if (aGame == GAME_COD8) {
|
} else if (aGame == GAME_COD8) {
|
||||||
resultFF = new FastFile_COD8_PC(aData);
|
resultFF = new FastFile_COD8_PC();
|
||||||
} else if (aGame == GAME_COD9) {
|
} else if (aGame == GAME_COD9) {
|
||||||
resultFF = new FastFile_COD9_PC(aData);
|
resultFF = new FastFile_COD9_PC();
|
||||||
} else if (aGame == GAME_COD10) {
|
} else if (aGame == GAME_COD10) {
|
||||||
resultFF = new FastFile_COD10_PC(aData);
|
resultFF = new FastFile_COD10_PC();
|
||||||
} else if (aGame == GAME_COD11) {
|
} else if (aGame == GAME_COD11) {
|
||||||
resultFF = new FastFile_COD11_PC(aData);
|
resultFF = new FastFile_COD11_PC();
|
||||||
} else if (aGame == GAME_COD12) {
|
} else if (aGame == GAME_COD12) {
|
||||||
resultFF = new FastFile_COD12_PC(aData);
|
resultFF = new FastFile_COD12_PC();
|
||||||
}
|
}
|
||||||
} else if (aPlatform == PLATFORM_PS3) {
|
} else if (aPlatform == PLATFORM_PS3) {
|
||||||
if (aGame == GAME_COD4) {
|
if (aGame == GAME_COD4) {
|
||||||
resultFF = new FastFile_COD4_PS3(aData);
|
resultFF = new FastFile_COD4_PS3();
|
||||||
} else if (aGame == GAME_COD5) {
|
} else if (aGame == GAME_COD5) {
|
||||||
resultFF = new FastFile_COD5_PS3(aData);
|
resultFF = new FastFile_COD5_PS3();
|
||||||
} else if (aGame == GAME_COD6) {
|
} else if (aGame == GAME_COD6) {
|
||||||
resultFF = new FastFile_COD6_PS3(aData);
|
resultFF = new FastFile_COD6_PS3();
|
||||||
} else if (aGame == GAME_COD7) {
|
} else if (aGame == GAME_COD7) {
|
||||||
resultFF = new FastFile_COD7_PS3(aData);
|
resultFF = new FastFile_COD7_PS3();
|
||||||
} else if (aGame == GAME_COD8) {
|
} else if (aGame == GAME_COD8) {
|
||||||
resultFF = new FastFile_COD8_PS3(aData);
|
resultFF = new FastFile_COD8_PS3();
|
||||||
} else if (aGame == GAME_COD9) {
|
} else if (aGame == GAME_COD9) {
|
||||||
resultFF = new FastFile_COD9_PS3(aData);
|
resultFF = new FastFile_COD9_PS3();
|
||||||
} else if (aGame == GAME_COD10) {
|
} else if (aGame == GAME_COD10) {
|
||||||
resultFF = new FastFile_COD10_PS3(aData);
|
resultFF = new FastFile_COD10_PS3();
|
||||||
} else if (aGame == GAME_COD11) {
|
} else if (aGame == GAME_COD11) {
|
||||||
resultFF = new FastFile_COD11_PS3(aData);
|
resultFF = new FastFile_COD11_PS3();
|
||||||
} else if (aGame == GAME_COD12) {
|
} else if (aGame == GAME_COD12) {
|
||||||
resultFF = new FastFile_COD12_PS3(aData);
|
resultFF = new FastFile_COD12_PS3();
|
||||||
}
|
}
|
||||||
} else if (aPlatform == PLATFORM_WII) {
|
} else if (aPlatform == PLATFORM_WII) {
|
||||||
if (aGame == GAME_COD4) {
|
if (aGame == GAME_COD4) {
|
||||||
resultFF = new FastFile_COD4_Wii(aData);
|
resultFF = new FastFile_COD4_Wii();
|
||||||
} else if (aGame == GAME_COD7) {
|
} else if (aGame == GAME_COD7) {
|
||||||
resultFF = new FastFile_COD7_Wii(aData);
|
resultFF = new FastFile_COD7_Wii();
|
||||||
} else if (aGame == GAME_COD8) {
|
} else if (aGame == GAME_COD8) {
|
||||||
resultFF = new FastFile_COD8_Wii(aData);
|
resultFF = new FastFile_COD8_Wii();
|
||||||
}
|
}
|
||||||
} else if (aPlatform == PLATFORM_WIIU) {
|
} else if (aPlatform == PLATFORM_WIIU) {
|
||||||
if (aGame == GAME_COD9) {
|
if (aGame == GAME_COD9) {
|
||||||
resultFF = new FastFile_COD9_WiiU(aData);
|
resultFF = new FastFile_COD9_WiiU();
|
||||||
} else if (aGame == GAME_COD10) {
|
} else if (aGame == GAME_COD10) {
|
||||||
resultFF = new FastFile_COD10_WiiU(aData);
|
resultFF = new FastFile_COD10_WiiU();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resultFF) {
|
if (resultFF) {
|
||||||
resultFF->SetStem(aStem);
|
resultFF->SetStem(aStem);
|
||||||
|
resultFF->Load(aData);
|
||||||
}
|
}
|
||||||
return resultFF;
|
return resultFF;
|
||||||
}
|
}
|
||||||
@ -283,7 +288,7 @@ private:
|
|||||||
|
|
||||||
static FastFile_Platform pGetPlatform(const QByteArray& aData) {
|
static FastFile_Platform pGetPlatform(const QByteArray& aData) {
|
||||||
const QStringList sections = pGetDataSections(aData);
|
const QStringList sections = pGetDataSections(aData);
|
||||||
if (sections[0] == "0000") {
|
if (sections[0] == "0000" || sections[0] == "4E58") {
|
||||||
return PLATFORM_360;
|
return PLATFORM_360;
|
||||||
} else if (sections[4] == "0000") {
|
} else if (sections[4] == "0000") {
|
||||||
if (sections[5] == "0001" && sections[6] == "78DA") {
|
if (sections[5] == "0001" && sections[6] == "78DA") {
|
||||||
@ -292,6 +297,8 @@ private:
|
|||||||
return PLATFORM_360;
|
return PLATFORM_360;
|
||||||
} else if (sections[5] == "0183" && sections[6] == "7801") {
|
} else if (sections[5] == "0183" && sections[6] == "7801") {
|
||||||
return PLATFORM_360;
|
return PLATFORM_360;
|
||||||
|
} else if (sections[5] == "01D9" && sections[6] == "0000") {
|
||||||
|
return PLATFORM_360;
|
||||||
} else if (sections[6] == "0101" && sections[7] == "CA3E") {
|
} else if (sections[6] == "0101" && sections[7] == "CA3E") {
|
||||||
return PLATFORM_360;
|
return PLATFORM_360;
|
||||||
} else if (sections[6] == "0000" && sections[7] == "0001") {
|
} else if (sections[6] == "0000" && sections[7] == "0001") {
|
||||||
@ -333,6 +340,8 @@ private:
|
|||||||
return GAME_COD6;
|
return GAME_COD6;
|
||||||
} else if (sections[4] == "D901" || sections[5] == "01DD" || sections[5] == "01D9") {
|
} else if (sections[4] == "D901" || sections[5] == "01DD" || sections[5] == "01D9") {
|
||||||
return GAME_COD7;
|
return GAME_COD7;
|
||||||
|
} else if (sections[0] == "4E58") {
|
||||||
|
return GAME_COD7_5;
|
||||||
} else if (sections[4] == "0100" || sections[5] == "006B" || sections[5] == "0070") {
|
} else if (sections[4] == "0100" || sections[5] == "006B" || sections[5] == "0070") {
|
||||||
return GAME_COD8;
|
return GAME_COD8;
|
||||||
} else if (sections[4] == "9300" || sections[5] == "0092"
|
} else if (sections[4] == "9300" || sections[5] == "0092"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user