Show path hash seed in info

This commit is contained in:
Truman Kilen 2024-05-31 11:42:55 -05:00
parent 389acbb7b4
commit 2bd2843e91
3 changed files with 6 additions and 0 deletions

View file

@ -205,6 +205,10 @@ impl PakReader {
self.pak.encryption_guid self.pak.encryption_guid
} }
pub fn path_hash_seed(&self) -> Option<u64> {
self.pak.index.path_hash_seed
}
pub fn get<R: Read + Seek>(&self, path: &str, reader: &mut R) -> Result<Vec<u8>, super::Error> { pub fn get<R: Read + Seek>(&self, path: &str, reader: &mut R) -> Result<Vec<u8>, super::Error> {
let mut data = Vec::new(); let mut data = Vec::new();
self.read_file(path, reader, &mut data)?; self.read_file(path, reader, &mut data)?;

View file

@ -200,6 +200,7 @@ fn info(aes_key: Option<aes::Aes256>, action: ActionInfo) -> Result<(), repak::E
println!("version major: {}", pak.version().version_major()); println!("version major: {}", pak.version().version_major());
println!("encrypted index: {}", pak.encrypted_index()); println!("encrypted index: {}", pak.encrypted_index());
println!("encrytion guid: {:032X?}", pak.encryption_guid()); println!("encrytion guid: {:032X?}", pak.encryption_guid());
println!("path hash seed: {:08X?}", pak.path_hash_seed());
println!("{} file entries", pak.files().len()); println!("{} file entries", pak.files().len());
Ok(()) Ok(())
} }

View file

@ -17,6 +17,7 @@ fn test_cli_info() {
version major: Fnv64BugFix version major: Fnv64BugFix
encrypted index: false encrypted index: false
encrytion guid: Some(00000000000000000000000000000000) encrytion guid: Some(00000000000000000000000000000000)
path hash seed: Some(205C5A7D)
4 file entries 4 file entries
"}); "});
} }