Export Ghidra Database #1766
This file contains hidden or 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: Export Ghidra Database | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| env: | |
| GHIDRA_VERSION: 11.1.2 | |
| GHIDRA_DATE: 20240709 | |
| jobs: | |
| export-ghidra: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - branch: xml | |
| type: xml | |
| - branch: main | |
| type: decomp | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Don't use actions/checkout@v4 because hurr durr it be broken: https://github.com/actions/checkout/issues/1477 | |
| - name: Clone th06-re repo | |
| run: | | |
| echo "$GHIDRA_SSH_AUTH" > ssh_key | |
| chmod 0600 ssh_key | |
| GIT_SSH_COMMAND="ssh -i $PWD/ssh_key -o IdentitiesOnly=yes" git clone git@github.com:happyhavoc/th06-re th06-re --branch ${{ matrix.branch }} | |
| rm ssh_key | |
| env: | |
| GHIDRA_SSH_AUTH: ${{ secrets.GHIDRA_SSH_AUTH }} | |
| - name: Install python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Get ghidra | |
| run: | | |
| curl -L https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_${GHIDRA_VERSION}_build/ghidra_${GHIDRA_VERSION}_PUBLIC_${GHIDRA_DATE}.zip -o /tmp/ghidra.zip | |
| unzip -d /tmp /tmp/ghidra.zip | |
| echo /tmp/ghidra_*/support >> $GITHUB_PATH | |
| - name: Export ghidra | |
| run: | | |
| echo "$GHIDRA_SSH_AUTH" > ssh_key | |
| python scripts/export_ghidra_database.py --user-mappings config/ghidra-user-maps.toml --username github-action --ssh-key ssh_key --program 'th06_102h.exe' 'ghidra://roblab.la/Touhou/Touhou 06 - The Embodiment of Scarlet Devil/' th06-re ${{ matrix.type }} | |
| rm ssh_key | |
| env: # Or as an environment variable | |
| GHIDRA_SSH_AUTH: ${{ secrets.GHIDRA_SSH_AUTH }} | |
| - name: Push th06-re | |
| run: | | |
| echo "$GHIDRA_SSH_AUTH" > ssh_key | |
| chmod 0600 ssh_key | |
| GIT_SSH_COMMAND="ssh -i $PWD/ssh_key -o IdentitiesOnly=yes" git -C th06-re push origin HEAD | |
| rm ssh_key | |
| env: | |
| GHIDRA_SSH_AUTH: ${{ secrets.GHIDRA_SSH_AUTH }} |