Skip to content

Commit

Permalink
Merge branch 'ghidra-10.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
al3xtjames committed Nov 4, 2022
2 parents 922591c + aca179b commit 2c0f31d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ on:
workflow_dispatch:

env:
GHIDRA_VERSION: 10.1.5
GHIDRA_DATE: 20220726
GHIDRA_VERSION: 10.2
GHIDRA_DATE: 20221101

jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: Set up Ghidra
Expand All @@ -42,10 +42,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: Set up Ghidra
Expand All @@ -72,10 +72,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: Set up Ghidra
Expand Down Expand Up @@ -107,8 +107,10 @@ jobs:
else
plugin_tag="$plugin_date.0"
fi
plugin_changelog="$(git log --pretty=format:%s ${last_tag}..)"
plugin_changelog="${plugin_changelog//$'\n'/'%0A'}"
echo "PLUGIN_TAG=${plugin_tag}" >> $GITHUB_ENV
echo "PLUGIN_CHANGELOG=$(git log --pretty=format:%s ${last_tag}..)" >> $GITHUB_ENV
echo "PLUGIN_CHANGELOG=${plugin_changelog}" >> $GITHUB_ENV
mv dist/*.zip "dist/ghidra_${GHIDRA_VERSION}_PUBLIC_${plugin_tag}_ghidra-firmware-utils.zip"
- name: Upload to Artifacts
Expand Down
7 changes: 2 additions & 5 deletions ghidra_scripts/UEFIHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
import firmware.common.UUIDUtils;
import firmware.uefi_te.TELoader;
import firmware.uefi_te.TerseExecutableHeader;
import generic.continues.RethrowContinuesFactory;
import ghidra.app.decompiler.*;
import ghidra.app.plugin.core.datamgr.archive.DuplicateIdException;
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
import ghidra.app.script.GhidraScript;
import ghidra.app.util.bin.BinaryReader;
import ghidra.app.util.bin.ByteArrayProvider;
import ghidra.app.util.bin.format.FactoryBundledWithBinaryReader;
import ghidra.app.util.bin.format.pe.MachineConstants;
import ghidra.app.util.bin.format.pe.NTHeader;
import ghidra.app.util.bin.format.pe.PeSubsystem;
Expand Down Expand Up @@ -414,10 +412,9 @@ public void run() throws Exception {
MemoryBlock peBlock = currentProgram.getMemory().getBlock(PeLoader.HEADERS);
byte[] blockBytes = new byte[(int) peBlock.getSize()];
peBlock.getBytes(peBlock.getStart(), blockBytes);
FactoryBundledWithBinaryReader reader = new FactoryBundledWithBinaryReader(
RethrowContinuesFactory.INSTANCE, new ByteArrayProvider(blockBytes), true);
BinaryReader reader = new BinaryReader(new ByteArrayProvider(blockBytes), true);
int ntHeaderOffset = reader.readInt(0x3C);
NTHeader ntHeader = NTHeader.createNTHeader(reader, ntHeaderOffset,
NTHeader ntHeader = new NTHeader(reader, ntHeaderOffset,
PortableExecutable.SectionLayout.FILE, false, false);
println("Loaded Portable Executable");

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/firmware/cbfs/CBFSFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public CBFSFile(BinaryReader reader) throws IOException {
type = reader.readNextInt();
attributesOffset = reader.readNextUnsignedInt();
offset = reader.readNextUnsignedInt();
name = reader.readNextNullTerminatedAsciiString();
name = reader.readNextAsciiString();

// The attributes offset should point past the end of the CBFS file structure.
if (attributesOffset != 0 && attributesOffset > CBFSConstants.CBFS_FILE_SIZE) {
Expand Down

0 comments on commit 2c0f31d

Please sign in to comment.