Page 82 - 《软件学报》2025年第7期
P. 82

软件学报 ISSN 1000-9825, CODEN RUXUEW                                        E-mail: jos@iscas.ac.cn
                 2025,36(7):3003−3021 [doi: 10.13328/j.cnki.jos.007335] [CSTR: 32375.14.jos.007335]  http://www.jos.org.cn
                 ©中国科学院软件研究所版权所有.                                                          Tel: +86-10-62562563



                                                                                       *
                 面向函数内联场景的二进制到源代码函数相似性检测方法

                 贾    昂,    范    铭,    徐    茜,    晋武侠,    王海军,    刘    烃


                 (西安交通大学 电子与信息学部, 陕西 西安 710049)
                 通信作者: 范铭, E-mail: mingfan@mail.xjtu.edu.cn

                 摘 要: 二进制到源代码函数相似性检测是软件组成成分分析的基础性工作之一. 现有方法主要采用一对一的匹
                 配策略, 即使用单一的二进制函数和单一的源代码函数进行比对. 然而, 由于函数内联的存在, 函数之间的映射关
                 系实际上表现为一对多——单一的二进制函数能够关联至多个源代码函数. 这一差异导致现有方法在函数内联场
                 景下遭受了    30%  的性能损失. 针对函数内联场景下的二进制到源代码函数匹配需求, 提出了一种面向一对多匹配
                 的二进制到源代码函数相似性检测方法, 旨在生成源代码函数集合作为内联二进制函数的匹配对象, 以弥补源代
                 码函数库的缺失. 通过一系列实验评估了方法的有效性. 实验数据表明, 方法不仅能够提升现有二进制到源代码函
                 数相似性检测的能力, 而且还能够找到内联的源代码函数, 帮助现有工具更好地应对内联挑战.
                 关键词: 二进制到源代码函数相似性检测; 函数内联; 源代码函数集合
                 中图法分类号: TP311

                 中文引用格式: 贾昂,  范铭,  徐茜,  晋武侠,  王海军,  刘烃.  面向函数内联场景的二进制到源代码函数相似性检测方法.  软件学报,
                 2025, 36(7): 3003–3021. http://www.jos.org.cn/1000-9825/7335.htm
                 英文引用格式: Jia A, Fan M, Xu X, Jin WX, Wang HJ, Liu T. Binary2Source Function Similarity Detection Method Under Function
                 Inlining. Ruan Jian Xue Bao/Journal of Software, 2025, 36(7): 3003–3021 (in Chinese). http://www.jos.org.cn/1000-9825/7335.htm

                 Binary2Source Function Similarity Detection Method Under Function Inlining

                 JIA Ang, FAN Ming, XU Xi, JIN Wu-Xia, WANG Hai-Jun, LIU Ting
                 (Faculty of Electronic and Information Engineering, Xi’an Jiaotong University, Xi’an 710049, China)

                 Abstract:  Binary2Source  function  similarity  detection  is  regarded  as  one  of  the  fundamental  tasks  in  software  composition  analysis.  In  the
                 existing  binary2Source  matching  works,  the  1-to-1  matching  mechanism  is  mainly  adopted,  where  one  binary  function  is  matched  against
                 one source function. However, it is found that such a mapping may be 1-to-n (one binary function is mapped to multiple source functions)
                 due  to  the  existence  of  function  inlining.  A  30%  performance  loss  is  suffered  by  the  existing  binary2Source  matching  methods  under
                 function  inlining  due  to  this  difference.  Aimed  at  the  matching  requirement  of  binary  to  source  functions  in  the  scene  of  function  inlining,
                 a  binary2Source  function  similarity  detection  method  for  1-to-n  matching  is  proposed  in  this  study,  which  is  designed  to  generate  source
                 function  sets  as  the  matching  objects  for  the  inlined  binary  functions  to  make  up  for  the  lack  of  the  source  function  library.  The
                 effectiveness  of  the  proposed  method  is  evaluated  through  a  series  of  experiments.  The  experimental  data  indicate  that  the  method  can  not
                 only improve the existing binary2Source function similarity detection ability but also identify the inlined source code functions, helping the
                 existing tools better cope with the challenges of inlining.
                 Key words:  binary2Source function similarity detection; function inlining; source function set

                    现代软件发展过程中, 开源软件得到了越来越广泛的发展和使用, 对开源软件的复用也越来越普遍. 根据美国
                 新思科技公司在      2022  年的报告, 96%  的软件在开发过程中都会使用到开源代码. 虽然开源代码的使用有助于软件


                 *    基金项目: 国家自然科学基金  (62232014, 62272377, 62372368, 62372367); 陕西省科学技术协会青年人才托举计划
                  本文由“新兴软件与系统的可信赖性与安全”专题特约编辑向剑文教授、陈厅教授、杨珉教授、周俊伟教授推荐.
                  收稿时间: 2024-08-22; 修改时间: 2024-10-15; 采用时间: 2024-11-25; jos 在线出版时间: 2024-12-10
                  CNKI 网络首发时间: 2025-04-09
   77   78   79   80   81   82   83   84   85   86   87