Ghidra is a software reverse engineering (SRE) framework
GhidraDev new module project wizard can now optionally include/exclude processor. Also fixed building processor using buildLanguage.xml.
Ryan Kurtz5c74632fdbf8
diff --git a/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/utils/GhidraModuleUtils.java b/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/utils/GhidraModuleUtils.javaindex a1d1182469..098599b875 100644--- a/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/utils/GhidraModuleUtils.java+++ b/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/utils/GhidraModuleUtils.java@@ -42,7 +42,8 @@ public class GhidraModuleUtils {PLUGIN("Plugin", "Extends the Ghidra user interface"),LOADER("Loader", "Loads/imports a binary file format into Ghidra"),FILESYSTEM("FileSystem", "Opens a file system format for browsing or batch import"),- EXPORTER("Exporter", "Exports/saves a Ghidra program to a specific file format");+ EXPORTER("Exporter", "Exports/saves a Ghidra program to a specific file format"),+ PROCESSOR("Processor", "Enables disassembly/decompilation of a processor/architecture");private String name;private String description;@@ -136,7 +137,14 @@ public class GhidraModuleUtils {List<String> excludeRegexes = new ArrayList<>();for (ModuleTemplateType moduleTemplateType : ModuleTemplateType.values()) {if (!moduleTemplateTypes.contains(moduleTemplateType)) {- excludeRegexes.add(SKELETON_CLASS + moduleTemplateType.getName() + "\\.java");+ if (moduleTemplateType.equals(ModuleTemplateType.PROCESSOR)) {+ excludeRegexes.add("languages");+ excludeRegexes.add("buildLanguage\\.xml");+ excludeRegexes.add("sleighArgs\\.txt");+ }+ else {+ excludeRegexes.add(SKELETON_CLASS + moduleTemplateType.getName() + "\\.java");+ }}}@@ -199,7 +207,7 @@ public class GhidraModuleUtils {* Writes project-specific ant properties, which get imported by the module project's language* build.xml file to allow building against a Ghidra that lives in an external location. If the* given project is not a Ghidra module project, or if the Ghidra module project does not have a- * language build.xml ant file, this method has no effect.+ * language buildLanguage.xml ant file, this method has no effect.** @param project The project to receive the ant properties.* @param ghidraLayout The layout that contains the Ghidra installation directory that the project@@ -216,7 +224,7 @@ public class GhidraModuleUtils {if (!dataFolder.exists()) {return;}- IFile buildXmlFile = dataFolder.getFile("build.xml");+ IFile buildXmlFile = dataFolder.getFile("buildLanguage.xml");if (!buildXmlFile.exists()) {return;}diff --git a/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/wizards/pages/ConfigureGhidraModuleProjectWizardPage.java b/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/wizards/pages/ConfigureGhidraModuleProjectWizardPage.javaindex 151a902b5d..057925a381 100644--- a/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/wizards/pages/ConfigureGhidraModuleProjectWizardPage.java+++ b/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/wizards/pages/ConfigureGhidraModuleProjectWizardPage.java@@ -49,12 +49,12 @@ public class ConfigureGhidraModuleProjectWizardPage extends WizardPage {public void createControl(Composite parent) {Composite container = new Composite(parent, SWT.NULL);- container.setLayout(new GridLayout(2, false));+ container.setLayout(new GridLayout(1, false));Label moduleTemplateLabel = new Label(container, SWT.NULL);moduleTemplateLabel.setText("Module template:");Group moduleTemplateGroup = new Group(container, SWT.SHADOW_ETCHED_OUT);- moduleTemplateGroup.setLayout(new RowLayout(SWT.HORIZONTAL));+ moduleTemplateGroup.setLayout(new RowLayout(SWT.VERTICAL));SelectionListener selectionListener = new SelectionListener() {@Override@@ -71,7 +71,8 @@ public class ConfigureGhidraModuleProjectWizardPage extends WizardPage {for (ModuleTemplateType moduleTemplateType : ModuleTemplateType.values()) {Button checkboxButton = new Button(moduleTemplateGroup, SWT.CHECK);checkboxButton.setSelection(true);- checkboxButton.setText(moduleTemplateType.getName());+ checkboxButton.setText(+ moduleTemplateType.getName() + " - " + moduleTemplateType.getDescription());checkboxButton.setToolTipText(moduleTemplateType.getDescription());checkboxButton.addSelectionListener(selectionListener);moduleTemplateCheckboxMap.put(checkboxButton, moduleTemplateType);