ELF instrumentation analysis method, device, electronic device, and storage medium

By analyzing the structure and header files of the ELF file, looking up the target symbol table and symbolized debugging information table, and inserting pile code, the problem of repeated jumps in ELF insertion pile positions and large-scale source code analysis is solved, reducing the workload and difficulty.

CN115470117BActive Publication Date: 2025-09-02CHONGQING CHANGAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211046166.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2025-09-02
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

In the prior art, the ELF insertion position repeatedly jumps and all source codes of the entire project need to be parsed, resulting in greater workload and difficulty.

Method used

By parsing the structure information and header files of the ELF file, finding the target symbol table and symbolized debug information table, extracting the .c file of the measured variables and objective function, and inserting the preset pile code at its location.

Benefits of technology

Reduces workload, reduces work difficulty, and avoids repeated jumps in the insertion position.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115470117B_ABST
    Figure CN115470117B_ABST
Patent Text Reader

Abstract

The present application relates to a parsing method, device, electronic device and storage medium for ELF stubs, wherein the method comprises: receiving a parsing instruction issued by a user, and parsing an executable and linkable format ELF file according to the parsing instruction to obtain the representation text of the ELF, and parsing the structural information of the ELF file and the ELF header files at multiple locations in the ELF file; searching the target symbol table according to the ELF header file, and extracting the measured variables and target functions according to the target symbol table; searching the symbolized debugging information table according to the ELF header file, and extracting the .c files corresponding to the measured variables and target functions from the symbolized debugging information table; parsing the .c files corresponding to the measured variables and target functions, and inserting the preset stub code. Thus, the problem that the related technology causes the stub position to jump repeatedly and requires parsing all the source codes of the entire project, which causes a large workload and difficulty, is solved, thereby reducing the workload and the difficulty of the work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to an ELF instrumentation parsing method, device, electronic device, and storage medium. Background Art

[0002] When setting up an automated testing environment, instrumentation is a relatively time-consuming step.

[0003] In the related art, a smart contract testing method based on the path coverage sufficiency criterion is performed by parsing the syntax and logic of the source code. Another Android application software automated testing method based on instrumentation technology is to decompile the ELF file, instrument the decompiled source code, and then compile it into a program for testing.

[0004] However, the macro definitions, declarations, multi-level calls, etc. in the first source code will cause repeated jumps in the instrumentation location. Even if the current test target is only a single module, it is not possible to parse only the source code of the module, but all the source codes of the entire project must be parsed, which is too much work. The decompilation difficulty and workload of the second technology are huge. Summary of the Invention

[0005] The present application provides an ELF instrumentation parsing method, device, electronic device, and storage medium to solve the problem that related technologies cause the instrumentation position to jump repeatedly and require parsing all source codes of the entire project, resulting in a large workload and difficulty, thereby reducing the workload and lowering the difficulty of the work.

[0006] A first aspect of the present application provides an ELF stub parsing method, comprising the following steps: receiving a parsing instruction issued by a user, and parsing an executable and linkable format ELF file according to the parsing instruction to obtain an ELF representation text; parsing structural information of the ELF file and ELF header files at multiple locations in the ELF file based on the ELF representation text; searching a target symbol table according to the ELF header file, and extracting a measured variable and a target function according to the target symbol table; searching a symbolized debugging information table according to the ELF header file, and extracting a .c file corresponding to the measured variable and the target function from the symbolized debugging information table; and parsing the .c file corresponding to the measured variable and the target function, and inserting a preset stub code.

[0007] Based on the above technical means, this application can solve the problem that related technologies will cause the insertion position to jump repeatedly and require parsing all the source codes of the entire project, resulting in a large workload and difficulty, thereby reducing the workload and lowering the difficulty of the work.

[0008] Optionally, in some embodiments, parsing the .c file corresponding to the measured variable and the target function and inserting the preset stub code includes: parsing the .c file corresponding to the measured variable and the target function to obtain the end position of the measured variable and the target function; and inserting the preset stub code before the end position.

[0009] According to the above technical means, the present application can insert preset stub code and replace the source code with ELF file, thereby reducing the workload and lowering the difficulty of parsing.

[0010] Optionally, in some embodiments, parsing the ELF file includes: using ielfdumparm.exe to parse the ELF file through a command line.

[0011] According to the above technical means, this application can parse ELF files through the ielfdumparm.exe tool to reduce the difficulty of the work.

