Bitwise dataflow
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cpp
調査の方向性
The issue names no files or tests. Start by reviewing the existing LLIL flag APIs shown—flag_bit, set_flag, and test_bit—and how processor flags are represented; use the 8086 PushF/PopF example to understand the current workaround. Done means the API supports combining flags into a register and addresses the requested flag sub-register cases.
索引モデルが issue の本文から書いたものです。
説明
Currently, binja allows referring to the various processor flags individually, but in the hardware, they are combined into one register. Although common ISAs like x86 do not provide rich operations on flags and commonly encountered code does not invoke them, on microcontrollers it is very common to have extensive operations on flags for two reasons:
- the flags register is often either directly addressable via a memory, or easily accessible via a dedicated instruction;
- some call/return constructs, in particular interrupts, implicitly push flags.
Because the flags aren't addressable as a whole, it is necessary to use a workaround, where the flags are either concatenated into one LLIL value, or individually set from one LLIL value. For example, this (written for 8086):
flags_bits = [
('c', 0),
('p', 2),
('a', 4),
('z', 6),
('s', 7),
('i', 9),
('d', 10),
('o', 11),
]
class PushF(Instruction):
def lift(self, il, addr):
flags = None
for flag, flag_bit in flags_bits:
bit = il.flag_bit(2, flag, flag_bit)
if flags is None:
flags = bit
else:
flags = il.or_expr(2, bit, flags)
il.append(il.push(2, flags))
class PopF(Instruction):
def lift(self, il, addr):
flags = LLIL_TEMP(il.temp_reg_count)
il.append(il.set_reg(2, flags, il.pop(2)))
for flag, flag_bit in flags_bits:
bit = il.test_bit(2, il.reg(2, flags), il.const(2, flag_bit))
il.append(il.set_flag(flag, bit))
This workaround generates large and complicated expressions that obscure useful information and impede analysis. It is tedious to implement when there are many instructions accessing flags, and essentially unfeasible when the flags register is memory-mapped due to the volume of generated LLIL.
Please provide, at least, a way to combine flags into a single register. Ideally, it would be also possible to have flags sub-registers (similar to normal sub-registers), because many architectures split the flags register into unprivileged and privileged portions that are used separately; simply have large flag regsiters that may not fit into GPRs with the available addressing modes; or have multi-bit fields in the flags register denoting privilege level, interrupt level, etc.
- 主要言語
- 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 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Vector35/binaryninja-api#8444 ·
Vector35/binaryninja-api の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
autowarefoundation/autoware_universe#13413 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
automated-analysis bug memory-safety
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 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 件 ·