exe-rs
is a Portable Executable (PE) parsing library tested on multiple kinds of malformed PE executables, including the Corkami corpus and various forms of malware! It's a library built with creation in mind as well as parsing, attempting to make tasks related to PE files as smooth and flawless as possible.
You can read the documentation here, and see various use examples in the test file.
u8
slice references! this has affected how PE files are initialized, see the docs for more details.PE::align_to_file
and ImageSectionHeader::is_aligned_to_file
for details.PE::get_dos_stub
.PE::buffer::HashData
in the docs.Offset
objects, buffer operations requiring offsets can now be accessed directly from them with a supplied PE
object.PE
image can now calculate disk sizes and memory sizes, see PE::calculate_disk_size
and PE::calculate_memory_size
.PE::find_embedded_images
. this does not have a corresponding test because it was tested on malware.added ability to calculate and validate PE checksums of an image, see PE::validate_checksum
and PE::calculate_checksum
.
fixed a bug in default ImageFileHeader
generation where the size_of_optional_header
value was calculated incorrectly.
PE::from_ptr
and the test file for example usage.u8
slices, see the HashData trait in the buffer module.u8
slices, see the Entropy trait in the buffer module.Buffer::save
.ImageSectionHeader
such as reading data and calculating proper offsets to data.all headers in the headers module now implement clone!
fixed a bug where RVA
s got translated incorrectly if they had no Offset
equivalent
allow for mutable ImageImportByName structure
fixed a bug where import thunks weren't properly parsed, now tested against imports_nothunk.exe