WO2014082422A1 - 一种代码改动的检测方法和装置 - Google Patents

一种代码改动的检测方法和装置 Download PDF

Info

Publication number
WO2014082422A1
WO2014082422A1 PCT/CN2013/074723 CN2013074723W WO2014082422A1 WO 2014082422 A1 WO2014082422 A1 WO 2014082422A1 CN 2013074723 W CN2013074723 W CN 2013074723W WO 2014082422 A1 WO2014082422 A1 WO 2014082422A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
binary file
modified
information
mark
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
Application number
PCT/CN2013/074723
Other languages
English (en)
French (fr)
Inventor
李俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP13779107.5A priority Critical patent/EP2778629A4/en
Priority to US14/088,658 priority patent/US9342285B2/en
Publication of WO2014082422A1 publication Critical patent/WO2014082422A1/zh
Anticipated expiration legal-status Critical
Priority to US15/066,827 priority patent/US10019240B2/en
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/48Incremental compilation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running

Definitions

  • the invention belongs to the field of computers, and in particular relates to a method and device for detecting code changes. Background technique
  • a hot patch is a code that can fix software vulnerabilities. It is characterized by not interrupting the running of the software. It only needs to modify or replace the function to be changed in the source code. That is, the analysis program finds out which function code has occurred. Changes, which can replace these function codes, replace the function during the run to achieve the effect of the hot patch.
  • the method for identifying and locating the changed program code is divided into two different implementation schemes, one is identified by analyzing and comparing the source code, and the other is identified by comparing the binary files compiled by the program. .
  • the first method has higher complexity and has many limitations.
  • the inline type function cannot know the final compiling effect, which makes it impossible to extract the really effective function change code, and the accuracy of the recognition cannot be guaranteed.
  • the second method requires two programs before and after patching, and then compares the compiled binary code, which is more complicated and time consuming, and this method requires more compiler options, some compile options. There may be conflicts that affect the reliability of the identification. Summary of the invention
  • an embodiment of the present invention provides a method for detecting a code change, where the method includes:
  • the adding a function to the function to be changed in the source code includes:
  • Creating a tag containing an external interface the tag being: a code or a macro that extracts information; the tag is added to the function to be altered in the source code via the external interface.
  • the obtaining the location information and the relocation information of the to-be-modified function in the binary file according to the identifier includes:
  • the information of the function to be modified in the binary file includes: a function name of the function to be modified in the binary file, or a function of the function to be changed in the binary file Start address
  • the dynamic function is saved to a separate segment of the binary file, the source code is again compiled into a binary file according to the compiled attribute, and the relocation information of the function to be modified in the binary file is obtained.
  • the information is compared with a symbol table in a binary file, and the to-be-modified is obtained according to the result of the comparison.
  • the location information of the function in the binary file including:
  • the information is a function name of the function to be modified in the binary file, comparing a function name of the function to be modified in the binary file with a symbol table in a binary file, to obtain a query a start address of the function to be modified in the binary file;
  • the information is the start address of the function to be modified in the binary file, compare the start address of the function to be changed in the binary file with the symbol table in the binary file, and query a function name of the function to be modified in the binary file;
  • the function name and the start address of the function to be modified in the binary file are used as location information of the to-be-modified function in the binary file.
  • an embodiment of the present invention provides a device for detecting a code change, where the device includes: a tag adding unit, configured to add a tag to a function to be changed in the source code, where the tag is used to compile the source code Positioning the function to be changed in the obtained binary file;
  • a compiling unit configured to compile source code added by the mark adding unit into a binary file
  • an information obtaining unit configured to acquire, according to the mark added by the mark adding unit, position information and relocation information of the function to be modified in a binary file compiled by the compiling unit.
  • the marking adding unit specifically includes: A tag creation sub-unit for creating a tag containing an external interface, the tag being: a code or a macro that extracts information;
  • a subunit is added for adding a tag created by the tag creation subunit to the function to be modified in the source code through the external interface.
  • the information acquiring unit specifically includes: a location information acquiring subunit, configured to use the identifier to obtain information about the function to be modified in the binary file, The information is compared with the symbol table in the binary file, and the position of the function to be modified in the binary file is obtained according to the result of the comparison, and the information of the function to be modified in the binary file includes: Changing the function name of the function in the binary file, or the start address of the function to be changed in the binary file;
  • a relocation information obtaining sub-unit configured to add a compiling attribute to the function to be changed, where the added compiling attribute is used to save the function to be modified into a separate segment of the binary file, according to the The compiled attribute again compiles the source code into a binary file to obtain relocation information of the function to be modified in the binary file.
  • the location information acquisition subunit compares the information with a symbol table in a binary file, including:
  • the information obtained by the tag is a function name of the function to be modified in the binary file, and the function name of the function to be changed in the binary file is compared with a symbol table in the binary file to query Obtaining a start address of the function to be modified in the binary file;
  • the function name and the start address of the function to be modified in the binary file are used as location information of the to-be-modified function in the binary file.
  • a mark is added to the function to be modified, the source code is compiled into a binary file, and position information and relocation information of the function to be modified in the binary file are obtained by the mark, so that in subsequent operations,
  • the hot patch file quickly detects and recognizes the changed code according to the location information and the relocation information, and corrects the function to be changed in the software, without comparing the source code before and after the compilation, and the implementation is simple, and the recognition is also ensured. Accuracy and reliability.
  • FIG. 1 is a flowchart of a code change detecting method according to an embodiment of the present invention.
  • step S102 provided by Embodiment 1 of the present invention
  • FIG. 3 is a structural diagram of a code change detecting apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of a code change detecting apparatus according to an embodiment of the present invention. detailed description
  • FIG. 1 is a flowchart of a code change detecting method according to an embodiment of the present invention, where the method includes the following steps:
  • step S101 a flag is added to the function to be changed in the source code, and the flag is used to locate the function to be changed in the binary file obtained after the source code is compiled.
  • the program is composed of source code
  • the program often has problems during the running process, and the problem needs to be corrected when the problem occurs, and the patch file is in the program composed of the source code.
  • the problem is corrected.
  • the patch file generally replaces or modifies one or more functions (functions to be changed) in the source code, so it is necessary to obtain the location information of the function to be modified.
  • the specific marking method is as follows:
  • the mark creator can create a mark by various forms.
  • the mark includes but is not limited to: a code with special effects or a macro for extracting information, by which the marked wait can be verified. Change the function. An interface for adding to the function to be changed is also included in the tag created.
  • the process of adding a mark to the function to be modified may be done manually, or may be automatically added by the tool.
  • step S102 the source code is compiled into a binary file, and position information and relocation information of the function to be modified in the binary file are obtained according to the mark.
  • the source code is compiled, the source code is compiled into a binary file, and the location information and the relocation information of the function to be modified in the binary file are obtained through analysis. Its The specific implementation process is shown in Figure 2 and the description of Figure 2.
  • a mark is added to the function to be modified, the source code is compiled into a binary file, and position information and relocation information of the function to be modified in the binary file are obtained by the mark, so that in subsequent operations,
  • the hot patch file corrects the function to be changed in the software according to the location information and the relocation information, and the technology is not only simple to implement, but also does not need to compare the source code before and after compiling.
  • FIG. 2 is a flowchart of a specific implementation of step S102 according to Embodiment 1 of the present invention, including: performing, in step S201, performing the marking to obtain information about the function to be modified in the binary file, The information is compared with the symbol table in the binary file, and the position of the function to be modified in the binary file is obtained according to the result of the comparison, and the information includes: a function name of the function to be modified in the binary file Or the start address of the function to be changed in the binary file.
  • the function to be changed in the source code after the source code is compiled into a binary file, the function to be changed in the source code generates corresponding information, and the mark records the information, and by executing the mark, the information.
  • the information comprising: a function name of the function to be modified in the binary file Or the start address of the function to be modified in the binary file, the function name and the start address are corresponding relationships in the symbol table, and obtaining one of them can obtain another one correspondingly, and can be determined according to the function name and the start address.
  • the location of the function to be changed in the binary file .
  • the comparing the information with a symbol table in a binary file including:
  • the function name of the function to be modified in the binary file is compared with the symbol table in the binary file to obtain a start address of the function to be modified in the binary file;
  • step S202 a compiled attribute is added to the function to be changed, and the added compiled attribute is used to save the function to be modified into a separate segment of the binary file, and according to the compiled attribute again
  • the source code is compiled into a binary file to obtain relocation information of the function to be modified in the binary file.
  • the function to be modified is saved to the compiled attribute in the independent segment of the binary file for the function to be modified, and the source code is compiled again, that is, the function to be changed can be obtained. Relocation information in the source code compiled into a binary file.
  • the patcher creates a tag containing an external interface, the tag being: a code or a macro that extracts information;
  • FIG. 3 is a structural diagram of a code change detecting apparatus according to an embodiment of the present invention. For convenience of description, only parts related to the embodiment of the present invention are shown, including:
  • a tag adding unit 31 configured to add a tag to a function to be changed in the source code, where the tag is used to locate the function to be changed in a binary file obtained after the source code is compiled, and the binary file is passed Compiled source code.
  • the program is composed of source code, and the program often has problems during the running process, and the problem needs to be corrected when the problem occurs, and the patch file is in the program composed of the source code.
  • the problem is corrected.
  • the patch file generally replaces or modifies one or more functions (functions to be changed) in the source code, so it is necessary to obtain the location information of the function to be changed.
  • the tag adding unit 31 specifically includes:
  • a tag creation subunit 311 for creating a tag containing an external interface the tag is: Or a macro that extracts information.
  • the mark creation sub-unit 311 can create a mark by various forms.
  • the mark includes but is not limited to: a code with special effects or a macro for extracting information, by which the mark can be checked.
  • An external interface for adding to the function to be modified is also included in the tag created.
  • the adding subunit 312 is configured to add the tag created by the tag creating subunit 311 to the function to be modified in the source code through the external interface.
  • the process of adding a mark to the function to be modified may be done manually, or may be automatically added by the tool.
  • the compiling unit 32 is configured to compile the source code added by the tag adding unit 31 into a binary file.
  • the information obtaining unit 33 is configured to acquire location information and relocation information of the function to be modified in the binary file compiled by the compiling unit 32 according to the tag added by the tag adding unit 31.
  • the source code is compiled, the source code is compiled into a binary file, and the location information and the relocation information of the function to be modified in the binary file are obtained through analysis.
  • the information acquiring unit 33 specifically includes:
  • the location information obtaining sub-unit 331 is configured to obtain information about the function to be modified in the binary file by using the identifier, compare the information with a symbol table in the binary file, and obtain the location according to the result of the comparison.
  • the position of the modification function in the binary file is mentioned, the information includes: a function name of the function to be modified in the binary file, or a start address of the function to be modified in the binary file.
  • the function to be changed in the source code after the source code is compiled into a binary file, the function to be changed in the source code generates corresponding information, and the mark records the information, and by executing the mark, the information.
  • the information comprising: a function name of the function to be modified in the binary file Or the start address of the function to be modified in the binary file, the function name and the start address are corresponding relationships in the symbol table, and obtaining one of them can obtain another one correspondingly, and can be determined according to the function name and the start address.
  • the location of the function to be changed in the binary file The location information acquisition sub-unit 331 compares the information with a symbol table in a binary file, and obtains location information of the to-be-modified function in the binary file according to the result of the comparison, which is specifically implemented by the following manner. :
  • a relocation information obtaining sub-unit 332 configured to add a compiling attribute to the function to be changed, where the added compiling attribute is used to save the function to be modified to the independent of the binary file
  • the source code is compiled into a binary file according to the compiled attribute to obtain relocation information of the function to be modified in the binary file.
  • a compilation attribute that saves the function to be modified to a separate segment of the binary file is added to the function to be modified. Compiling the source code again, the relocation information of the function to be modified in the source code compiled into the binary file can be obtained, and the technology is not only simple to implement, but also does not need to compare the source code before and after compiling.
  • the code change detecting apparatus of this embodiment includes: at least one processor 401, a memory 402, a communication interface 403, and a bus. The processor 401, the memory 402, and the communication interface 403 are connected by a bus and complete communication with each other.
  • the bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Componet Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA). Bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Componet Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 4, but it does not mean that there is only one bus or one type of bus. among them:
  • Memory 402 is for storing executable program code, the program code including computer operating instructions.
  • the memory 402 may include a high speed RAM memory, and may also include a non-volatile memory, and at least one of the memory devices.
  • the processor 401 operates on the program corresponding to the executable program code by reading the executable program code stored in the memory 402 for:
  • Adding a mark to the function to be changed in the source code the mark being used to locate the function to be changed in a binary file obtained after the source code is compiled; Compiling the source code into a binary file, and acquiring location information and relocation information of the function to be modified in the binary file according to the mark.
  • the processor 401 runs a program corresponding to the executable program code by reading executable program code stored in the memory 402 for:
  • Creating a tag containing an external interface the tag being: a code or a macro that extracts information; the tag is added to the function to be altered in the source code via the external interface.
  • the processor 401 runs a program corresponding to the executable program code by reading executable program code stored in the memory 402 for:
  • Performing the tag obtaining the information of the function to be modified in the binary file in the tag, comparing the information with a symbol table in the binary file, and acquiring the to-be-modified according to the result of the comparison a location of the function in the binary file, the information comprising: a function name of the function to be modified in the binary file, or a start address of the function to be modified in the binary file; adding to the function to be changed Compiling an attribute, the added compiled attribute is used to save the function to be modified into a separate segment of the binary file, and compiling the source code into a binary file according to the compiled attribute to obtain the The relocation information of the function to be modified in the binary file.
  • the processor 401 runs a program corresponding to the executable program code by reading executable program code stored in the memory 402 for:
  • the information is a function name of the function to be modified in the binary file, comparing a function name of the function to be modified in the binary file with a symbol table in a binary file to obtain the The start address of the function to be modified in the binary file;
  • the information is the start address of the function to be changed in the binary file
  • the starting address of the modified function in the binary file is compared with the symbol table in the binary file to obtain the function name of the function to be modified in the binary file.
  • the processor 401 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more configured to implement the embodiments of the present invention. integrated circuit.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the foregoing processor 401 may be used to perform other processes in the foregoing method embodiments, and details are not described herein again.
  • the communication interface 403 is mainly used to implement communication between the traffic source determining device of the present embodiment and other devices or devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本发明适用于代码检测领域,提供了一种代码改动的检测方法和装置,所述方法包括:为源代码中待改动的函数添加标记;编译所述源代码,根据所述标记获取所述待改动的函数在编译后的源代码中的位置信息和重定位信息。本发明实施例,为待改动函数添加标记,将源代码编译为二进制文件,通过所述标记获取所述待改动函数在所述二进制文件中的位置信息和重定位信息,以使后续操作中,热补丁文件根据所述位置信息和重定位信息,对软件中待改动的函数进行改正,不仅实现的技术简单,而且无需比较编译前后的源代码。

