A high-security patch source code information construction method

By integrating source code information and managing its security during the patch compilation process, the problem of lacking direct access to source code information in existing technologies is solved, thereby improving patch application and debugging efficiency and reducing security risks.

CN117850855BActive Publication Date: 2026-05-01CHINA TELECOM CLOUD TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2023-12-14
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies lack methods for directly obtaining the source code information corresponding to patches, which makes it inconvenient to locate patch information and debug functions, and also poses security risks.

Method used

During the patch compilation process, source code information is assembled, organized, processed, and displayed in the patch binary file. Security management is performed by intercepting compiler options, including layout, encryption, deletion, and other processing.

Benefits of technology

It enables real-time acquisition of source code information corresponding to patch binaries, facilitating debugging, reducing the possibility of patch application errors, and enhancing security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117850855B_ABST
    Figure CN117850855B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of cloud computing virtualization, and discloses a high-security patch source code information construction method, comprising the following steps: S1, assembling first-hand source code information in the patch compiling process; S2, processing source code information in the patch generation process; S3, displaying source code information in the patch query process; S4, processing source code information in the patch offline processing process.The present application can integrate source code information directly in patch binary files, can acquire source code information corresponding to patch binary files in real time, the corresponding relationship between binary and source code is self-evident, greatly facilitates the debugging of patches, and reduces the possibility of patch application confusion.
Need to check novelty before this filing date? Find Prior Art

Description

A method for constructing high-security patch source code information Technical Field

[0001] The invention belongs to the technical field of cloud computing virtualization, specifically involving a method for constructing high-security patch source code information. Background Technology

[0002] A patch binary is a binary file used to fix bugs or vulnerabilities in the original program. Patches are typically generated by comparing the differences between the original program and the patch, and can be applied to the original program to achieve a fix or upgrade. Patch binaries may contain new code, data, or other information to fix or improve the functionality of the original program. This technique can be used to create upgrade packages for released software, incremental backups of different versions of source code, incremental storage of data, and so on.

[0003] Traditional patching tools support basic functions such as loading and unloading patches, and querying patch status. However, they lack a direct method to obtain the source code information corresponding to the loaded patch. Typically, patch binary and corresponding source code information can only be stored manually or separately in another system, which is very inconvenient for patch information location and function debugging. Furthermore, this may further increase the possibility of patch application chaos. Existing solutions for managing patch source code information lack security considerations. Reverse engineering techniques such as source code information inference may potentially uncover larger vulnerabilities or be exploited for attacks.

[0004] For example, Chinese patent CN111930413B discloses a method, apparatus, and system for automatically generating patches. The method includes, in response to an acquired patch source code filename, loading a preset patch source code template to form an initial patch source code file; loading a patch source code editor to modify defects in the initial patch source code file, forming a patch source code file; and generating a patch target file based on the patch source code file, thus completing the automatic patch generation. This invention avoids the inefficient labor involved in manual patching and can exponentially improve the efficiency of software engineers in creating patches.

[0005] All of the above patents suffer from the problem described in this background: the lack of a direct method to obtain the source code information corresponding to the loaded patch.

[0006] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a high-security patch source code information construction method, which directly integrates the source code information into the patch binary, and can obtain the source code information corresponding to the patch binary in real time. The correspondence between the binary and the source code is clear at a glance, which greatly facilitates debugging and reduces the possibility of patch application confusion.

[0008] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0009] On one hand, the present invention provides a method for constructing high-security patch source code information, comprising the following steps:

[0010] S1: Constructing first-hand source code information during the patch compilation process;

[0011] S2: Organize and process source code information during patch generation;

[0012] S3: Display source code information during patch lookup;

[0013] S4: Process source code information during offline patch processing.

[0014] As a preferred embodiment of the high-security patch source code information construction method of the present invention, the source code information includes the source file path and function name.

[0015] As a preferred embodiment of the high-security patch source code information construction method of the present invention, after creating the source code information, the source code information is constructed into the patch file, and the total length of the patch header is updated.

[0016] As a preferred embodiment of the high-security patch source code information construction method of the present invention, the method adopted to construct the source code information into the patch file is to reuse the interceptor compiler option.

[0017] As a preferred embodiment of the high-security patch source code information construction method of the present invention, the method of organizing and processing the source code information includes laying out the source code information in random positions and laying out the source code information in fixed positions.

[0018] As a preferred embodiment of the high-security patch source code information construction method of the present invention, the display states of the source code information include not displaying source code information, displaying unencrypted source code information, displaying encrypted source code information after entering a password as required, displaying obfuscated source code information, and displaying source code information after decompression.

[0019] As a preferred embodiment of the high-security patch source code information construction method of the present invention, the processing of source code information includes deleting source code information, obfuscating source code information, encrypting source code information, and stripping source code information.

[0020] As a preferred embodiment of the high-security patch source code information construction method described in this invention, the method for querying patch source code information is as follows:

[0021] If the source code information is not encrypted, the source code information will be displayed.

