Verification and analysis system and equipment for object code to source code in airborne software

Through disassembly and decompilation technology, the corresponding relationship between the target code and the source code is established, which solves the problem of difficulty in verifying the COFF format file in the existing technology, realizes the traceability verification from the target code to the source code, and improves the machine performance. Security analysis and verification efficiency of downloaded software.

CN114741278BActive Publication Date: 2024-10-22EAST CHINA NORMAL UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210283082.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2024-10-22
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

It is difficult to effectively verify the correspondence between the target code and the source code in airborne software with existing technology, especially in COFF format files, resulting in difficulties in security analysis and verification.

Method used

Propose a verification and analysis system from target code to source code in airborne software. Through disassembly and decompilation technology, it generates assembly code and establishes a mapping table between variable names and logical addresses. It combines the IDA Pro tool and the Hex-Rays Decompiler plug-in. , to achieve traceability verification from target code to source code.

Benefits of technology

It solves the defect that IDA Pro cannot decompile COFF format files, provides a new traceability verification idea from executable target code to source code, and improves the efficiency of security analysis and verification of airborne software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741278B_ABST
    Figure CN114741278B_ABST
Patent Text Reader

Abstract

The present application provides a verification and analysis system from target code to source code in airborne software. Specifically, the first code module obtains the first assembly code by disassembling the first target code, and obtains the first C code by decompiling the first assembly code; the relationship mapping module compares the first C code with the source code to obtain the correspondence between the source code variable names; according to the correspondence, in combination with the first assembly code, obtains a relationship mapping table between the source code variable names and the logical addresses in the instructions of the assembly code; the second code module obtains the second assembly code by disassembling the second target code; the assembly code is decompiled according to the relationship mapping table to obtain the second C code; the first verification and analysis module compares the second C code with the source code to obtain the first verification result. The present application solves the defect that IDA Pro cannot decompile COFF format files, and provides a new verification idea for traceability from executable target code to source code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of airborne software airworthiness certification, and specifically, relates to a verification and analysis system and equipment for object code to source code in airborne software. Background Art

[0002] With the rapid development of airborne control system technology, it has become a top priority to ensure the reliability, robustness and adaptability of airborne software. The failure of airborne software can lead to catastrophic losses of property and life safety. For airborne systems, the most important thing is to ensure its safety. This requires that airborne software must undergo strict safety certification, which means that the software products produced at each stage of the airborne software development process need to meet the safety certification goals. In 1992, RTCA issued the DO-178C airworthiness certification standard to illustrate the software life cycle and guide the development and verification process of airborne software. As the scale of software continues to increase, the complexity of airborne software is also continuously increasing. The number of components, modules, interfaces, etc. involved in the software is also increasing, which makes the possibility of software failure gradually increase, and also brings many obstacles to the safety analysis and verification of airborne software. In recent years, the number of lines of code for airborne software has also increased exponentially. For example, the embedded software code of the US F-35 fighter is as high as 10 million lines, and the code volume of the flight control system of the Boeing 787 also exceeds 10 million lines.

[0003] Currently, the verification of executable object code (EOC) is mainly performed through testing, and can be assisted by the review and analysis in the DO-178C standard. Formal analysis can replace part of the EOC testing work, but it is still necessary to perform testing in the target hardware to ensure that the software in the target computer meets the DO-178C standard requirements. Summary of the invention

[0004] The present invention proposes a verification and analysis system and device for object code to source code in airborne software, aiming to solve the defect that IDA Pro cannot decompile COFF format files, and provides a new verification idea for traceability from executable object code to source code.

[0005] According to a first aspect of an embodiment of the present application, a verification and analysis system for object code to source code in airborne software is provided, specifically comprising:

[0006] A first code module: used for obtaining a first assembly code by disassembling the first target code, and obtaining a first C code by decompiling the first assembly code;

[0007] Relationship mapping module: used to compare the first C code with the source code to obtain the corresponding relationship between the source code variable names; according to the corresponding relationship, combined with the first assembly code, obtain a relationship mapping table between the source code variable names and the logical addresses in the instructions of the assembly code;

