Skip to content

Commit

Permalink
fix: issues while parsing PE files
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Mar 19, 2024
1 parent 09ad66f commit 45593df
Show file tree
Hide file tree
Showing 6 changed files with 6,874 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/src/modules/dotnet/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ impl<'a> Dotnet<'a> {
let pe = PE::parse(data)?;

let (_, _, cli_header) = pe
.get_dir_entry_data(PE::IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR, true)
.get_dir_entry_data(
PE::IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR,
false,
)
.ok_or(Error::InvalidDotNet)?;

let (_, cli_header) = Self::parse_cli_header(cli_header)?;
Expand Down Expand Up @@ -451,7 +454,7 @@ impl<'a> Dotnet<'a> {

// `num_rows_per_present_table` contains an entry per each table
// that is present. But we need an array with an entry per table,
// no matter if its present or not. Of course, tables that are not
// no matter if it's present or not. Of course, tables that are not
// present will have zero rows.
self.num_rows = Vec::with_capacity(64);

Expand Down
Binary file not shown.
Loading

0 comments on commit 45593df

Please sign in to comment.