Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix several endianness issues in PE modules#1884

Merged
plusvic merged 1 commit into
VirusTotal:masterfrom
vthib:fix-endianness-issues
Mar 22, 2023
Merged

fix several endianness issues in PE modules#1884
plusvic merged 1 commit into
VirusTotal:masterfrom
vthib:fix-endianness-issues

Conversation

@vthib
Copy link
Copy Markdown
Contributor

@vthib vthib commented Feb 26, 2023

Those were all bugs affecting big-endian architectures:

  • The length field in resources string was read without endianness correction, leading to the name_string, language_string and type_string in pe.resources[*] not being properly set.
  • pe.size_of_optional_header was not using the right size for endianness correction.
  • pe.opthdr_magic was not using the right size for endianness correction.
  • pe.dll_characteristics was read without endianness correction.
  • pe.data_directories was not correctly filled at all, due to not using the right size for endianness correction when reading NumberOfRvaAndSizes.
  • The entrypoint operator was not returning the right value, as the VirtualSize field was read without endianness correction. This operator is deprecated, but the fix is very trivial.

Those were all bugs affecting big-endian architectures:

- The length field in resources string was read without endianness
  correction, leading to the `name_string`, `language_string` and
  `type_string` in `pe.resources[*]` not being properly set.
- `pe.size_of_optional_header` was not using the right size for
  endianness correction.
- `pe.opthdr_magic` was not using the right size for endianness
  correction.
- `pe.dll_characteristics` was not using the right size for endianness
  correction.
- `pe.data_directories` was not correctly filled at all, due to not
  using the right size for endianness correction when reading
  `NumberOfRvaAndSizes`.
- The `entrypoint` operator was not returning the right value, as the
  VirtualSize field was read without endianness correction. This
  operator is deprecated, but the fix is very trivial.
@plusvic plusvic merged commit cebb29a into VirusTotal:master Mar 22, 2023
@vthib vthib deleted the fix-endianness-issues branch March 22, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants