Vector35 / Vector35/binaryninja-api

Automatically infer the size of the stucture based on outlined memcpy/memset

Open
#4,691 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We already infer the size of a structure if it comes from a known memory allocation routine, e.g., malloc. The same thing can be done when a buffer is referenced in the following code pattern:

__builtin_memset(s: &var_58_125, c: 0xff, n: 0x38)

We can automatically set the size of the struct to 0x38 in this case

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

Start by locating the existing structure-size inference for known allocation routines and the handling of outlined __builtin_memcpy/__builtin_memset calls. Compare the shown memset pattern with that path. Done means a buffer referenced by the pattern infers the structure size from n, such as 0x38 in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
reverse-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.