a collection of ghidra+switch related scripts for ur most delicate perusal
about:
- Scripts vary wildly in usage+scope: Some are for ghidra scriptmanager gui, some are for pyghidra (jvm glued onto normal python process vm), some may not be very related to ghidra. This is a dumping ground.
- I didn't write everything here, see filenames+contents for attribution/etc where relevant.
my setup/suggestions:
- Linux should be fine, but I'm not testing/targeting msys or macOS
- I use an Arch WSL2 instance with the devkitpro pacman repo which is easy to install on Arch and provides a current aarch64/arm64 gcc toolchain. Arch is also not zero-upkeep and things may break if you blindly update after a long time, so if (like me) you put off updates because you want your build environment to behave predictably for a long time, put some time aside for updates when you do get to it.
- Running everything we can together in the wsl instance is ideal for performance and interoperability between tools. My approximate package list:
- sudo vim git base-devel wget curl make cmake less screen tmux zsh python3 openssh # good shit
- clang # Clang/LLVM (an alternate toolchain option) is useful to have around even if I mainly use gcc, as it comes with cool utilities and aarch64/arm64 support
- java-environment java-environment-common java-runtime-common # ghidra needs java
- xorg xorg-server xorg-apps xterm # required for X wslg?
- mesa vulkan-dzn # acceleration for wslg?
- noto-fonts noto-fonts-extra noto-fonts-emoji ttf-sourcecodepro-nerd # ghidra prefers to have fonts
- aarch64-linux-gnu-gdb python-protobuf python-psutil # protobuf+psutil expected by ghidra-gdb interface
- python-pip # i got annoyed with something trivial in the ghidra distribution and ran
pip install pyghidra --break-system-packages(no root) to be done with that setup
- Ghidra:
- i recommend downloading from nsa github :D Arch seems to lag a bit and it can be nice to have control over installations
- ghidra also needs an extension to load NSOs which is mandatory unless you have something else dumping to elf or otherwise know what you're doing
- WSL2 stuff:
- If you have WSL1 don't waste time with that, update it.
- Even with WSL2, try to keep all your wsl disk io inside wsl, and keep windows disk io to windows. Explorer can access wsl disks at eg
\\wsl.localhost\Archfor easier inspection from the windows side. - Emulation and web browsers stay outside of wsl for now, but wsl can push mod binaries to the host, serve http to host browsers, and do socket io with the game process anywhere it runs.
- On the windows host, create file
C:\Users\$USER\.wslconfigwith the following to make networking ez:
[wsl2]
networkingMode=mirrored
firewall=false