From 4956d1d68a6cf83960da50811b416b3335f4ab6c Mon Sep 17 00:00:00 2001 From: nstarke Date: Sat, 14 May 2022 17:08:08 -0500 Subject: [PATCH] Bugfixes for Ghidra API Changes in Ghidra 10.1.3 --- src/main/java/efiSeek/EfiSeekAnalyzer.java | 3 ++- src/main/java/efiSeek/EfiUtils.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/efiSeek/EfiSeekAnalyzer.java b/src/main/java/efiSeek/EfiSeekAnalyzer.java index 26c4fbd..f67f6ae 100644 --- a/src/main/java/efiSeek/EfiSeekAnalyzer.java +++ b/src/main/java/efiSeek/EfiSeekAnalyzer.java @@ -33,6 +33,7 @@ import ghidra.app.util.bin.format.pe.NTHeader; import ghidra.app.util.bin.format.pe.OptionalHeader; import ghidra.app.util.bin.format.pe.PortableExecutable; +import ghidra.app.util.bin.format.FactoryBundledWithBinaryReader; import ghidra.util.Msg; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; @@ -73,7 +74,7 @@ public boolean canAnalyze(Program program) { new ByteArrayProvider(blockBytes), !program.getLanguage().isBigEndian()); int ntHeaderOffset = reader.readInt(0x3C); - ntHeader = new NTHeader(reader, ntHeaderOffset, + ntHeader = NTHeader.createNTHeader((FactoryBundledWithBinaryReader)reader, ntHeaderOffset, PortableExecutable.SectionLayout.FILE, false, false); } catch (Exception e) { return false; diff --git a/src/main/java/efiSeek/EfiUtils.java b/src/main/java/efiSeek/EfiUtils.java index bab97f7..5d4dd7f 100644 --- a/src/main/java/efiSeek/EfiUtils.java +++ b/src/main/java/efiSeek/EfiUtils.java @@ -21,6 +21,7 @@ import ghidra.app.util.bin.BinaryReader; import ghidra.app.util.bin.format.pe.NTHeader; import ghidra.app.util.bin.format.pe.PortableExecutable; +import ghidra.app.util.bin.format.FactoryBundledWithBinaryReader; import ghidra.program.flatapi.FlatProgramAPI; import ghidra.program.model.address.Address; import ghidra.program.model.data.DataType; @@ -112,7 +113,7 @@ public final Address getEntryPoint() throws Exception { new ByteArrayProvider(blockBytes), !getCurrentProgram().getLanguage().isBigEndian()); int ntHeaderOffset = reader.readInt(0x3C); - ntHeader = new NTHeader(reader, ntHeaderOffset, + ntHeader = NTHeader.createNTHeader((FactoryBundledWithBinaryReader)reader, ntHeaderOffset, PortableExecutable.SectionLayout.FILE, false, false); long baseEntyPoint = ntHeader.getOptionalHeader().getAddressOfEntryPoint();