Description

一种代码改动的检测方法和装置 本申请要求于 2012 年 11 月 30 日提交中国专利局、 申请号为 201210504577.7 , 发明名称为 "一种代码改动的检测方法和装置" 的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明属于计算机领域, 尤其涉及一种代码改动的检测方法和装置。 背景技术
软件的生产和使用过程中, 经常会发现各种潜在的问题,解决的方法一般 是为该软件创建一个源代码级的补丁。 热补丁是一种可以修复软件漏洞的代 码, 其特点是不会中断软件的运行, 只需要对源代码中待改动的函数进行修改 或替换即可, 即通过分析程序找出那些函数代码发生了变化,从而可以替代这 些函数代码, 在运行过程中替换函数来达到热补丁的效果。
现有技术中,对于识别和定位发生变化的程序代码的方法,分成两种不同 的实现方案,一种是通过分析对比源代码来识别, 另一种是通过比较程序编译 之后的二进制文件来识别。其中,第一种方法复杂度比较高,而且有诸多限制, 如 inline类型的函数就无法知道其最后的编译效果, 从而导致无法提取真正有 效的函数变动代码,识别的准确度得不到保证; 而第二种方法需要编译补丁前 和补丁后两个程序, 然后比较编译好之后的二进制代码, 复杂度较高, 比较耗 时, 而且这种方法需要使用较多的编译器选项, 有些编译选项可能存在冲突, 从而影响识别的可靠性。 发明内容
本发明实施例的目的在于提供一种代码改动的检测方法和装置,旨在更高 效地检测识别出发生改动的代码, 降低识别的复杂度, 并提高识别的准确度和 可靠性。
本发明实施例是这样实现的, 第一方面, 本发明实施例提供一种代码改动 的检测方法, 所述方法包括:
为源代码中待改动的函数添加标记,所述标记用于在所述源代码编译后得 到的二进制文件中定位所述待改动的函数;
将所述源代码编译为二进制文件 ,根据所述标记获取所述待改动的函数在 所述二进制文件中的位置信息和重定位信息。
在第一方面的第一种可能的实施方式中,所述为源代码中待改动的函数添 力口标己, 包括:
创建包含外部接口的标记, 所述标记为: 代码或提取信息的宏; 通过所述外部接口将所述标记添加到源代码中待改动的函数。
在第一方面的第二种可能的实施方式中,所述根据所述标记获取所述待改 动的函数在所述二进制文件中的位置信息和重定位信息, 包括:
执行所述标记以获取所述待改动函数在所述二进制文件中的信息,将所述 信息与二进制文件中的符号表进行对比,根据所述对比的结果得出所述待改动 函数在所述二进制文件中的位置信息,所述待改动函数在所述二进制文件中的 信息包括: 所述待改动函数在所述二进制文件中的函数名、或所述待改动函数 在所述二进制文件中的开始地址;
为所述待改动的函数增加编译属性,增加的所述编译属性用于将所述待改 动的函数保存到所述二进制文件的独立的段中,根据所述编译属性再次将所述 源代码编译为二进制文件,并获取所述待改动的函数在所述二进制文件中的重 定位信息。
结合第一方面的第二种可能的实施方式,在第三种可能的实施方式中, 所 述将所述信息与二进制文件中的符号表进行对比,根据所述对比的结果获取所 述待改动函数在所述二进制文件中的位置信息, 包括:
如果所述信息为所述待改动函数在所述二进制文件中的函数名,则将所述 待改动函数在所述二进制文件中的函数名与二进制文件中的符号表进行对比, 以查询得出所述待改动函数在所述二进制文件中的开始地址;
如果所述信息为所述待改动函数在所述二进制文件中的开始地址 ,则将所 述待改动函数在所述二进制文件中的开始地址与二进制文件中的符号表进行 对比, 以查询得出所述待改动函数在所述二进制文件中的函数名;
将所述待改动函数在所述二进制文件中的函数名和开始地址作为所述待 改动函数在所述二进制文件中的位置信息。
第二方面, 本发明实施例提供一种代码改动的检测装置, 所述装置包括: 标记添加单元 ,用于为源代码中待改动的函数添加标记, 所述标记用于在 所述源代码编译后得到的二进制文件中定位所述待改动的函数;
编译单元,用于将经过所述标记添加单元添加标记的源代码编译为二进制 文件;
信息获取单元,用于根据所述标记添加单元添加的标记获取所述待改动的 函数在在所述编译单元编译的二进制文件中的位置信息和重定位信息。
在第二方面的第一种可能的实施方式中, 所述标记添加单元具体包括: 标记创建子单元, 用于创建包含外部接口的标记, 所述标记为: 代码或提 取信息的宏;
添加子单元,用于通过所述外部接口将所述标记创建子单元创建的标记添 加到源代码中待改动的函数。
在第二方面的第二种可能的实施方式中, 所述信息获取单元具体包括: 位置信息获取子单元,用于利用所述标记来获取所述待改动函数在所述二 进制文件中的信息,将所述信息与二进制文件中的符号表进行对比,根据所述 对比的结果得出所述待改动函数在所述二进制文件中的位置,待改动函数在所 述二进制文件中的信息包括: 待改动函数在所述二进制文件中的函数名、或待 改动函数在所述二进制文件中的开始地址;
重定位信息获取子单元, 用于为所述待改动的函数增加编译属性,增加的 所述编译属性用于将所述待改动的函数保存到所述二进制文件的独立的段中, 根据所述编译属性再次将所述源代码编译为二进制文件,以获取所述待改动的 函数在所述二进制文件中的重定位信息。
结合第二方面的第二种可能的实施方法,在第三种可能的实施方法中, 所 述位置信息获取子单元将所述信息与二进制文件中的符号表进行对比, 包括: 当利用所述标记获取的所述信息为所述待改动函数在所述二进制文件中 的函数名时,将所述待改动函数在所述二进制文件中的函数名与二进制文件中 的符号表进行对比,以查询得到所述待改动函数在所述二进制文件中的开始地 址;
当利用所述标记获取的所述信息为所述待改动函数在所述二进制文件中 的开始地址时,将所述待改动函数在所述二进制文件中的开始地址与二进制文 件中的符号表进行对比,以查询得到所述待改动函数在所述二进制文件中的函 数名;
将所述待改动函数在所述二进制文件中的函数名和开始地址作为所述待 改动函数在所述二进制文件中的位置信息。
本发明实施例, 为待改动函数添加标记, 将源代码编译为二进制文件, 通 过所述标记获取所述待改动函数在所述二进制文件中的位置信息和重定位信 息, 以使后续操作中, 热补丁文件根据所述位置信息和重定位信息, 快速检测 识别出发生改动的代码, 并对软件中待改动的函数进行改正, 无需比较编译前 后的源代码, 实现简单, 同时也保证了识别的准确度和可靠性。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是 本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的 前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例提供的代码改动检测方法的流程图;
图 2是本发明实施例 1提供的步骤 S102的具体实现流程图;
图 3是本发明实施例提供的代码改动检测装置的结构图;
图 4是本发明实施例提供的代码改动检测设备的结构图。 具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白, 以下结合附图及实 施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅 仅用以解释本发明, 并不用于限定本发明。
如图 1所示为本发明实施例提供的代码改动检测方法的流程图,所述方法 包括以下步骤:
在步骤 S101中, 为源代码中待改动的函数添加标记, 所述标记用于在所 述源代码编译后得到的二进制文件中定位所述待改动的函数。
在本发明实施例中,程序是由源代码构成的, 而程序在运行过程中常常会 出现问题, 在出现问题时需要对这些问题进行修正, 而补丁文件就是对由源代 码构成的程序中的问题进行修正的文件。补丁文件一般是对源代码中的某一段 或几段函数 (待改动函数)进行替换或修改, 因此需要获取待改动函数的位置 信息。 其具体的标记方法如下:
a、 创建包含外部接口的标记, 所述标记为: 代码或提取信息的宏。
在本发明实施例中, 标记创建人员可以通过多种形式创建标记, 具体的, 该标记包括但不限于: 带有特殊效果的代码或提取信息的宏,通过所述代码可 以检验被标记的待改动函数。在创建的所述标记中还包括用于添加到待改动函 数的接口。
b、 通过所述外部接口将所述标记添加到源代码中待改动的函数。
在本发明实施例中, 为待改动的函数添加标记的过程可以由人工完成, 也 可以由工具自动添力口。
在步骤 S102中, 将所述源代码编译为二进制文件, 根据所述标记获取所 述待改动的函数在所述二进制文件中的位置信息和重定位信息。
在本发明实施例中,对所述源代码进行编译,源代码被编译为二进制文件, 通过分析, 获取待改动函数在所述二进制文件中的位置信息和重定位信息。其 具体的实现流程详见图 2以及对图 2的描述。
本发明实施例, 为待改动函数添加标记, 将源代码编译为二进制文件, 通 过所述标记获取所述待改动函数在所述二进制文件中的位置信息和重定位信 息, 以使后续操作中, 热补丁文件根据所述位置信息和重定位信息, 对软件中 待改动的函数进行改正, 不仅实现的技术简单, 而且无需比较编译前后的源代 码。
如图 2所示为本发明实施例 1提供的步骤 S102的具体实现流程图,包括: 在步骤 S201中, 执行所述标记以获取所述待改动函数在所述二进制文件 中的信息, 将所述信息与二进制文件中的符号表进行对比,根据所述对比的结 果得到所述待改动函数在所述二进制文件中的位置, 所述信息包括: 待改动函 数在所述二进制文件中的函数名、或待改动函数在所述二进制文件中的开始地 址。
在本发明实施例中,在源代码被编译为二进制文件之后, 源代码中的待改 动的函数会产生相应的信息, 所述标记会记录所述信息, 通过执行所述标记, 可以获取所述信息。将所述信息与二进制文件中的符号表进行对比,根据对比 的结果获取所述待改动函数在所述二进制文件中的位置, 所述信息包括: 待改 动函数在所述二进制文件中的函数名、或待改动函数在所述二进制文件中的开 始地址, 函数名和开始地址在所述符号表中是对应的关系, 获取其中的一个就 可以对应的获取另一个,根据函数名和开始地址就可以确定待改动函数在所述 二进制文件中的位置。 。 所述将所述信息与二进制文件中的符号表进行对比, 包括:
a、 如果所述信息为所述待改动函数在所述二进制文件中的函数名, 则将 所述待改动函数在所述二进制文件中的函数名与二进制文件中的符号表进行 对比, 以获取所述待改动函数在所述二进制文件中的开始地址;
b、 当所述信息中不包括函数名时, 将所述待改动函数在所述二进制文件 中的开始地址与二进制文件中的符号表进行对比。
上述对比过程完成后,就可以得到待改动函数在所述二进制文件中的函数 名和开始地址; 其中,得到的函数名和开始地址即为所述待改动函数在所述二 进制文件中的位置信息。 在步骤 S202中, 为所述待改动的函数增加编译属性, 增加的所述编译属 性用于将所述待改动的函数保存到所述二进制文件的独立的段中,根据所述编 译属性再次将所述源代码编译为二进制文件,以获取所述待改动的函数在所述 二进制文件中的重定位信息。
在本发明实施例中,为待改动的函数增加将所述待改动的函数保存到所述 二进制文件的独立的段中的编译属性, 再次编译所述源代码, 即可以获取所述 待改动函数在编译为二进制文件的源代码中的重定位信息。
举例说明:
此处以 linux装置为例, 说明如何检测代码的改动:
1、 补丁人员创建包含外部接口的标记, 所述标记为: 代码或提取信息的 宏;
2、 通过手动或自动的添加, 通过所述外部接口将所述标记添加到源代码 中待改动的函数;
3、将所述源代码编译为二进制文件, 可以通过各种编译器, 如 gcc ( GNU C Compiler GNU C语言编译器)
4、 调用信息读取工具读取所述二进制文件, 并分析保存所述标记的二进 制文件的段, 获取: 待改动函数在所述二进制文件中的函数名, 待改动函数在 所述二进制文件中的开始地址和待改动函数在所述;
5、 将所述待改动函数在所述二进制文件中的函数名或开始地址与所述二 进制文件的符号表进行对比,根据对比结果获取所述待改动函数在所述二进制 文件中的地址;
6、 为所述源代码添加将所述待改动的函数保存到所述二进制文件的独立 的段中的编译属性;
7、 再次编译将所述源代码编译为二进制文件, 获取所述待改动函数在所 述二进制文件中的重定位信息。
如图 3所示为本发明实施例提供的代码改动检测装置的结构图,为了便于 说明, 仅示出与本发明实施例相关的部分, 包括:
标记添加单元 31 , 用于为源代码中待改动的函数添加标记, 所述标记用 于在所述源代码编译后得到的二进制文件中定位所述待改动的函数,所述二进 制文件为经过的编译的源代码。
在本发明实施例中,程序是由源代码构成的, 而程序在运行过程中常常会 出现问题, 在出现问题时需要对这些问题进行修正, 而补丁文件就是对由源代 码构成的程序中的问题进行修正的文件。补丁文件一般是对源代码中的某一段 或几段函数(待改动函数)进行替换或修改, 因此需要获取待改动函数的位置 信息。 所述标记添加单元 31具体包括:
标记创建子单元 311 , 用于创建包含外部接口的标记, 所述标记为: 代码 或提取信息的宏。
在本发明实施例中, 标记创建子单元 311可以通过多种形式创建标记, 具 体的, 该标记包括但不限于: 带有特殊效果的代码或提取信息的宏, 通过所述 代码可以检验被标记的待改动函数。在创建的所述标记中还包括用于添加到待 改动函数的外部接口。
添加子单元 312, 用于通过所述外部接口将所述标记创建子单元 311创建 的标记添加到源代码中待改动的函数。
在本发明实施例中, 为待改动的函数添加标记的过程可以由人工完成, 也 可以由工具自动添力口。
编译单元 32 , 用于将经过所述标记添加单元 31添加标记的源代码编译为 二进制文件。
信息获取单元 33 , 用于根据所述标记添加单元 31添加的标记获取所述待 改动的函数在所述编译单元 32 编译的二进制文件中的位置信息和重定位信 息。
在本发明实施例中,对所述源代码进行编译,源代码被编译为二进制文件, 通过分析, 获取待改动函数在所述二进制文件中的位置信息和重定位信息。其 中所述信息获取单元 33具体包括:
位置信息获取子单元 331 , 用于利用所述标记获取所述待改动函数在所述 二进制文件中的信息,将所述信息与二进制文件中的符号表进行对比,根据所 述对比的结果获取所述待改动函数在所述二进制文件中的位置, 所述信息包 括: 待改动函数在所述二进制文件中的函数名、或待改动函数在所述二进制文 件中的开始地址。 在本发明实施例中,在源代码被编译为二进制文件之后, 源代码中的待改 动的函数会产生相应的信息, 所述标记会记录所述信息, 通过执行所述标记, 可以获取所述信息。将所述信息与二进制文件中的符号表进行对比,根据对比 的结果获取所述待改动函数在所述二进制文件中的位置, 所述信息包括: 待改 动函数在所述二进制文件中的函数名、或待改动函数在所述二进制文件中的开 始地址, 函数名和开始地址在所述符号表中是对应的关系, 获取其中的一个就 可以对应的获取另一个,根据函数名和开始地址就可以确定待改动函数在所述 二进制文件中的位置。所述位置信息获取子单元 331将所述信息与二进制文件 中的符号表进行对比,根据所述对比的结果得出所述待改动函数在所述二进制 文件中的位置信息, 具体通过如下方式实现:
a、 当利用所述标记获取的所述信息为所述待改动函数在所述二进制文件 中的函数名时,将所述待改动函数在所述二进制文件中的函数名与二进制文件 中的符号表进行对比,以查询得到所述待改动函数在所述二进制文件中的开始 地址;
b、 当利用所述标记获取的所述信息为所述待改动函数在所述二进制文件 中的开始地址时,将所述待改动函数在所述二进制文件中的开始地址与二进制 文件中的符号表进行对比,以查询得到所述待改动函数在所述二进制文件中的 函数名;
c、 将上述获取的函数名和开始地址确定为待改动函数在所述二进制文件 中的位置信息。
重定位信息获取子单元 332 , 用于为所述待改动的函数增加编译属性, 增 加的所述编译属性用于将所述待改动的函数保存到所述二进制文件的独立的 段中,根据所述编译属性再次将所述源代码编译为二进制文件, 以获取所述待 改动的函数在所述二进制文件中的重定位信息。
在本发明实施例中,为待改动的函数增加将所述待改动的函数保存到所述 二进制文件的独立的段中的编译属性, 。 再次编译所述源代码, 即可以获取所 述待改动函数在编译为二进制文件的源代码中的重定位信息,不仅实现的技术 简单, 而且无需比较编译前后的源代码。 。 示, 本实施例的代码改动检测设备包括: 至少一个处理器 401、 存储器 402、 通信接口 403和总线。 处理器 401、 存储器 402和通信接口 403通过总线连接 并完成相互间的通信。 所述总线可以是工业标准体系结构 (Industry Standard Architecture,简称为 ISA )总线、夕卜部设备互连( Peripheral Componet Interconnect 简称为 PCI ) 总线或扩展工业标准体系结构 (Extended Industry Standard Architecture, 简称为 EISA ) 总线等。 所述总线可以分为地址总线、 控制总线 等。 为了便于表示, 图 4中仅用一条粗线表示, 但并不表示仅有一根总线或一 种类型的总线。 其中:
存储器 402用于存储可执行程序代码, 该程序代码包括计算机操作指令。 存储器 402 可能包含高速 RAM 存储器, 也可能还包括非易失性存储器 ( non- volatile memory ) , 例 口至少一个存盘存 4诸器。
在一个实施例中,处理器 401通过读取存储器 402中存储的可执行程序代 码来运行于所述可执行程序代码对应的程序, 以用于:
为源代码中待改动的函数添加标记,所述标记用于在所述源代码编译后得 到的二进制文件中定位所述待改动的函数; 将所述源代码编译为二进制文件 ,根据所述标记获取所述待改动的函数在 所述二进制文件中的位置信息和重定位信息。
再另一个实施例中,处理器 401通过读取存储器 402中存储的可执行程序 代码运行与所述可执行程序代码对应的程序, 用于:
创建包含外部接口的标记, 所述标记为: 代码或提取信息的宏; 通过所述外部接口将所述标记添加到源代码中待改动的函数。
在另一个实施例中,处理器 401通过读取存储器 402中存储的可执行程序 代码运行与所述可执行程序代码对应的程序, 用于:
执行所述标记 ,以所述标记中获取所述待改动函数在所述二进制文件中的 信息,将所述信息与二进制文件中的符号表进行对比,根据所述对比的结果获 取所述待改动函数在所述二进制文件中的位置, 所述信息包括: 待改动函数在 所述二进制文件中的函数名、 或待改动函数在所述二进制文件中的开始地址; 为所述待改动的函数增加编译属性,增加的所述编译属性用于将所述待改 动的函数保存到所述二进制文件的独立的段中,根据所述编译属性再次将所述 源代码编译为二进制文件,以获取所述待改动的函数在所述二进制文件中的重 定位信息。
在另一个实施例中,处理器 401通过读取存储器 402中存储的可执行程序 代码运行与所述可执行程序代码对应的程序, 用于:
如果所述信息为所述待改动函数在所述二进制文件中的函数名,则将所述 待改动函数在所述二进制文件中的函数名与二进制文件中的符号表进行对比, 以获取所述待改动函数在所述二进制文件中的开始地址;
如果所述信息为所述待改动函数在所述二进制文件中的开始地址 ,则将所 述待改动函数在所述二进制文件中的开始地址与二进制文件中的符号表进行 对比, 以获取所述待改动函数在所述二进制文件中的函数名。
处理器 401可能是一个中央处理器( Central Processing Unit,简称为 CPU ), 或者是特定集成电路 ( Application Specific Integrated Circuit, 简称为 ASIC ) , 或者是被配置成实施本发明实施例的一个或多个集成电路。
需说明的是, 上述处理器 401除了具有上述功能之外,还可用于执行上述 方法实施例中的其他流程, 再次不再赘述。
通信接口 403 主要用于实现本实施例的流量来源确定设备与其他设备或 装置之间的通信。
以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明,凡在本发 明的精神和原则之内所作的任何修改、等同替换和改进等, 均应包含在本发明 的保护范围之内。

