NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
49.09k stars 5.65k forks source link

Add ARM32 coprocessor symbolic names for decompilation view (for mcr,mrc,mcrr,mrrc instructions) #6575

Open tihmstar opened 1 month ago

tihmstar commented 1 month ago

I added names for arm coprocessor the read/write instructions mrc, mcr, mrrc and mcrr for the reserved coprocessors (cp15 and cp14). That makes reversing bare metal arm code much more pleasant.

Side by side before and after comparison: beforeafter

I compiled a list of as many register names for usage with mcr/mrc and mcrr/mrrc as i could and wrote a few python scripts to generate sleigh code from it.

input_32.txt input_64.txt scripts.zip

PS: This does work perfectly well for but, since i have no idea what i'm doing, please someone come up with a clean solution for this and integrate it into the build process. I.e. cleanup the list to remove duplicates and make the script pretty and readable or replace it altogether