mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-13 04:16:53 +00:00
Read MS-DOS stub data directly; use with CExe
This commit is contained in:
@@ -124,6 +124,11 @@ namespace BurnOutSharp.ExecutableType.Microsoft.Headers
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// All data after the last item in the header but before the new EXE header address
|
||||
/// </summary>
|
||||
public byte[] ExecutableData;
|
||||
|
||||
public static MSDOSExecutableHeader Deserialize(Stream stream, bool asStub = true)
|
||||
{
|
||||
MSDOSExecutableHeader idh = new MSDOSExecutableHeader();
|
||||
@@ -152,6 +157,7 @@ namespace BurnOutSharp.ExecutableType.Microsoft.Headers
|
||||
{
|
||||
idh.Reserved1[i] = stream.ReadUInt16();
|
||||
}
|
||||
|
||||
idh.OEMIdentifier = stream.ReadUInt16();
|
||||
idh.OEMInformation = stream.ReadUInt16();
|
||||
idh.Reserved2 = new ushort[Constants.ERES2WDS];
|
||||
@@ -159,7 +165,9 @@ namespace BurnOutSharp.ExecutableType.Microsoft.Headers
|
||||
{
|
||||
idh.Reserved2[i] = stream.ReadUInt16();
|
||||
}
|
||||
|
||||
idh.NewExeHeaderAddr = stream.ReadInt32();
|
||||
idh.ExecutableData = stream.ReadBytes(idh.NewExeHeaderAddr - (int)stream.Position);
|
||||
|
||||
return idh;
|
||||
}
|
||||
@@ -192,6 +200,7 @@ namespace BurnOutSharp.ExecutableType.Microsoft.Headers
|
||||
{
|
||||
idh.Reserved1[i] = content.ReadUInt16(ref offset);
|
||||
}
|
||||
|
||||
idh.OEMIdentifier = content.ReadUInt16(ref offset);
|
||||
idh.OEMInformation = content.ReadUInt16(ref offset);
|
||||
idh.Reserved2 = new ushort[Constants.ERES2WDS];
|
||||
@@ -199,7 +208,9 @@ namespace BurnOutSharp.ExecutableType.Microsoft.Headers
|
||||
{
|
||||
idh.Reserved2[i] = content.ReadUInt16(ref offset);
|
||||
}
|
||||
|
||||
idh.NewExeHeaderAddr = content.ReadInt32(ref offset);
|
||||
idh.ExecutableData = content.ReadBytes(ref offset, idh.NewExeHeaderAddr - offset);
|
||||
|
||||
return idh;
|
||||
}
|
||||
|
||||
@@ -92,28 +92,28 @@ namespace BurnOutSharp.ExecutableType.Microsoft
|
||||
// - .tls *1 protection Thread-local storage (object only)
|
||||
//
|
||||
// Here is a list of non-standard sections whose contents are read by various protections:
|
||||
// X - CODE *1 protection WTM CD Protect
|
||||
// X - CODE 2 protections SafeDisc, WTM CD Protect
|
||||
// X - .grand *1 protection CD-Cops / DVD-Cops
|
||||
// X - .init *1 protection SolidShield
|
||||
// - .NOS0 *1 protection UPX (NOS Variant) [Used as endpoint]
|
||||
// - .NOS1 *1 protection UPX (NOS Variant) [Used as endpoint]
|
||||
// - .pec2 *1 protection PE Compact [Unconfirmed]
|
||||
// X - .txt2 *1 protection SafeDisc
|
||||
// - .UPX0 *1 protection UPX [Used as endpoint]
|
||||
// - .UPX1 *1 protection UPX [Used as endpoint]
|
||||
//
|
||||
// Here is a list of non-standard sections whose existence are checked by various protections:
|
||||
// Here is a list of non-standard sections whose data is not read by various protections:
|
||||
// - .brick 1 protection StarForce
|
||||
// - .cenega 1 protection Cenega ProtectDVD
|
||||
// - .icd* 1 protection CodeLock
|
||||
// - .ldr 1 protection 3PLock
|
||||
// - .ldt 1 protection 3PLock
|
||||
// - .nicode 1 protection Armadillo
|
||||
// - .NOS0 *1 protection UPX (NOS Variant) [Used as endpoint]
|
||||
// - .NOS1 *1 protection UPX (NOS Variant) [Used as endpoint]
|
||||
// - .pec1 1 protection PE Compact
|
||||
// - .securom 1 protection SecuROM
|
||||
// - .sforce 1 protection StarForce
|
||||
// - stxt371 1 protection SafeDisc
|
||||
// - stxt774 1 protection SafeDisc
|
||||
// - .UPX0 *1 protection UPX [Used as endpoint]
|
||||
// - .UPX1 *1 protection UPX [Used as endpoint]
|
||||
// - .vob.pcd 1 protection VOB ProtectCD
|
||||
// - _winzip_ 1 protection WinZip SFX
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user