Skip to content

Commit

Permalink
added compatibility with ghidra 10.2_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Евгений Рассказов committed Apr 26, 2022
1 parent 48d4172 commit 573f4b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 7 additions & 7 deletions src/main/java/efiSeek/EfiSeekAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@



import generic.continues.RethrowContinuesFactory;
import ghidra.app.util.bin.ByteProvider;
import ghidra.app.services.AbstractAnalyzer;
import ghidra.app.services.AnalyzerType;
import ghidra.app.util.importer.MessageLog;
Expand All @@ -29,7 +29,7 @@
import ghidra.program.model.listing.Program;
import ghidra.program.model.mem.MemoryBlock;
import ghidra.app.util.bin.ByteArrayProvider;
import ghidra.app.util.bin.format.FactoryBundledWithBinaryReader;
import ghidra.app.util.bin.BinaryReader;
import ghidra.app.util.bin.format.pe.NTHeader;
import ghidra.app.util.bin.format.pe.OptionalHeader;
import ghidra.app.util.bin.format.pe.PortableExecutable;
Expand Down Expand Up @@ -69,12 +69,12 @@ public boolean canAnalyze(Program program) {
}
bytesRead += block.getBytes(block.getStart(), blockBytes, bytesRead, (int) block.getSize());
}
FactoryBundledWithBinaryReader reader = new FactoryBundledWithBinaryReader(
RethrowContinuesFactory.INSTANCE, new ByteArrayProvider(blockBytes),
!program.getLanguage().isBigEndian());
BinaryReader reader = new BinaryReader(
new ByteArrayProvider(blockBytes),
!program.getLanguage().isBigEndian());
int ntHeaderOffset = reader.readInt(0x3C);
ntHeader = NTHeader.createNTHeader(reader, ntHeaderOffset,
PortableExecutable.SectionLayout.FILE, false, false);
ntHeader = new NTHeader(reader, ntHeaderOffset,
PortableExecutable.SectionLayout.FILE, false, false);
} catch (Exception e) {
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/efiSeek/EfiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

import java.util.ArrayList;

import generic.continues.RethrowContinuesFactory;
import ghidra.app.util.bin.ByteProvider;
import ghidra.app.util.bin.ByteArrayProvider;
import ghidra.app.util.bin.format.FactoryBundledWithBinaryReader;
import ghidra.app.util.bin.BinaryReader;
import ghidra.app.util.bin.format.pe.NTHeader;
import ghidra.app.util.bin.format.pe.PortableExecutable;
import ghidra.program.flatapi.FlatProgramAPI;
Expand Down Expand Up @@ -108,12 +108,12 @@ public final Address getEntryPoint() throws Exception {
}
bytesRead += block.getBytes(block.getStart(), blockBytes, bytesRead, (int) block.getSize());
}
FactoryBundledWithBinaryReader reader = new FactoryBundledWithBinaryReader(
RethrowContinuesFactory.INSTANCE, new ByteArrayProvider(blockBytes),
BinaryReader reader = new BinaryReader(
new ByteArrayProvider(blockBytes),
!getCurrentProgram().getLanguage().isBigEndian());
int ntHeaderOffset = reader.readInt(0x3C);
ntHeader = NTHeader.createNTHeader(reader, ntHeaderOffset,
PortableExecutable.SectionLayout.FILE, false, false);
ntHeader = new NTHeader(reader, ntHeaderOffset,
PortableExecutable.SectionLayout.FILE, false, false);

long baseEntyPoint = ntHeader.getOptionalHeader().getAddressOfEntryPoint();
return getCurrentProgram().getImageBase().add(baseEntyPoint);
Expand Down

0 comments on commit 573f4b9

Please sign in to comment.