From 30e0b24c8653d70fb33aecd8203798ed19bb5a18 Mon Sep 17 00:00:00 2001 From: theubusu <80545678+theubusu@users.noreply.github.com> Date: Thu, 4 Dec 2025 19:17:34 +0100 Subject: [PATCH] pfl_upg: handle folders, fix incorrect decryption bug --- src/formats/pfl_upg.rs | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/formats/pfl_upg.rs b/src/formats/pfl_upg.rs index cfb9868..810b18c 100644 --- a/src/formats/pfl_upg.rs +++ b/src/formats/pfl_upg.rs @@ -2,7 +2,7 @@ use std::fs::{File}; use rsa::{RsaPublicKey, BigUint}; use hex::decode; use std::path::Path; -use std::io::{Cursor, Write}; +use std::io::{Read, Cursor, Write}; use std::fs::{self, OpenOptions}; use aes::Aes256; @@ -35,7 +35,7 @@ struct FileHeader { real_size: u32, stored_size: u32, _header_size: u32, - _attributes: u32, + #[br(count = 4)] attributes: Vec, } impl FileHeader { fn file_name(&self) -> String { @@ -96,7 +96,7 @@ pub fn extract_pfl_upg(mut file: &File, output_folder: &str) -> Result<(), Box Result<(), Box Result<(), Box