[0022] If the source code is encrypted, enter the password to decrypt it and determine whether the source code has been stripped; if so, do not display the source code; otherwise, display the source code.

[0023] Secondly, the present invention provides an electronic device, including a memory for storing instructions and a processor for executing the instructions, causing the device to perform operations that implement the high-security patch source code information construction method of the present invention.

[0024] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a high-security patch source code information construction method as described in the present invention.

[0025] Compared to current common patch source code query solutions, the beneficial effects achieved by this invention are as follows:

[0026] Users can obtain the source code information corresponding to the patch binary file in real time, without having to manually manage the patch binary file and source code information. This improves the efficiency of patch application and system debugging and reduces the possibility of patch application (loading / unloading) becoming chaotic.

[0027] According to security requirements, source code information can be randomly laid out, obfuscated, deleted, and encrypted, which enhances the confidentiality of patch source code information management and reduces the risk of system vulnerability exposure. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0029] Figure 1 is a flowchart of a high-security patch source code information construction method provided by the present invention;

[0030] Figure 2 is a flowchart of the method for querying patch source code information provided by the present invention. Detailed Implementation

[0031] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0032] Example 1

[0033] This embodiment describes a method for constructing high-security patch source code information. Referring to Figure 1, the method includes the following steps:

[0034] S1: Constructing first-hand source code information during the patch compilation process;

[0035] The source code information includes the source file path and function name; as shown in the following code:

[0036] struct SourceInfo

[0037] {

[0038] char file

[256] ;

[0039] char function

[64] ;

[0040] }

[0041] Reuse the interceptor compiler options to build source code information into the patch file and update the total length of the patch header;

[0042] S2: Organize and process source code information during patch generation; including laying out source code information to random positions and laying out source code information to fixed positions;

[0043] The following code demonstrates how to lay out source code information at random locations:

[0044] struct PatchHeader

[0045] {

[0046] struct CommonHeader comm_hdr;

[0047] struct SourceInfo src_info[]; / / Random location

[0048] }

[0049] S3: Display source code information during patch lookup;

[0050] The display states of the source code information include not displaying source code information, displaying unencrypted source code information, displaying encrypted source code information after entering a password as required, displaying obfuscated source code information, and displaying source code information after decompression.

[0051] S4: Process source code information during offline patch processing;

[0052] Methods of processing source code information include deleting source code information, obfuscating source code information, encrypting source code information, and stripping source code information;

[0053] The methods for querying patch source code information are as follows:

[0054] If the source code information is not encrypted, the source code information will be displayed.

[0055] If the source code is encrypted, enter the password to decrypt it and determine whether the source code has been stripped; if so, do not display the source code; otherwise, display the source code.

[0056] Example 2

[0057] Based on the same inventive concept as other embodiments, this embodiment introduces an electronic device, including a memory and a processor. The memory is used to store instructions, and the processor is used to execute the instructions, causing the computer device to perform a method for constructing high-security patch source code information that implements the methods described above.

[0058] Since the electronic device described in this embodiment is the electronic device used to implement the high-security patch source code information construction method of this application embodiment, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the high-security patch source code information construction method described in this application embodiment. Therefore, how the electronic device implements the method in this application embodiment will not be described in detail here. Any electronic device used by those skilled in the art to implement the high-security patch source code information construction method of this application embodiment falls within the scope of protection of this application.

[0059] Example 3

[0060] Based on the same inventive concept as other embodiments, this embodiment introduces a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a high-security patch source code information construction method provided by the above methods.

[0061] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0062] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for constructing high-security patch source code information, characterized in that: Includes the following steps: S1: Assemble first-hand source code information during patch compilation; S2: Organize and process source code information during patch generation; S3: Display source code information during patch lookup; S4: Process source code information during offline patch processing; the source code information includes source file paths and function names; after creating the source code information, build the source code information into the patch file and update the total length of the patch header; the method of building the source code information into the patch file is to reuse interceptor compiler options; the methods of organizing and processing source code information include laying the source code information into random positions and laying the source code information into fixed positions; the display states of the source code information include not displaying source code information, displaying unencrypted source code information, displaying encrypted source code information after entering a password as required, displaying obfuscated source code information, and displaying source code information after decompression; the methods of processing source code information include deleting source code information, obfuscating source code information, encrypting source code information, and stripping source code information; the method of querying patch source code information is as follows: if the source code information is not encrypted, the source code information is displayed; if the source code information is encrypted, a password is entered to decrypt it, and it is determined whether the source code information has been stripped; if yes, the source code information is not displayed; if no, the source code information is displayed.

2. An electronic device, characterized in that, include: Memory, used to store instructions; A processor is configured to execute the instructions, causing the device to perform operations that implement the high-security patch source code information construction method as described in claim 1.

3. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements a method for constructing high-security patch source code information as described in claim 1.

Citation Information

Patent Citations

  • A method, apparatus and system for automatic patch generation

    CN111930413B

  • Tool and realization method for positioning modification and influencing range of patch through software test

    CN107341110A

  • Automatic patch generation method, device and system

    CN111930413A