[0008] The second code module is used to obtain a second assembly code by disassembling the second target code; and decompile the second assembly code according to the relationship mapping table to obtain a second C code;

[0009] The first verification analysis module is used to compare the second C code with the source code to obtain a first verification result.

[0010] In some implementations of the present application, the first target code is a target code in ELF format or PE format.

[0011] In some implementations of the present application, the first code module is specifically used to:

[0012] Compile the source code to obtain a first target code, where the first target code is an ELF format target code;

[0013] Disassemble the ELF format target code using IDA Pro to obtain the first assembly code;

[0014] Decompile the first assembly code using the Hex-Rays Decompiler plug-in to obtain a first C code.

[0015] In some implementations of the present application, the second target code is a target code in COFF format.

[0016] In some implementations of the present application, the second code module is specifically used to:

[0017] Obtain a second assembly code by disassembling the second target code through IDA;

[0018] The second assembly code is decompiled by using the IDA Pro tool in combination with the relationship mapping table to obtain the second C code.

[0019] In some implementations of the present application, the second assembly code is decompiled by using the IDA Pro tool in combination with the relationship mapping table to obtain the second C code, which specifically includes:

[0020] Identify and obtain a processor model according to the second assembly code;

[0021] Search the instruction set library according to the processor model to obtain the corresponding processor instruction set;

[0022] According to the processor instruction set, combined with the relationship mapping table between the source code variable name and the logical address in the instruction of the assembly code, the second assembly code is decompiled to obtain the second C code.

[0023] In some embodiments of the present application, a second verification analysis module is further included, which is used to compare the first C code with the source code to obtain a second verification result of the first target code and the source code.

[0024] In some embodiments of the present application, the second verification and analysis module is specifically used to:

[0025] Compare the first C code with the source code to determine whether they are consistent;

[0026] If they are inconsistent, the additional code of the first C code is obtained, and whether malicious code exists is analyzed based on the additional code.

[0027] In some embodiments of the present application, the first verification and analysis module is specifically used to:

[0028] Compare the second C code with the source code to determine whether they are consistent;

[0029] If they are inconsistent, the additional code of the second C code is obtained, and whether malicious code exists is analyzed based on the additional code.

[0030] According to a second aspect of an embodiment of the present application, a verification and analysis device for converting a target code into a source code is provided, comprising:

[0031] Memory: used to store executable instructions; and

[0032] Processor: used to connect to the memory to execute executable instructions to complete the verification and analysis system from the target code to the source code in the onboard software.

[0033] A verification and analysis system for converting target code to source code in the onboard software in the embodiment of the present application is adopted. Specifically, a first code module 10 obtains a first assembly code by disassembling the first target code, and decompiles the first assembly code to obtain a first C code; a relationship mapping module 20 compares the first C code with the source code to obtain a correspondence between source code variable names; based on the correspondence, in combination with the first assembly code, a relationship mapping table between source code variable names and logical addresses in instructions of the assembly code is obtained; a second code module 30 obtains a second assembly code by disassembling the second target code; the assembly code is decompiled according to the relationship mapping table to obtain a second C code; and a first verification and analysis module 40 compares the second C code with the source code to obtain a first verification result.

[0034] This application solves the defect that IDA Pro cannot decompile COFF format files and provides a new way to verify the traceability of executable target code to source code. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0036] Figure 1 : shows a schematic diagram of the structure of the verification and analysis system from target code to source code in the onboard software according to an embodiment of the present application;

[0037] Figure 2 A schematic diagram of the steps of obtaining the first C code by disassembling and decompiling the first target code according to an embodiment of the present application is shown in FIG.

[0038] Figure 3 A schematic diagram of the steps of obtaining the second C code by disassembling and decompiling the second target code according to an embodiment of the present application is shown in FIG.

[0039] Figure 4 : shows a flow chart of a method for verifying and analyzing the object code to the source code in the onboard software according to an embodiment of the present application;

[0040] Figure 5 A schematic diagram of the steps of a method for verifying and analyzing the object code to the source code in the onboard software according to an embodiment of the present application is shown in FIG.

