Vector35 / Vector35/binaryninja-api

Broken navigation with nested anonymous structures

Offen
#8,558 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C++
Sterne
1.3k
Forks
298
Ø Merge
5 T. 5 Std.
Gemergte PRs (30 T.)
19

Beschreibung

Version and Platform (required):

  • Binary Ninja Version: 6.1.10668-dev
  • Edition: Ultimate
  • OS: macOS
  • OS Version: 27.0
  • CPU Architecture: M5

Bug Description:
Trying to navigate to a field nested in one or more anonymous structures fails to navigate.

Steps To Reproduce:

Structure:
struct foo {
    int pad;
    struct {
        int bar;
    } inner;
};

Code (x86 Windows):
int32_t sub_0(struct foo* arg1)
mov     eax, dword [esp+0x4]
mov     eax, dword [eax+0x4]
retn

HLIL:
return arg1->inner.bar

Trying to double click bar fails to navigate to the field. Looking at the token itself:

>>> current_il_instruction.tokens[-1].typeNames
['bar']

The token doesn't have valid type information for figuring out how to navigate to it.

Making it a union instead:

union foo_u
{
    struct
    {
        int32_t a;
        int32_t b;
    } bar;
};

Function type:
int32_t sub_0(union foo_u* arg1)

HLIL (broken):
return arg1->bar.__offset(0x4).d

MLIL:
eax = eax_1->bar.b

Double clicking b in MLIL also fails to navigate. The token for this:

>>> current_il_instruction.tokens[-1].typeNames
['foo_u', 'bar', 'b']

These two types also fail to navigate when made into data variables.

Expected Behavior:
Double clicking the inner field of these structures should navigate to that field in the types view.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Start by reproducing the nested anonymous-structure and union examples in the types view, then inspect the HLIL/MLIL tokens and their typeNames as described. Trace how double-click navigation resolves those tokens, including data variables, and consider the issue done when inner fields navigate to their definitions.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
reverse-engineering
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.