mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
PEF - fix export count calculation (#418)
* Initial version of PEF * add pef test file * Fixed export hash slot count calculation --------- Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#pragma author Dominik Tamiollo
|
||||
#pragma author domin568
|
||||
#pragma description Preffered Executable Format executable (for Mac OS 7.1.2 - Mac OS 10.4 / BeOS)
|
||||
#pragma endian big
|
||||
#pragma pattern_limit 1000000
|
||||
#pragma magic [4A 6F 79 21] @ 0x00
|
||||
|
||||
import std.core;
|
||||
import std.sys;
|
||||
import std.math;
|
||||
|
||||
struct PEFContainerHeader
|
||||
{
|
||||
@@ -435,7 +435,7 @@ u32 relocBegin = loaderOffset + loaderHeader.relocInstrOffset;
|
||||
u32 relocSize = loaderOffset + loaderHeader.loaderStringsOffset - relocBegin;
|
||||
RelocInstruction relocationInstructions[while(($-relocBegin) < relocSize)] @ relocBegin;
|
||||
|
||||
u32 exportSlotNum = 2 * loaderHeader.exportHashTablePower; // 2 ^ loaderHeader.exportHashTablePower
|
||||
u32 exportSlotNum = std::math::pow(2, loaderHeader.exportHashTablePower);
|
||||
u32 exportDataOffset = loaderOffset + loaderHeader.exportHashOffset;
|
||||
u32 exportSymbolKeysOffset = exportDataOffset + sizeof(PEFExportedSymbolHashSlot) * exportSlotNum;
|
||||
u32 exportedSymbolsOffset = exportSymbolKeysOffset + sizeof(PEFExportedSymbolKey) * loaderHeader.exportedSymbolCount;
|
||||
|
||||
Reference in New Issue
Block a user