Skip to content

Commit

Permalink
Add Borderlands 3 decryption
Browse files Browse the repository at this point in the history
+ Alien isolation hash update
  • Loading branch information
bucanero committed May 4, 2022
1 parent f274604 commit 80130eb
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 10 deletions.
17 changes: 17 additions & 0 deletions appdata/CUSA00362.savepatch
Original file line number Diff line number Diff line change
@@ -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]
17 changes: 17 additions & 0 deletions appdata/CUSA00363.savepatch
Original file line number Diff line number Diff line change
@@ -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]
10 changes: 5 additions & 5 deletions appdata/CUSA00924.savepatch
Original file line number Diff line number Diff line change
Expand Up @@ -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-=-

Expand Down Expand Up @@ -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)
10 changes: 5 additions & 5 deletions appdata/CUSA01141.savepatch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
49 changes: 49 additions & 0 deletions appdata/CUSA07823.savepatch
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions source/saves.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 80130eb

Please sign in to comment.