作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2009, Vol. 35 ›› Issue (4): 38-40. doi: 10.3969/j.issn.1000-3428.2009.04.013

• 软件技术与数据库 • 上一篇    下一篇

一种用于反编译代码与源代码的比较算法

曹孟春,陈凯明   

  1. (中国科学技术大学计算机科学技术系,合肥 230027)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2009-02-20 发布日期:2009-02-20

Differencing Algorithm for Decompilation Code and Source Code

CAO Meng-chun, CHEN Kai-ming   

  1. (Department of Computer Science and Technology, University of Science and Technology of China, Hefei 230027)
  • Received:1900-01-01 Revised:1900-01-01 Online:2009-02-20 Published:2009-02-20

摘要: 现有反编译器产生的代码与对应的源代码之间存在差异,找到并理解差异有助于改进并完善反编译器的设计。该文给出一种适用于C语言反编译代码与源代码的比较算法。该算法以语法树匹配方法为基础,定义新的C语言中间代码表示形式并对表达式进行动态匹配,提高了语法树匹配的准确性。实验结果表明,该算法能有效计算出反编译代码与源代码之间的多数差异。

关键词: 反编译代码, 源代码, 比较算法, 中间代码, 动态表达式匹配

Abstract: There are many differences between the codes produced by existing decompilers and the corresponding source codes. To find and understand these differences can help to improve and refine the design of decompiler. This paper presents a differencing algorithm for decompilation code and source code of a C program. This algorithm is based on syntax tree matching method. A new C program intermediate representation is defined and a dynamic expression matching method is proposed to improve the accuracy of the syntax tree matching method. Experimental results show that this algorithm is able to find out most differences between decompilation code and source code.

Key words: decompilation code, source code, differencing algorithm, intermediate code, dynamic expression matching

中图分类号: