We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e4c747 commit 3271758Copy full SHA for 3271758
src/pe/tls.rs
@@ -219,12 +219,15 @@ impl<'a> TlsData<'a> {
219
// VA to RVA
220
let rva = itd.start_address_of_raw_data - image_base;
221
let size = itd.end_address_of_raw_data - itd.start_address_of_raw_data;
222
+ let offset = utils::find_offset(rva as usize, sections, file_alignment, opts);
223
- if let Some(offset) = utils::find_offset(rva as usize, sections, file_alignment, opts) {
224
+ raw_data = offset.and_then(|offset| {
225
if offset < bytes.len() {
- raw_data = (&bytes[offset..]).pread_with(0, size as usize).ok();
226
+ (&bytes[offset..]).pread_with(0, size as usize).ok()
227
+ } else {
228
+ None
229
}
- }
230
+ });
231
232
233
// Parse the index if any
0 commit comments