Skip to content

Commit

Permalink
pe: read reserved DOS header fields (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkent030315 committed Apr 21, 2024
1 parent 47ee850 commit eda1be7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/pe/header.rs
Expand Up @@ -321,12 +321,10 @@ impl DosHeader {
let initial_relative_cs = bytes.gread_with(&mut offset, scroll::LE)?;
let file_address_of_relocation_table = bytes.gread_with(&mut offset, scroll::LE)?;
let overlay_number = bytes.gread_with(&mut offset, scroll::LE)?;
let reserved = [0x0; 4];
offset += core::mem::size_of_val(&reserved);
let reserved = bytes.gread_with(&mut offset, scroll::LE)?; // 4
let oem_id = bytes.gread_with(&mut offset, scroll::LE)?;
let oem_info = bytes.gread_with(&mut offset, scroll::LE)?;
let reserved2 = [0x0; 10];
offset += core::mem::size_of_val(&reserved2);
let reserved2 = bytes.gread_with(&mut offset, scroll::LE)?; // 10

debug_assert!(
offset == PE_POINTER_OFFSET as usize,
Expand Down

0 comments on commit eda1be7

Please sign in to comment.