Setting a calling convention doesn't trigger argument locations to be redetermined
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp
调研方向
Start with the calling-convention update path and inspect how current_function.type.parameters[0].location relates to bv.arch.get_reg_name(current_function.parameter_vars[0].storage). Reproduce the sequence of removing an explicit location and changing the calling convention; done means parameters using the default location move to the new convention's default location.
由索引模型根据 Issue 内容生成。
描述
Version and Platform (required):
- Binary Ninja Version: 3.5.4390-dev
- OS: macOS
- OS Version: 13.5
- CPU Architecture: arm64
Bug Description:
Created a custom calling convention that took the first argument at x20 (this in Swift) and applied it, but it didn't work:
Explicit argument locations do work, however:
It turns out this is a little more complicated than 'it doesn't work', though. What appears to be happening is that:
- If you have the argument location at
x20first - ...and then edit the signature to remove the explicit argument location
- ...and then change the calling convention
- ...the argument won't be at
x20because the calling convention updates the type, but doesn't update the actual variables
Removing the explicit location changes the argument to the "default location" (x0, in this case) and then the update does not change the variable location even though the calling convention has changed in the type of the function. The variable in the type is still at "default location" but the variable in the analysis has not been changed to the "default location" of the new calling convention. Check current_function.type.parameters[0].location is None vs bv.arch.get_reg_name(current_function.parameter_vars[0].storage) to see that this is the case.
Expected Behavior:
Any time the calling convention has changed, it should update the parameter variable locations if they are set to the default location. It should update to use the default location in the new calling convention.
Additional Information:
Lots of thanks to @CouleeApps for figuring out what was actually happening here, since it appeared to be working non-deterministically before.
- 主要语言
- 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 ·
-
难度 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
-
难度 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 ·