Claims

权 利 要 求
1、 一种代码改动的检测方法, 其特征在于, 所述方法包括:
为源代码中待改动的函数添加标记,所述标记用于在所述源代码编译后得 到的二进制文件中定位所述待改动的函数;
将所述源代码编译为二进制文件 ,根据所述标记获取所述待改动的函数在 所述二进制文件中的位置信息和重定位信息。
2、 如权利要求 1所述的方法, 其特征在于, 所述为源代码中待改动的函 数添力口标记, 包括:
创建包含外部接口的标记, 所述标记为: 代码或提取信息的宏; 通过所述外部接口将所述标记添加到所述源代码中待改动的函数。
3、 如权利要求 1所述的方法, 其特征在于, 所述根据所述标记获取所述 待改动的函数在所述二进制文件中的位置信息和重定位信息, 包括:
执行所述标记以获取所述待改动函数在所述二进制文件中的信息,将所述 信息与二进制文件中的符号表进行对比,根据所述对比的结果得出所述待改动 函数在所述二进制文件中的位置信息,所述待改动函数在所述二进制文件中的 信息包括: 所述待改动函数在所述二进制文件中的函数名、或所述待改动函数 在所述二进制文件中的开始地址;
为所述待改动的函数增加编译属性,增加的所述编译属性用于将所述待改 动的函数保存到所述二进制文件的独立的段中 ,根据所述编译属性再次将所述 源代码编译为二进制文件,以获取所述待改动的函数在所述二进制文件中的重 定位信息。
4、 如权利要求 3所述的方法, 其特征在于, 所述将所述信息与二进制文 件中的符号表进行对比,根据所述对比的结果获取所述待改动函数在所述二进 制文件中的位置信息, 包括:
如果所述信息为所述待改动函数在所述二进制文件中的函数名,则将所述 待改动函数在所述二进制文件中的函数名与二进制文件中的符号表进行对比, 以查询得出所述待改动函数在所述二进制文件中的开始地址;
如果所述信息为所述待改动函数在所述二进制文件中的开始地址 ,则将所 述待改动函数在所述二进制文件中的开始地址与二进制文件中的符号表进行 对比, 以查询得出所述待改动函数在所述二进制文件中的函数名;
将所述待改动函数在所述二进制文件中的函数名和开始地址作为所述待 改动函数在所述二进制文件中的位置信息。
5、 一种代码改动的检测装置, 其特征在于, 所述装置包括:
标记添加单元 ,用于为源代码中待改动的函数添加标记, 所述标记用于在 所述源代码编译后得到的二进制文件中定位所述待改动的函数;
编译单元,用于将经过所述标记添加单元添加标记的源代码编译为二进制 文件;
信息获取单元,用于根据所述标记添加单元添加的标记获取所述待改动的 函数在在所述编译单元编译的二进制文件中的位置信息和重定位信息。
6、 如权利要求 5所述的装置, 其特征在于, 所述标记添加单元具体包括: 标记创建子单元, 用于创建包含外部接口的标记, 所述标记为: 代码或提 取信息的宏; 添加子单元,用于通过所述外部接口将所述标记创建子单元创建的标记添 加到源代码中待改动的函数。
7、 如权利要求 5所述的装置, 其特征在于, 所述信息获取单元具体包括: 位置信息获取子单元,用于利用所述标记来获取所述待改动函数在所述二 进制文件中的信息,将所述信息与二进制文件中的符号表进行对比,根据所述 对比的结果得出所述待改动函数在所述二进制文件中的位置信息,待改动函数 在所述二进制文件中的信息包括: 待改动函数在所述二进制文件中的函数名、 或待改动函数在所述二进制文件中的开始地址;
重定位信息获取子单元, 用于为所述待改动的函数增加编译属性,增加的 所述编译属性用于将所述待改动的函数保存到所述二进制文件的独立的段中 , 根据所述编译属性再次将所述源代码编译为二进制文件,以获取所述待改动的 函数在所述二进制文件中的重定位信息。
8、 如权利要求 7所述的装置, 其特征在于, 所述位置信息获取子单元具 体用于:
当利用所述标记获取的所述信息为所述待改动函数在所述二进制文件中 的函数名时,将所述待改动函数在所述二进制文件中的函数名与二进制文件中 的符号表进行对比,以查询得到所述待改动函数在所述二进制文件中的开始地 址;
当利用所述标记获取的所述信息为所述待改动函数在所述二进制文件中 的开始地址时,将所述待改动函数在所述二进制文件中的开始地址与二进制文 件中的符号表进行对比,以查询得到所述待改动函数在所述二进制文件中的函 数名; 将所述待改动函数在所述二进制文件中的函数名和开始地址作为所述待 改动函数在所述二进制文件中的位置信息。
PCT/CN2013/074723 2012-11-30 2013-04-25 一种代码改动的检测方法和装置 Ceased WO2014082422A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP13779107.5A EP2778629A4 (en) 2012-11-30 2013-04-25 METHOD AND DEVICE FOR DETECTING CODE CHANGES
US14/088,658 US9342285B2 (en) 2012-11-30 2013-11-25 Method and apparatus for detecting code change
US15/066,827 US10019240B2 (en) 2012-11-30 2016-03-10 Method and apparatus for detecting code change

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210504577.7 2012-11-30
CN201210504577.7A CN103077062B (zh) 2012-11-30 2012-11-30 一种代码改动的检测方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/088,658 Continuation US9342285B2 (en) 2012-11-30 2013-11-25 Method and apparatus for detecting code change