[0041] Figure 6 The figure shows a schematic diagram of the structure of the verification and analysis device for converting target code to source code in the onboard software according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] In the process of implementing the present application, the inventors found that the complexity of airborne software is continuously increasing, and the number of components, modules, interfaces, etc. involved in the software is also increasing, which makes the possibility of software failure gradually increase, and also brings many obstacles to the safety analysis and verification of airborne software.

[0043] The verification of executable object code EOC (Executable Object Code) is mainly performed through testing.

[0044] Interactive Disassembler Professional (IDA Pro) is a static decompiler. This application proposes a method for verifying the traceability of target code to source code, using tools to disassemble the target code to obtain assembly instruction code, and then decompiling the assembly code to obtain C code, comparing the C code with the source code to determine whether additional code is generated, and further reviewing the additional code to determine whether malicious code is generated.

[0045] Specifically, the present application is a verification and analysis method and storage medium for object code to source code in airborne software. Specifically, a first assembly code is obtained by disassembling a first object code, and a first C code is obtained by decompiling the first assembly code; the first C code is compared with the source code to obtain a correspondence between source code variable names; according to the correspondence, in combination with the first assembly code, a relationship mapping table between source code variable names and logical addresses in instructions of the assembly code is obtained; according to the second object code, a second assembly code is obtained by disassembling; the assembly code is decompiled according to the relationship mapping table to obtain a second C code; the second C code is compared with the source code to obtain a first verification result.

[0046] This application solves the defect that IDA Pro cannot decompile COFF format files and provides a new way to verify the traceability of executable target code to source code.

[0047] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0048] Example 1

[0049] Figure 1 Detailed description is given of the structural diagram of the target code to source code verification and analysis system in the onboard software according to an embodiment of the present application.

[0050] like Figure 1 As shown, the verification and analysis system for converting target code to source code in the onboard software of the embodiment of the present application specifically includes a first code module 10 , a relationship mapping module 20 , a second code module 30 and a verification and analysis module 40 .

[0051] Specifically,

[0052] The first code module 10 is used to obtain a first assembly code by disassembling the first target code, and to obtain a first C code by decompiling the first assembly code.

[0053] Specifically, the first target code of this embodiment is a target code in ELF format or PE format.

[0054] Figure 2 A schematic diagram of the steps of obtaining the first C code by disassembling and decompiling the first target code according to an embodiment of the present application is shown in FIG.

[0055] like Figure 2 As shown, when the first C code is obtained by disassembling and decompiling the first target code, it specifically includes:

[0056] S1011: Obtain a first target code according to the source code compilation, where the first target code is an ELF format target code;

[0057] S1012: Disassemble the ELF format target code using IDA Pro to obtain a first assembly code;

[0058] S1013: Decompile the first assembly code using a Hex-Rays Decompiler plug-in to obtain a first C code.

[0059] The relationship mapping module 20 is used to compare the first C code with the source code to obtain the corresponding relationship between the source code variable names; according to the corresponding relationship, combined with the first assembly code, obtain a relationship mapping table between the source code variable names and the logical addresses in the instructions of the assembly code.

[0060] The second code module 30 is used to obtain a second assembly code by disassembling the second target code; and to decompile the assembly code according to the relationship mapping table to obtain a second C code.

[0061] Specifically, the second target code of this embodiment is a target code in COFF format.

[0062] Figure 3 A schematic diagram of the steps of obtaining the second C code by disassembling and decompiling the second target code according to an embodiment of the present application is shown in FIG.

[0063] like Figure 3 As shown, when the second C code is obtained by disassembling and decompiling the second target code, it specifically includes:

[0064] S1031: Obtain a second assembly code by disassembling the second target code through IDA;

[0065] S1032: Next, the second assembly code is decompiled using the IDA Pro tool in combination with the relationship mapping table to obtain a second C code.

[0066] Among them, the specific steps of decompiling the second assembly code by using the IDA Pro tool in combination with the relationship mapping table to obtain the second C code include:

[0067] S1: First, identify the processor model according to the second assembly code;

[0068] S2: Secondly, search the instruction set library according to the processor model to obtain the corresponding processor instruction set;

