PE: remove leftover dbg_tls test and check layout offsets

Removes the print-only dbg_tls test in image.rs (TLS presence is already asserted in parses_own_test_binary) and switches layout.rs offset helpers (read_u32, read_u64, optional_header_offset, file_header_offset, data_directory_offset) to checked arithmetic so extreme offsets return None instead of overflowing.
This commit is contained in:
Manuel Pérez committed 2026-11-24 00:48:47 +01:00
1 parent e98d3ca96e
commit ef22723e84
2 files changed
+24 -17

No files matched your search

-11
View File
@@ -471,14 +471,3 @@ mod tests {
));
}
}
#[cfg(test)]
mod dbg_tls {
#[test]
fn dump_tls() {
let data = std::fs::read(std::env::current_exe().unwrap()).unwrap();
let info = super::ImageInfo::parse(&data).unwrap();
eprintln!("TLS = {:?}", info.tls);
eprintln!("image_base = {:x}", info.image_base);
}
}