mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-17 11:43:02 +00:00
Accurately get OverlayAddress for UPX-compressed executables (#67)
* Add alternate path for OverlayAddress for upx-compressed executables, for benefit of extractions that need an accurate overlay address. * Use SectionNames * Update SabreTools.Serialization/Wrappers/PortableExecutable.cs --------- Co-authored-by: Matt Nadareski <mnadareski@outlook.com>
This commit is contained in:
committed by
GitHub
parent
92356903cc
commit
463c3ba50d
@@ -343,7 +343,10 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
|
||||
// Search through all sections and find the furthest a section goes
|
||||
long endOfSectionData = OptionalHeader.SizeOfHeaders;
|
||||
// OptionalHeader.SizeOfHeaders is inconsistent here so first section is used instead
|
||||
// TODO: Investigate cases where first section pointer does not work
|
||||
long endOfSectionData = SectionTable[0].PointerToRawData;
|
||||
|
||||
Array.ForEach(SectionTable, s => endOfSectionData += s.SizeOfRawData);
|
||||
|
||||
// If we didn't find the end of section data
|
||||
|
||||
Reference in New Issue
Block a user