[0012] Optionally, in some embodiments, the symbolic debugging information table consists of multiple compile_units and statistical information of the multiple compile_units.

[0013] Based on the above technical means, this application can reduce work difficulty and alleviate workload.

[0014] The second aspect of the present application provides an ELF stub parsing device, including: a receiving module for receiving a parsing instruction issued by a user, and parsing an executable and linkable format ELF file according to the parsing instruction to obtain an ELF representation text; a first parsing module for parsing structural information of the ELF file and ELF header files at multiple locations in the ELF file based on the ELF representation text; an extraction module for searching a target symbol table according to the ELF header file, and extracting a measured variable and a target function according to the target symbol table; a debugging module for searching a symbolized debugging information table according to the ELF header file, and extracting a .c file corresponding to the measured variable and the target function from the symbolized debugging information table; and a second parsing module for parsing the .c file corresponding to the measured variable and the target function, and inserting a preset stub code.

[0015] Optionally, in some embodiments, the second parsing module is specifically used to: parse the .c files corresponding to the measured variables and target functions to obtain the end positions of the measured variables and target functions; and insert the preset stub code before the end positions.

[0016] Optionally, in some embodiments, parsing the ELF file includes: using ielfdumparm.exe to parse the ELF file through a command line.

[0017] Optionally, in some embodiments, the symbolic debugging information table consists of multiple compile_units and statistical information of the multiple compile_units.

[0018] A third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the ELF stub parsing method as described in the above embodiment.

[0019] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the ELF stub parsing method as described in the above embodiment.

[0020] Thus, by receiving a parsing instruction issued by a user and parsing an executable and linkable format ELF file according to the parsing instruction, the representation text of the ELF is obtained, the structural information of the ELF file and the ELF header files at multiple locations in the ELF file are parsed, the target symbol table is searched according to the ELF header file, and the measured variables and target functions are extracted according to the target symbol table, and the symbolic debugging information table is searched according to the ELF header file, and the .c files corresponding to the measured variables and target functions are extracted from the symbolic debugging information table; the .c files corresponding to the measured variables and target functions are parsed, and preset stub codes are inserted. Thus, the problem that the related technology causes the stub insertion position to jump repeatedly and requires parsing all the source codes of the entire project, which causes a large workload and difficulty, is solved, and the workload is reduced and the work difficulty is lowered.

[0021] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0023] Figure 1 Flowchart of the ELF instrumentation parsing method provided according to an embodiment of the present application;

[0024] Figure 2 A schematic diagram of a method for using ielfdumparm.exe according to an embodiment of the present application;

[0025] Figure 3 A schematic diagram of an ELF header provided according to one embodiment of the present application;

[0026] Figure 4 A schematic diagram of variables and functions in the symbol table .symtab provided according to one embodiment of the present application;

[0027] Figure 5 A schematic diagram of the locations of measured variables in the symbolic debugging information table .debug_info provided according to one embodiment of the present application;

[0028] Figure 6 A schematic diagram of the location of a tested function in the symbolic debugging information table .debug_info provided according to one embodiment of the present application;

[0029] Figure 7 A schematic diagram of inserting stubs in a source file according to one embodiment of the present application;

[0030] Figure 8 Schematic diagram of a block diagram of an ELF instrumentation parsing device provided according to an embodiment of the present application;

[0031] Figure 9 A schematic diagram of an electronic device provided according to an embodiment of the present application.

[0032] Description of the accompanying drawings: 10 - ELF instrumentation parsing device, 100 - receiving module, 200 - first parsing module, 300 - extraction module, 400 - debugging module and 500 - second parsing module. DETAILED DESCRIPTION

[0033] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0034] The following describes the parsing method, device, electronic device and storage medium of the ELF plugging embodiment of the present application with reference to the accompanying drawings. In view of the problem that the related art mentioned in the above background technology will cause the plugging position to jump repeatedly, and it is necessary to parse all the source codes of the entire project, resulting in a large workload and difficulty, the present application provides a parsing method for ELF plugging, in which a parsing instruction issued by a user is received, and an executable and linkable format ELF file is parsed according to the parsing instruction to obtain an ELF representation text, and the structural information of the ELF file and the ELF header files at multiple locations in the ELF file are parsed, and the target symbol table is searched according to the ELF header file, and the measured variables and target functions are extracted according to the target symbol table, and the symbolized debugging information table is searched according to the ELF header file, and the .c file corresponding to the measured variables and target functions is extracted from the symbolized debugging information table; the .c file corresponding to the measured variables and target functions is parsed, and the preset stub code is inserted. Thus, the problem that the related art causes the plugging position to jump repeatedly, and it is necessary to parse all the source codes of the entire project, resulting in a large workload and difficulty, is solved, and the workload is reduced and the work difficulty is reduced.

