WO2014023069A1 - 一种反编译数据流分析中的寄存器清除方法及系统 - Google Patents
一种反编译数据流分析中的寄存器清除方法及系统 Download PDFInfo
- Publication number
- WO2014023069A1 WO2014023069A1 PCT/CN2012/085154 CN2012085154W WO2014023069A1 WO 2014023069 A1 WO2014023069 A1 WO 2014023069A1 CN 2012085154 W CN2012085154 W CN 2012085154W WO 2014023069 A1 WO2014023069 A1 WO 2014023069A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- binary tree
- function
- register
- register name
- node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/53—Decompilation; Disassembly
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30098—Register arrangements
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
Definitions
- the present invention relates to the field of decompilation, and in particular to a method and system for register clearing in decompiled data stream analysis. Background technique
- Decompilation technology as an indispensable part of computer reverse technology, has been widely used in the field of system vulnerability, software security and virus Trojan.
- Decompilation techniques can convert assembly language to high-level languages such as C.
- the most important and difficult part of decompilation technology is data flow analysis.
- Data flow analysis is a technique for collecting information about values calculated by computer programs at different points. Specifically, a program control flow graph (CFG) can be used to determine which parts of the program may be propagated to a single assignment of a variable.
- CFG program control flow graph
- the existing register clearing phase generally adopts the following method: Let two statements map to each other, and then erase the registers superimposed therein.
- the embodiment of the present invention provides a method and system for clearing a register in decompilation data stream analysis, so as to solve the problem that the existing register clearing method has low execution efficiency, and the technical solution is as follows:
- a method of register clearing in decompiled data stream analysis including:
- the function statement including the register name is sequentially determined to determine whether the function statement includes a binary tree right child end identifier, and if so, the constructed binary tree is subjected to the elimination processing to remove the register name in the binary tree to generate a simplest
- a binary tree generates a high-level language function statement according to the simplest binary tree; otherwise, it continues to determine whether a register name is included in the subsequent function statement.
- the register name is: EAX, AX, BX, CX, DX, SP, SI, BP or DI.
- the open register clears the code file of the previous assembly language and reads all the function statements in the code file, including:
- the binary child right child end identifier is "eax;,,.
- the constructing a binary tree and inputting the function statement into the binary tree comprises: constructing a binary tree;
- the code of the middle of the function statement is input to the left child in the binary tree; the code to the right of the function statement is input to the right child in the binary tree.
- the performing the elimination processing to remove the register name in the binary tree to generate a simplest binary tree includes:
- a register clearing system in decompilation data stream analysis comprising: a reading unit, a register name judging unit, a binary tree building unit, an ending identifier judging unit, a dissipating unit, and a high-level language generating unit,
- the reading unit is configured to open a register to clear a code file of an assembly language and read all function statements in the code file;
- the register name determining unit is configured to sequentially judge the read function statement, determine whether the function name includes a register name, and if yes, trigger the binary tree building unit;
- the binary tree building unit is configured to construct a binary tree And inputting the function statement into the binary tree;
- the end identifier determining unit is configured to sequentially determine a function statement including a register name, and determine whether the function statement includes a binary tree right child end identifier, and if so, Is sends the elimination unit; otherwise, sends a cancellation unit; Determining an instruction to the register name determining unit, so that the register name determining unit continues to determine whether a register name is included in the subsequent function statement;
- the elimination unit is configured to perform a fading process on the constructed binary tree to remove a register name in the binary tree to generate a simple binary tree;
- the high-level language generating unit is configured to generate a function statement of a high-level language according to the simplest binary tree.
- the reading unit comprises: a file opening unit, a single linked list construction subunit, and a file opening subunit of the single linked list, configured to open a code file of an assembly language before the register is cleared; and the single linked list construction subunit is used Constructing a singly linked list according to all function statements in the code file;
- the single linked list traverses the subunits for traversing the singly linked list.
- the binary tree building unit comprises: a binary tree building subunit, a left child subunit, and a right child subunit,
- the binary tree constructs a subunit for constructing a binary tree
- the left child subunit is configured to input a code to the left of the function statement to the left child in the binary tree;
- the right child subunit is configured to input the code to the right of the function statement to the right child in the binary tree. Replace the right child of the next level node with the code in the right child of the top root node The register name in the middle and delete the next level node of the top-level root node.
- the method and system for clearing the register in the decompiled data stream analysis provided by the present invention can read all the function statements at one time without having to perform 'reading and writing multiple times.
- the binary tree is constructed according to the read function statement and the binary tree is subjected to the elimination processing, it is convenient and quick to obtain a function statement without the register name, and the execution efficiency is high.
- FIG. 1 is a register clearing method in decompilation data stream analysis according to an embodiment of the present invention
- FIG. 2 is a schematic diagram of an assembly language function statement according to an embodiment of the present invention
- FIG. 3 is a schematic flowchart of another method for clearing a register in decompilation data stream analysis according to an embodiment of the present invention
- FIG. 5 is a schematic diagram of a method for clearing a register in a decompiled data stream analysis according to an embodiment of the present invention
- FIG. 6 is a schematic flowchart of a method for clearing a register in a decompiled data stream analysis according to an embodiment of the present invention
- Figure 7 is a schematic diagram of a binary tree according to an embodiment of the present invention
- Figure 8 is a schematic diagram of a binary tree according to an embodiment of the present invention
- FIG. 9 is a schematic diagram of a binary tree according to an embodiment of the present invention
- Figure 10 is a schematic diagram of a binary tree according to an embodiment of the present invention
- Figure 11 is a schematic diagram of a binary tree according to an embodiment of the present invention
- Figure 12 is a schematic diagram of a binary tree according to an embodiment of the present invention
- FIG. 14 is a schematic structural diagram of a register clearing system in another decompilation data turbulence analysis according to an embodiment of the present invention
- FIG. 15 is a schematic structural diagram of a register clearing system in another decompiled data turbulence analysis according to an embodiment of the present invention
- a register clearing method in decompiled data stream analysis may include:
- the code file of the assembly language before the register is cleared can be opened as shown in Figure 2. It can be understood that the assembly language uses ";" as the identifier between function statements, and each ";” represents the end of a function statement.
- the present invention can read all the function statements in the code file on the premise of a read operation.
- step S102 Perform a judgment on the read function statement sequentially, and determine whether the function statement includes a registration.
- the name of the device if yes, step S103; otherwise, step S107;
- the register name can be: EAX, AX, BX, CX, DX, SP, SI, BP or DI.
- EAX can be lowercase "eax”.
- computer registers mainly include AX, BX, CX, DX, SP, SI, BP, DI, and so on. With the lower 8 bits, the upper 8 bits, the 16 bits, and the 32 bits, the reading of the registers and the name of the names are also different.
- assembly code the most used and iterative meaning is mainly EAX in AX.
- the use of stack registers is primarily to restore the system environment. The invention does not limit the specific names of the registers herein.
- a binary tree In computer science, a binary tree is an ordered tree with at most two subtrees per node. Usually the # history of a subtree is called left subtree and right subtree. The two child nodes of each node are called left child and right child respectively.
- the code to the left of the function number including the register name can be input to the left child in the binary tree, and the code to the right of the function statement including the register name can be input to the right child in the binary tree.
- step S104 the function statement containing the register name is sequentially determined to determine whether the function statement includes a binary tree right child end identifier, and if so, step S105 is performed, otherwise, step S102 is continued; /
- step S103 Since it is not determined which function statement has the binary tree right child end identifier, it may be further determined in step S103 whether the function statement including the register name includes the binary tree right child end identifier.
- the binary child right child end identifier can be "register name;", such as: “eax:” or "BX;” and so on.
- register name such as: "eax:” or "BX;” and so on.
- S105 Perform a disambiguation process on the constructed binary tree to remove the register name in the binary tree, and generate a simple binary tree;
- the register clearing method in the decompilation teaching stream analysis provided by the embodiment of the invention can read all the function statements at one time without having to read and write multiple times. At the same time, since the binary tree is constructed according to the read function statement and the binary tree is eliminated, the function statement not including the register name can be obtained conveniently and quickly, and the execution efficiency is high.
- the step S101 in the embodiment shown in FIG. 1 may include:
- a singly linked list can store data elements in a linear table with a set of storage locations with arbitrary addresses. It represents the node with an element (the image of the data element) plus a pointer (indicating the location of the successor element). It is more convenient to use a singly linked list to change the reading order at will than to directly read the function statements in the code file.
- the step SI03 in the embodiment shown in FIG. 1 may include:
- the third sentence contains "eax”. Similarly, put “eax” into the left child (node D) of node B, and put “eax+int a" into B. In the right child (node E) of the node, a binary tree as shown in FIG. 8 is formed, and the height of the binary tree is 3.
- the binary tree is continuously constructed as described above, and finally constructed to form a binary tree as shown in Fig. 9, the binary tree having a height of 5. Since the last sentence in the function statement shown in Fig. 6 includes the binary tree right child end identifier "eax;", the binary tree is created after the function statement is processed. Subsequent function statements will form a new binary tree.
- step S105 in the embodiment shown in FIG. 1 may include:
- step S106 may be performed.
- the left child of the simplest binary tree is used as the code to the left of the equal sign of the desired output function
- the right child of the simplest binary tree is used as the function equal to the right of the output.
- the present invention also provides a register clearing system in decompilation data stream analysis.
- a register clearing system in a decompiled data stream analysis may include: a read unit excitation, a register name determination unit 200, a binary tree construction unit 300, an end identification determination unit 400, The elimination unit 100 and the high-level language generating unit 600, the reading unit 100 is configured to open the code file of the assembly language before the register is cleared and read therein, and the code file of the assembly language before the register is cleared can be opened as shown in FIG. 2 Show. can j Q It is understood that assembly language uses ";" as the identifier between function statements, and each ";” represents the end of a function statement. The invention can read all the function statements in the code file on the premise of a read operation.
- the register name determining unit 200 is configured to sequentially judge the read function statement, determine whether the function name includes the register name, and if so, trigger the binary tree building unit 300;
- the register name can be: EAX, AX, BX, CX, DX, SP, SI, BP or DI. It should be noted that in assembly language and high-level language, EAX can be lowercase "eax". Generally speaking, in John von, Neumann computer architecture, computer registers mainly include AX, BX, CX, DX. SP, SI, BP, DI, etc. With the lower 8 bits, the upper 8 bits, the 16 bits, and the 32 bits, the reading of the registers and the name of the names are also different. In assembly code, the most used and iterative meaning is mainly EAX in AX. For example: The use of stack registers is primarily to restore the system environment. The invention does not limit the specific names of the registers herein.
- the binary tree building unit 300 is configured to construct a binary tree and input the function statement into the binary tree;
- a binary tree is an ordered tree with at most two subtrees per node.
- the root of a subtree is called the left subtree and the right subtree.
- the two child nodes of each node are called left child and right child, respectively.
- the code to the left of the function number including the register name can be input to the left child in the binary tree, and the code to the right of the function statement including the register name can be input to the right child in the binary tree.
- the code to the left of the middle of the statement is entered into the left child of the left child, and the code to the right of the equal sign is entered into the right child of the left child. According to the above rules, the remaining function statements are processed in turn until the binary child right child end identifier appears in the function statement.
- the end identifier determining unit 400 is configured to sequentially determine a function statement including a register name, and determine whether the function statement includes a binary tree right child end identifier, and if yes, trigger the elimination unit 500;
- the judgment instruction to the register name judging unit 200 causes the register name judging unit 200 to continue to determine whether the register name is included in the subsequent function statement; wherein, the binary tree right child end identifier may be "register name;", for example: "eax: "Or” BX; "etc.
- the register name is eax, the right child of the binary tree ends with the identifier "eax;".
- the elimination unit 500 is configured to perform a disambiguation process on the constructed binary tree to remove a register name in the binary tree to generate a simple binary tree;
- the high-level language generating unit 600 is configured to generate a function statement of the high-level language according to the simplest binary tree.
- the high-level language function statement can be outputted after it is generated.
- the register clearing system in the decompiled data stream analysis provided by the embodiment of the invention can read all the function statements at one time without having to read and write multiple times.
- the function statement not including the register name can be obtained conveniently and quickly, and the execution efficiency is high.
- the reading unit 100 may include: a file opening unit 110, a single linked list construction subunit 120, and a single linked list. Traversing subunit 130,
- the file opening subunit 110 is configured to open a code file of an assembly language before the register is cleared; j 2
- the single linked list construction subunit 120 is configured to construct a single linked list according to all function statements in the code file;
- a singly linked list can store data elements in a linear table with a set of storage locations with arbitrary addresses. It represents the node with an element (the object of the data element) plus a pointer (indicating the location of the subsequent element storage). It is more convenient to use a singly linked list to change the reading order at will than to directly read the function statements in the code file.
- the single linked list traverse subunit 130 is configured to traverse the singly linked list.
- the binary tree construction unit 300 may include: a binary tree construction subunit 310, a left child subunit 320, and a right child. Subunit 330,
- the binary tree construction subunit 310 is configured to construct a binary tree
- the left child subunit 320 is configured to input a code to the left of the function statement to the left child in the binary tree;
- the right child sub-unit 330 is configured to input the code to the right of the middle of the function statement into the right child in the binary tree.
- the binary tree is continuously constructed as described above, and finally constructed to form a binary tree as shown in Fig. 9, the binary tree having a height of 5. Since the last sentence in the function statement shown in Fig. 6 includes the binary tree right child end identifier "eax;", the binary tree is created after the function statement is processed. Subsequent function statements will form a new binary tree.
- the elimination unit 500 can be specifically configured as:
- the high-level language generating unit 600 may be triggered to use the left child of the simplest binary tree as the code to the left of the equal sign of the desired output function according to the simplest binary tree shown in FIG. 12, and the right child of the most binary binary tree as the function to be outputted.
- the code to the right of the equal sign, and finally get the high-level language letter to be output The number statement is: "int al - int a + int a + int. a; ". It can be seen that the register name is not included in the high level language function statement and has been successfully removed by the present invention.
- the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or in the form of a software product, which can be stored in a storage medium such as OM/RAM, disk. , optical disk, etc., including thousands of instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
- a computer device which may be a personal computer, server, or network device, etc.
- the invention is applicable to a wide variety of general purpose or special purpose computing system environments or configurations.
- personal computer server computer, handheld or portable device, tablet device, multiprocessor system, microprocessor based system, set-top box, programmable consumer electronics device, network PC, small computer, mainframe computer, including Any of the above systems or devices, distributed computing environments, and so on.
- the invention may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
- program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
- the invention may also be practiced in distributed computing environments where remote processing devices are connected through a communication network Perform the task.
- program modules can be located in both local and remote computer storage media including storage devices.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
本发明公开了一种反编译数据流分析中的寄存器清除方法及系统,可以读取代码文件中的所有函数语句并对所读取的函数语句依次进行判断,当函数语句中包括寄存器名称时,构建二叉树并将该函数语句输入到所述二叉树中;进一步对包含有寄存器名称的函数语句依次进行判断,当该函数语句中包括二叉树右孩子结束标识时,对构建的二叉树进行消元处理以去除所述二叉树中的寄存器名称,生成最简二叉树,根据所述最简二叉树生成高级语言的函数语句。由于可以一次将所有语句进行读取,因此本发明不用再多次进行读写。同时,由于根据读取的函数语句构建了二叉树并对二叉树进行消元处理,因此可以很方便、快捷的得到不包含寄存器名称的函数语句,执行效率高。
Description
本申请要求于 2012 年 08 月 10 日提交中国专利局、 申请号为 201210283230.4、 发明名称为 "一种反编译数据流分析中的寄存器清除方法及 系统"的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及反编译^ ί支术领域,特別是涉及一种反编译数据流分析中的寄存 器清除方法及系统。 背景技术
反编译技术作为计算机逆向技术中不可或缺的一部分, 在分折系统漏洞、 软件安全以及病毒木马等领域得到了广泛应用。 反编译技术可以将汇编语言 ) 转换为高级语言 (如 C语言)。 在反编译技术中, 最重要、 最困难的部分是数 据流分析。数据流分析是一种用于收集计算机程序在不同点计算的值的信息的 技术。 具体的, 可以使用程序控制流图 (CFG, control flow graph)来确定对变 量的一次赋值可能传播到程序中的哪些部分。
在数据流分柝中,主要包括寄存器的清除和条件码的清除两个阶段。其中, 现有的寄存器清除阶段一般采用如下方法: 让两个语句相互映射, 然后消去其 中叠加的寄存器。
这种方法会造成磁盘的频繁读写, 耗费了大量时间, 执行效率低。 发明内容
为解决上述技术问题,本发明实施例提供一种反编译数据流分析中的寄存 器清除方法及系统, 以解决现有寄存器清除方法执行效率低的问题,技术方案 如下:
一种反编译数据流分析中的寄存器清除方法, 包括:
打开寄存器清除之前汇编语言的代码文件并读取所述代码文件中的所有 函数语句;
对所读取的函数语句依次进行判断, 判断函数语句中是否包括寄存器名
- 称, 如果是., 则构建二叉树并将该函数语句输入到所述二叉树中;
对包含有寄存器名称的函数语句依次进行判断,判断该函数语句中是否包 括二叉树右孩子结束标识,如果是, 则对构建的二叉树进行消元处理以去除所 述二叉树中的寄存器名称, 生成最简二叉树,根据所述最简二叉树生成高级语 言的函数语句; 否则, 继续判断后续函数语句中是否包括寄存器名称。
优选的, 所述寄存器名称为: EAX、 AX、 BX、 CX、 DX、 SP、 SI、 BP 或 DI。
优选的,所述打开寄存器清除之前汇编语言的代码文件并读取所述代码文 件中的所有函数语句, 包括:
打开寄存器清除之前汇编语言的代码文件;
根据所述代码文件中的所有函数语句构建单链表;
遍历所述单链表。
优选的, 当所述寄存器名称为 EAX 时, 所述二叉树右孩子结束标识为 "eax;,,。
优选的, 所述构建二叉树并将该函数语句输入到所述二叉树中, 包括: 构建二叉树;
将该函数语句中等号左边.的代码输入到所述二叉树中的左孩子中; 将该函数语句中等号右边的代码输入到所述二叉树中的右孩子中。
优选的, 所述进行消元处理以去除所述二叉树中的寄存器名称, 生成最简 二叉树, 包括:
使用顶层根节点的右孩子中的代码替换顶层根节点下一层节点的右孩子 中的寄存器名称并删除所述顶层根节点的下一层节点。
一种反编译数据流分析中的寄存器清除系统, 包括: 读取单元、 寄存器名 称判断单元、 二叉树构建单元、 结束标识判断单元、 消元单元和高级语宫生成 单元,
所述读取单元,用于打开寄存器清除之前汇编语言的代码文件并读取所述 代码文件中的所有函数语句;
所述寄存器名称判断单元, 用于对所读取的函数语句依次进行判断, 判断 函数语句中是否包括寄存器名称, 如果是, 则触发所述二叉树构建单元; 所述二叉树构建单元,用于构建二叉树并将该函数语句输入到所述二叉树 中;
所述结束标识判断单元,用于对包含有寄存器名称的函数语句依次进行判 断, 判断该函数语句中是否包括二叉树右孩子结束标识, 如果是, 则) Is发所述 消元单元; 否则发送一判断指令到所述寄存器名称判断单元,使所述寄存器名 称判断单元继续判断后续函数语句中是否包括寄存器名称;
所述消元单元,用于对构建的二叉树进行消元处理以去除所述二叉树中的 寄存器名称, 生成最简二叉树;
所述高级语言生成单元,用于根据所述最简二叉树生成高级语言的函数语 句。
优选的, 所述读取单元包括: 文件打开单元、 单链表构建子单元和单链表 所述文件打开子单元, 用于打开寄存器清除之前汇编语言的代码文件; 所述单链表构建子单元,用于根据所述代码文件中的所有函数语句构建单 链表;
所述单链表遍历子单元, 用于遍历所述单链表。
优选的, 所述二叉树构建单元包括: 二叉树构建子单元、 左孩子子单元和 右孩子子单元,
所述二叉树构建子单元, 用于构建二叉树;
所述左孩子子单元,用于将该函数语句中等号左边的代码输入到所述二叉 树中的左孩子中;
所述右孩子子单元,用于将该函数语句中等号右边的代码输入到所述二叉 树中的右孩子中。 使用顶层根节点的右孩子中的代码替换顶层根节点下一层节点的右孩子
中的寄存器名称并删除所述顶层根节点的下一层节点。
通过应用以上技术方案,本发明提供的一种反编译数据流分析中的寄存器 清除方法及系统,可以一次读取所有的函数语句,不用再多次进行'读写。同时, 由于根据读取的函数语句构建了二叉树并对二叉树进行消元处理,因此可以很 方便、 快捷的得到不包含寄存器名称的函数.语句, 执行效率高。 附图说明
为了更清除地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明中记载的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 i 为本发明实施例提供的一种反编译数据流分析中的寄存器清除方法
图 2为本发明实施例提供的一种汇编语言函数语句的示意图; 图 3 为本发明实施例提供的另一种反编译数据流分析中的寄存器清除方 法的流程示意图; 图 4 为本发明实施例提供的一种反编译数据流分析中的寄存器清除方法 中单链表的示意图; 图 5 为本发明实施例提供的另一种反编译数据流分析中的寄存器清除方 法的流程示意图; 图 6为本发明实施例提供的汇编语言语句的示意图;
图 7为本发明实施例提供的二叉树的示意图; 图 8为本发明实施例提供的二叉树的示意图;
图 9为本发明实施例提供的二叉树的示意图;
图 10为本发明实施例提供的二叉树的示意图; 图 11为本发明实施例提供的二叉树的示意图; 图 12为本发明实施例提供的二叉树的示意图; 图 13为本发明实施例提供的一种反编译数据流分析中的寄存器清除系统 的结构示意图; 图 14为本发明实施例提供的另一种反编译数椐流分析中的寄存器清除系 统的结构示意图; 图 15为本发明实施例提供的另一种反编译数据流分析中的寄存器清除系 统的结构示意图。 具体实施方式 为了使本技术领域的人员更好地理解本发明中的技术方案,下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清除, 完整地描述, 显然, 所描述的实施例仅仅.是本发明一部分实施例, 而不是全部的实施例。 基 于本发明中的实施例 ,本领域普通技术人员在没有做出创造性劳动前提下所获 得的所有其他实施例, 都应当属于本发明保护的范围。
如图 1所示,本发明实施例提供的一种反编译数据流分析中的寄存器清除 方法, 可以包 ^":
S101、打开寄存器清除之前汇编语言的代码文件并读取所述代码文件中的 所有函数语句;
其中, 寄存器清除之前汇编语言的代码文件被打开后可以如图 2所示。可 以理解的是, 汇编语言以 ";"作为函数语句间的标识, 每一个 ";" 都代表着 一个函数语句的结束。 本发明可以在一个读操作的前提下,将所述代码文件中 的函数语句全部读取。
S102、对所读取的函数语句依次进行判断,判断函数语句中是否包括寄存
器名称, 如果是, 则执行步骤 S103; 否則执行步驟 S107;
所述寄存器名称可以为: EAX, AX、 BX、 CX、 DX、 SP、 SI、 BP或 DI。 需要说明的一点是, 在汇编语言及高级语言中, EAX可以为小写的 "eax"。
一般而言, 在约翰, 冯, 诺依曼计算机体系结构中, 计算机寄存器主要包 括 AX、 BX、 CX、 DX, SP、 SI、 BP、 DI等。 随着低 8位、 高 8位、 16位, 32位的不同, 对寄存器的读取以及名称的叫法也有不同。 在汇编代码中, 使 用最多且具有迭代意义主要是 AX中的 EAX。 例如: 堆栈寄存器的用处主要 是恢复系统环境等。 本发明在此并不限定寄存器的具体名称。
如图 2所示, 在读取代码文件的函数语句后, 会发现第一句 (int a^i ; ) 中没有寄存器名称, 这时, 可以直接将该函数语句进行 '输出处理, 不用再进行 寄存器清除。
S 103、 构建二叉树并将该函数语句输入到所述二叉树中;
在计算机科学中,二叉树是每个结点最多有两个子树的有序树。通常子树 的 # 史称作左子才对 ( left subtree )和右子 4对 ( right subtree )。 每个节点的两个子 节点分别^^称为左孩子和右孩子。
在实际应用中,可以将包括寄存器名称的函数语句中等号左边的代码输入 到二叉树中的左孩子中,将包括寄存器名称的函数语句中等号右边的代码输入 到二叉树中的右孩子中。
由于读取的函数语句为多个, 可以按照函数语句的顺序依次构建。 如, 将 第一个包含寄存器名称的函数语句构造为高度为 2的二叉树,将等号左右边的 代码分别输入该二叉树的左孩子和右孩子中。将第二个包含寄存器名称的函数 语句中等号左边的代码输入上一左孩子的左孩子中,将等号右边的代码输入上 一左孩子的右孩子中。 按照以上规律, 依次对剩余的函数语句进行处理, 直到 函数语句中出现二叉树右孩子结束标识为止。
S104、对包含有寄存器名称的函数语句依次进行判断,判断该函数语句中 是否包括二叉树右孩子结束标识, 如果是, 则执行步骤 S105, 否则, 继续执 行步骤 S102;
/
由于并不确定哪一个函数语句中存在二叉树右孩子结束标识,因此可以在 步驟 S103后, 进一步依次判断包含有寄存器名称的函数语句中是否包括有二 叉树右孩子结束标识。
其中,二叉树右孩子结束标识可以为 "寄存器名称; ",如: "eax: "或 "BX; " 等。 当寄存器名称为 eax时, 二叉树右孩子结束标识为 "eax; "。
S105、 对构建的二叉树进行消元处理以去除所述二叉树中的寄存器名称, 生成最简二叉树;
具体的,可以使用顶层根节点的右孩子中的代码替换顶层根节点下一层节 点的右孩子中的寄存器名称并删除所述顶层根节点的下一层节点。
S106、 根据所述最简二叉树生成高级语言的函数语句;
在实际应用中, 可以将最简二叉树左孩子中的代码放于等号左边,将最简 二叉树右孩子中的代码放于等号右边, 并和等号一起, 形成高级语言的函数语 句。
S107、 进行输出处理。
本发明实施例提供的一种反编译教据流分析中的寄存器清除方法,可以一 次读取所有的函数语句, 不用再多次进行读写。 同时, 由于根据读取的函数语 句构建了二叉树并对二叉树进行消元处理, 因此可以很方便、快捷的得到不包 含寄存器名称的函数语句, 执行效率高。
如图 3所示,在本发明实施例提供的另一种反编译数据流分析中的寄存器 清除方法中, 图 1所示实施例中的步骤 S101可以包括:
S10ia、 打开寄存器清除之前汇编语言的代码文件;
S 10 lb、 根据所述代码文件中的所有函数语句构建单链表
单链表可以用一组地址任意的存储单元存放线性表中的数据元素。 它 以元素 (数据元素的映象) 加指针 (指示后继元素存储位置) 来表示结点。 与直 接读取代码文件中的函数语句相比,使用单链表可以随意改变读取顺序, 更为 方便。
S10ic、 遍历所述单链表。
对于图 2中的第一个函数语句 "int a = ;",可以构建如图 4所示的单链表, 其中, 单 1表中每个字符占用一个节点, "i" 为头结点, 指针指向头结点 该单链^ _中包括一首节点。 指针可以遍历单链表, 同时进行字符匹配操作。 如 果在指针遇到 ";" 之前, 都未遇到 eax, 则输出所遍历的代码。 在图 4 中显 示为遍历了 "inta- 1;", 则将 "int a ::::: 1;" 输出而不进行寄存器删除处理。
如图 5所示,本发明实施例提供的另一种反编译数椐流分析中的寄存器清 除方法中, 图 1所示实施例中的步驟 SI03可以包括:
S103a、 构建二叉树;
S 103b ,将该函数语句中等号左边的代码输入到所述二叉树中的左孩子中; S103c、将该函数语句中等号右边的代码输入到所述二叉树中的右孩子中。 如图 6所示, 以图 2所示的部分函数语句为例进行说明:
由于第一句函数语句 "inta^ l;" 中并不包括寄存器名称, 因此直接进行 输出处理。 然后判断第二句, 由于第二句中包含寄存器名称 "eax", 因此将等 号左边的代码 "eax"输入二叉树的左孩子(节点 B)中, 将右边的代码 "inta" 输入二叉树的右孩子(节点 C) 中, 其中, 该二叉树的根节点为节点 A。 形成 如图 7所示的二叉树, 该二叉树的高度为 2。
按照顺序继续对下一函数语句进行判断, 第三句中包含 "eax", 同理, 将 "eax" 放入 B节点的左孩子 (节点 D) 中, 将 "eax+int a" 放入 B节点的右 孩子(节点 E) 中, 形成如图 8所示的二叉树, 该二叉树的高度为 3。
按照上述方法继续对二叉树进行构建,并最终构建形成如图 9所示的二叉 树, 该二叉树的高度为 5。 由于图 6所示的函数语句中的最后一句中包括有二 叉树右孩子结束标识 "eax;", 因此在处理完这句函数语句后, 该二叉树就创 建完毕。 后续函数语句将形成新的二叉树。
在创建完二叉 ^]·后, 需要对其进行消元处理, 以去除二叉树中的寄存器名 称。 犹选的, 图 1所示实施例中的步骤 S105可以包括:
使用顶层根节点的右孩子中的代码替换顶层根节点下一层节点的右孩子 中的寄存器名称并删除顶层根节点下一层节点。
下面以图 9所示的已经创建好的二叉树为例进行说明:
首先, 从图 9所示二叉树的顶层根节点 (节点 A )开始, 将节点 A的右 孩子(节点 C )中的代码替换下一层的右孩子 (节点 E )中的寄存器名称 "eax" 并删除该层的节点 B和节点 C, 形成如图 10所示的二叉树。 此时, 顶层根节 点的左孩子变为节点 D, 右孩子变为节点£。
然后, 将图 10所示二叉树中的顶层根节点的右孩子 (节点 E ) 中的代码 替换下一层右孩子(节点 G )中的寄存器名称, 并删除节点 D和节点 E, 形成 如图 11所示的二叉树。 此时, 顶层根节点的左孩子变为节点 F, 右孩子变为 节点 G。
最后, 将图 11所示二叉树中的顶层根节点的右孩子 (节点 G ) 中的代码 替换下一层右孩子(节点 I ) 中的寄存器名称, 并劑除节点 F和节点 G, 形成 如图 12所示的二叉树。 此时, 顶层根节点的左孩子变为节点 H, 右孩子变为 节点 I。 由于此时二叉树的高度已经为 2, 已经是最简二叉树, 因此不用再进 行消元处理。
这时, 可以执行步骤 S106, 根据图 12所示的最简二叉树, 将最简二叉树 的左孩子作为所要输出函数等号左边的代码,将最简二叉树的右孩子作为所要 输出的函数等号右边的代码,并最终得到所要输出的高级语言函数语句为: "mt al - int a + int a + int a; " e 可以看到, 该高级.语言函数语句中并不包含寄存器 名称, 本发明已经成功的将其去除。
与本发明提供的方法实施例相对应,本发明还提供了一种反编译数据流分 析中的寄存器清除系统。
如图 13所示, 本发明实施例提供的一种反编译数据流分析中的寄存器清 除系统, 可以包括: 读取单元励、 寄存器名称判断单元 200、 二叉树构建单 元 300、 结束标识判断单元 400、 消元单元 500和高级语言生成单元 600, 所述读取单元 100, 用于打开寄存器清除之前汇编语言的代码文件并读取 其中, 寄存器清除之前汇编语言的代码文件被打开后可以如图 2所示。可
j Q 以理解的是, 汇编语言以 ";"作为函数语句间的标识, 每一个 ";" 都代表着 一个函数语句的结束。本发明可以在一个读搡作的前提下,将所述代码文件中 的函数语句全部读取。
所述寄存器名称判断单元 200, 用于对所读取的函数语句依次进行判断, 判断函数语句中是否包括寄存器名称, 如果是, 则触发所述二叉树构建单元 300;
所述寄存器名称可以为: EAX, AX、 BX、 CX、 DX、 SP、 SI、 BP或 DI。 需要说明的一点是, 在汇编语言及高级语言中, EAX可以为小写的 "eax" 一般而言, 在约翰 冯, 诺依曼计算机体系结构中, 计算机寄存器主要包 括 AX、 BX、 CX、 DX, SP、 SI、 BP、 DI等。 随着低 8位、 高 8位、 16位, 32位的不同, 对寄存器的读取以及名称的叫法也有不同。 在汇编代码中, 使 用最多且具有迭代意义主要是 AX 中的 EAX。 例如: 堆栈寄存器的用处主要 是恢复系统环境等。 本发明在此并不限定寄存器的具体名称。
如图 2所示, 在读取代码文件的函数语句后, 会发现第一句 (int a=! ; ) 中没有寄存器名称, 这时, 可以直接将该函数语句进行输出处理, 不用再进行 寄存器清除。
所述二叉树构建单元 300, 用于构建二叉树并将该函数语句输入到所述二 叉树中;
在计算机科学中,二叉树是每个结点最多有两个子树的有序树。通常子树 的根被称作左子树 ( left subtree )和右子树 ( right subtree )。 每个节点的两个子 节点分别被称为左孩子和右孩子。
在实际应用中,可以将包括寄存器名称的函数语句中等号左边的代码输入 到二叉树中的左孩子中,将包括寄存器名称的函数语句中等号右边的代码输入 到二叉树中的右孩子中。
由于读取的函数语句为多个, 可以按照函数语句的顺序依次构建。 如, 将 第一个包含寄存器名称的函数语句构造为高度为 2的二叉树,将等号左右边的 代码分别输入该二叉树的左孩子和右孩子中。将第二个包含寄存器名称的函数
】】
语句中等号左边的代码输入上一左孩子的左孩子中,将等号右边的代码输入上 —左孩子的右孩子中。 按照以上规律, 依次对剩余的函数语句进行处理, 直到 函数语句中出现二叉树右孩子结束标识为止。
所述结束标识判断单元 400, 用于对包含有寄存器名称的函数语句依次进 行判断, 判断该函数语句中是否包括二叉树右孩子结束标识, 如果是, 則触发 所述消元单元 500; 否则发送一判断指令到所述寄存器名称判断单元 200, 使 所述寄存器名称判断单元 200继续判断后续函数语句中是否包括寄存器名称; 其中,二叉树右孩子结束标识可以为 "寄存器名称; ",如: "eax: "或 "BX; " 等。 当寄存器名称为 eax时, 二叉树右孩子结束标识为 "eax; "。
所述消元单元 500, 用于对构建的二叉树进行消元处理以去除所述二叉树 中的寄存器名称, 生成最简二叉树;
具体的,可以使用顶层根节点的右孩子中的代码替换顶层根节点下一层节 点的右孩子中的寄存器名称并删除所述顶层根节点的下一层节点。
所述高级语言生成单元 600, 用于根据所述最简二叉树生成高级语言的函 数语句。
在实际应用中, 可以将最简二叉树左孩子中的代码放于等号左边,将最简 二叉树右孩子中的代码放于等号右边, 并和等号一起, 形成高级语言的函数语 句。
可以理解的是, 在生成高级语言函数语句后就可以对其进行输出处理。 本发明实施例提供的一种反编译数据流分析中的寄存器清除系统,可以一 次读取所有的函数语句, 不用再多次进行读写。 同时, 由于根据读取的函数语 句构建了二叉树并对二叉树进-行消元处理, 因此可以很方便、快捷的得到不包 含寄存器名称的函数语句, 执行效率高。
如图 14所示, 本发明实施例提供的另一种反编译数据流分析中的寄存器 清除系统中, 所述读取单元 100可以包括: 文件打开单元 110、 单链表构建子 单元 120和单链表遍历子单元 130,
所述文件打开子单元 110,用于打开寄存器清除之前汇编语言的代码文件;
j 2
所述单链表构建子单元 120, 用于根据所述代码文件中的所有函数语句构 建单链表;
单链表可以用一组地址任意的存储单元存放线性表中的数据元素。 它 以元素 (数据元素的暁象) 加指针 (指示后继元素存储位置) 来表示结点。 与直 接读取代码文件中的函数语句相比, 使用单链表可以随意改变读取顺序, 更为 方便。
所述单链表遍历子单元 130, 用于遍历所述单链表。
对于图 2中的第一个函数语句 "inta::::l;",可以构建如图 4所示的单链表, 其中, 单 1表中每个字符占用一个节点, "i" 为头结点, 指针指向头结点 该单链^ _中包括一首节点。 指针可以遍历单链表, 同时进行字符匹配操作。 如 果在指针遇到 ";" 之前, 都未遇到 eax, 则输出所遍历的代码。 在图 4 中显 示为遍历了 "inta- 1;", 则将 "inta- 1;" 输出而不进行寄存器删除处理。
如图 15所示, 本发明实施例提供的另一种反编译数据流分析中的寄存器 清除系统中, 所述二叉树构建单元 300可以包括: 二叉树构建子单元 310、 左 孩子子单元 320和右孩子子单元 330,
所述二叉树构建子单元 310, 用于构建二叉树;
所述左孩子子单元 320, 用于将该函数语句中等号左边的代码输入到所述 二叉树中的左孩子中;
所述右孩子子单元 330, 用于将该函数语句中等号右边的代码输入到所述 二叉树中的右孩子中。
如图 6所示, 以图 2所示的部分函数语句为例进-行说明:
由于第一句函数语句 "mta=l;" 中并不包括寄存器名称, 因此直接进行 输出处理。 然后判断第二句, 由于第二句中包含寄存器名称 "eax',, 因此将等 号左边的代码 "eax"输入二叉树的左孩子(节点 B)中, 将右边的代码 "inta" 输入二叉树的右孩子(节点 C) 中, 其中, 该二叉树的根节点为节点 A。 形成 如图 7所示的二叉刺-, 该二叉树的高度为 2。
按照顺序继续对下一函数语句进-行判断, 第三句中包含 "eax", 同理, 将
j 3
"eax" 放入 B节点的左孩子 (节点 D ) 中, 将 "eax+int a" 放入 B节点的右 孩子(节点 E ) 中, 形成如图 8所示的二叉树, 该二叉树的高度为 3。
按照上述方法继续对二叉树进行构建,并最终构建形成如图 9所示的二叉 树, 该二叉树的高度为 5。 由于图 6所示的函数语句中的最后一句中包括有二 叉树右孩子结束标识 "eax;", 因此在处理完这句函数语句后, 该二叉树就创 建完毕。 后续函数语句将形成新的二叉树。
在创建完二叉树后, 需要对其进行消元处理, 以去除二叉树中的寄存器名 称。 优选的, 消元单元 500可以具体设置为:
使用顶层根节点的右孩子中的代码替换顶层根节点下一层节点的右孩子 中的寄存器名称并删除所述顶层根节点的下一层节点。
下面以图 9所示的已经创建好的二叉树为例进行说明:
首先, 从图 9所示二叉树的顶层根节点 (节点 A )开始, 将节点 A的右 孩子(节点 C )中的代码替换下一层的右孩子(节点 E )中的寄存器名称 "eax" 并删除该层的节点 B和节点 C, 形成如图 10所示的二叉树。 此时, 顶层 ¾1节 点的左孩子变为节点 D, 右孩子变为节点£。
然后, 将图 1 0所示二叉树中的顶层根节点的右孩子 (节点 E ) 中的代码 替换下一层右孩子(节点 G )中的寄存器名称, 并删除节点 D和节点 E, 形成 如图 !1所示的二叉树。 此时, 顶层根节点的左孩子变为节点 F , 右孩子变为 节点 G。
最后, 将图 1 1所示二叉树中的顶层根节点的右孩子 (节点 G ) 中的代码 替换下一层右孩子(节点 I ) 中的寄存器名称, 并刪除节点 F和节点 G, 形成 如图 12所示的二叉树。 此时, 顶层根节点的左孩子变为节点 H, 右孩子变为 节点 I。 由于此时二叉树的高度已经为 2 , 已经是最简二叉树, 因此不用再进 行消元处理。
这时, 可以触发高级语言生成单元 600, 根据图 12所示的最简二叉树, 将最简二叉树的左孩子作为所要输出函数等号左边的代码,将最筒二叉树的右 孩子作为所要输出的函数等号右边的代码,并最终得到所要输出的高级语言函
数语句为: "int al - int a + int a + int. a; "。 可以看到, 该高级语言函数语句中 并不包含寄存器名称, 本发明已经成功的将其去除。
为了描述的方便, 描述以上装置时以功能分为各.种单元分别描述。 当然, 在实施本发明时可以把各单元的功能在同一个或多个软件和 /或硬件中实现。
通过以上的实施方式的描述可知,本领域的技术人员可以清除地了解到本 发明可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解, 本发 明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形 式体现出来,该计算机软件产品可以存储在存储介质中,如 OM/RAM,磁碟、 光盘等, 包括若千指令用以使得一台计算机设备(可以是个人计算机,服务器, 或者网络设备等 )执行本发明各个实施例或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相 的部分互相参见即可, 每个实施例重点说明的都是与其他实施例的不同之 处。 尤其, 对于系统实施例而言, 由于其基本相似于方法实施例, 所以描述得 比较简单,相关之处参见方法实施例的部分说明即可。 以上所描述的系统实施 例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是 物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元, 即可以 位于一个地方, 或者也可以分布到多个网络单元上。可以根据实际的需要选择 不付出创造性劳动的情况下, 即可以理解并实施。
本发明可用于众多通用或专用的计算系统环境或配置中。例如: 个人计算 机、 服务器计算机、 手持设备或便携式设备、 平板型设备、 多处理器系统、 基 于微处理器的系统、 置顶盒、 可编程的消费电子设备、 网络 PC、 小型计算机、 大型计算机、 包括以上任何系统或设,备的分布式计算环境等等。
本发明可以在由计算机执行的计算机可执行指令的一般上下文中描述,例 如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的 例程、 程序、 对象、 组件、 数据结构等等。 也可以在分布式计算环境中实践本 发明,在这些分布式计算环境中, 由通过通信网络 被连接的远程处理设备来
执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地 和远程计算机存储介质中。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅^ I用来将 一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些 实体或操作之间存在任何这种实际的关系或者顺序。
以上所述仅是本发明的具体实施方式, 应当指出,对于本技术领域的普通 技术人员来说, 在不脱离本发明原理的前提下, 还可以做出若千改进和润饰, 这些改进和润饰也应视为本发明的保护范围。
Claims
1、 一种反编译数据流分柝中的寄存器清除方法, 其特征在于, 包括: 函数语句;
对所读取的函数语句依次进行判断, 判断函数语句中是否包括寄存器名 称, 如果是, 则构建二叉树并将该函数语句输入到所述二叉树中;
对包含有寄存器名称的函数语句依次进行判断,判断该函数语句中是否包 括二叉树右孩子结束标识,如果是, 则对构建的二叉树进行消元处理以去除所 述二叉树中的寄存器名称, 生成最简二叉树,根据所述最简二叉树生成高级语 言的函数语句; 否则, 继续判断后续函数语句中是否包括寄存器名称。
2、 根椐权利要求 1所述的方法, 其特征在于, 所述寄存器名称为: EAX, AX、 BX、 CX, DX, SP、 SI , BP或 DI。
3、 根据权利要求 i或 2所述的方法, 其特征在于, 所述打开寄存器清除 之前汇编语言的代码文件并读取所述代码文件中的所有函数语句, 包括:
打开寄存器清除之前汇编语言的代码文件;
根据所述代码文件中的所有函数语句构建单链表;
遍历所述单链表。
4、 根据权利要求 1所述的方法, 其特征在于, 当所述寄存器名称为 EAX 时, 所述二叉树右孩子结束标识为 "eax; "。
5 , 根据权利要求 1所述的方法, 其特征在于, 所述构建二叉树并将该函 数语句输入到所述二叉树中, 包括:
构建二叉树;
将该函数语句中等号左边的代码输入到所述二叉树中的左孩子中; 将该函数语句中等号右边的代码输入到所述二叉树中的右孩子中。
6、 根据权利要求 1所述的方法, 其特征在于, 所述进 -行消元处理以去除 所述二叉树中的寄存器名称, 生成最简二叉树, 包括:
使用顶层根节点的右孩子中的代码替换顶层根节点下一层节点的右孩子
中的寄存器名称并删除所述顶层根节点的下一层节点。
7、 一种反编译数据流分析中的寄存器清除系统, 其特征在于, 包括: 读 取单元、 寄存器名称判断单元、 二叉树构建单元、 结束标识判断单元、 消元单 元和高级语言生成单元,
所述读取单元,用于打开寄存器清除之前汇编语言的代码文件并读取所述 代码文件中的所有函数语句;
所述寄存器名称判断单元, 用于对所读取的函数语句依次进行判断, 判断 函数语句中是否包括寄存器名称, 如果是, 则触发所述二叉树构建单元;
所述二叉树构建单元,用于构建二叉树并将该函数语句输入到所述二叉树 中;
所述结束标识判断单元,用于对包含有寄存器名称的函数语句依次进行判 断, 判断该函数语句中是否包括二叉树右孩子结束标识, 如果是, 则触发所述 消元单元; 否则发送一判断指令到所述寄存器名称判断单元,使所述寄存器名 称判断单元继续判断后续函数语句中是否包括寄存器名称;
所述消元单元,用于对构建的二叉树进行消元处理以去除所述二叉树中的 寄存器名称, 生成最简二叉树;
所述高级语言生成单元,用于根据所述最简二叉树生成高级语言的函数语 句。
8 , 根据权利要求 7所述的系统, 其特征在于, 所述读取单元包括: 文件 打开单元、 单链表构建子单元和单链表遍历子单元,
所述文件打开子单元, 用于打开寄存器清除之前汇编语言的代码文件; 所述单链表构建子单元,用于根据所述代码文件中的所有函数语句构建单 链表
所述单链表遍历子单元, 用于遍历所述单链表。
9、 根据权利要求 7所述的系统, 其特征在于, 所述二叉树构建单元包括: 二叉树构建子单元、 左孩子子单元和右孩子子单元,
所述二叉树构建子单元, 用于构建二叉树;
― ] ―
所述左孩子子单元,用于将该函数语句中等号左边的代码输入到所述二叉 树中的左孩子中;
所述右孩子子单元,用于将该函数语句中等号右边的代码输入到所述二叉 树中的右孩子中。
10、根据权利要求 7所述的系统,其特征在于,所述消元单元具体设置为: 使用顶层根节点的右孩子中的代码替换顶层根节点下一层节点的右孩子 中的寄存器名称并删除所述顶层根节点的下一层节点。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US14/125,881 US9405519B2 (en) | 2012-08-10 | 2012-11-23 | Method and system for register clearing in data flow analysis in decompilation |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210283230.4 | 2012-08-10 | ||
| CN201210283230.4A CN102855139B (zh) | 2012-08-10 | 2012-08-10 | 一种反编译数据流分析中的寄存器清除方法及系统 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2014023069A1 true WO2014023069A1 (zh) | 2014-02-13 |
Family
ID=47401750
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2012/085154 Ceased WO2014023069A1 (zh) | 2012-08-10 | 2012-11-23 | 一种反编译数据流分析中的寄存器清除方法及系统 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US9405519B2 (zh) |
| CN (1) | CN102855139B (zh) |
| WO (1) | WO2014023069A1 (zh) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12124586B2 (en) * | 2013-09-13 | 2024-10-22 | Omnissa, Llc | Risk assessment for managed client devices |
| CN105044653A (zh) * | 2015-06-30 | 2015-11-11 | 武汉大学 | 一种智能电表的软件一致性检测方法 |
| CN106919429B (zh) * | 2015-12-25 | 2021-05-04 | 阿里巴巴集团控股有限公司 | 反编译数据的处理方法和装置 |
| CN106919430B (zh) * | 2015-12-25 | 2020-11-24 | 阿里巴巴集团控股有限公司 | 反编译指令中寄存器的处理方法和装置 |
| CN106055378B (zh) * | 2016-06-06 | 2018-03-13 | 中国南方电网有限责任公司电网技术研究中心 | 继电保护装置嵌入式软件的反汇编方法和系统 |
| CN114936304B (zh) * | 2022-05-31 | 2025-05-20 | 中国船舶重工集团公司第七0七研究所 | 一种基于xml文件的数据库表定义方法 |
| CN115392160B (zh) * | 2022-06-10 | 2024-04-09 | 无锡芯光互连技术研究院有限公司 | 一种电路图描述文件的格式转换方法 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6516319B1 (en) * | 1999-05-20 | 2003-02-04 | International Business Machines Corporation | Parallelized processing device for processing search keys based upon tree structure |
| CN1900910A (zh) * | 2005-07-22 | 2007-01-24 | 中国科学院计算技术研究所 | 二进制翻译中经由跳转表的多目标分支语句的识别方法 |
| CN101561779A (zh) * | 2008-04-14 | 2009-10-21 | 国际商业机器公司 | 一种调试方法和调试器 |
| CN101751334A (zh) * | 2009-12-30 | 2010-06-23 | 中国人民解放军国防科学技术大学 | 一种基于还原程序的硬件故障检测方法 |
Family Cites Families (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5117493A (en) * | 1989-08-07 | 1992-05-26 | Sun Microsystems, Inc. | Pipelined register cache |
| DE69524170T2 (de) * | 1994-09-22 | 2002-05-29 | Sun Microsystems, Inc. | Eingebettete Programmablaufinformation zwecks Zielcodemanipulation |
| US5860008A (en) * | 1996-02-02 | 1999-01-12 | Apple Computer, Inc. | Method and apparatus for decompiling a compiled interpretive code |
| US6981132B2 (en) * | 2000-08-09 | 2005-12-27 | Advanced Micro Devices, Inc. | Uniform register addressing using prefix byte |
| WO2002017071A1 (en) * | 2000-08-22 | 2002-02-28 | Theis Jean Paul | A configurable register file with multi-range shift register support |
| US8589861B2 (en) * | 2002-11-06 | 2013-11-19 | Code Valley Corp Pty Ltd | Code generation |
| US7051322B2 (en) * | 2002-12-06 | 2006-05-23 | @Stake, Inc. | Software analysis framework |
| US20060130016A1 (en) * | 2003-03-17 | 2006-06-15 | Wagner John R | Method of kernal-mode instruction interception and apparatus therefor |
| US7765539B1 (en) * | 2004-05-19 | 2010-07-27 | Nintendo Co., Ltd. | System and method for trans-compiling video games |
| US8584109B2 (en) * | 2006-10-27 | 2013-11-12 | Microsoft Corporation | Virtualization for diversified tamper resistance |
| US8935677B2 (en) * | 2008-04-07 | 2015-01-13 | Microsoft Corporation | Automatic reverse engineering of input formats |
| US8645935B2 (en) * | 2009-05-01 | 2014-02-04 | University Of Maryland | Automatic parallelization using binary rewriting |
| CN101963898B (zh) * | 2010-09-17 | 2012-05-02 | 广州迪庆电子科技有限公司 | 反编译过程中的寄存器传播方法、装置及反编译器 |
| US8607193B2 (en) * | 2012-01-16 | 2013-12-10 | International Business Machines Corporation | Tracking stale comments in source code listings |
| US8966635B2 (en) * | 2012-02-24 | 2015-02-24 | Hewlett-Packard Development Company, L.P. | Software module object analysis |
| US8918881B2 (en) * | 2012-02-24 | 2014-12-23 | Appthority, Inc. | Off-device anti-malware protection for mobile devices |
| US9690584B2 (en) * | 2013-10-18 | 2017-06-27 | Marvell World Trade Ltd. | Systems and methods for register allocation |
-
2012
- 2012-08-10 CN CN201210283230.4A patent/CN102855139B/zh active Active
- 2012-11-23 US US14/125,881 patent/US9405519B2/en active Active
- 2012-11-23 WO PCT/CN2012/085154 patent/WO2014023069A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6516319B1 (en) * | 1999-05-20 | 2003-02-04 | International Business Machines Corporation | Parallelized processing device for processing search keys based upon tree structure |
| CN1900910A (zh) * | 2005-07-22 | 2007-01-24 | 中国科学院计算技术研究所 | 二进制翻译中经由跳转表的多目标分支语句的识别方法 |
| CN101561779A (zh) * | 2008-04-14 | 2009-10-21 | 国际商业机器公司 | 一种调试方法和调试器 |
| CN101751334A (zh) * | 2009-12-30 | 2010-06-23 | 中国人民解放军国防科学技术大学 | 一种基于还原程序的硬件故障检测方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102855139A (zh) | 2013-01-02 |
| US20150212805A1 (en) | 2015-07-30 |
| US9405519B2 (en) | 2016-08-02 |
| CN102855139B (zh) | 2015-04-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2014023069A1 (zh) | 一种反编译数据流分析中的寄存器清除方法及系统 | |
| CN112236747B (zh) | 在正则表达式代码上使用最长通用子序列算法的正则表达式生成 | |
| US12225049B2 (en) | System and methods for integrating datasets and automating transformation workflows using a distributed computational graph | |
| US20140012865A1 (en) | Using annotators in genome research | |
| CN102693396B (zh) | 一种基于虚拟执行模式的Flash漏洞检测方法 | |
| Haeupler et al. | Near-optimal low-congestion shortcuts on bounded parameter graphs | |
| CN114675875A (zh) | 一种共享组件发布方法、装置、设备及介质 | |
| CN108984155A (zh) | 数据处理流程设定方法和装置 | |
| CN112559101A (zh) | 页签处理方法、装置、计算机设备及介质 | |
| US20200183938A1 (en) | Automatic quantum searching of object databases | |
| US20160366201A1 (en) | Suppressing stream functionality to expedite preferred data | |
| JP2016081496A (ja) | 複合イベント処理のためのイベント構成規則の動的更新システム及び方法 | |
| US20180129736A1 (en) | System to organize search and display unstructured data | |
| US20120227047A1 (en) | Workflow validation and execution | |
| CN107729001B (zh) | 一种表达式处理方法和装置 | |
| CN107622057A (zh) | 一种查找任务的方法和装置 | |
| CN109299443B (zh) | 一种基于最小顶点覆盖的新闻文本去重方法 | |
| CN111880799A (zh) | 取号客户端程序的生成方法、装置及可读介质 | |
| CN114265846A (zh) | 一种数据操作方法、装置、电子设备和存储介质 | |
| US9916347B2 (en) | Rapid searching and matching of data to a dynamic set of signatures facilitating parallel processing and hardware acceleration | |
| CN112036843A (zh) | 基于rpa及ai的流程元素定位方法、装置、设备和介质 | |
| US12450349B2 (en) | Evaluating files for malicious and/or suspicious code | |
| US9875045B2 (en) | Regular expression matching with back-references using backtracking | |
| CN113268965A (zh) | 用于自动生成路由表的方法、装置、存储介质及电子设备 | |
| CN105446711A (zh) | 获取用于软件开发任务的上下文信息的方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| WWE | Wipo information: entry into national phase |
Ref document number: 14125881 Country of ref document: US |
|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 12882832 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 12882832 Country of ref document: EP Kind code of ref document: A1 |