mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-04 05:36:12 +00:00
Overlay address in PE should be long, fix caching
This commit is contained in:
@@ -43,11 +43,17 @@ namespace SabreTools.Serialization.Wrappers
|
||||
// Get the available source length, if possible
|
||||
long dataLength = Length;
|
||||
if (dataLength == -1)
|
||||
return -1;
|
||||
{
|
||||
_overlayAddress = -1;
|
||||
return _overlayAddress.Value;
|
||||
}
|
||||
|
||||
// If a required property is missing
|
||||
if (Header == null || SegmentTable == null || ResourceTable?.ResourceTypes == null)
|
||||
return -1;
|
||||
{
|
||||
_overlayAddress = -1;
|
||||
return _overlayAddress.Value;
|
||||
}
|
||||
|
||||
// Search through the segments table to find the furthest
|
||||
long endOfSectionData = -1;
|
||||
|
||||
@@ -292,7 +292,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
/// Address of the overlay, if it exists
|
||||
/// </summary>
|
||||
/// <see href="https://www.autoitscript.com/forum/topic/153277-pe-file-overlay-extraction/"/>
|
||||
public int OverlayAddress
|
||||
public long OverlayAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -305,11 +305,17 @@ namespace SabreTools.Serialization.Wrappers
|
||||
// Get the available source length, if possible
|
||||
long dataLength = Length;
|
||||
if (dataLength == -1)
|
||||
return -1;
|
||||
{
|
||||
_overlayAddress = -1;
|
||||
return _overlayAddress.Value;
|
||||
}
|
||||
|
||||
// If the section table is missing
|
||||
if (SectionTable == null)
|
||||
return -1;
|
||||
{
|
||||
_overlayAddress = -1;
|
||||
return _overlayAddress.Value;
|
||||
}
|
||||
|
||||
// If we have certificate data, use that as the end
|
||||
if (OptionalHeader?.CertificateTable != null)
|
||||
|
||||
Reference in New Issue
Block a user