Broken navigation with nested anonymous structures

Đang mở
#8,558 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
reverse-engineering

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
1.3k
Fork
298
Merge trung bình
5 ngày 5 giờ
Pull request đã merge (30 ngày)
19

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Vector35/binaryninja-api

Tất cả issue của Vector35/binaryninja-api

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.