mirror of
https://github.com/Perfare/Il2CppDumper.git
synced 2025-01-10 03:27:28 -03:00
Fixed #394
This commit is contained in:
parent
95173b37a6
commit
7f2817ef12
1 changed files with 5 additions and 3 deletions
|
@ -25,20 +25,22 @@ namespace Il2CppDumper
|
|||
}
|
||||
var fileHeader = ReadClass<FileHeader>();
|
||||
var pos = Position;
|
||||
if (fileHeader.Machine == 0x14c) //Intel 386
|
||||
var magic = ReadUInt16();
|
||||
Position -= 2;
|
||||
if (magic == 0x10b)
|
||||
{
|
||||
Is32Bit = true;
|
||||
var optionalHeader = ReadClass<OptionalHeader>();
|
||||
imageBase = optionalHeader.ImageBase;
|
||||
}
|
||||
else if (fileHeader.Machine == 0x8664) //AMD64
|
||||
else if (magic == 0x20b)
|
||||
{
|
||||
var optionalHeader = ReadClass<OptionalHeader64>();
|
||||
imageBase = optionalHeader.ImageBase;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("ERROR: Unsupported machine.");
|
||||
throw new NotSupportedException($"Invalid Optional header magic {magic}");
|
||||
}
|
||||
Position = pos + fileHeader.SizeOfOptionalHeader;
|
||||
sections = ReadClassArray<SectionHeader>(fileHeader.NumberOfSections);
|
||||
|
|
Loading…
Reference in a new issue