[0069] S3: Finally, according to the processor instruction set and in combination with the relationship mapping table between the source code variable name and the logical address in the instruction of the assembly code, the second assembly code is decompiled to obtain the second C code.

[0070] Verification and analysis module 40: used for comparing the second C code with the source code to obtain a first verification result.

[0071] Among them, the second C code is compared with the source code to obtain a first verification result. The specific steps include: comparing the second C code with the source code to determine whether they are consistent; if they are inconsistent, obtaining additional code of the second C code, and analyzing whether there is malicious code based on the additional code.

[0072] In other implementations, a second verification analysis module is further included, which is used to compare the first C code with the source code to obtain a second verification result of the first target code and the source code.

[0073] Specifically, the second verification and analysis module is used to compare the first C code with the source code to determine whether they are consistent; if they are inconsistent, obtain additional code of the first C code and analyze whether there is malicious code based on the additional code.

[0074] Figure 4 A flow chart of a method for verifying and analyzing target code to source code in onboard software according to an embodiment of the present application is shown in FIG.

[0075] In order to further illustrate the verification and analysis method from target code to source code in the onboard software of the present application, the implementation method of the present application is described from another perspective.

[0076] This application mainly targets files in the target code formats of ELF and COFF, which are commonly used in airborne software, and proposes a method for verifying the traceability of target code to source code using IDA and Hex-Rays Decompiler tools.

[0077] like Figure 4As shown in the figure, for the target file in ELF format, the assembly code is first obtained by IDA decompilation. Since Hex-Rays Decompiler can directly decompile ELF files, the decompiled C code can be obtained. By comparing the generated C code with the source code, the additional code can be further analyzed. The same method is also applicable to the decompilation of the target code in PE format.

[0078] For the target file in COFF format, IDA is also used for disassembly. However, since Hex-RaysDecompiler does not support the decompilation of COFF files, indirect decompilation is required for the reverse analysis of the target file in COFF format.

[0079] The indirect decompilation method proposed in this application also utilizes the Hex-Rays Decompiler plug-in to simplify the decompilation work.

[0080] First, compile the source code in a specific processor to generate the target code in ELF format. For the target file in ELF format, first disassemble it through IDA Pro to get the assembly code. Since Hex-Rays Decompiler can directly decompile ELF files, the decompiled C code can be obtained. The C code is obtained through the decompilation process of ELF format, and the corresponding relationship between the variable names is obtained by comparing the source code. Then, combined with the assembly code, the relationship mapping table between the source code variables and the logical addresses in the assembly instructions is obtained. Through the processor model identified during IDA disassembly, the corresponding processor instruction set is found, and then the relationship mapping table between the logical address and the variable name is combined for manual decompilation, so that the assembly code can be decompiled into C code, and finally the traceability is verified by comparing the source code.

[0081] This application uses the IDA Pro tool to disassemble the target code and obtain the assembly instruction code. Then, the ELF format code is produced with the help of the source code for decompilation to obtain the relationship mapping table between the logical address and the source code variable name. Then, according to the relationship mapping table and the assembly instruction set, the assembly code is decompiled to obtain the C code, and the C code is compared with the source code to determine whether additional code is generated, and the additional code is further reviewed to determine whether malicious code is generated.

[0082] A verification and analysis system for converting target code to source code in the onboard software in the embodiment of the present application is adopted. Specifically, a first code module 10 obtains a first assembly code by disassembling the first target code, and decompiles the first assembly code to obtain a first C code; a relationship mapping module 20 compares the first C code with the source code to obtain a correspondence between source code variable names; based on the correspondence, in combination with the first assembly code, a relationship mapping table between source code variable names and logical addresses in instructions of the assembly code is obtained; a second code module 30 obtains a second assembly code by disassembling the second target code; the assembly code is decompiled according to the relationship mapping table to obtain a second C code; and a first verification and analysis module 40 compares the second C code with the source code to obtain a first verification result.

[0083] This application solves the defect that IDA Pro cannot decompile COFF format files and provides a new way to verify the traceability of executable target code to source code.

[0084] Example 2

