From 80130eb9ca354140cd8cbf253bbc968c6b4b2552 Mon Sep 17 00:00:00 2001 From: bucanero Date: Tue, 3 May 2022 20:54:31 -0300 Subject: [PATCH] Add Borderlands 3 decryption + Alien isolation hash update --- appdata/CUSA00362.savepatch | 17 +++++++++++++ appdata/CUSA00363.savepatch | 17 +++++++++++++ appdata/CUSA00924.savepatch | 10 ++++---- appdata/CUSA01141.savepatch | 10 ++++---- appdata/CUSA07823.savepatch | 49 +++++++++++++++++++++++++++++++++++++ source/saves.c | 7 ++++++ 6 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 appdata/CUSA00362.savepatch create mode 100644 appdata/CUSA00363.savepatch create mode 100644 appdata/CUSA07823.savepatch diff --git a/appdata/CUSA00362.savepatch b/appdata/CUSA00362.savepatch new file mode 100644 index 0000000..78d3c86 --- /dev/null +++ b/appdata/CUSA00362.savepatch @@ -0,0 +1,17 @@ +; CUSA00362 +; PS4 Alien: Isolation +; by bucanero + +:THEFILE + +; cheat codes go here + +[Update SHA1 XOR64 for THEFILE (Required)] +set [off1]:read(0x18, 4) +set [off1]:endian_swap +set [off2]:read(0x1C, 4) +set [off2]:endian_swap +set pointer:[off1]+[off2]-1 +set range:0x20,pointer +set [csum]:sha1_xor64 +write at 0x08:[csum] diff --git a/appdata/CUSA00363.savepatch b/appdata/CUSA00363.savepatch new file mode 100644 index 0000000..53c37a8 --- /dev/null +++ b/appdata/CUSA00363.savepatch @@ -0,0 +1,17 @@ +; CUSA00363 +; PS4 Alien: Isolation +; by bucanero + +:THEFILE + +; cheat codes go here + +[Update SHA1 XOR64 for THEFILE (Required)] +set [off1]:read(0x18, 4) +set [off1]:endian_swap +set [off2]:read(0x1C, 4) +set [off2]:endian_swap +set pointer:[off1]+[off2]-1 +set range:0x20,pointer +set [csum]:sha1_xor64 +write at 0x08:[csum] diff --git a/appdata/CUSA00924.savepatch b/appdata/CUSA00924.savepatch index 83ef3e8..1a00db5 100644 --- a/appdata/CUSA00924.savepatch +++ b/appdata/CUSA00924.savepatch @@ -7,9 +7,9 @@ [Decrypt DATA0.DAT (Required)] set range:0x0020,eof+1 -endian_swap(4) +endian_swap(32) DECRYPT blowfish_ecb("zW$2eWaHNdT~6j86T_&j") -endian_swap(4) +endian_swap(32) ;-=-Campaign Mode Codes-=- @@ -229,10 +229,10 @@ set range:0x0020,pointer set [hash]:SHA1 write next (0):[hash] set range:pointer,pointer+0x14 -endian_swap(4) +endian_swap(32) [Encrypt DATA0.DAT (Required)] set range:0x0020,eof+1 -endian_swap(4) +endian_swap(32) ENCRYPT blowfish_ecb("zW$2eWaHNdT~6j86T_&j") -endian_swap(4) +endian_swap(32) diff --git a/appdata/CUSA01141.savepatch b/appdata/CUSA01141.savepatch index c6bb494..7945dbd 100644 --- a/appdata/CUSA01141.savepatch +++ b/appdata/CUSA01141.savepatch @@ -6,9 +6,9 @@ [Decrypt DATA0.DAT (Required)] set range:0x0020,eof+1 -endian_swap(4) +endian_swap(32) DECRYPT blowfish_ecb("zW$2eWaHNdT~6j86T_&j") -endian_swap(4) +endian_swap(32) [Raid - All Custom Parts Level MAX] 10013198 00000163 @@ -542,10 +542,10 @@ set range:0x0020,pointer set [hash]:SHA1 write next (0):[hash] set range:pointer,pointer+0x14 -endian_swap(4) +endian_swap(32) [Encrypt DATA0.DAT (Required)] set range:0x0020,eof+1 -endian_swap(4) +endian_swap(32) ENCRYPT blowfish_ecb("zW$2eWaHNdT~6j86T_&j") -endian_swap(4) +endian_swap(32) diff --git a/appdata/CUSA07823.savepatch b/appdata/CUSA07823.savepatch new file mode 100644 index 0000000..136ad40 --- /dev/null +++ b/appdata/CUSA07823.savepatch @@ -0,0 +1,49 @@ +; CUSA07823 +; PS4 Borderlands 3 +; by bucanero + +:profile + +[Decrypt profile (Required)] +search "BP_DefaultOakProfile_C" +set [size]:read(pointer+0x17,4) +set [size]:endian_swap +set [size]:[size]+0x1A +set range:pointer+0x1B,pointer+[size] +;use profile xor keys +DECRYPT borderlands3(0) + +:* + +[Decrypt save-game] +search "OakSaveGame" +set [size]:read(pointer+0x0C,4) +set [size]:endian_swap +set [size]:[size]+0x0F +set range:pointer+0x10,pointer+[size] +;use save-game xor keys +DECRYPT borderlands3(1) + +; +; cheat codes go here +; + +:profile + +[Encrypt profile (Required)] +search "BP_DefaultOakProfile_C" +set [size]:read(pointer+0x17,4) +set [size]:endian_swap +set [size]:[size]+0x1A +set range:pointer+0x1B,pointer+[size] +ENCRYPT borderlands3(0) + +:* + +[Encrypt save-game] +search "OakSaveGame" +set [size]:read(pointer+0x0C,4) +set [size]:endian_swap +set [size]:[size]+0x0F +set range:pointer+0x10,pointer+[size] +ENCRYPT borderlands3(1) diff --git a/source/saves.c b/source/saves.c index ae22b62..09c4244 100644 --- a/source/saves.c +++ b/source/saves.c @@ -869,6 +869,13 @@ int ReadBackupCodes(save_entry_t * bup) closedir(d); } + if (!list_count(bup->codes)) + { + list_free(bup->codes); + bup->codes = NULL; + return 0; + } + LOG("%zu items loaded", list_count(bup->codes)); return list_count(bup->codes);