Publications (1)

Publication Number Publication Date
WO2014082422A1 true WO2014082422A1 (zh) 2014-06-05

Family

ID=48153599

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/074723 Ceased WO2014082422A1 (zh) 2012-11-30 2013-04-25 一种代码改动的检测方法和装置

Country Status (4)

Country Link
US (2) US9342285B2 (zh)
EP (1) EP2778629A4 (zh)
CN (1) CN103077062B (zh)
WO (1) WO2014082422A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115437685A (zh) * 2022-07-29 2022-12-06 西安深信科创信息技术有限公司 一种函数定位方法、装置和电子设备
CN117193872A (zh) * 2023-08-28 2023-12-08 杭州极钛微电子有限公司 一种基于符号表动态执行的芯片启动固件装置和方法

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077062B (zh) 2012-11-30 2016-08-03 华为技术有限公司 一种代码改动的检测方法和装置
WO2015176492A1 (en) * 2014-05-21 2015-11-26 Huawei Technologies Co., Ltd. A system and method thereof for creating dynamically attachable and detachable binary files
CN105354045A (zh) * 2014-08-21 2016-02-24 中兴通讯股份有限公司 补丁的制作方法及装置、补丁的激活方法及装置
US9639350B2 (en) 2014-12-15 2017-05-02 Red Hat, Inc. Tagging non-upstream source code
CN105068796A (zh) * 2015-07-22 2015-11-18 用友金融信息技术有限公司 补丁程序集的推送方法和补丁程序集的推送系统
CN105183789A (zh) * 2015-08-21 2015-12-23 福建天晴数码有限公司 基于git源代码冲突的文件合并方法及系统
CN107885527A (zh) * 2016-09-27 2018-04-06 北京嘀嘀无限科技发展有限公司 一种测试系统的代码修改方法及装置
CN108268266A (zh) * 2016-12-29 2018-07-10 中移(苏州)软件技术有限公司 一种升级方法和装置
US10698668B1 (en) * 2018-05-29 2020-06-30 Amazon Technologies, Inc. Custom code transformations during compilation process
US10649763B2 (en) * 2018-06-15 2020-05-12 Microsoft Technology Licensing, Llc Resource efficient deployment of multiple hot patches
CN108875320B (zh) * 2018-07-17 2021-10-08 北京元心科技有限公司 软件安全防护方法、装置、电子设备及计算机存储介质
US10983857B2 (en) 2018-10-26 2021-04-20 International Business Machines Corporation Continuing a running script after modification
US11106460B2 (en) * 2019-09-03 2021-08-31 Electronic Arts Inc. Software change tracking and analysis
CN111221566B (zh) * 2019-12-28 2021-10-22 华为技术有限公司 一种软件代码的多变更版本合并方法及装置
CN111324481A (zh) * 2020-02-28 2020-06-23 中国工商银行股份有限公司 一种Linux平台的修复方法及装置
CN112416360B (zh) * 2020-11-25 2023-08-08 北京金山云网络技术有限公司 热补丁的生成方法、装置和服务器
CN113094040B (zh) * 2021-03-08 2024-06-28 南京唯优信息技术有限公司 一种小程序编译方法和装置
US11237952B1 (en) * 2021-04-07 2022-02-01 State Farm Mutual Automobile Insurance Company Runtime class recompilation during mutation testing
US11163675B1 (en) 2021-04-07 2021-11-02 State Farm Mutual Automobile Insurance Company Mutation testing in parallel threads
US12072790B1 (en) 2021-04-07 2024-08-27 State Farm Mutual Automobile Insurance Company Mutation testing within continuous integration systems
US11822910B2 (en) * 2021-10-14 2023-11-21 International Business Machines Corporation Reducing a delivery size of a software update
US12182553B2 (en) 2022-02-07 2024-12-31 Red Hat, Inc. User customizable compiler attributes for code optimization
US11941382B2 (en) * 2022-02-07 2024-03-26 Red Hat, Inc. User customizable compiler attributes for code checking
CN118251658A (zh) * 2022-03-03 2024-06-25 华为技术有限公司 一种二进制程序的优化方法及装置
US11928460B2 (en) * 2022-04-20 2024-03-12 International Business Machines Corporation Dynamic update of a computer program in memory
US11803371B1 (en) * 2022-10-21 2023-10-31 Aurora Labs Ltd. Symbol-matching between software versions

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US1920116A (en) * 1931-08-06 1933-07-25 American Hardware Corp Padlock
CN101916194A (zh) * 2010-06-01 2010-12-15 浙江大学 一种无线传感网节点程序的部署方法
CN102279749A (zh) * 2011-08-30 2011-12-14 大唐移动通信设备有限公司 一种代码归并方法和设备
CN102479265A (zh) * 2010-11-25 2012-05-30 上海华虹集成电路有限责任公司 修改硬掩膜产品固件错误功能的方法