[0035] Specifically, Figure 1 A flowchart of an ELF instrumentation parsing method provided in an embodiment of the present application.

[0036] like Figure 1 As shown, the ELF instrumentation parsing method includes the following steps:

[0037] In step S101, a parsing instruction issued by a user is received, and an executable and linkable format ELF file is parsed according to the parsing instruction to obtain an ELF representation text.

[0038] Optionally, in some embodiments, parsing the ELF file includes: using ielfdumparm.exe to parse the ELF file through a command line, wherein the usage of ielfdumparm.exe is as follows: Figure 2 As shown, the optional parameters of the command line can be as shown in Table 1.

[0039] Table 1

[0040]

[0041]

[0042] In step S102, the structural information of the ELF file and the ELF header files at multiple locations in the ELF file are parsed based on the ELF representation text.

[0043] Among them, the ELF header file can be as follows Figure 3As shown, the ELF file of the embodiment of the present application can contain 5 program segments, each with a length of 32 bytes, including 29 sections, each with a length of 40 bytes, section 3 is the symbol table .symtab, and section 18 is the symbolic debugging information table .debug_info.

[0044] The format code of the ELF header file can be as follows,

[0045] #define EI_NIDENT 16

[0046] typedef struct{

[0047] unsigned char e_ident[EI_NIDENT];

[0048] Elf32_Half e_type;

[0049] Elf32_Half e_machine;

[0050] Elf32_Word e_version;

[0051] Elf32_Addr e_entry;

[0052] Elf32_Off e_phoff;

[0053] Elf32_Off e_shoff;

[0054] Elf32_Word e_flags;

[0055] Elf32_Half e_ehsize;

[0056] Elf32_Half e_phentsize;

[0057] Elf32_Half e_phnum;

[0058] Elf32_Half e_shentsize;

[0059] Elf32_Half e_shnum;

[0060] Elf32_Half e_shstrndx;

[0061] }Elf32_Ehdr.

[0062] In step S103, the target symbol table is searched according to the ELF header file, and the measured variables and target functions are extracted according to the target symbol table.

[0063] Among them, the format code of the target symbol table can be as follows:

[0064] typedef struct{

[0065] Elf32_Word st_name;

[0066] Elf32_Addr st_value;

[0067] Elf32_Word st_size;

[0068] unsigned char st_info;

[0069] unsigned char st_other;

[0070] Elf32_Half st_shndx;

[0071] }Elf32_Sym.

[0072] Among them, st_info contains three pieces of information: bind, type, and info. Their relationship with st_info is as follows:

[0073] st_info:i

[0074] bind:#define ELF32_ST_BIND(i)((i)>>4)

[0075] type:#define ELF32_ST_TYPE(i)((i)&0xf)

[0076] b:bind,t:type

[0077] info:#define ELF32_ST_INFO(b,t)(((b)<<4)+((t)&0xf))

[0078] like Figure 4 As shown, Rte_COMCbk_gInAPARemoteOnOff_gInAPARemoteOnOff is the variable name, BdGb indicates that it is declared as extern, the address is 0x10018081, the length is 0x28 bytes, and it is located in Section 5. Atm_PosnLiSwt_Chart_SwtReq_Init is the function name, Bd Lc indicates that it is declared as static, the address is 0x1003e2f1, the length is 0xe bytes, and it is located in Section 5.

[0079] In step S104, the symbolic debugging information table is searched according to the ELF header file, and the .c files corresponding to the measured variables and the target function are extracted from the symbolic debugging information table.

[0080] Optionally, in some embodiments, the symbolic debugging information table consists of multiple compile_units and statistical information of the multiple compile_units.

[0081] Specifically, in an embodiment of the present application, the symbolic debugging information table .debug_info can be composed of multiple compile_units and their statistical information. Each compile_unit corresponds to a .c file, which contains file information such as encoding and language standards, as well as program information such as variables and functions within it.

