Comments (2)
from pe-parse.
Being worked on in #45.
I wasn't able to find much information about PE file endianness, but here
is some information that I have found.
According to this source
https://en.wikibooks.org/wiki/X86_Disassembly/Windows_Executable_Files
the PE header signature (which is always 0x00004550 = "\0\0EP")
should indicate:
a) the file is a legitimate PE file,
b) the byte order of the file
But I wasn't able to find any other information related to the signature
and the byte ordering.
Also, in the NT file header in the Characteristics field there are some
deprecated flags:
IMAGE_FILE_BYTES_REVERSED_LO - Little endian: the least significant
bit (LSB) precedes the most significant bit (MSB) in memory. This
flag is deprecated and should be zero.
IMAGE_FILE_BYTES_REVERSED_HI - Big endian: the MSB precedes the LSB
in memory. This flag is deprecated and should be zero.
Source: Microsoft Portable Executable and Common Object File Format
Specification
But there is nothing else related to their usage, and also how these
flags are related to each other.
On this source http://www.doswin32.com/doswin32-en.txt there is a text:
1.7. If you do NOT need to load the extension DLL with your program
(to save memory and for quicker load time) you can mark your program
not to load this DLL. This is accomplished by setting
the IMAGE_FILE_BYTES_REVERSED_LO attribute (this attribute is ignored
by Win32 on x86).
NOTE: Some old linkers (Borland tlink32 version < 5.0, Watcom wlink)
always set this bit. New linkers (ilink32 from BCB >= 4, link
from VC >= 4) do not.
UniLink sets this bit if you use -ay or -aY command line switches
instead of -ax or -aX).
Which means that IMAGE_FILE_BYTES_REVERSED_LO was also used for something
else unrelated to the byte ordering.
So far I have implemented byte swapping if there is a little-endian machine
set and Characteristics flag IMAGE_FILE_BYTES_REVERSED_HI is on.
from pe-parse.
Related Issues (20)
- Corkami PE Testing - Known Failure Fixes
- Compile error HOT 6
- peaddrconv compile error with GCC 11.0.0 HOT 3
- Compilation with warnings-as-errors should be optional
- Error parsing resource id with invalid unicode characters HOT 1
- pepy: Remove support for Python 3.6, add 3.8, 3.9, 3.10
- Workflows are referencing vulnerable actions HOT 1
- Invalid user-defined conversion (compiling error) - latest release HOT 4
- Add a CHANGELOG
- Reduce our build matrix
- Build failure/failure with `-Wconversion` HOT 6
- tests\assets\corkami-poc-dataset\PE\bin\no_dd64.exe flagged as Trojan:Win32/Wacatac.B!ml HOT 6
- Publish Python wheels
- python setup.py sdist builds incorrect packages due to missing files in MANIFEST.in
- RIIR HOT 3
- codecvt_utf8 deprecated in C++17
- Reduce reference set of pe-parse - peparse::`dynamic initializer for 'ProductIdMap'' HOT 1
- Problem in parsing 2 files HOT 4
- Switch to trusted publishing
- CONTRIBUTING.md deserves an update!!! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pe-parse.