[0085] The present embodiment provides a method for verifying and analyzing the object code to source code in airborne software. For details not disclosed in the method for verifying and analyzing the object code to source code in airborne software of the present embodiment, please refer to the specific implementation contents of the system for verifying and analyzing the object code to source code in airborne software in other embodiments.

[0086] Figure 5 FIG. 4 is a schematic diagram showing the steps of a method for verifying and analyzing target code to source code in onboard software according to an embodiment of the present application.

[0087] like Figure 5 As shown, the verification and analysis method from the target code to the source code in the onboard software of the embodiment of the present application specifically includes the following steps:

[0088] S101: obtaining a first assembly code by disassembling a first target code, and obtaining a first C code by decompiling the first assembly code.

[0089] Specifically, the first target code of this embodiment is a target code in ELF format or PE format.

[0090] Figure 2 A schematic diagram of the steps of obtaining the first C code by disassembling and decompiling the first target code according to an embodiment of the present application is shown in FIG.

[0091] like Figure 2 As shown, when the first C code is obtained by disassembling and decompiling the first target code, it specifically includes:

[0092] S1011: Obtain a first target code according to the source code compilation, where the first target code is an ELF format target code;

[0093] S1012: Disassemble the ELF format target code using IDA Pro to obtain a first assembly code;

[0094] S1013: Decompile the first assembly code using a Hex-Rays Decompiler plug-in to obtain a first C code.

[0095] S102: Compare the first C code with the source code to obtain a correspondence between source code variable names; and obtain a mapping table of a relationship between source code variable names and logical addresses in instructions of the assembly code based on the correspondence and in combination with the first assembly code.

[0096] In some embodiments of the present application, after obtaining the first assembly code by disassembling the first target code and obtaining the first C code by decompiling the first assembly code, the process further includes: comparing the first C code with the source code to obtain a second verification result of the first target code and the source code. The specific steps include:

[0097] Compare the first C code with the source code to determine whether they are consistent;

[0098] If they are inconsistent, the additional code of the first C code is obtained, and whether malicious code exists is analyzed based on the additional code.

[0099] S103: Obtain a second assembly code by disassembling the second target code; and decompile the second assembly code according to the relationship mapping table to obtain a second C code.

[0100] Specifically, the second target code of this embodiment is a target code in COFF format.

[0101] Figure 3 A schematic diagram of the steps of obtaining the second C code by disassembling and decompiling the second target code according to an embodiment of the present application is shown in FIG.

[0102] like Figure 3 As shown, when the second C code is obtained by disassembling and decompiling the second target code, it specifically includes:

[0103] S1031: Obtain a second assembly code by disassembling the second target code through IDA;

[0104] S1032: Next, the second assembly code is decompiled using the IDA Pro tool in combination with the relationship mapping table to obtain a second C code.

[0105] Among them, the specific steps of decompiling the second assembly code by using the IDA Pro tool in combination with the relationship mapping table to obtain the second C code include:

[0106] S1: First, identify the processor model according to the second assembly code;

[0107] S2: Secondly, search the instruction set library according to the processor model to obtain the corresponding processor instruction set;

[0108] S3: Finally, according to the processor instruction set and in combination with the relationship mapping table between the source code variable name and the logical address in the instruction of the assembly code, the second assembly code is decompiled to obtain the second C code.

[0109] S104: Compare the second C code with the source code to obtain a first verification result.

[0110] The second C code is compared with the source code to obtain a first verification result. The specific steps include:

[0111] Compare the second C code with the source code to determine whether they are consistent;

[0112] If they are inconsistent, the additional code of the second C code is obtained, and whether malicious code exists is analyzed based on the additional code.

[0113] Figure 4 A flow chart of a method for verifying and analyzing target code to source code in onboard software according to an embodiment of the present application is shown in FIG.

[0114] In order to further illustrate the verification and analysis method from target code to source code in the onboard software of the present application, the implementation method of the present application is described from another perspective.

[0115] This application mainly targets files in the target code formats of ELF and COFF, which are commonly used in airborne software, and proposes a method for verifying the traceability of target code to source code using IDA and Hex-Rays Decompiler tools.

