binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

`Override call type...` Not Working On Inlined Functions

Open w1282 opened this issue 1 year ago • 1 comments

Version and Platform (required):

  • Binary Ninja Version: 4.1.5475-dev
  • OS: Windows
  • OS Version: 11
  • CPU Architecture: x64

Bug Description: After selecting the Inline during analysis (experimental) option on a function, any of the call_sites within that function cannot have their type overrode (except when directly viewing the original function)

Steps To Reproduce:

  1. Find a function that is both called from another function and contains function calls in its body
  2. Mark it as 'Inline during analysis (experimental)'
  3. After re-analysis, find any instance where that function was in-lined and attempt to Override call type... on the call
  4. Observe that it cannot be overridden
  5. Navigate back to the original function that has been in-lined and attempt to override a call type and observe that it functions as expected

Expected Behavior: Function call sites brought into a function through inlining should be able to have their type overridden

Additional Information: Even I was getting confused with which 'function' was which in the above description, so here is an example that I hope clarifies a bit more.

void outer_func() {
    inner_func(1);
}

void inner_func(int arg1) {
    inlined_func(1, 2, arg1);
}

When the inner_func is tagged with inline during analysis the view of this becomes...

void outer_func() {
    inlined_func(1, 2, 1);
}

Now try and Override call type... of inlined_func when viewing the call_site through outer_func, not inner_func, and you won't be able to. Now navigate to inner_func and attempt to override the call type and it will work as expected.

w1282 avatar Jun 12 '24 18:06 w1282