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:
1 parent
8661578c1b
commit
058fab325d
2 files changed
+24
-17
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user