MSP430: Sub lifts operands in reverse order (inconsistent with Cmp)
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 92/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
打开 arch/msp430/src/lift.rs,并结合 Instruction::Cmp 检查 Instruction::Sub case。使用 printf '\x3b\x80\x02\x24' > sub_repro.bin 复现,并将其作为 MSP430 加载。完成标准是 sub #0x2402, r11 生成 LLIL r11 = r11 - 0x2402,同时 constant-generator 形式保持不受影响。
由索引模型根据 Issue 内容生成。
描述
Version and Platform (required):
- Binary Ninja Version: 5.0.7648
- Edition: Non-Commercial
- OS: Ubuntu Linux
- OS Version: 24.04
- CPU Architecture: x64
Bug Description:
The MSP430 lifter emits sub with its operands reversed. MSP430 defines sub src, dst as computing dst - src, but the lifter produces src - dst.
Cmp in the same file (arch/msp430/src/lift.rs) is correct, and the two are inconsistent:
// Instruction::Sub
il.sub(size, src, dest)
// Instruction::Cmp
il.sub(size, dest, src)
Steps To Reproduce:
Load 3b 80 02 24 as msp430 (sub #0x2402, r11).
Expected LLIL: r11 = r11 - 0x2402
Actual LLIL: r11 = 0x2402 - r11
Binary:
printf '\x3b\x80\x02\x24' > sub_repro.bin in a terminal.
Possible solution:
Switch src and dest in il.sub(size, src, dest), in the case Instruction::Sub(inst) of the file arch/msp430/src/lift.rs.
Notes:
Constant-generator forms (dec, decd) are unaffected -- they take a different code path, which lifts correctly.
Impact:
Produces plausible but incorrect decompilation for any length or offset computation using sub
- 主要语言
- C++
- 星标
- 1.3k
- 派生
- 298
- 平均合并
- 5 天 5 小时
- 30 天内合并 PR
- 19
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Vector35/binaryninja-api 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
Vector35/binaryninja-api#8540 ·
-
Arch: MSP430
难度 2/5 1-3 小时 新手友好度 88/100
Vector35/binaryninja-api#8516 · 已指派 1 人 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
Vector35/binaryninja-api#8446 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
Vector35/binaryninja-api#8444 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
Vector35/binaryninja-api#8441 · 3 条评论 ·
查看 Vector35/binaryninja-api 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
AXERA-TECH/ax-llm#77 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
games-on-whales/wolf#509 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
-
bug-unconfirmed
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 74/100
NVIDIA/cuda-samples#453 ·