mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-04 05:36:12 +00:00
Adjust overlay address for PE using certificate table
This commit is contained in:
@@ -438,6 +438,14 @@ namespace SabreTools.Serialization.Wrappers
|
||||
return _overlaySize;
|
||||
}
|
||||
|
||||
// If we have certificate data, use that as the end
|
||||
if (OptionalHeader?.CertificateTable != null)
|
||||
{
|
||||
int certificateTableAddress = (int)OptionalHeader.CertificateTable.VirtualAddress;
|
||||
if (certificateTableAddress != 0 && certificateTableAddress < dataLength)
|
||||
dataLength = certificateTableAddress;
|
||||
}
|
||||
|
||||
// Get the overlay address if possible
|
||||
long endOfSectionData = OverlayAddress;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user