Vector35 / Vector35/binaryninja-api

Support for creating a structure that have function pointers by selection

Open
#3,584 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Let's say I've this:

void* data_1800cb168 = sub_1800998d0
void* data_1800cb170 = sub_180099a50
void* data_1800cb178 = sub_180099940
void* data_1800cb180 = sub_180099c20
void* data_1800cb188 = sub_180099cb0

When I select all of them and press S Binary Ninja creates a structure like this:

struct struct_1 data_1800cb168 = 
{
    void* field_0 = sub_1800998d0
    void* field_8 = sub_180099a50
    void* field_10 = sub_180099940
    void* field_18 = sub_180099c20
    void* field_20 = sub_180099cb0
}

It is good, but I guess we should set field types to function pointers.

For example first function have this prototype: int64_t sub_1800998d0(int64_t* arg1). So, field_0's type should be a pointer for that function.

I think this would be especially useful for creating virtual function tables.

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 selection of function assignments and the S structure-creation action described in the issue, then trace the structure and type inference entry points. Check how the selected functions' prototypes are available and define done as generated fields using function-pointer types rather than generic void*, including the virtual-function-table case.

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.