[0082] The format code of compile_unit's statistical information is as follows:

[0083] typedef struct{

[0084] Elf32_Addr cus_value;

[0085] Elf32_Word cus_size;

[0086] unsigned char cus_version;

[0087] Elf32_Addr cus_abbreviations;

[0088] unsigned char cus_address_size;

[0089] Elf32_Word cus_other;

[0090] }Elf32_CUSummary;

[0091] The format code of the compile_unit file information is as follows:

[0092]

[0093] like Figure 5As shown in the table .debug_info, the variable s_b_ee_busy_flag is defined in the file D:\TestProjects\origin_update\Source\CDD\CDD_Driver\hwa_rf\5781\5781_E2.c. The entry for the variable type is 0x43e. Function A5781E2_GetIdleSts is as follows: Figure 6 As shown, it is defined in the file D:\TestProjects\origin_update\Source\CDD\CDD_Driver\hwa_rf\5781\5781_E2.c, and the storage location entry of its return value type is 0x43e.

[0094] In step S105 , the .c files corresponding to the measured variables and the target function are parsed, and preset stub codes are inserted.

[0095] Optionally, in some embodiments, parsing the .c files corresponding to the measured variables and the target function and inserting the preset stub code includes: parsing the .c files corresponding to the measured variables and the target function to obtain the end positions of the measured variables and the target function; and inserting the preset stub code before the end position.

[0096] Specifically, if Figure 7 As shown, parse the source file D:\TestProjects\origin_update\Source\CDD\CDD_Driver\hwa_rf\5781\5781_E2.c, find the start and end positions of the tested function A5781E2_GetIdleSts, and insert the stub code before the end position of the function.

[0097] According to the ELF stub parsing device proposed in the embodiment of the present application, by receiving a parsing instruction issued by the user, and parsing the executable and linkable format ELF file according to the parsing instruction, obtaining the ELF representation text, parsing the structural information of the ELF file and the ELF header files at multiple locations in the ELF file, searching the target symbol table according to the ELF header file, extracting the measured variables and target functions according to the target symbol table, searching the symbolized debugging information table according to the ELF header file, and extracting the .c files corresponding to the measured variables and target functions from the symbolized debugging information table; parsing the .c files corresponding to the measured variables and target functions, and inserting the preset stub code. Thus, the problem that the related technology causes the stub position to jump repeatedly and requires parsing all the source codes of the entire project, which causes a large workload and difficulty, is solved, thereby reducing the workload and the difficulty of the work.

[0098] Next, the ELF instrumentation parsing device proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

[0099] Figure 8 4 is a block diagram of an ELF instrumentation parsing device according to an embodiment of the present application.

[0100] like Figure 8 As shown, the ELF instrumentation parsing device 10 includes: a receiving module 100 , a first parsing module 200 , an extraction module 300 , a debugging module 400 and a second parsing module 500 .

[0101] Among them, the receiving module 100 is used to receive the parsing instruction issued by the user, and parse the executable and linkable format ELF file according to the parsing instruction to obtain the ELF representation text; the first parsing module 200 is used to parse the structural information of the ELF file and the ELF header files at multiple locations in the ELF file based on the ELF representation text; the extraction module 300 is used to search the target symbol table according to the ELF header file, and extract the measured variables and target functions according to the target symbol table; the debugging module 400 is used to search the symbolized debugging information table according to the ELF header file, and extract the .c files corresponding to the measured variables and target functions from the symbolized debugging information table; and the second parsing module 500 is used to parse the .c files corresponding to the measured variables and target functions, and insert preset stub codes.

[0102] Optionally, in some embodiments, the second parsing module 500 is specifically configured to: parse the .c files corresponding to the measured variables and the target function to obtain the end positions of the measured variables and the target function; and insert a preset stub code before the end position.

[0103] Optionally, in some embodiments, parsing the ELF file includes: using ielfdumparm.exe to parse the ELF file through a command line.

[0104] Optionally, in some embodiments, the symbolic debugging information table consists of multiple compile_units and statistical information of the multiple compile_units.

[0105] It should be noted that the above explanation of the ELF instrumentation parsing method embodiment is also applicable to the ELF instrumentation parsing device of this embodiment, and will not be repeated here.

