Function parameters are not inlined when indirectly pushed to the stack

Open
#4,986 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

Start by loading the provided class_test.zip binary in Binary Ninja and inspecting address 0040104f, comparing the current analysis with the expected-result screenshot. Reproduce the clang-built case with optimizations disabled and verify that indirectly stack-pushed function parameters are inlined when appropriate.

Written by the indexing model from the issue text.

Description

Component: Core Effort: Low Impact: Low

Version and Platform (required):

  • Binary Ninja Version: 3.6.4807-dev, 864ff019
  • OS: Windows
  • OS Version: 11
  • CPU Architecture: x86_64

Bug Description:
I'm unsure if the root cause of the issue is what I mentioned in the title. Based on my testing, when optimizations are disabled, the clang compiler occasionally utilizes a register to store function arguments on the stack. However, when this occurs, BN does not inline function parameters.

Steps To Reproduce:
I'll share my binary below. Anyone can identify the bug by navigating to address 0040104f.

Expected Behavior:
I expect BN to inline those function parameters if it's appropriate (as it is in the current example), just as it did for other binaries built with other compilers I've tested using the same code.

Screenshots:

Disassembly:
disassembly

Example expected result:
expected

Additional Information:
class_test.zip

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.