diff --git a/GhidraBuild/EclipsePlugins/SleighEditor/certification.manifest b/GhidraBuild/EclipsePlugins/SleighEditor/certification.manifest index 2a70edbb54..e40d9e3a38 100644 --- a/GhidraBuild/EclipsePlugins/SleighEditor/certification.manifest +++ b/GhidraBuild/EclipsePlugins/SleighEditor/certification.manifest @@ -34,9 +34,11 @@ ghidra.xtext.sleigh.ui/src/ghidra/xtext/sleigh/ui/outline/SleighOutlineTreeProvi ghidra.xtext.sleigh.ui/src/ghidra/xtext/sleigh/ui/quickfix/SleighQuickfixProvider.xtend||GHIDRA||||END| ghidra.xtext.sleigh/.launch/Generate Sleigh (sleigh) Language Infrastructure.launch||GHIDRA||||END| ghidra.xtext.sleigh/.launch/Launch Runtime Eclipse.launch||GHIDRA||||END| +ghidra.xtext.sleigh/GhidraSleighEditor_README.html||GHIDRA||||END| ghidra.xtext.sleigh/META-INF/MANIFEST.MF||GHIDRA||||END| ghidra.xtext.sleigh/build.gradle||GHIDRA||||END| ghidra.xtext.sleigh/build.properties||GHIDRA||||END| +ghidra.xtext.sleigh/build_README.txt||GHIDRA||||END| ghidra.xtext.sleigh/plugin.xml||GHIDRA||||END| ghidra.xtext.sleigh/src/ghidra/xtext/sleigh/GenerateSleigh.mwe2||GHIDRA||||END| ghidra.xtext.sleigh/src/ghidra/xtext/sleigh/Sleigh.xtext||GHIDRA||||END| diff --git a/GhidraBuild/EclipsePlugins/SleighEditor/ghidra.xtext.sleigh/GhidraSleighEditor_README.html b/GhidraBuild/EclipsePlugins/SleighEditor/ghidra.xtext.sleigh/GhidraSleighEditor_README.html new file mode 100644 index 0000000000..b8ba8ea9e5 --- /dev/null +++ b/GhidraBuild/EclipsePlugins/SleighEditor/ghidra.xtext.sleigh/GhidraSleighEditor_README.html @@ -0,0 +1,201 @@ + + + + GhidraSleighEditor README + + + + + +

GhidraSleighEditor README

+

GhidraSleighEditor makes developing and modifying Ghidra Sleigh processor modules much more enjoyable by providing a modern +day context sensitive editor with syntax highlighting, navigation, context sensitive error notation, quick fixes, and more. The +editor is built with the excellent XTEXT DSL framework within Eclipse. +

+

The information provided in this document is effective as of Ghidra Sleigh Editor 1.0.0 and is subject to +change with future releases.

+ + + +

Minimum Requirements

+ +

(Back to Top)

+ + +

Installing GhidraSleighEditor

+

GhidraSleighEditor is installed manually into Eclipse and should be installed by anyone interested in working with +processor module sleigh specifications. The Sleigh Editor must be manually installed in Eclipse. In the future the extension +may be installed automatically along with the GhidraDev Eclipse plugin when setting up Eclipse for Ghidra scripting and plugin development.

+ +

Install pre-Built

+

GhidraSleighEditor can be installed into an existing installation of Eclipse the same way most Eclipse +plugins are installed. From Eclipse:

+
    +
  1. Click Help → Install New Software...
  2. +
  3. Click Add...
  4. +
  5. Click Archive...
  6. +
  7. + Select GhidraSleighEditor zip file from <GhidraInstallDir>/Extensions/Eclipse/GhidraSleighEditor/ +
  8. +
  9. Click OK (name field can be blank)
  10. +
  11. Check Ghidra category (or Ghidra Sleigh Editor entry)
  12. +
  13. Click Next
  14. +
  15. Click Next
  16. +
  17. Accept the terms of the license agreement
  18. +
  19. Click Finish
  20. +
  21. Click Install anyway
  22. +
  23. Click Restart Now
  24. +
+

Building Eclipse Sleigh Editor

+
    +

    To build the Sleigh Editor, follow the instructions in ghidra/DevGuide.md to setup eclipse + for development. Then follow the directions in + ghidra/GhidraBuild/EclipsePlugins/GhidraSleighEditor/ghidra.xtext.sleigh.feature/build_README.txt.

    +
+ +

Uninstalling

+

GhidraSleighEditor can be uninstalled as follows from +Eclipse:

+
    +
  1. Click Help → About Eclipse
  2. + +
  3. Click Installation Details
  4. +
  5. Select Ghidra Sleigh Editor
  6. +
  7. Click Uninstall...
  8. +
  9. Select Ghidra Sleigh Editor
  10. +
  11. Click Finish
  12. +
  13. Click Restart Now
  14. +
+

(Back to Top)

+ +

Upgrading

+

GhidraSleighEditor can be upgraded the same way it was initially installed.

+

(Back to Top)

+ +

Sleigh Editor Features

+

The Ghidra Sleigh Editor provides a variety of features one would expect in any modern IDE to make viewing, modifying, debugging, +and creating Sleigh processor specifications as painless as possible. +Once installed, any .sinc or .slaspec file that is edited will be brought up in the sleigh editor.