Family Cites Families (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5182806A (en) * 1989-06-30 1993-01-26 Digital Equipment Corporation Incremental compiler for source-code development system
US5293629A (en) * 1990-11-30 1994-03-08 Abraxas Software, Inc. Method of analyzing computer source code
US5764992A (en) * 1995-06-06 1998-06-09 Apple Computer, Inc. Method and apparatus for automatic software replacement
US5848274A (en) * 1996-02-29 1998-12-08 Supercede, Inc. Incremental byte code compilation system
US5881290A (en) * 1996-12-09 1999-03-09 Allen-Bradley Company, Llc Industrial controller decompiler accommodating an expandable instruction set
US6311327B1 (en) * 1998-03-02 2001-10-30 Applied Microsystems Corp. Method and apparatus for analyzing software in a language-independent manner
US6654953B1 (en) * 1998-10-09 2003-11-25 Microsoft Corporation Extending program languages with source-program attribute tags
US6269442B1 (en) * 1998-11-13 2001-07-31 Hewlett-Packard Company Apparatus and method for on-line replacement of a running program code and data using checkpoints
US6314567B1 (en) * 1998-11-13 2001-11-06 Hewlett-Packard Company Apparatus and method for transferring state data when performing on-line replacement of a running program code and data
JP3690730B2 (ja) * 2000-10-24 2005-08-31 インターナショナル・ビジネス・マシーンズ・コーポレーション 構造回復システム、構文解析システム、変換システム、コンピュータ装置、構文解析方法、及び記憶媒体
US20020073410A1 (en) * 2000-12-13 2002-06-13 Arne Lundback Replacing software at a telecommunications platform
US20030056192A1 (en) * 2001-05-24 2003-03-20 Burgess Allen G. Source code analysis system and method
US20030005408A1 (en) * 2001-07-02 2003-01-02 Pradeep Tumati System and method for creating software modifiable without halting its execution
US6925635B2 (en) * 2001-12-13 2005-08-02 International Business Machines Corporation Embedded pre-processor with dynamic macro forms
CN1230744C (zh) * 2002-08-16 2005-12-07 华为技术有限公司 一种嵌入式系统软件补丁的实现和控制方法
US7096311B2 (en) * 2002-09-30 2006-08-22 Innopath Software, Inc. Updating electronic files using byte-level file differencing and updating algorithms
US7784044B2 (en) * 2002-12-02 2010-08-24 Microsoft Corporation Patching of in-use functions on a running computer system
US7627851B2 (en) * 2004-07-15 2009-12-01 Conitec Gmbh Modification method for modifying a source code
EP1755034B1 (en) * 2005-08-18 2017-01-18 Telefonaktiebolaget LM Ericsson (publ) Object code generation for increasing the performance of delta files
ATE491988T1 (de) * 2005-12-20 2011-01-15 Ericsson Telefon Ab L M Erstellung inkrementeller programmaktualisierungen
US7631294B2 (en) * 2006-09-19 2009-12-08 Black Duck Software, Inc. Notification system for source code discovery
CN100533383C (zh) 2006-11-03 2009-08-26 北京飞天诚信科技有限公司 一种对软件中的数据进行替换的方法
CN101192193A (zh) 2006-11-27 2008-06-04 国际商业机器公司 用于实现观察点的方法和系统
US7895515B1 (en) * 2007-02-28 2011-02-22 Trend Micro Inc Detecting indicators of misleading content in markup language coded documents using the formatting of the document
CN101281488A (zh) 2007-04-06 2008-10-08 上海宇梦通信科技有限公司 Linux操作系统的内核调试方法
US8839225B2 (en) * 2008-01-23 2014-09-16 International Business Machines Corporation Generating and applying patches to a computer program code concurrently with its execution
KR100961611B1 (ko) * 2008-04-29 2010-06-04 제주대학교 산학협력단 온톨로지 기반 이피씨 코드 자동 변환 방법 및 시스템
US8607208B1 (en) * 2008-10-01 2013-12-10 Oracle International Corporation System and methods for object code hot updates
US8468516B1 (en) 2008-12-19 2013-06-18 Juniper Networks, Inc. Creating hot patches for embedded systems
US8589880B2 (en) * 2009-02-17 2013-11-19 International Business Machines Corporation Identifying a software developer based on debugging information
US8612951B2 (en) 2009-04-21 2013-12-17 Oracle International Corporation Method of determining which computer program functions are changed by an arbitrary source code modification
CN101650664B (zh) 2009-06-30 2012-06-27 飞天诚信科技股份有限公司 链接方法和链接器
US8731583B2 (en) * 2010-01-04 2014-05-20 Alcatel Lucent Interactive ID system using mobile devices
US8347276B2 (en) * 2010-01-07 2013-01-01 Gunther Schadow Systems and methods for software specification and design using a unified document
US8656377B2 (en) * 2010-06-10 2014-02-18 Microsoft Corporation Tracking variable information in optimized code
US8631225B2 (en) * 2010-06-25 2014-01-14 International Business Machines Corporation Dynamically rewriting branch instructions to directly target an instruction cache location
US8370799B2 (en) * 2010-09-28 2013-02-05 International Business Machines Corporation Provision of code base modification using automatic learning of code changes
CN102023870B (zh) 2010-12-31 2013-07-24 深圳市普联技术有限公司 一种软件修改的检测方法、装置及电子设备
CN102650992B (zh) 2011-02-25 2014-07-30 国际商业机器公司 用于二进制xml数据的生成及其节点定位的方法和装置
US9405739B1 (en) * 2011-08-12 2016-08-02 The Boeing Company Source code format for IDE code development with embedded objects
CN102521222B (zh) 2011-12-08 2015-05-20 深圳众为兴技术股份有限公司 一种系统文字的多语言翻译装置及翻译方法
CN103077062B (zh) 2012-11-30 2016-08-03 华为技术有限公司 一种代码改动的检测方法和装置
US9639350B2 (en) * 2014-12-15 2017-05-02 Red Hat, Inc. Tagging non-upstream source code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US1920116A (en) * 1931-08-06 1933-07-25 American Hardware Corp Padlock
CN101916194A (zh) * 2010-06-01 2010-12-15 浙江大学 一种无线传感网节点程序的部署方法
CN102479265A (zh) * 2010-11-25 2012-05-30 上海华虹集成电路有限责任公司 修改硬掩膜产品固件错误功能的方法
CN102279749A (zh) * 2011-08-30 2011-12-14 大唐移动通信设备有限公司 一种代码归并方法和设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115437685A (zh) * 2022-07-29 2022-12-06 西安深信科创信息技术有限公司 一种函数定位方法、装置和电子设备
CN117193872A (zh) * 2023-08-28 2023-12-08 杭州极钛微电子有限公司 一种基于符号表动态执行的芯片启动固件装置和方法

Also Published As

Publication number Publication date
US10019240B2 (en) 2018-07-10
US20140157232A1 (en) 2014-06-05
CN103077062A (zh) 2013-05-01
US9342285B2 (en) 2016-05-17
EP2778629A4 (en) 2015-01-14
US20160196116A1 (en) 2016-07-07
CN103077062B (zh) 2016-08-03
EP2778629A1 (en) 2014-09-17

Similar Documents

Publication Publication Date Title
WO2014082422A1 (zh) 一种代码改动的检测方法和装置
CN102609241B (zh) 热补丁方法及装置
CN106815058B (zh) 一种模拟器的识别方法和系统
CN103019787B (zh) 函数调用关系确定方法、热补丁升级方法及装置
US20230315416A1 (en) Code translation method and apparatus, and device
CN104834837A (zh) 一种基于语义的二进制代码反混淆方法
CN106843840A (zh) 一种基于相似度分析的源代码版本演化注释复用方法
CN107643893B (zh) 一种程序检测方法及装置
CN105446806A (zh) 一种应用程序无响应的处理方法及装置
CN107203535B (zh) 信息查询方法及装置
CN105550575B (zh) 一种未导出的函数地址和数据结构偏移的获取方法及装置
CN117093281A (zh) 一种函数调用方法、装置、设备及介质
CN103744682B (zh) 一种分开编译异构混编程序的方法和系统
CN111240790A (zh) 一种应用的多语言适配方法、装置、客户端和存储介质
WO2022068559A1 (zh) 一种代码处理方法、装置及设备
WO2014082432A1 (zh) overlay符号表建立和查找的方法、装置及程序调制系统
CN111796832B (zh) 热补丁文件生成方法、装置、设备及存储介质
CN112540755A (zh) 一种基于前端的组件处理方法、装置、设备及存储介质
CN111859089B (zh) 一种用于互联网信息的错词检测控制方法
CN119149665A (zh) 代码的搜索方法、装置、电子设备和存储介质
CN117668785A (zh) 基于符号执行的虚拟指令提取方法及系统
CN110245333B (zh) 字体类型检测方法、装置、电子设备及存储介质
CN114594961A (zh) 一种函数表达式实现方法、装置、电子设备及存储介质
CN106484489A (zh) 一种扩展编程语言特性的方法及装置
CN115599534A (zh) 数据竞争检测方法、系统、集群及介质

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2013779107

Country of ref document: EP

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13779107

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE