Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Ghidra_11.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmkurtz committed May 20, 2024
2 parents 7404d3c + 8734c48 commit 8e1263a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
23 changes: 20 additions & 3 deletions Ghidra/Debug/Debugger-agent-dbgeng/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ dependencies {
testImplementation project(path: ":Debugger-gadp", configuration: 'testArtifacts')
}

ext.tlb = file("build/os/win_x86_64/dbgmodel.tlb")

if ("win_x86_64".equals(getCurrentPlatformName())) {

String makeName = "win_x86_64DbgmodelTlbMake"
task(type: Exec, makeName) {
ext.tmpBatch = file("build/buildTlb.bat")
ext.idl = file("src/main/py/src/ghidradbg/dbgmodel/DbgModel.idl")
ext.tlb = file("build/os/win_x86_64/dbgmodel.tlb")
inputs.file(idl)
outputs.file(tlb)

Expand All @@ -69,13 +70,29 @@ if ("win_x86_64".equals(getCurrentPlatformName())) {
}
}
}
else {
else if (file(tlb).exists()) {
// required for multi-platform build
tasks.assemblePyPackage {
from(rootProject.BIN_REPO + '/' + getGhidraRelativePath(project) + "/os/win_x86_64/dbgmodel.tlb") {
from(tlb) {
println "Copying existing tlb build artifact: " + tlb
into("src/ghidradbg/dbgmodel/tlb")
}
}
}
else {
def prebuiltTlb = new File(rootProject.BIN_REPO + '/' + getGhidraRelativePath(project) + "/os/win_x86_64/dbgmodel.tlb")
if (prebuiltTlb.exists()) {
println "Copying prebuilt dbgmodel.tlb"
tasks.assemblePyPackage {
from(rootProject.BIN_REPO + '/' + getGhidraRelativePath(project) + "/os/win_x86_64/dbgmodel.tlb") {
into("src/ghidradbg/dbgmodel/tlb")
}
}
}
else {
println "WARNING: dbgmodel.tlb omitted from ghidradbg python package"
}
}

distributePyDep("Pybag-2.2.10-py3-none-any.whl")
distributePyDep("capstone-5.0.1-py3-none-win_amd64.whl")
Expand Down
1 change: 1 addition & 0 deletions Ghidra/Debug/Debugger-agent-dbgeng/certification.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Module.manifest||GHIDRA||||END|
data/debugger-launchers/local-dbgeng.bat||GHIDRA||||END|
data/debugger-launchers/local-ttd.bat||GHIDRA||||END|
src/main/py/LICENSE||GHIDRA||||END|
src/main/py/MANIFEST.in||GHIDRA||||END|
src/main/py/README.md||GHIDRA||||END|
src/main/py/pyproject.toml||GHIDRA||||END|
src/main/py/src/ghidradbg/dbgmodel/DbgModel.idl||GHIDRA||||END|
Expand Down
1 change: 1 addition & 0 deletions Ghidra/Debug/Debugger-agent-dbgeng/src/main/py/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft src
6 changes: 6 additions & 0 deletions Ghidra/Debug/Debugger-agent-dbgeng/src/main/py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ dependencies = [
[project.urls]
"Homepage" = "https://github.com/NationalSecurityAgency/ghidra"
"Bug Tracker" = "https://github.com/NationalSecurityAgency/ghidra/issues"

[tool.setuptools.package-data]
ghidradbg = ["*.tlb"]

[tool.setuptools]
include-package-data = true
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
import ghidra.util.task.SwingUpdateManager;

/**
* Loads and manages updating of available script files.
* Loads and manages updating of available script files.
* <p>
* Use the {@link #refresh()} method to reload the script files.
*/
public class ScriptList {

private BundleHost bundleHost;
private List<ResourceFile> scriptFiles = new ArrayList<>();
private List<ResourceFile> scriptFiles = null;
private WeakSet<ChangeListener> listeners = WeakDataStructureFactory.createCopyOnWriteWeakSet();

private SwingUpdateManager refreshUpdateManager = new SwingUpdateManager(this::doRefresh);
Expand Down Expand Up @@ -76,7 +76,7 @@ private void doRefresh() {

void load() {
Swing.runNow(() -> {
if (scriptFiles.isEmpty()) {
if (scriptFiles == null) {
doRefresh();
}
});
Expand All @@ -87,7 +87,7 @@ List<ResourceFile> getScriptFiles() {
return Collections.unmodifiableList(scriptFiles);
}

List<ResourceFile> getScriptDirectories() {
private List<ResourceFile> getScriptDirectories() {
return bundleHost.getGhidraBundles()
.stream()
.filter(GhidraSourceBundle.class::isInstance)
Expand All @@ -96,8 +96,8 @@ List<ResourceFile> getScriptDirectories() {
.collect(Collectors.toList());
}

private void updateAvailableScriptFilesForDirectory(
List<ResourceFile> scriptAccumulator, ResourceFile directory) {
private void updateAvailableScriptFilesForDirectory(List<ResourceFile> scriptAccumulator,
ResourceFile directory) {
ResourceFile[] files = directory.listFiles();
if (files == null) {
return;
Expand Down

0 comments on commit 8e1263a

Please sign in to comment.