A collection of Java scripts to aide in the decompilation of the Keil compiler/linker Firmware
- Open the CodeBrowser Tool or an Existing Workspace
- Open the Script Manager pane
- Window -> Script Manager
- or, use the green "play" button
- Click on Manage Script Directories
- Looks like a list icon
- Click the add button
- Navigate to the $REPO_ROOT/ghidra_scripts directory
- Click OK
I will gloss over all of the documented parts of how to use Ghidra and import files. I will focus on the special steps to get this file imported properly to use with the tools.
- Back up the processor language files located in $GHIDRA_HOME/Ghidra/Processors/8051/data/languages
- Copy the files from $REPO_ROOT/Ghidra/Processors/8051/data/languages to $GHIDRA_HOME/Ghidra/Processors/8051/data/languages
- Open Ghidra and create a new Project
- Import a file and select the firmware file
- Change the follwing import settings
- Format: Raw Binary
- Language: 8051:BE:16:rtk:Keil (Use Keil to search in the selection box)
- Options
- Block Name: CODE
- Base Address: CODE: 0
- File Offset: 0x2
- Length: 0x3ffe
- Check boxes checked
- Import the BANKED memory using
LoadBankedMemoryForRTL.java
- See adding Scripts
- Select the script
- Select the same firmware file
- Click OK
- BANK01 - BANKnn should now be visible
- Import the AT51 Symbols
- See AT51 Section in ANALYSIS_NOTES.md