Skip to content

Commit

Permalink
fix: bug in parse_dir_entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Mar 18, 2024
1 parent 6f32a08 commit 5a96896
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 53 deletions.
2 changes: 1 addition & 1 deletion lib/src/modules/pe/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ impl<'a> PE<'a> {

fn parse_dir_entries(&self) -> Option<Vec<DirEntry>> {
// The number of directory entries is limited to MAX_DIR_ENTRIES.
let num_dir_entries = usize::max(
let num_dir_entries = usize::min(
self.optional_hdr.number_of_rva_and_sizes as usize,
Self::MAX_DIR_ENTRIES,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,38 +202,6 @@ data_directories:
size: 0
- virtual_address: 0
size: 0
- virtual_address: 2019914798
size: 116
- virtual_address: 340336
size: 4096
- virtual_address: 340480
size: 1024
- virtual_address: 0
size: 0
- virtual_address: 0
size: 1610612768
- virtual_address: 1952539694
size: 97
- virtual_address: 42620
size: 348160
- virtual_address: 40960
size: 341504
- virtual_address: 0
size: 0
- virtual_address: 0
size: 3221225536
- virtual_address: 1936487470
size: 0
- virtual_address: 9
size: 393216
- virtual_address: 512
size: 382464
- virtual_address: 0
size: 0
- virtual_address: 0
size: 3221225536
- virtual_address: 1920168494
size: 99
resource_timestamp: 0 # 1970-01-01 00:00:00 UTC
resource_version:
major: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,26 +106,6 @@ data_directories:
size: 2832
- virtual_address: 0
size: 0
- virtual_address: 1952805678
size: 28789
- virtual_address: 14272
size: 512
- virtual_address: 14272
size: 512
- virtual_address: 0
size: 0
- virtual_address: 0
size: 1615855648
- virtual_address: 1818587694
size: 25455
- virtual_address: 32
size: 14784
- virtual_address: 32
size: 14784
- virtual_address: 0
size: 0
- virtual_address: 0
size: 1108344896
is_signed: true
signatures:
- subject: "/C=AT/O=Security Coding Factory GmbH/OU=Security Coding Factory Certificate Authority/CN=Security Coding Factory Software CA"
Expand Down

0 comments on commit 5a96896

Please sign in to comment.