Ensure overlay accounts for certificates properly

This commit is contained in:
Matt Nadareski
2025-09-11 10:40:09 -04:00
parent e9e89b0b43
commit f8531daa5c

View File

@@ -215,7 +215,7 @@ namespace SabreTools.Serialization.Wrappers
// If we have certificate data, use that as the end
if (OptionalHeader?.CertificateTable != null)
{
int certificateTableAddress = (int)OptionalHeader.CertificateTable.VirtualAddress.ConvertVirtualAddress(SectionTable);
int certificateTableAddress = (int)OptionalHeader.CertificateTable.VirtualAddress;
if (certificateTableAddress != 0 && certificateTableAddress < dataLength)
dataLength = certificateTableAddress;
}