[0106] According to the ELF stub parsing device proposed in the embodiment of the present application, by receiving a parsing instruction issued by the user, and parsing the executable and linkable format ELF file according to the parsing instruction, obtaining the ELF representation text, parsing the structural information of the ELF file and the ELF header files at multiple locations in the ELF file, searching the target symbol table according to the ELF header file, extracting the measured variables and target functions according to the target symbol table, searching the symbolized debugging information table according to the ELF header file, and extracting the .c files corresponding to the measured variables and target functions from the symbolized debugging information table; parsing the .c files corresponding to the measured variables and target functions, and inserting the preset stub code. Thus, the problem that the related technology causes the stub position to jump repeatedly and requires parsing all the source codes of the entire project, which causes a large workload and difficulty, is solved, thereby reducing the workload and the difficulty of the work.

[0107] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0108] A memory 901 , a processor 902 , and a computer program stored in the memory 901 and executable on the processor 902 .

[0109] When the processor 902 executes the program, the ELF instrumentation parsing method provided in the above embodiment is implemented.

[0110] Furthermore, the electronic device further includes:

[0111] The communication interface 903 is used for communication between the memory 901 and the processor 902 .

[0112] The memory 901 is used to store computer programs that can be run on the processor 902 .

[0113] The memory 901 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0114] If the memory 901, the processor 902, and the communication interface 903 are implemented independently, the communication interface 903, the memory 901, and the processor 902 can be connected to each other via a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0115] Optionally, in a specific implementation, if the memory 901, the processor 902 and the communication interface 903 are integrated on a chip, the memory 901, the processor 902 and the communication interface 903 can communicate with each other through an internal interface.

[0116] The processor 902 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0117] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned ELF instrumentation parsing method when executed by a processor.

[0118] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0119] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0120] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0121] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0122] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0123] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for parsing ELF instrumentation, characterized in that: The following steps are involved: Receive a parsing instruction from a user, and parse an executable and linkable format ELF file according to the parsing instruction to obtain an ELF representation text; Based on the characterization text of described ELF, parse the ELF header files of multiple positions in the structural information of described ELF file and described ELF file; Search target symbol table according to described ELF header file, and extract measured variable and target function according to described target symbol table; Searching the symbolic debugging information table according to the ELF header file, and extracting the .c file corresponding to the measured variable and the target function from the symbolic debugging information table; as well as Parse the .c files corresponding to the measured variables and target functions, and insert preset stub codes.

2. The method according to claim 1, characterized in that The parsing of the .c file corresponding to the measured variable and the target function and inserting the preset stub code includes: Parsing the .c file corresponding to the measured variable and the objective function to obtain the end position of the measured variable and the objective function; The preset stub code is inserted before the end position.

3. The method according to claim 1, characterized in that The parsing of the ELF file includes: The ELF file is parsed through the command line using ielfdumparm.exe.

4. The method according to claim 1, wherein The symbolic debugging information table consists of a plurality of compile_units and statistical information of the plurality of compile_units.

5. An ELF instrumentation parsing device, characterized in that: include: A receiving module is used to receive a parsing instruction issued by a user, and parse the executable and linkable format ELF file according to the parsing instruction to obtain the representation text of the ELF; A first parsing module is used for parsing the ELF header files of multiple positions in the structural information of the ELF file and the ELF file based on the characterization text of the ELF file; Extraction module, for searching target symbol table according to described ELF header file, and extracting measured variable and target function according to described target symbol table; A debugging module is used to search the symbolic debugging information table according to the ELF header file, and extract the .c file corresponding to the measured variable and the target function from the symbolic debugging information table; as well as The second parsing module is used to parse the .c file corresponding to the measured variable and the target function, and insert a preset stub code.

6. The device according to claim 5, characterized in that The second parsing module is specifically used to: Parsing the .c file corresponding to the measured variable and the objective function to obtain the end position of the measured variable and the objective function; The preset stub code is inserted before the end position.

7. The device according to claim 5, characterized in that The parsing of the ELF file includes: The ELF file is parsed through the command line using ielfdumparm.exe.

8. The device according to claim 5, characterized in that The symbolic debugging information table consists of a plurality of compile_units and statistical information of the plurality of compile_units.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the ELF instrumentation parsing method according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the ELF instrumentation parsing method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Interception method and device applied to dynamic library API (Application Program Interface) in Linux system

    CN106325927A

  • Dynamic link library function hooking method, device and storage medium

    CN108415739A