Skip to content

update README

update README #361

Workflow file for this run

name: "build"
on:
push:
pull_request:
branches:
- latest
jobs:
simple-build:
name: "Build and Test"
runs-on: "ubuntu-latest"
strategy:
matrix:
ghidra: ["11.1", "11.1.1"]
include:
- ghidra: "11.1"
ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.1_build/ghidra_11.1_PUBLIC_20240607.zip"
ghidra-sha256: "293f60e04fa480315d2c467f4b2b4b10b3b6b5c8a8416bf7167fe082406e3be8"
ghidra-filename: "ghidra_11.1_PUBLIC_20240607.zip"
ghidra-folder: "ghidra_11.1_PUBLIC"
- ghidra: "11.1.1"
ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.1.1_build/ghidra_11.1.1_PUBLIC_20240614.zip"
ghidra-sha256: "7fe8d9a6e7e5267f3cf487a0c046b21fb08d7a602facaa2e81ac2f09b5df2866"
ghidra-filename: "ghidra_11.1.1_PUBLIC_20240614.zip"
ghidra-folder: "ghidra_11.1.1_PUBLIC"
env:
GHIDRA_INSTALL_DIR: /home/runner/ghidra/${{ matrix.ghidra-folder }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Cache Ghidra
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache-ghidra
with:
path: ~/ghidra
key: ${{ runner.os }}-${{ matrix.ghidra }}
- name: Get Ghidra
if: steps.cache-ghidra.outputs.cache-hit != 'true'
run: |
wget -q ${{ matrix.ghidra-url }}
echo "${{ matrix.ghidra-sha256 }} ${{ matrix.ghidra-filename }}" | sha256sum -c
unzip ${{ matrix.ghidra-filename }} -d ~/ghidra
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'adopt'
java-version: '17'
- name: Set Up SDK Environment
run: |
curl -s "https://get.sdkman.io?rcupdate=false" | bash
source "/home/runner/.sdkman/bin/sdkman-init.sh"
sdk install gradle 8.8
sdk use gradle 8.8
sdk default gradle 8.8
- name: Run Unit Tests
run: |
echo "skipping gradle test due to inconsistencies in reliability"
- name: Build and Install
run: |
source "/home/runner/.sdkman/bin/sdkman-init.sh"
gradle buildExtension
rm -rf $GHIDRA_INSTALL_DIR/Ghidra/Extensions/ruby-dragon
unzip dist/$(ls dist) -d $GHIDRA_INSTALL_DIR/Ghidra/Extensions
mkdir ~/projects
- name: JRubyBasics Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -preScript JRubyBasicsScriptRb.rb -deleteProject | grep -v "^\(INFO\)\|\(WARN\)\|\( \)" > actual.txt
awk '/^=begin$/{flag=1;next}/^=end$/{flag=0}flag' ghidra_scripts/JRubyBasicsScriptRb.rb > expected.txt
diff actual.txt expected.txt
rm actual.txt expected.txt
- name: Ghidra Basics Ruby Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript GhidraBasicsScriptRb.rb HeadlessTest -deleteProject | awk '/^INFO SCRIPT:/{flag=1;next}/^INFO /{flag=0}flag' > actual.txt
diff actual.txt src/test/resources/expected/GhidraBasicsScript.txt
rm actual.txt
- name: Ghidra Basics Kotlin Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript GhidraBasicsScriptKts.kts HeadlessTest -deleteProject | sed -n "s/^INFO GhidraBasicsScriptKts.kts> \(.*\) (GhidraScript).*$/\1/p" > actual.txt
diff actual.txt src/test/resources/expected/GhidraBasicsScript.txt
rm actual.txt
- name: Ghidra Basics Groovy Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript GhidraBasicsScriptGroovy.groovy HeadlessTest -deleteProject | sed -n "s/^INFO GhidraBasicsScriptGroovy.groovy> \(.*\) (GhidraScript).*$/\1/p" > actual.txt
diff actual.txt src/test/resources/expected/GhidraBasicsScript.txt
rm actual.txt
- name: Ghidra Basics Clojure Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript GhidraBasicsScriptClj.clj HeadlessTest -deleteProject | awk '/^INFO SCRIPT:/{flag=1;next}/^INFO /{flag=0}flag' > actual.txt
diff actual.txt src/test/resources/expected/GhidraBasicsScript.txt
rm actual.txt
- name: Save Strings Ruby Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript SaveStringsScriptRb.rb TestStringsRuby.txt -deleteProject
grep "Hello Ghidra!" TestStringsRuby.txt
rm TestStringsRuby.txt
- name: Save Strings Kotlin Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript SaveStringsScriptKts.kts TestStringsKotlin.txt -deleteProject
grep "Hello Ghidra!" TestStringsKotlin.txt
rm TestStringsKotlin.txt
- name: Save Strings Groovy Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript SaveStringsScriptGroovy.groovy TestStringsGroovy.txt -deleteProject
grep "Hello Ghidra!" TestStringsGroovy.txt
rm TestStringsGroovy.txt
- name: Save Strings Clojure Script
run: |
$GHIDRA_INSTALL_DIR/support/analyzeHeadless ~/projects/ RubyDragonTest -import ./src/test/resources/bin/HelloGhidra.exe -postScript SaveStringsScriptClj.clj TestStringsClojure.txt -deleteProject
grep "Hello Ghidra!" TestStringsClojure.txt
rm TestStringsClojure.txt