NationalSecurityAgency / ghidra

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

Feature request: Renaming registers in functions after parameter binding #5819

Open agatti opened 11 months ago

agatti commented 11 months ago

Is your feature request related to a problem? Please describe.

In register-starved architectures, or certain hand-written assembly code blocks, or when calling interrupts/SWIs/whatever it is common to reuse registers for multiple purposes within the context of a single function.

If parameters are set for a function given the abovementioned scenario, they are bound to the marked register for the whole scope of the function, making disassembly extremely confusing.

Describe the solution you'd like

I would like to see a way to restrict the link between a function parameter and its register, or more generically, a register name equivalent for the "Set register values..." dialog where to set (or clear) a register name in an address range.

Describe alternatives you've considered

What I'm doing right now is skipping binding parameters when defining functions and marking things myself in EOL comments, which slows work down a fair bit when looking up which register is what by looking at comments at the far edge of the screen.

Additional context

Here's an example of how confusing it can be for simple blocks of code (this is from a DOS/IA16 executable):

registers

serhack commented 10 months ago

They should set for a single or more basic blocks, not quite sure why it gets propagated to everything.