Skip to content

Call with non-resolvable target cannot set stack adjustmentΒ #7668

@CouleeApps

Description

@CouleeApps

Version and Platform (required):

  • Binary Ninja Version: 5.2.8614
  • Edition: Ultimate
  • OS: macOS
  • OS Version: 15.5
  • CPU Architecture: M1

Bug Description:
When a call has a target which cannot be resolved, trying to set user stack adjustment on the call has no effect. This can lead to mismatched stack pointers in later blocks which cannot be easily fixed.

Steps To Reproduce:

  1. New Mapped Data
  2. Assemble x86:
cmp esi, 0
je after
mov eax, 1000
push ecx
call eax

after:
ret
  1. Create function at the start
  2. Observe the return has a mismatched stack pointer
  3. Right click call to eax and try to Set Stack Adjustment to 4
  4. Observe no change to analysis

Expected Behavior:
I expected setting the stack adjustment of a call to actually have an effect

Screenshots/Video Recording:

Image

Additional Information:
Setting a user call type on the call fixes this by bypassing the early-exit in the stack resolver. Looks like this is bailing early at core/stackadjustresolver.cpp:231

Reported by loadlibrary on Slack

Metadata

Metadata

Assignees

Labels

Component: CoreIssue needs changes to the coreCore: LLILIssue involves Low Level ILEffort: LowIssues require < 1 week of workImpact: MediumIssue is impactful with a bad, or no, workaround

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions