Function inlining makes HLIL and Disassembly sync hard to use

Open
#6,763 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale

Research direction

Start by reproducing the synced HLIL and disassembly views described in issue #6763, especially with DYLD Shared Cache stub functions and inlining. Review related issues #6601 and #6737, then determine and document an expected synchronization behavior; the issue names no source files or tests, so completion requires an agreed design before implementation.

Written by the indexing model from the issue text.

Description

Component: Core Component: UI Effort: Medium Impact: Medium

Version and Platform (required):

  • Binary Ninja Version: 5.1.7320-dev (aa12054b)
  • OS: macOS
  • OS Version: 15.2
  • CPU Architecture: M1

Bug Description:
I commonly have HLIL and disassembly linear view panes side by side and synced. Due to function inlining the disassembly view can end up being in a different function than the HLIL view. DYLD Shared Cache has lots of stub functions, which get inlined by the DSC plugin function workflow, so its very common in DSC binary views for there to be function inlining.

Due to the stub functions just being calls to other functions, this makes function calls in the HLIL almost always an inlined function. It can be the case that many lines in a row in the HLIL can just be inlined functions where a given function is making many function calls using function stubs. Therefore if you want to figure out what arguments are being passed to the function by looking at the disassembly, there's essentially nowhere you can click in the HLIL nearby to the call to see the disassembly for that call.

Binary Ninja has its issues so sometimes the disassembly is required for the source of truth. When I can't find a non-inlined location nearby in the HLIL, I end up having to go much further away from the call site to get the disassembly view to sync with the HLIL in the same function and then manually path my way through the disassembly to find the call. Which is not always a trivial process. Its not a show stopper but it does make life harder than it needs to be.

Expected Behavior:
To be honest I don't actually know. I created this issue to bring to light the problem but I don't have a solution to it at this moment in time. It makes sense what is happening but as a user it can be frustrating because its not what I want.

Maybe there could be some kind of setting, on a per-function basis, or just a global setting, to sync the disassembly view location with the location where the inlined function was inlined. So if in HLIL a call is highlighted that occurs in an inlined function, the disassembly view will be at the call instruction to the inlined function, not the function the inlined function calls.

Additional Information:
This is somewhat of a broader issue with function inlining. Its not the only problem as I also created issue #6601 and there is also #6737. I know these aren't quite related issues but it seems as great as function inlining is, its also causing a number of issues.

Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Vector35/binaryninja-api

All issues in Vector35/binaryninja-api

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.