mirror of
https://github.com/xavo95/repak.git
synced 2025-01-18 19:04:07 +00:00
Check for invalid entry offsets
This commit is contained in:
parent
45780637c2
commit
d594642d6a
1 changed files with 4 additions and 0 deletions
|
@ -301,6 +301,10 @@ impl Pak {
|
||||||
let mut encoded_entries = io::Cursor::new(&encoded_entries);
|
let mut encoded_entries = io::Cursor::new(&encoded_entries);
|
||||||
for (dir_name, dir) in fdi {
|
for (dir_name, dir) in fdi {
|
||||||
for (file_name, encoded_offset) in dir {
|
for (file_name, encoded_offset) in dir {
|
||||||
|
if *encoded_offset == 0x80000000 {
|
||||||
|
println!("{file_name:?} has invalid offset: 0x{encoded_offset:08x}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
encoded_entries.seek(io::SeekFrom::Start(*encoded_offset as u64))?;
|
encoded_entries.seek(io::SeekFrom::Start(*encoded_offset as u64))?;
|
||||||
let entry =
|
let entry =
|
||||||
super::entry::Entry::read_encoded(&mut encoded_entries, version)?;
|
super::entry::Entry::read_encoded(&mut encoded_entries, version)?;
|
||||||
|
|
Loading…
Reference in a new issue