Skip to content

Commit df57551

Browse files
committed
API changes and docker images for Ghidra 11.2
1 parent 269b78d commit df57551

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "ghidrecomp",
55
// image from https://github.com/clearbluejar/ghidra-python
6-
"image": "ghcr.io/clearbluejar/ghidra-python:11.0.3ghidra3.12python-bookworm",
6+
"image": "ghcr.io/clearbluejar/ghidra-python:11.2ghidra3.12python-bookworm",
77
// Configure tool-specific properties.
88
"customizations": {
99
// Configure properties specific to VS Code.

.devcontainer/post-create.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@ pip install --upgrade pip
99
pip install ghidra-stubs
1010

1111
# If linux arm64 os, need to build native binaries for Ghidra
12+
# If arm64 os, need to build native binaries for Ghidra
1213
if uname -a | grep -q 'aarch64'; then
13-
$GHIDRA_INSTALL_DIR/support/buildNatives
14+
if [ -e $GHIDRA_INSTALL_DIR/support/buildNatives ]
15+
then
16+
$GHIDRA_INSTALL_DIR/support/buildNatives
17+
else
18+
# needed for Ghidra 11.2+
19+
pushd $GHIDRA_INSTALL_DIR/support/gradle/
20+
gradle buildNatives
21+
popd
22+
fi
1423
fi
1524

1625
# install local workspace and test requirements

.github/workflows/pytest-devcontainer-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# cover the latest and all versions of all subreleases
2525
image: [
2626
"latest",
27-
"11.0.1ghidra3.12python-bookworm",
27+
"11.1.2ghidra3.12python-bookworm",
2828
"11.0ghidra3.11python-bookworm",
2929
"10.4ghidra3.11python-bookworm",
3030
"10.4ghidra3.9python-bookworm",

ghidrecomp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.5.3'
1+
__version__ = '0.5.4'
22
__author__ = 'clearbluejar'
33

44
# Expose API

ghidrecomp/utility.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ def get_pdb(prog: "ghidra.program.model.listing.Program") -> "java.io.File":
119119
from ghidra.util.task import ConsoleTaskMonitor
120120
from pdb_ import PdbPlugin
121121

122-
find_opts = FindOption.of(FindOption.ALLOW_REMOTE)
123-
# find_opts = FindOption.NO_OPTIONS
122+
if hasattr(FindOption, 'ALLOW_UNTRUSTED'):
123+
# Ghidra 11.2 +
124+
find_opts = FindOption.of(FindOption.ALLOW_UNTRUSTED)
125+
else:
126+
# Ghidra < 11.2
127+
find_opts = FindOption.of(FindOption.ALLOW_REMOTE)
124128

125129
# Ghidra/Features/PDB/src/main/java/pdb/PdbPlugin.java#L191
126130
pdb = PdbPlugin.findPdb(prog, find_opts, ConsoleTaskMonitor())
@@ -148,8 +152,14 @@ def set_remote_pdbs(program: "ghidra.program.model.listing.Program", allow: bool
148152
from ghidra.app.plugin.core.analysis import PdbUniversalAnalyzer
149153
# Enable Remote Symbol Servers
150154

151-
PdbUniversalAnalyzer.setAllowRemoteOption(program, allow)
152-
PdbAnalyzer.setAllowRemoteOption(program, allow)
155+
if hasattr(PdbUniversalAnalyzer, 'setAllowUntrustedOption'):
156+
# Ghidra 11.2 +
157+
PdbUniversalAnalyzer.setAllowUntrustedOption(program, True)
158+
PdbAnalyzer.setAllowUntrustedOption(program, True)
159+
else:
160+
# Ghidra < 11.2
161+
PdbUniversalAnalyzer.setAllowRemoteOption(program, True)
162+
PdbAnalyzer.setAllowRemoteOption(program, True)
153163

154164

155165
def apply_gdt(program: "ghidra.program.model.listing.Program", gdt_path: Union[str, Path], verbose: bool = False):

0 commit comments

Comments
 (0)