[0116] For the target file in ELF format, firstly, we disassemble the assembly code through IDA. Since Hex-RaysDecompiler can directly decompile ELF files, we can get the decompiled C code. By comparing the generated C code with the source code, we can further analyze the additional code. The same method is also applicable to the decompilation of the target code in PE format.

[0117] For the target file in COFF format, IDA is also used for disassembly. However, since Hex-RaysDecompiler does not support the decompilation of COFF files, indirect decompilation is required for the reverse analysis of the target file in COFF format.

[0118] The indirect decompilation method proposed in this application also utilizes the Hex-Rays Decompiler plug-in to simplify the decompilation work.

[0119] First, compile the source code in a specific processor to generate the target code in ELF format. For the target file in ELF format, first disassemble it through IDA Pro to get the assembly code. Since Hex-Rays Decompiler can directly decompile ELF files, the decompiled C code can be obtained. The C code is obtained through the decompilation process of ELF format, and the corresponding relationship between the variable names is obtained by comparing the source code. Then, combined with the assembly code, the relationship mapping table between the source code variables and the logical addresses in the assembly instructions is obtained. Through the processor model identified during IDA disassembly, the corresponding processor instruction set is found, and then the relationship mapping table between the logical address and the variable name is combined for manual decompilation, so that the assembly code can be decompiled into C code, and finally the traceability is verified by comparing the source code.

[0120] This application uses the IDA Pro tool to disassemble the target code and obtain the assembly instruction code. Then, the ELF format code is produced with the help of the source code for decompilation to obtain the relationship mapping table between the logical address and the source code variable name. Then, according to the relationship mapping table and the assembly instruction set, the assembly code is decompiled to obtain the C code, and the C code is compared with the source code to determine whether additional code is generated, and the additional code is further reviewed to determine whether malicious code is generated.

[0121] The object code to source code verification and analysis method in the onboard software in the embodiment of the present application is adopted. Specifically, a first assembly code is obtained by disassembling according to a first object code, and a first C code is obtained by decompiling according to the first assembly code; the first C code is compared with the source code to obtain a correspondence between source code variable names; according to the correspondence, in combination with the first assembly code, a relationship mapping table between source code variable names and logical addresses in instructions of the assembly code is obtained; according to the second object code, a second assembly code is obtained by disassembling; the assembly code is decompiled according to the relationship mapping table to obtain a second C code; the second C code is compared with the source code to obtain a first verification result.

[0122] This application solves the defect that IDA Pro cannot decompile COFF format files and provides a new way to verify the traceability of executable target code to source code.

[0123] Example 3

[0124] The present embodiment provides a verification and analysis device for converting target code into source code in airborne software. For details not disclosed in the verification and analysis device for converting target code into source code in airborne software of the present embodiment, please refer to the specific implementation contents of the verification and analysis method or system for converting target code into source code in airborne software in other embodiments.

[0125] Figure 6 Schematic diagram of the structure of the verification and analysis device 400 for converting target code to source code in the onboard software according to an embodiment of the present application is shown in FIG.

[0126] like Figure 6 As shown, the verification and analysis device 400 includes:

[0127] Memory 402: used to store executable instructions; and

[0128] Processor 401: used to connect with memory 402 to execute executable instructions to complete the motion vector prediction method.

[0129] Those skilled in the art will understand that Figure 6 It is only an example of the verification and analysis device 400 and does not constitute a limitation of the verification and analysis device 400. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the verification and analysis device 400 may also include input and output devices, network access devices, buses, etc.

[0130] The processor 401 (Central Processing Unit, CPU) may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 401 may also be any conventional processor, etc. The processor 401 is the control center of the verification and analysis device 400, and uses various interfaces and lines to connect various parts of the entire verification and analysis device 400.

[0131] The memory 402 can be used to store computer-readable instructions. The processor 401 implements various functions of the verification and analysis device 400 by running or executing computer-readable instructions or modules stored in the memory 402 and calling data stored in the memory 402. The memory 402 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the verification and analysis device 400, etc. In addition, the memory 402 can include a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM) or other non-volatile / volatile storage devices.

[0132] If the module integrated in the verification and analysis device 400 is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete it through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the computer-readable instructions are executed by the processor, the steps of the above-mentioned various method embodiments can be implemented.