+

The editor provides the following capabilities:

+ +

Change History

+

1.0.0: Initial release in Ghidra 9.1

+

(Back to Top)

+ + +
+
+
+ + + diff --git a/GhidraBuild/EclipsePlugins/SleighEditor/ghidra.xtext.sleigh/build_README.txt b/GhidraBuild/EclipsePlugins/SleighEditor/ghidra.xtext.sleigh/build_README.txt new file mode 100644 index 0000000000..ab599c09e1 --- /dev/null +++ b/GhidraBuild/EclipsePlugins/SleighEditor/ghidra.xtext.sleigh/build_README.txt @@ -0,0 +1,83 @@ +The Ghidra Sleigh Editor for Eclipse is currently built from Eclipse and checked into the bin repo. +Ideally we will use Gradle one day, but we aren't there yet. We do rely on Gradle prepDev to generate +the Eclipse project and build GhidraSleighEditor's dependencies though, hence the build.gradle file. + +Required: Eclipse IDE with Java and DSL version 2019-03 or later, XTEXT 2.17 or later. + The following instructions assume that you have setup Eclipse. + +It is also suggested that you use the Eclipse IDE with DSL extensions already installed if you will +use the GhidraSleighEditor. You can build the GhidraSleighEditor installation zip with the XTEXT runtime +in the plugin. The XTEXT runtime was not included in the distribution build because it would +have added 80Meg. + + +Importing GhidraSleighEditor Eclipse projects (they are deactivated by default): + 1) Uncomment the line in settings.gradle that includes the GhidraSleighEditor project. + 2) Run "gradle eclipse -PSleighEditor" to generate the GhidraSleighEditor Eclipse projects. + 3) From Eclipse, File --> Import --> General --> Existing Projects into Workspace + 4) From the ghidra repo, import all "Eclipse GhidraSleighEditor *" projects. + + +Generating all Sleigh XTEXT generated files: + 1) open ghidra.xtext.sleigh project + 2) navigate to the file src --> ghidra.xtext.sleigh --> GenerateSleigh.mwe2 + 3) NOTE: the following will download a jar file from the internet (not from NSA) + unless you pre-download. + 3a) Download the file http://download.itemis.com/antlr-generator-3.2.0-patch.jar + 3b) Put the file in ghidra/GhidraBuild/EclipsePlugins/SleighEditor/ghidra.xtext.sleigh + 3c) Rename the file to .antlr-generator-3.2.0-patch.jar + 3) From the popup menu RunAs --> MWE2 Workflow + - Files in xtend-gen and src-gen will be created + - The project should rebuild, and there should be no red Problem errors + + +Try out the Sleigh Editor + 1) Navigate to the 'Eclipse SleighEditor' and chose RunAs --> Eclipse Runtime + 2) Add a sleigh processor module + 2a) File --> NewJavaProject... + - Uncheck default location and navigate to a processor in Ghidra/Processors/ + - The project be automatically named + - Finish + - Cancel Module creation + - Navigate to a /data/languages/.sinc or .slaspec + - On the popup asking to convert to an XTEXT project, choose "Yes" + 2b) -OR- + - drop a .slaspec or .sinc file from the file browser on eclipse + - this is good for quick viewing, however navigation across files may not work. + + +Optional: Changing version number (GhidraSleighEditor is versioned independently of Ghidra): + 1) Open feature.xml in the GhidraSleighEditor Feature project. + 2) In the "Overview" tab, update the "Version" field to x.y.z.qualifier and save. + 3) Open category.xml in the GhidraSleighEditor Feature project. + 4) Highlight ghidra.xtext.sleigh.editor (x.y.z.qualifier), and click "Remove". + 5) Highlight ghidra.xtext.sleigh.editor, and click "Add Feature". + 6) Select ghidra.ghidradev (x.y.z.qualifer), click "OK", and save. + 7) Update GhidraDev_README.html "Change History" section if necessary. + + +Optional: Including the XTEXT runtime +You can include the XTEXT runtime or redist module in the .zip file which will negate the need +to have Eclipse with the DSL in the Eclipse into which the Eclipse Sleigh Editor is installed to run. + 1) Navigate to the ghidra.xtext.sleigh.feature + 2) bring up the feature.xml with the Feature Manager Editor (dbl-click on it). + 3) Go to the Included Features tab + 4) Add... + 5) Filter by 'redist' and add org.eclipse.xtext.redist + + +Creating an installation zip file to install in Eclipse: + 1) Do a Gradle prepDev to ensure GhidraDev's dependencies are up-to-date. + 2) File --> Export --> Plug-in Development --> Deployable plugins and fragments + 4) Select "Archive file" and choose a directory to save it to. It must end up in + ghidra.bin/GhidraBuild/Eclipse/GhidraDev/. Name it GhidraDev-x.y.z.zip. + 5) In the "Options" tab make sure things look like this: + - Export source: UNCHECKED + - Package as individual JAR archives: CHECKED + - Generate p2 repository: CHECKED + - Categorize repository: CHECKED. + - Qualifier replacement: CHECKED + clear field so default is used + - Save as Ant script: UNCHECKED + - Allow for binary cycles in target platform: CHECKED + - Use class files compiled in the workspace: UNCHECKED + 6) Finish