Struct Overlapping Single Variables on Stack

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

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
reverse-engineering

Hướng nghiên cứu

Start with discussion #5260 and the linked private issue, since no source file, test, or entry point is named here. The desired result is to retain earlier overlapping stack variables while showing the later struct and its members at the same addresses.

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

Mô tả

Component: Core

If I understand the following correctly, I do not believe we currently support this use-case. But, I can understand how/why it would be useful. So, we should consider adding support for this.

EDIT: Vector 35 employees, please see the private issue that has been linked into this one below that discusses some implementation details.

Discussed in https://github.com/Vector35/binaryninja-api/discussions/5260

Originally posted by utkonos April 10, 2024
When a particular address on the stack is used for different variables, they're all created automatically and nicely (this is just an examples of overlap at an address; these particular variables are totally not related to the problem below):
image

However, if I want to set the type to a struct that overlaps the locations used previously on the stack, after setting that type, the other varables are gone. Is there a way to get this to work?

Here is how the Stack view looks before. That struct is incorrectly a pointer at the moment just as a placeholder.
image

The two variables enc_str.size and fill_value are both input parameters for init_string here:
image

That function cleans up the stack via ret 8.

Later in the function, space is created for the struct on the stack via sub esp, 0x18. For some reason, if I set the type at that location to the struct, it blows away those two previous stack variables.
image

I want to keep those two variables in the second screenshot above and set a struct at the same addresses in the stack. This way it reflects both usages at the different points in the function.

Is what I want to do possible? I can always just write comments to work around this, but the downstream uses of that struct don't show up nicely with the members in the disassembly 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.