Struct Overlapping Single Variables on Stack

オープン
#5,285 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C++
スター
1.3k
フォーク
298
平均マージ
5日 5時間
マージ済み PR(30日)
19

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Vector35/binaryninja-api のほかの issue

Vector35/binaryninja-api の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。