Ghidra: Custom killed register list for a specific function

Created on 6 Mar 2019  路  2Comments  路  Source: NationalSecurityAgency/ghidra

Currently Ghidra allows partially customizing the calling convention for any given function (Edit Function Signature), but only the part related to arguments and the return value. It would be useful to be able to also override the killed register list.

This can be accomplished by defining a new custom calling convention in e.g. Ghidra/Processors/x86/data/languages/x86win.cspec, but it would be nice to be able to do one-off changes. For example, a __chkesp() function call is inserted at the end of many functions by the compiler, and this function does not clobber floating-point registers; however, the calling conventions available by default all kill ST0, which breaks data-flow analysis for any function that returns a float and calls __chkesp() before returning. A one-off override for __chkesp() would solve this more cleanly.

Decompiler Enhancement

Most helpful comment

Would a PR that adds a Calling Convention Manager be accepted? There are so many things out there with weird calling conventions that this would be immensely useful for.

All 2 comments

Also want this. But fully edit/create calling conventions too.

Would a PR that adds a Calling Convention Manager be accepted? There are so many things out there with weird calling conventions that this would be immensely useful for.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tambry picture tambry  路  3Comments

pd0wm picture pd0wm  路  3Comments

rrivera1849 picture rrivera1849  路  3Comments

forkoz picture forkoz  路  3Comments

CalcProgrammer1 picture CalcProgrammer1  路  3Comments