Vector35 / Vector35/binaryninja-api

call + pop pattern not handled by default

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

Nobody has claimed this yet.

Component: Architecture Effort: Medium Impact: Low
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

In shellcode, this pattern is used quite often. It uses a combination of call + pop to load the address of a string into a register.

image

Note, the default behavior is even more problematic -- the disassembly would continue to disassemble the string "VirtualProtect" and produce garbage. To get what is shown in the image, I have already set the function to a no-return to stop the control flow.

The tricky part of this is there is no easy way to handle this. If we wish to patch the code, the space is not enough. We would have to create a new segment and put some code there, which is complex

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.

Research direction

Reproduce the shellcode call+pop pattern described in the issue and compare the default disassembly with the manually configured no-return result. Investigate how the default control flow handles the string "VirtualProtect"; done means the pattern no longer causes the string to be disassembled as garbage without manual function configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.