From 16efca688fc7d5338f3f14243f6ceaa87979f020 Mon Sep 17 00:00:00 2001 From: theubusu <80545678+theubusu@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:07:47 +0200 Subject: [PATCH] Add ps5 support to PUP extractor + fixups --- src/formats/pup.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/formats/pup.rs b/src/formats/pup.rs index f035c27..1460ea2 100644 --- a/src/formats/pup.rs +++ b/src/formats/pup.rs @@ -53,7 +53,7 @@ struct BlockEntry { pub fn is_pup_file(file: &File) -> bool { let header = common::read_file(&file, 0, 4).expect("Failed to read from file."); - if header == b"\x4F\x15\x3D\x1D" { + if header == b"\x4F\x15\x3D\x1D" || header == b"\x54\x14\xF5\xEE" { //ps4, ps5 true } else { false @@ -94,6 +94,7 @@ pub fn extract_pup(mut file: &File, output_folder: &str) -> Result<(), Box> 12) + 12); let block_count = (block_size + entry.uncompressed_size as u32 - 1) / block_size; + let last_block_size = entry.uncompressed_size % block_size as u64; let mut my_block_table: Option = None; println!("Block size: {}, Block count: {}", block_size, block_count); @@ -118,8 +119,16 @@ pub fn extract_pup(mut file: &File, output_folder: &str) -> Result<(), Box