NationalSecurityAgency / ghidra

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

Power PC - Add Support for e200 Core - 32-bit with VLE #2449

Open 5754436F opened 3 years ago

5754436F commented 3 years ago

Is your feature request related to a problem? Please describe. The e200 core in my application (Freescale MPC5604) uses 32-bit registers and supports VLE instructions. None of the existing 32-bit Power PC languages support VLE instructions. Power PC VLE instructions are currently only supported on Power PC languages with 64-bit registers.

Describe the solution you'd like I would like to see this processor variant added to Ghidra. Although it initially seemed trivial, my attempts at doing this myself were unsuccessful.

Describe alternatives you've considered Using the 64 bit language "PowerISA-VLE-64-32addr" with 32-bit VLE code causes numerous issues with the decompiler. Wrong datatypes, unnecessary type casts and suspected issues with signed math operations. I also suspect the decompiler warning "Could not reconcile some variable overlaps" is caused by this mismatch.

Thank you.

esaulenka commented 3 years ago

@5754436F, can you share sample binary? If anyone else is interesed in this CPU, instructions set can be found here

seclex commented 2 years ago

Hello guys, did You find a way to decompile code from a E200Z0 (ST SPC58)?

Krezalis commented 1 year ago

@5754436F, can you share sample binary? If anyone else is interesed in this CPU, instructions set can be found here

I have unpacked 2 mb of SPC5645S (e200z4d) code.