Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes for Ghidra API Changes in Ghidra 10.1.3 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/efiSeek/EfiSeekAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/efiSeek/EfiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down