Open fuzyll opened 2 years ago
Half of this is probably covered by #2032.
Issue #1003 is also probably related.
I'm closing all the other issues in favor of this one. I modified this to mention that we also need to be able to specify the location of return value on the stack
Another addendum: https://github.com/Vector35/binaryninja-api/issues/2793 Calling conventions should allow specification of partial registers.
Another addendum: https://github.com/Vector35/binaryninja-api/issues/2801 Support for indirect return result locations
As of >=4.2.5919-dev, the syntax support for stack locations was added, but only syntax support and not analysis support. Spelling a function as int foo(int bar @ 8)
will now return a FunctionType
object which has the bar
parameter with a non-default location of StackVariableSourceType
with storage 0x8
.
Again, this is only syntax spelling support, not analysis support.
What is the feature you'd like to have? You can specify a register as the location for an argument in binary ninja by doing something like
int32_t arg1@rax
(to specify thatarg1
is inrax
). You cannot specify a stack location, which is problematic for certain compilers and/or languages (like Go).Is your feature request related to a problem? See above. We would have much better support for languages like Go that tend to do this a fair amount, even if doing this were a manual process instead of an automated one.
Additional Information: There are many ways this could be implemented. In my head, it would be simple enough to just extend the
@
syntax to allow for something likeint32_t arg1@rsp+4
(e.g.register + offset
instead of justregister
) when setting the type for the return value or an argument. Ideally we would also update our analysis to be able to identify these things automatically, but being able to manually fix things up is an important first step.It should be noted that I don't think you can specify the return location in a specific register through the
y
button (the "Change Type" menu) at all right now, either, which maybe means this should be split into two issues? I believe you need to do it through the Edit Function Properties window instead. I've campaigned for merging these together on a few occasions, so consider this another suggestion to consider doing so. 🙂