Add data at PE entry point

This commit is contained in:
Matt Nadareski
2022-06-19 22:40:07 -07:00
parent a8fca77331
commit b233b3c17b
2 changed files with 27 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ namespace BurnOutSharp.ExecutableType.Microsoft.PE.Headers
/// The address of the entry point relative to the image base when the executable file is loaded into memory.
/// For program images, this is the starting address.
/// For device drivers, this is the address of the initialization function.
// An entry point is optional for DLLs.
/// An entry point is optional for DLLs.
/// When no entry point is present, this field must be zero.
/// </summary>
public uint AddressOfEntryPoint;

View File

@@ -184,6 +184,15 @@ namespace BurnOutSharp.ExecutableType.Microsoft.PE
#endregion
#region Raw Other Data
/// <summary>
/// Data at the entry point of the application
/// </summary>
public byte[] EntryPointRaw;
#endregion
#region Resources
/// <summary>
@@ -366,6 +375,16 @@ namespace BurnOutSharp.ExecutableType.Microsoft.PE
#endregion
#region Freeform Data
if (this.OptionalHeader != null && this.OptionalHeader.AddressOfEntryPoint != 0)
{
int entryPointAddress = (int)ConvertVirtualAddress(this.OptionalHeader.AddressOfEntryPoint, SectionTable);
this.EntryPointRaw = this.ReadArbitraryRange(entryPointAddress, 256);
}
#endregion
// Populate resources, if possible
PopulateResourceStrings();
}
@@ -476,6 +495,13 @@ namespace BurnOutSharp.ExecutableType.Microsoft.PE
#endregion
#region Freeform Data
if (this.OptionalHeader != null && this.OptionalHeader.AddressOfEntryPoint != 0)
this.EntryPointRaw = this.ReadArbitraryRange((int)this.OptionalHeader.AddressOfEntryPoint, 256);
#endregion
// Populate resources, if possible
PopulateResourceStrings();
}