mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-05-21 04:41:18 +03:00
Move Is64Bit method from OptionalHeaderParser to OptionalHeader class
This commit is contained in:
parent
49a0a9e3a3
commit
79773b08aa
@ -5,6 +5,10 @@ namespace X86Disassembler.PE
|
||||
/// </summary>
|
||||
public class OptionalHeader
|
||||
{
|
||||
// Optional Header Magic values
|
||||
private const ushort PE32_MAGIC = 0x10B; // 32-bit executable
|
||||
private const ushort PE32PLUS_MAGIC = 0x20B; // 64-bit executable
|
||||
|
||||
// Standard fields
|
||||
public ushort Magic; // Magic number (PE32 or PE32+)
|
||||
public byte MajorLinkerVersion; // Major linker version
|
||||
@ -40,6 +44,15 @@ namespace X86Disassembler.PE
|
||||
public uint NumberOfRvaAndSizes; // Number of RVA and sizes
|
||||
|
||||
public DataDirectory[] DataDirectories; // Data directories
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the PE file is 64-bit based on the Magic value
|
||||
/// </summary>
|
||||
/// <returns>True if the PE file is 64-bit, false otherwise</returns>
|
||||
public bool Is64Bit()
|
||||
{
|
||||
return Magic == PE32PLUS_MAGIC;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user