component data variable notifications raise AttributeError
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
binaryninja/binaryview.py を開き、1481 行目と 1491 行目付近のコンポーネントコールバックを、1171〜1183 行目付近で動作しているデータ変数コールバックと比較します。BinaryDataNotification、bv.create_component()、component.add_data_variable(dv) を使って再現します。完了条件は、両方のコンポーネントコールバックがポインタを正しく処理し、アノテーションが受け取ったハンドル型と一致することです。
索引モデルが issue の本文から書いたものです。
説明
_component_data_variable_added passes the raw BNDataVariable pointer to
DataVariable.from_core_struct, which expects a dereferenced struct.
File "binaryninja/binaryview.py", line 1481, in _component_data_variable_added
self._notify.component_data_var_added(self._view, result,
DataVariable.from_core_struct(var, self._view))
File "binaryninja/binaryview.py", line 12255, in from_core_struct
core.BNNewTypeReference(var.type), platform=view.platform,
^^^^^^^^
AttributeError: 'LP_BNDataVariable' object has no attribute 'type'
The three non-component callbacks dereference correctly; the two component ones
do not:
1171 data_var_added from_core_struct(var[0], ...) ok
1177 data_var_removed from_core_struct(var[0], ...) ok
1183 data_var_updated from_core_struct(var[0], ...) ok
1481 component_data_var_added from_core_struct(var, ...) throws
1491 component_data_var_removed from_core_struct(var, ...) throws
The type annotations on the component callbacks are also wrong: declared
var: core.BNDataVariable, actually receive LP_BNDataVariable. The working ones
correctly declare core.BNDataVariableHandle.
FIX: var -> var[0] at lines 1481 and 1491; correct the annotations.
REPRODUCE (no plugin needed):
load any binary, register a BinaryDataNotification implementing
component_data_var_added, then bv.create_component() and
component.add_data_variable(dv).
- 主要言語
- C++
- スター
- 1.3k
- フォーク
- 298
- 平均マージ
- 5日 5時間
- マージ済み PR(30日)
- 19
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Vector35/binaryninja-api のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
Vector35/binaryninja-api#8540 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Vector35/binaryninja-api#8516 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Vector35/binaryninja-api#8503 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Vector35/binaryninja-api#8446 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Vector35/binaryninja-api#8441 · コメント 3 件 ·
Vector35/binaryninja-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gazebosim/gz-sensors#662 · コメント 1 件 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
comp-datalake
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ClickHouse/ClickHouse#121222 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
LadybirdBrowser/ladybird#12123 ·