[论文解读] Finding Semantically-Equivalent Binary Code By Synthesizing Adaptors
本文提出一种技术,通过合成适配器(即桥接函数接口差异的胶水代码)自动发现语义等价的二进制函数。该方法结合具体执行与二进制符号执行,高效识别真实世界二进制程序中可替换的函数对,在安全加固、性能优化和去混淆方面展现出实际应用价值,并通过对超过13,000个Linux C库函数的大规模评估,证实了可适配等价代码的普遍性。
Independently developed codebases typically contain many segments of code that perform the same or closely related operations (semantic clones). Finding functionally equivalent segments enables applications like replacing a segment by a more efficient or more secure alternative. Such related segments often have different interfaces, so some glue code (an adaptor) is needed to replace one with the other. We present an algorithm that searches for replaceable code segments at the function level by attempting to synthesize an adaptor between them from some family of adaptors; it terminates if it finds no possible adaptor. We implement our technique using (1) concrete adaptor enumeration based on Intel's Pin framework and (2) binary symbolic execution, and explore the relation between size of adaptor search space and total search time. We present examples of applying adaptor synthesis for improving security and efficiency of binary functions, deobfuscating binary functions, and switching between binary implementations of RC4. For large-scale evaluation, we run adaptor synthesis on more than 13,000 function pairs from the Linux C library. Our results confirm that several instances of adaptably equivalent binary functions exist in real-world code, and suggest that these functions can be used to construct cleaner, less buggy, more efficient programs.
研究动机与目标
- 识别仅接口不同的语义等价二进制函数,以支持代码替换,实现优化或安全加固。
- 通过自动合成适配器来解决接口不同的函数替换问题,从而桥接其差异。
- 评估适配器合成在真实世界二进制代码库中的可行性与效率,特别是在Linux C库等大规模系统中的适用性。
- 探索在二进制函数等价性检测中,适配器搜索空间大小与总搜索时间之间的权衡。
提出的方法
- 该方法采用基于Intel Pin框架的具体适配器枚举,以探索二进制函数之间潜在的接口转换。
- 结合二进制符号执行,在适配器合成过程中探索二进制函数的控制流与数据流路径。
- 算法在预定义的适配器家族内进行搜索,当无法找到有效适配器时终止,确保在搜索空间内的完备性。
- 该方法支持功能等价性检查与实际代码替换,通过生成正确胶水代码实现。
- 将接口不匹配建模为参数与返回类型转换,从而系统化地探索适配器候选。
- 在包含13,000对函数的大型Linux C库语料库上评估该框架,以衡量其可扩展性与有效性。
实验结果
研究问题
- RQ1能否自动合成适配器,以桥接语义等价二进制函数之间的接口差异?
- RQ2适配器搜索空间的大小如何影响找到有效适配器所需的总时间?
- RQ3在真实世界代码库(如Linux C库)中,可适配等价的二进制函数有多普遍?
- RQ4适配器合成在多大程度上能提升二进制程序的安全性、性能与去混淆能力?
- RQ5具体执行与二进制符号执行的结合,在发现函数级语义克隆方面有多高效?
主要发现
- 对Linux C库中的13,000对函数进行了分析,发现真实世界代码中存在多组可适配等价的二进制函数。
- 该方法成功为多对函数合成了适配器,使得可将效率较低或安全性较差的实现替换为更优替代方案。
- 适配器搜索空间大小与搜索时间呈强相关性,表明搜索空间剪枝对可扩展性至关重要。
- 适配器合成实现了二进制安全与性能的实际改进,包括对混淆函数的去混淆处理。
- 该技术在RC4不同二进制实现之间切换方面验证了可行性,证实其在真实世界二进制转换中的实用性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。