al3xtjames / ghidra-firmware-utils

Ghidra utilities for analyzing PC firmware
Other
386 stars 43 forks source link

ghidra api usage error #23

Closed SteinsGatep001 closed 1 year ago

SteinsGatep001 commented 1 year ago

Code

BinaryReader reader = new BinaryReader(new ByteArrayProvider(blockBytes), true);
// ....
NTHeader ntHeader = new NTHeader(reader, ntHeaderOffset, PortableExecutable.SectionLayout.FILE, false, false);

should be changed to

FactoryBundledWithBinaryReader reader = new FactoryBundledWithBinaryReader(RethrowContinuesFactory.INSTANCE, new ByteArrayProvider(blockBytes), true);
// ...
NTHeader ntHeader = NTHeader.createNTHeader(reader, ntHeaderOffset, PortableExecutable.SectionLayout.FILE, false, false);

Tested in Ghidra 10.1.5

al3xtjames commented 1 year ago

This was done in https://github.com/al3xtjames/ghidra-firmware-utils/commit/b07081698df6320c8fae9f96dba07f43b27071aa, which was included in 20221104.1. 20221104.1 is just 20221104.0 with API updates for Ghidra 10.2, so you can use 20221104.0 on Ghidra 10.1.5.