Pseudo C: zero-extended 16-bit sum printed with casts on the operands, losing the 16-bit truncation
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
研究方向
The payload names no source files or tests, and the Pseudo C cast emission is likely in the closed-source decompiler core, not this public API repo. Start from the disassembly in the body: movzx eax, ax truncates the sum, and the Pseudo C drops that truncation by casting the operands instead. Reproduce it with a small x64 sample and check whether the outer (uint32_t) cast needs a (uint16_t) inside it. Done means the expected output shown in the issue is produced for that sample.
由索引模型根據 Issue 內容生成。
描述
Version and Platform (required):
- Binary Ninja Version: 6.0.10601-Stable
- Edition: Non-Commercial
- OS: Windows on ARM
- OS Version: 26H1
- CPU Architecture: x64 target
Bug Description:
A 16-bit truncation of a sum (movzx eax, ax after two 32-bit adds) is printed in Pseudo C as a sum of uint16_t-cast operands with an outer uint32_t cast. But uint16_t is storage type by C language standard. Under C’s integer promotion rules that expression computes the full, untruncated sum, so the Pseudo C has different semantics from the binary.
Disassembly:
140001076 movzx r9d, r8w ; a = h & 0xFFFF
14000107f shr r8d, 0x10 ; b = h >> 16
140001088 add eax, r8d ; eax = n + b (eax = strlen result)
14000108b add eax, r9d ; eax = n + b + a
14000108e movzx eax, ax ; c = (n + b + a) & 0xFFFF
140001091 mov dword [rsp+0x28], eax
Pseudo C output:
(uint32_t)((uint16_t)rax_1 + (uint16_t)r8_2 + (uint16_t)r9_1)
Expected Pseudo C output:
(uint32_t)(uint16_t)((uint16_t)rax_1 + (uint16_t)r8_2 + (uint16_t)r9_1)
- 主要語言
- C++
- 星號
- 1.3k
- 分支
- 304
- 平均合併
- 2 天 20 小時
- 30 天內合併 PR
- 10
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Vector35/binaryninja-api 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 84/100
Vector35/binaryninja-api#8715 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
Vector35/binaryninja-api#8714 ·
維護者通常 2 天內回覆
-
難度 1/5 1 小時以內 新手友好度 85/100
Vector35/binaryninja-api#8713 ·
維護者通常 2 天內回覆
-
難度 1/5 1-3 小時 新手友好度 78/100
Vector35/binaryninja-api#8689 ·
維護者通常 2 天內回覆
-
Component: Python API
難度 2/5 1-3 小時 新手友好度 70/100
Vector35/binaryninja-api#8649 ·
維護者通常 2 天內回覆
查看 Vector35/binaryninja-api 的全部 Issue
相似的 Issue
-
Bug Core VIF
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 80/100
ESPresense/ESPresense#2680 · 2 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1 小時以內 新手友好度 75/100
stew675/llama-cpp-rdna-boosts#348 ·
維護者通常 1 天內回覆
-
Documentation: Add comprehensive newcomer onboarding guide, project structure, and local usage to README可能已有人在做 @Ash-Blanc 今天認領。 未關閉area/other status/bot-triaged status/need-triage
難度 2/5 半天 新手友好度 85/100
-
bug
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