upgrade for 11.0.2 (#40) #340
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "build" | |
on: | |
push: | |
pull_request: | |
branches: | |
- latest | |
jobs: | |
simple-build: | |
name: "Build and Test" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
ghidra: ["11.0.2"] | |
include: | |
- ghidra: "11.0.2" | |
ghidra-url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.0.2_build/ghidra_11.0.2_PUBLIC_20240326.zip" | |
ghidra-sha256: "4f16ae3f288f8c01fd1872e8e55b25c79744e7b1e8a9383c5e576668ca7d1906" | |
ghidra-filename: "ghidra_11.0.2_PUBLIC_20240326.zip" | |
ghidra-folder: "ghidra_11.0.2_PUBLIC" | |
env: | |
GHIDRA_INSTALL_DIR: /home/runner/ghidra/${{ matrix.ghidra-folder }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Ghidra | |
uses: actions/cache@v2 | |
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@v2 | |
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 7.4 | |
sdk use gradle 7.4 | |
sdk default gradle 7.4 | |
- 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 |