From c5375c11aa18687c4ca32a166f68983ab4e8ef7c Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 24 Aug 2022 00:49:02 -0700 Subject: [PATCH] fix download quests --- src/Quest.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Quest.cc b/src/Quest.cc index 05770ae1..3e623ba4 100644 --- a/src/Quest.cc +++ b/src/Quest.cc @@ -692,12 +692,14 @@ static string create_download_quest_file(const string& compressed_data, data += compressed_data; // Add temporary extra bytes if necessary so encryption won't fail - the data - // size must be a multiple of 4 for PSO V2 encryption. + // size must be a multiple of 4 for PSO PC encryption. + size_t original_size = data.size(); data.resize((data.size() + 3) & (~3)); - PSOV3Encryption encr(encryption_seed); + PSOV2Encryption encr(encryption_seed); encr.encrypt(data.data() + sizeof(PSODownloadQuestHeader), data.size() - sizeof(PSODownloadQuestHeader)); + data.resize(original_size); return data; }