-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pe: add Terse Executable (TE) support (#397)
Add terse executable (TE) support to the PE module. A terse executable is a PE32/PE32+ binary with a reduced header size containing only the fields necessary for the binary to be properly executed by a PI architecture compliant loader and executor. Terse executables are most commonly used by UEFI compliant firmware to reduce the overall size of the binary. Only the header is replaced, and no other data is changed in a terse executable, resulting in all address values being invalid. The TE parser must take appropriate action to fix up addresses during parsing by adjusting the existing value by the difference between the `stripped_size` and the new size of the header.
- Loading branch information
Showing
11 changed files
with
378 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# TE binaries | ||
|
||
Binaries located in this directory are precompiled PE32/PE32+ binaries using a | ||
terse executable (TE) header as defined in the Platform Initialization (PI) | ||
specification: [TE](https://uefi.org/specs/PI/1.8/V1_TE_Image.html#te-header). | ||
These binaries were compiled using the | ||
[EDK2](https://github.com/tianocore/edk2) build system. | ||
|
||
## test_image.te | ||
|
||
This binary is a simple Terse executable binary | ||
|
||
## test_image_loaded.bin | ||
|
||
This binary is the same as `test_image.te`, but it has been loaded by a loader, | ||
meaning the sections have been placed in the expected address. Please note that | ||
this particular binary has not been relocated, so no relocations have been | ||
applied | ||
|
||
## test_image_relocated.bin | ||
|
||
This binary is the same as `test_image.te`, but it has been loaded by a loader, | ||
meaning the sections have been placed in the expected address, and any any | ||
relocations have been applied. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.