[0133] Example 4

[0134] This embodiment provides a computer-readable storage medium on which a computer program is stored; the computer program is executed by a processor to implement the verification and analysis method from target code to source code in the onboard software in other embodiments.

[0135] The verification and analysis device and computer storage medium for object code to source code in the onboard software in the embodiment of the present application specifically obtain a first assembly code by disassembling the first object code, and obtain a first C code by decompiling the first assembly code; the first C code is compared with the source code to obtain a correspondence between source code variable names; according to the correspondence, in combination with the first assembly code, a relationship mapping table between source code variable names and logical addresses in instructions of the assembly code is obtained; according to the second object code, a second assembly code is obtained by disassembling; the assembly code is decompiled according to the relationship mapping table to obtain a second C code; the second C code is compared with the source code to obtain a first verification result.

[0136] This application solves the defect that IDA Pro cannot decompile COFF format files and provides a new way to verify the traceability of executable target code to source code.

[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0141] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0142] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0143] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0144] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A verification and analysis system for object code to source code in airborne software, It is characterized in that Specifically include: A first code module: used for obtaining a first assembly code by disassembling the first target code, and obtaining a first C code by decompiling the first assembly code; Relationship mapping module: used to compare the first C code with the source code to obtain the corresponding relationship between the source code variable names; According to the corresponding relationship, in combination with the first assembly code, a mapping table of the relationship between the source code variable name and the logical address in the instruction of the assembly code is obtained; The second code module is used to obtain the second assembly code by disassembling the second target code; Decompile the second assembly code according to the relationship mapping table to obtain a second C code; The first verification analysis module is used to compare the second C code with the source code to obtain a first verification result, wherein the first target code is a target code in ELF format or PE format. The second target code is a target code in COFF format. The second assembly code is obtained by disassembling the second target code; Decompiling the second assembly code according to the relationship mapping table to obtain a second C code specifically includes: Obtain a second assembly code by disassembling the second target code through IDA; Decompile the second assembly code by using the IDA Pro tool in combination with the relationship mapping table to obtain a second C code. Decompiling the second assembly code by using the IDA Pro tool in combination with the relationship mapping table to obtain the second C code specifically includes: Identify and obtain a processor model according to the second assembly code; Search the instruction set library according to the processor model to obtain the corresponding processor instruction set; According to the processor instruction set, in combination with a mapping table of the relationship between source code variable names and logical addresses in instructions of the assembly code, the second assembly code is decompiled to obtain a second C code, The first verification and analysis module is specifically used for: Compare the second C code with the source code to determine whether they are consistent; If they are inconsistent, the additional code of the second C code is obtained, and whether malicious code exists is analyzed based on the additional code.

2. The object code to source code verification and analysis system according to claim 1, It is characterized in that The first code module is specifically used for: Obtain a first target code according to the source code compilation, wherein the first target code is an ELF format target code; Disassemble the ELF format target code using IDA Pro to obtain a first assembly code; Decompile the first assembly code using a Hex-Rays Decompiler plug-in to obtain a first C code.

3. The object code to source code verification and analysis system according to claim 1, It is characterized in that It also includes a second verification analysis module, which is used to compare the first C code with the source code to obtain a second verification result of the first target code and the source code.

4. The object code to source code verification and analysis system according to claim 3, It is characterized in that The second verification and analysis module is specifically used for: Compare the first C code with the source code to determine whether they are consistent; If they are inconsistent, the additional code of the first C code is obtained, and whether malicious code exists is analyzed according to the additional code.

5. A verification and analysis device for object code to source code, It is characterized in that include: Memory: used to store executable instructions; as well as Processor: used to connect to the memory to execute the executable instructions to complete the verification and analysis system from target code to source code in the onboard software as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Static program analysis system for target code

    CN106649095A

  • Source code and target code contrastive analysis method and system for aviation airborne software

    CN110659200A

  • Firmware vulnerability detection method and system in cross-platform scene

    CN111310178A

  • Verification analysis method from target code to source code in airborne software and storage medium

    CN114756453A

  • Analyzing binary software components utilizing multiple instruction sets

    US20190121626A1