use phosg big-endian types

This commit is contained in:
Martin Michelsen
2022-03-07 22:05:43 -08:00
parent 627498dc8a
commit 3fc1013e1a
4 changed files with 15 additions and 19 deletions
+2 -8
View File
@@ -19,14 +19,9 @@ using namespace std;
struct PSODownloadQuestHeader {
// When sending a DLQ to the client, this is the DECOMPRESSED size. When
// reading it from a GCI file, this is the COMPRESSED size.
uint32_t size;
be_uint32_t size;
// Note: use PSO PC encryption, even for GC quests.
uint32_t encryption_seed;
void byteswap() {
this->size = bswap32(this->size);
this->encryption_seed = bswap32(this->encryption_seed);
}
be_uint32_t encryption_seed;
};
@@ -367,7 +362,6 @@ string Quest::decode_gci(const string& filename) {
}
PSODownloadQuestHeader* h = reinterpret_cast<PSODownloadQuestHeader*>(
data.data() + 0x2080);
h->byteswap();
string compressed_data_with_header = data.substr(0x2088, h->size);