Description
Version and Platform (required):
- Binary Ninja Version: 5.1.7379-dev (f55a1eef)
- OS: macOS
- OS Version: 15.2
- CPU Architecture: M1
Bug Description:
Prior to the regression call type overrides applied via the API or through the UI as a user, would work as expected. However version 5.1.7379-dev kind of broke them and now calls from inlined functions do not propagate the return type of the applied call type override at the site where the function was inlined. This is specifically an issue with calls in functions that have been inlined. Overrides elsewhere seem to work fine.
Steps To Reproduce:
Please provide all steps required to reproduce the behavior:
- Load a copy of DYLD Shared Cache.
- Load a library like
FeatureStore
or anyone that makes calls to stub functions. - Find a call to a stub function. I've been testing with
_objc_alloc
. - Try to apply a call type override to it with a different return type and observe that the variable being assigned the result of the
_objc_alloc
doesn't change to use the return type of the call type override. You might need to be in MLIL to observe a variable assignment, often in HLIL the result of the call is passed directly to another call. - Now stop the function being inlined by going to
j__objc_alloc
and editing its function properties and turning off function inlining. I find often times toggling this setting doesn't work. Sometimes it requires multiple attempts but usually changing the function workflow from inherited to the same workflow just not the inherited option, at the same time as unticking the function inlining checkbox, will actually get the change to stick. - Try setting a call type override, with a different return type, to the
j__objc_alloc
call and observe that the variable being assigned the result will take on the return type of the call type override.
Expected Behavior:
Overridding the type of a call in an inlined function (at the location where its been inlined, not the actual function) should result in the return type being propagated to the variable its being assigned to.
Additional Information:
- This is not a problem for non-inlined calls (calls that aren't from inlined functions).
- In 5.1.7372-dev (c3488220) things worked as expected. I originally noticed this issue in the latest version (was 5.1.7399 at the time) and went back and found where the regression occurred so its still broken on latest.