add PC save file formats and encrypt/decrypt functions

This commit is contained in:
Martin Michelsen
2023-09-23 17:01:37 -07:00
parent 85897baaeb
commit cc70280761
30 changed files with 412 additions and 79 deletions
+2 -3
View File
@@ -101,14 +101,13 @@ uint32_t compute_psogc_timestamp(
return second + (minute + (hour + (res_day * 24)) * 60) * 60;
}
string decrypt_gci_fixed_size_file_data_section_for_salvage(
string decrypt_gci_fixed_size_data_section_for_salvage(
const void* data_section,
size_t size,
uint32_t round1_seed,
uint64_t round2_seed,
size_t max_decrypt_bytes) {
string decrypted = decrypt_gci_or_vms_v2_data_section<true>(
data_section, size, round1_seed, max_decrypt_bytes);
string decrypted = decrypt_data_section<true>(data_section, size, round1_seed, max_decrypt_bytes);
PSOV2Encryption round2_crypt(round2_seed);
round2_crypt.encrypt_big_endian(decrypted.data(), decrypted.size());