From 8f0b55d1d45e323f9c1478fa941745dd63756d4e Mon Sep 17 00:00:00 2001 From: FzFStormZ Date: Fri, 22 Sep 2023 15:39:37 +0200 Subject: [PATCH 1/2] ghidra api work --- ghidra/README.md | 80 ++++ ghidra/script/GetInfos.py | 44 +++ ghidra/script/SearchPattern.py | 617 ++++++++++++++++++++++++++++++ ghidra/tables/table_broadcom.json | 101 +++++ ghidra/tables/table_nrf51.json | 65 ++++ ghidra/tables/table_nrf52.json | 218 +++++++++++ 6 files changed, 1125 insertions(+) create mode 100644 ghidra/README.md create mode 100644 ghidra/script/GetInfos.py create mode 100644 ghidra/script/SearchPattern.py create mode 100644 ghidra/tables/table_broadcom.json create mode 100644 ghidra/tables/table_nrf51.json create mode 100644 ghidra/tables/table_nrf52.json diff --git a/ghidra/README.md b/ghidra/README.md new file mode 100644 index 0000000..33c20dd --- /dev/null +++ b/ghidra/README.md @@ -0,0 +1,80 @@ +# oasis-firmware-analyzer-ghidra-api +Use Ghidra API to automatize the pattern searching in the firmware analyzer module of the OASIS framework + +# Folders +- `script/` : scripts who use the Ghidra API +- `tables/` : tables for different architecture (Broadcom (complete at 70%), NRF51-Softdevice, NRF52-Zephyr) + +# How to use +1. Install Ghidra +2. Create a Ghidra Folder, import binary file, choose the language type (ARMv7 little endian) and run it for the first time to do the analyzis with ARM force options +3. Find `analyzeHeadless` executable (default location `/usr/share/ghidra/support/`) +4. How to use `analyzeHeadless` : + +` +/usr/share/ghidra/support/analyzeHeadless -noanalysis -process -postScript