Patch execution method and device
By obtaining and updating the thread variable address in the patch file, the problem of repairing defects without pause during process operation is solved, the process performance and speed are improved, and the patch file is ensured to be called normally in the process or dynamic library.
Patent Information
- Application Number
- CN202310357995.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
The existing technology is difficult to repair defects in the process without pause during the running of the process, which affects the performance and running speed of the process.
By obtaining the patch file, referencing the thread variables in the process or dynamic library, updating the offset and module ID in the GOT table, and obtaining the thread variable address, the patch file can be called normally in the process or dynamic library.
It realizes the repair of defects without suspending the process, improves the performance and running speed of the process, and ensures that the patch file can normally call the thread variables in the process and dynamic library.
Smart Images

Figure CN118733097A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a patch execution method and device. Background Art
[0002] There may be defects in the process while it is running. In order to make the process run normally, the defects in the process need to be corrected. If the process is paused to fix the defects, the performance and running speed of the process will be affected. How to fix the defects in the process without pausing the process needs further research. Summary of the invention
[0003] The present application provides a patch execution method and device, which realizes that a patch file can call thread variables in a process and thread variables in a dynamic library.
[0004] In a first aspect, the present application provides a patch execution method, characterized in that the method includes: obtaining a patch file, the patch file is used to repair defects existing in a first process, the patch file references a first thread variable, and the first thread variable is a thread variable defined in the first process or a first dynamic library; adding a GOT table to the patch file, the GOT table includes a first table item and a second table item, the first table item is an offset of the first thread variable, and the second table item is a module ID of the module where the first thread variable is located; obtaining the offset of the first thread variable as the first offset and the module ID of the module where the first thread variable is located as the first ID; updating the first offset and the first ID to the GOT table to obtain an updated patch file; running the updated patch file, obtaining the address of the first thread variable through the first function, the first function obtaining the address of the first thread variable through the first offset and the first ID in the GOT table; calling the first thread variable through the address of the first thread variable.
[0005] Here, the module ID of the module where the first thread variable is located may refer to the process ID of the process where the first thread variable is located or the dynamic library ID of the dynamic library where the first thread variable is located.
[0006] Through this method, the patch file can call the thread variables in the process and the thread variables in the dynamic library.
[0007] In combination with the first aspect, in a possible implementation, before obtaining the address of the first thread variable through the first function, the method also includes: obtaining a first instruction in the patch file that references the first thread variable; when the first instruction is not for obtaining the address of the first thread variable through a function, modifying the first instruction to a second instruction, the second instruction being for obtaining the address of the first thread variable through the first function; running the update patch file to obtain the address of the first thread variable through the first function, specifically including: running the update patch file and executing the second instruction in the update patch file to obtain the address of the first thread variable through the first function.
[0008] In this way, when the first thread variable is a thread variable in the first process and / or the first dynamic library, if the first instruction does not obtain the address of the first thread variable through a function, the first instruction is modified to a second instruction, and the second instruction obtains the address of the first thread variable through a system function, thereby ensuring that the patch file can normally call the first thread variable in the first process and the first thread variable in the first dynamic library.
[0009] In combination with the first aspect, in a possible implementation method, when the first instruction is for obtaining the address of the first thread variable not through a function, the first instruction is modified to a second instruction, specifically including: when the first instruction is for obtaining the address of the first thread variable not through a function and the first thread variable is a thread variable defined in a first dynamic library, the first instruction is modified to the second instruction.
[0010] In this way, only when the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified to the second instruction, ensuring that the patch file can normally call the first thread variable in the first dynamic library.
[0011] In combination with the first aspect, in a possible implementation, the method further includes: when the first thread variable is a thread variable defined in the first process, running the update patch file and executing the first instruction in the update patch file to obtain the address of the first thread variable.
[0012] The first instruction is to obtain the address of the first thread variable through the first process. In this way, when the first thread variable is a thread variable defined in the first process, the first process can directly obtain the address of the first thread variable, thereby eliminating the need to modify the first instruction into the second instruction.
[0013] In combination with the first aspect, in a possible implementation method, the first offset and the first ID are updated to the GOT table to obtain an updated patch file, specifically including: before loading the patch file, obtaining the offset of the first thread variable as the first offset, setting the module ID of the module where the first thread variable is located to the second value, and updating the first offset and the second value to the GOT table; after loading the patch file, obtaining the module ID of the module where the first thread variable is located as the first value, and changing the module ID of the module where the first thread variable is located in the GOT table from the second value to the first value to obtain an updated patch file.
[0014] In this way, regardless of whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library, the module ID of the module where the first thread variable is located is obtained after the patch file is loaded.
[0015] In combination with the first aspect, in a possible implementation method, the first offset and the first ID are updated to the GOT table to obtain an updated patch file, specifically including: before loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table; after loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is changed from the second value to the first value to obtain an updated patch file.
[0016] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, after loading the patch file, the dynamic library ID of the first dynamic library where the first thread variable is located is obtained.
[0017] In combination with the first aspect, in a possible implementation method, the method also includes: before loading the patch file, when the first thread variable is a thread variable defined in the first process, obtaining the offset of the first thread variable as the first offset and the module ID of the module where the first thread variable is located as the first ID, and updating the first offset and the first ID to the GOT table to obtain an updated patch file.
[0018] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first process, the process ID of the first process where the first thread variable is located can be obtained before loading the patch file.
[0019] In combination with the first aspect, in a possible implementation, the first thread control block stores the content of the segment including the first thread variable in the first dynamic library or the first process, the first thread control block is used to store the data of the first thread calling the first thread variable, the first ID is the dynamic library ID of the first dynamic library or the process ID of the first process; the address of the first thread variable is obtained through the first function, specifically including: obtaining the addresses of multiple thread control blocks based on the first ID through the first function; obtaining the address of the first thread control block from the addresses of multiple thread control blocks based on the first thread ID; obtaining the address of the first thread variable based on the address of the first thread control block and the first offset through the first function. Afterwards, the address of the first thread variable is passed to the first thread through the first function.
[0020] In this way, whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0021] In combination with the first aspect, in a possible implementation, the first thread control block stores the content of the segment where the first thread variable in the first dynamic library is located, and the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library; the address of the first thread variable is obtained through the first function, specifically including: obtaining the addresses of multiple thread control blocks based on the first ID through the first function; obtaining the address of the first thread control block from the addresses of multiple thread control blocks based on the first thread ID through the first function; obtaining the address of the first thread variable based on the address of the first thread control block and the first offset through the first function; passing the address of the first thread variable to the first thread through the first function.
[0022] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0023] In combination with the first aspect, in a possible implementation manner, the first thread control block stores content of a segment where a first thread variable in the first process is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is a process ID of the first process;
[0024] Running the update patch file and executing the first instruction in the update patch file to obtain the address of the first thread variable specifically includes: running the update patch file and executing the first instruction in the update patch file; in response to the first instruction, obtaining the first address of the first process through the first process; determining the addresses of multiple thread control blocks through the first process based on the first address, the second offset and the third offset of the first process, wherein the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value; obtaining the address of the first thread control block from the addresses of the multiple thread control blocks based on the first thread ID through the first process; obtaining the address of the first thread variable through the first process based on the address of the first thread control block and the first offset; passing the address of the first thread variable to the first thread through the first process.
[0025] The third offset may be the size of a thread control block.
[0026] In this way, when the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable can be directly obtained through the first process.
[0027] In a second aspect, the present application provides a patch execution device, which includes an acquisition module, an execution module and a calling module; wherein the acquisition module is used to obtain a patch file, the patch file is used to repair defects existing in a first process, and the patch file references a first thread variable, which is a thread variable defined in the first process or a first dynamic library.
[0028] Execution module for:
[0029] A GOT table is added in the patch file. The GOT table includes a first table entry and a second table entry. The first table entry is the offset of the first thread variable, and the second table entry is the module ID of the module where the first thread variable is located.
[0030] The offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID.
[0031] Update the first offset and the first ID into the GOT table to obtain an update patch file.
[0032] The update patch file is run, and the address of the first thread variable is obtained through the first function. The first function obtains the address of the first thread variable through the first offset and the first ID in the GOT table.
[0033] The calling module is used to call the first thread variable through the address of the first thread variable.
[0034] Through this method, the patch file can call the thread variables in the process and the thread variables in the dynamic library.
[0035] In conjunction with the second aspect, in a possible implementation manner, the execution module is further configured to:
[0036] The first instruction referencing the first thread variable in the patch file is obtained.
[0037] In the case where the first instruction is for obtaining the address of the first thread variable not through a function, the first instruction is modified into a second instruction, and the second instruction is for obtaining the address of the first thread variable through the first function.
[0038] The execution module is specifically used to run the update patch file and execute the second instruction in the update patch file, and obtain the address of the first thread variable through the first function.
[0039] In this way, when the first thread variable is a thread variable in the first process and / or the first dynamic library, if the first instruction does not obtain the address of the first thread variable through a function, the first instruction is modified to a second instruction, and the second instruction obtains the address of the first thread variable through a system function, thereby ensuring that the patch file can normally call the first thread variable in the first process and the first thread variable in the first dynamic library.
[0040] In combination with the second aspect, in a possible implementation, the execution module is specifically used to modify the first instruction into the second instruction when the first instruction is not to obtain the address of the first thread variable through a function and the first thread variable is a thread variable defined in the first dynamic library.
[0041] In this way, only when the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified to the second instruction, ensuring that the patch file can normally call the first thread variable in the first dynamic library.
[0042] In combination with the second aspect, in a possible implementation, the execution module is also used to run the update patch file and execute the first instruction in the update patch file to obtain the address of the first thread variable when the first thread variable is a thread variable defined in the first process.
[0043] The first instruction is to obtain the address of the first thread variable through the first process. In this way, when the first thread variable is a thread variable defined in the first process, the first process can directly obtain the address of the first thread variable, thereby eliminating the need to modify the first instruction into the second instruction.
[0044] In conjunction with the second aspect, in a possible implementation manner, the execution module is specifically configured to:
[0045] Before loading the patch file, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table.
[0046] After loading the patch file, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain an updated patch file.
[0047] In this way, regardless of whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library, the module ID of the module where the first thread variable is located is obtained after the patch file is loaded.
[0048] In conjunction with the second aspect, in a possible implementation manner, the execution module is specifically configured to:
[0049] Before loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table.
[0050] After loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain an updated patch file.
[0051] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, after loading the patch file, the dynamic library ID of the first dynamic library where the first thread variable is located is obtained.
[0052] In combination with the second aspect, in a possible implementation method, the execution module is also used to, before loading the patch file, when the first thread variable is a thread variable defined in the first process, obtain the offset of the first thread variable as the first offset and the module ID of the module where the first thread variable is located as the first ID, and update the first offset and the first ID to the GOT table to obtain an updated patch file.
[0053] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first process, the process ID of the first process where the first thread variable is located can be obtained before loading the patch file.
[0054] In combination with the second aspect, in one possible implementation, the first thread control block stores the contents of a segment in a first dynamic library or in a first process including a first thread variable, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library or the process ID of the first process.
[0055] Get the module, specifically for:
[0056] The addresses of the plurality of thread control blocks are acquired based on the first ID through the first function.
[0057] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID.
[0058] The address of the first thread variable is obtained through the first function based on the address of the first thread control block and the first offset. Afterwards, the address of the first thread variable is transferred to the first thread through the first function.
[0059] In this way, whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0060] In combination with the second aspect, in a possible implementation, the first thread control block stores the contents of the segment where the first thread variable in the first dynamic library is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library.
[0061] Get the module, specifically for:
[0062] The addresses of the plurality of thread control blocks are acquired based on the first ID through the first function.
[0063] The address of the first thread control block is obtained from the addresses of the plurality of thread control blocks based on the first thread ID through the first function.
[0064] The address of the first thread variable is obtained based on the address of the first thread control block and the first offset through the first function. The address of the first thread variable is transferred to the first thread through the first function.
[0065] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0066] In combination with the second aspect, in a possible implementation, the first thread control block stores the contents of the segment where the first thread variable in the first process is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the process ID of the first process.
[0067] Get the module, specifically for:
[0068] Run the update patch file and execute the first instruction in the update patch file.
[0069] In response to the first instruction, a first address of the first process is acquired through the first process.
[0070] The addresses of multiple thread control blocks are determined by the first process based on the first address, second offset and third offset of the first process, the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value.
[0071] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID through the first process.
[0072] The address of the first thread variable is acquired through the first process based on the address of the first thread control block and the first offset.
[0073] The address of the first thread variable is passed to the first thread by the first process.
[0074] The third offset may be the size of a thread control block.
[0075] In this way, when the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable can be directly obtained through the first process.
[0076] In a third aspect, the present application provides another patch execution device, the device comprising a memory and a processor. The memory is used to store computer program code, the computer program code comprises computer instructions, and the processor calls the computer instructions to make the patch execution device execute:
[0077] A patch file is obtained, where the patch file is used to repair defects in the first process. The patch file references a first thread variable, where the first thread variable is a thread variable defined in the first process or a first dynamic library.
[0078] A GOT table is added in the patch file. The GOT table includes a first table entry and a second table entry. The first table entry is the offset of the first thread variable, and the second table entry is the module ID of the module where the first thread variable is located.
[0079] The offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID; the first offset and the first ID are updated to the GOT table to obtain an update patch file.
[0080] The update patch file is run, and the address of the first thread variable is obtained through the first function. The first function obtains the address of the first thread variable through the first offset and the first ID in the GOT table.
[0081] The first thread variable is called by the address of the first thread variable.
[0082] The patch file can call thread variables in the process and in the dynamic library.
[0083] In conjunction with the third aspect, in a possible implementation manner, the processor calls a computer instruction to cause the patch execution device to execute:
[0084] The first instruction referencing the first thread variable in the patch file is obtained.
[0085] In the case where the first instruction is for obtaining the address of the first thread variable not through a function, the first instruction is modified into a second instruction, and the second instruction is for obtaining the address of the first thread variable through the first function.
[0086] The update patch file is run and the second instruction in the update patch file is executed, and the address of the first thread variable is obtained through the first function.
[0087] In this way, when the first thread variable is a thread variable in the first process and / or the first dynamic library, if the first instruction does not obtain the address of the first thread variable through a function, the first instruction is modified to a second instruction, and the second instruction obtains the address of the first thread variable through a system function, thereby ensuring that the patch file can normally call the first thread variable in the first process and the first thread variable in the first dynamic library.
[0088] In conjunction with the third aspect, in a possible implementation manner, the processor calls a computer instruction to cause the patch execution device to execute:
[0089] In a case where the first instruction is to obtain the address of the first thread variable without using a function and the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified into a second instruction.
[0090] In this way, only when the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified to the second instruction, ensuring that the patch file can normally call the first thread variable in the first dynamic library.
[0091] In conjunction with the third aspect, in a possible implementation manner, the processor calls a computer instruction to cause the patch execution device to execute:
[0092] In the case where the first thread variable is a thread variable defined in the first process, the update patch file is run and the first instruction in the update patch file is executed to obtain the address of the first thread variable.
[0093] The first instruction is to obtain the address of the first thread variable through the first process. In this way, when the first thread variable is a thread variable defined in the first process, the first process can directly obtain the address of the first thread variable, thereby eliminating the need to modify the first instruction into the second instruction.
[0094] In conjunction with the third aspect, in a possible implementation manner, the processor calls a computer instruction to cause the patch execution device to execute:
[0095] Before loading the patch file, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table.
[0096] After loading the patch file, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain an updated patch file.
[0097] In this way, regardless of whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library, the module ID of the module where the first thread variable is located is obtained after the patch file is loaded.
[0098] In conjunction with the third aspect, in a possible implementation manner, the processor calls a computer instruction to cause the patch execution device to execute:
[0099] Before loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table.
[0100] After loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain an updated patch file.
[0101] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, after loading the patch file, the dynamic library ID of the first dynamic library where the first thread variable is located is obtained.
[0102] In combination with the third aspect, in a possible implementation method, the processor calls a computer instruction to enable the patch execution device to execute: before loading the patch file, when the first thread variable is a thread variable defined in the first process, the offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID, and the first offset and the first ID are updated to the GOT table to obtain an updated patch file.
[0103] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first process, the process ID of the first process where the first thread variable is located can be obtained before loading the patch file.
[0104] In combination with the third aspect, in a possible implementation, the first thread control block stores the contents of a segment in a first dynamic library or in a first process including a first thread variable, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library or the process ID of the first process.
[0105] The processor invokes computer instructions to cause the patch execution device to execute:
[0106] The addresses of the plurality of thread control blocks are acquired based on the first ID through the first function.
[0107] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID.
[0108] The address of the first thread variable is obtained through the first function based on the address of the first thread control block and the first offset. Afterwards, the address of the first thread variable is transferred to the first thread through the first function.
[0109] In this way, whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0110] In combination with the third aspect, in a possible implementation, the first thread control block stores the contents of the segment where the first thread variable in the first dynamic library is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library.
[0111] The processor invokes computer instructions to cause the patch execution device to execute:
[0112] The addresses of the plurality of thread control blocks are acquired based on the first ID through the first function.
[0113] The address of the first thread control block is obtained from the addresses of the plurality of thread control blocks based on the first thread ID through the first function.
[0114] The address of the first thread variable is obtained based on the address of the first thread control block and the first offset through the first function. The address of the first thread variable is transferred to the first thread through the first function.
[0115] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0116] In combination with the third aspect, in a possible implementation, the first thread control block stores the contents of the segment where the first thread variable in the first process is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the process ID of the first process.
[0117] The processor invokes computer instructions to cause the patch execution device to execute:
[0118] Run the update patch file and execute the first instruction in the update patch file.
[0119] In response to the first instruction, a first address of the first process is acquired through the first process.
[0120] The addresses of multiple thread control blocks are determined by the first process based on the first address, second offset and third offset of the first process, the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value.
[0121] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID through the first process.
[0122] The address of the first thread variable is acquired through the first process based on the address of the first thread control block and the first offset.
[0123] The address of the first thread variable is passed to the first thread by the first process.
[0124] The third offset may be the size of a thread control block.
[0125] In this way, when the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable can be directly obtained through the first process.
[0126] In a fourth aspect, the present application provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed on a patch execution device, the patch execution device executes a patch execution method provided in any possible implementation of the first aspect above.
[0127] In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a patch execution device, the patch execution device executes a patch execution method provided in any possible implementation of the first aspect above.
[0128] For the beneficial effects of the second to fifth aspects, reference may be made to the description of the beneficial effects in the first aspect, and this application will not elaborate on them here. BRIEF DESCRIPTION OF THE DRAWINGS
[0129] Figure 1 A schematic diagram of a patching method flow chart provided in an embodiment of the present application;
[0130] Figure 2 A schematic diagram of making a patch file provided in an embodiment of the present application;
[0131] Figure 3A A schematic diagram of how to generate a patch file provided in an embodiment of the present application;
[0132] Figure 3B A schematic diagram of a software structure for implementing a patch provided in an embodiment of the present application;
[0133] Figure 4 A schematic diagram of a method for loading and running a patch function provided in an embodiment of the present application;
[0134] Figure 5 A patch loading process for the Datacom V8 platform provided in an embodiment of the present application;
[0135] Figure 6A-6G A set of code implementation schematic diagrams provided for embodiments of the present application;
[0136] Figure 7 A flowchart of a function execution method provided by this application;
[0137] Figure 8 A schematic diagram of a patch execution device provided for this application;
[0138] Fig. 9 A schematic diagram of another patch execution device provided for this application. DETAILED DESCRIPTION
[0139] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0140] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0141] First, the technical terms involved in this application are explained.
[0142] 1. Processes and threads
[0143] A process is a program in a computer with certain independent functions, and is an operation activity related to a certain data set. The process is also the basis of the operating system structure, and the application programs in the computer are run by processes.
[0144] A thread is an execution unit in a process, responsible for executing the program in the current process. There is at least one thread in a process. There can be multiple threads in a process. The computer allocates resources to the process, and all threads in the same process share all the resources of the process.
[0145] 2. Variables and thread variables (thread local storage, TLS)
[0146] A variable is a name that represents some values in a computer's memory. It is usually a letter, character or word. A variable is an abstract concept in computer language that can store calculation results or represent numerical values. A variable is also a place where applications on a computer temporarily store data when they are running. A variable can be accessed by its address.
[0147] As the name implies, thread variables are the names of some values defined in a thread. Thread variables can be accessed through the address of the thread variable. When a thread variable is accessed by other threads, the data structure is the same, but the value is different. In other words, a thread variable can have different values in different threads. If thread variable sharing can be achieved, the purpose of creating a thread variable that is shared by multiple threads can be achieved. It can also reduce the memory space occupied by creating multiple thread variables.
[0148] Thread variables can include static thread variables and global thread variables. Static thread variables can also be called local thread variables. Among them, local thread variables are limited to being called by this file, and other files cannot call the thread variable. For example, a process can be composed of multiple files, such as multiple files including a first file, a second file, and a third file. Among them, the first thread variable is defined in the first file, and the first thread variable is a static thread variable. Then the first thread variable can only be called by the first file, and the second file and the third file cannot call the first thread variable.
[0149] Global thread variables are not limited to file calls, but can also be called by other files. In other words, global thread variables can be called by all files to achieve sharing. For example, a process can be composed of multiple files, such as a first file, a second file, and a third file. The first thread variable is defined in the first file, and the first thread variable is a global thread variable. Then the first thread variable can only be called by the first file, and the second and third files can also call the first thread variable.
[0150] 3. Dynamic link library (DLL)
[0151] A dynamic library is also called a dynamic link library. A DLL is a library that contains code and data that can be used by multiple programs at the same time. A DLL is not an executable file. Dynamic linking provides a way for a process to call functions that are not part of its executable code. The executable code of a function is located in a DLL, which contains one or more functions that have been compiled, linked, and stored separately from the processes that use them. DLLs also help share data and resources.
[0152] The dynamic library includes thread variables. The thread variables in the dynamic library include static thread variables and global thread variables. The calling rules of static thread variables and global thread variables in the dynamic library are similar to the calling rules of static thread variables and global thread variables in the process. Please refer to the above description, and this application will not repeat them here.
[0153] 4. Hot patch: fix some vulnerabilities and defects in the process without restarting the process.
[0154] The present application proposes a patch method. The present application supports a method for referencing thread variables in a process and / or thread variables in a dynamic library in a patch file. Before running the patch file, it is determined that a first thread variable is referenced in the patch file, and a GOT table corresponding to the first thread variable can be newly added to the patch file, and the GOT table includes two table items: an offset value and a module ID. When making a patch file, first assign the offset value in the GOT table. When loading the patch file, modify the value of the module ID in the GOT table. Finally, the offset value and the module ID in the GOT table are used as input parameters of the first function, so that the first function can obtain the address of the first thread variable. When running the patch file, the purpose of referencing the first thread variable can be achieved based on the address of the first thread variable.
[0155] It should be noted that the patch file is not limited to one thread variable, and more thread variables can be referenced in the patch file, which is not limited in this application. This application only takes how the patch file references the first thread variable as an example for explanation.
[0156] Figure 1 A schematic diagram of a patching method flow chart provided in an embodiment of the present application.
[0157] S101. Determine that a software failure has occurred.
[0158] A software failure may be that the functions implemented in the software are different from the expected functions, so the software failure needs to be repaired so that the software can achieve the expected functions.
[0159] Alternatively, software failure may also refer to a software code writing error, which causes the software to report an error during execution. The software failure needs to be repaired so that the software can run normally.
[0160] S102: Determine the location where the software fails.
[0161] Based on the software failure in S101, the location where the software failure occurs can be determined.
[0162] S103: Determine a solution.
[0163] Based on the software failure, the staff can determine a solution that can fix the software failure.
[0164] S104. Based on the solution, obtain a patch code.
[0165] Based on the solution, the staff can rewrite the code to get the patch code, which can fix the above software failure.
[0166] S105, compile the patch code and output it as a .obj file.
[0167] The obj file is a computer binary file format, which is a relocatable target program file. It is compiled by the compiler from the source code file. Here, making a patch requires compiling the patch code into a .obj file.
[0168] S106. Make the .obj file into a patch file.
[0169] The .obj file compiled and output by the patch code can be made into a patch file through the patch tool.
[0170] The GOT table corresponding to the thread variable (e.g., the first thread variable) referenced by the patch file also needs to be added to the patch file. The GOT table includes two table items: the offset value of the first thread variable and the module ID of the module where the first thread variable is located. When making a patch file, the offset value of the first thread variable in the GOT table is first assigned.
[0171] This patch file can repair the vulnerabilities and defects in the program.
[0172] S107: Load and run the patch file.
[0173] Loading and running the patch file includes the following steps: loading the patch file, processing symbols in the patch file, running the patch file, etc. After loading the patch file, it is necessary to assign a value to the module ID of the module where the first thread variable is located in the GOT table of the patch file. Afterwards, the address of the first thread variable can be obtained based on the offset value of the first thread variable and the module ID of the module where the first thread variable is located through a first function (such as the __tls_get_addr function). When running the patch file, the first thread variable can be accessed through the address of the first thread variable, thereby achieving the purpose of referencing thread variables in processes and / or dynamic libraries in the patch.
[0174] For a detailed description of the S107 embodiment, please refer to Figure 2 and Figure 4 The description in the embodiments is not repeated here.
[0175] S108. Repair software failures.
[0176] After running the patch file, the faults and vulnerabilities in the software can be modified. In this way, some vulnerabilities and defects in the program can be repaired without restarting the program.
[0177] The following is a detailed introduction on how to make a patch file.
[0178] To make a patch file, it is necessary to add the GOT table corresponding to the thread variable (e.g., the first thread variable) referenced by the patch file to the patch file. The GOT table includes two table items: the offset value of the first thread variable and the module ID of the module where the first thread variable is located. When making a patch file, first assign the offset value of the first thread variable in the GOT table.
[0179] Figure 2 A schematic diagram showing how to make a patch file.
[0180] S201. Obtain a first thread variable called in a patch file.
[0181] The first thread variable may be a thread variable in a process or a thread variable in a dynamic library.
[0182] S202: Generate a GOT table of the first thread variable, where the GOT table includes two entries.
[0183] Table 1
[0184] Offset of thread variable The module ID of the module where the thread variable is located
[0185] Table 1 shows a generated GOT table. The GOT includes at least two table entries: the offset of the thread variable and the module ID of the module where the thread variable is located.
[0186] Among them, the offset of the thread variable is the offset in the segment where the thread variable is located. The segment may include a data segment, a code segment, a symbol table segment, etc. For example, the thread variable may be in a bin file or in a so file. The bin file is the executable file of the process, and the so file can be loaded by the process file to execute the code therein. The bin file may include multiple segments, and it is possible to determine in which segment of the multiple segments the thread variable is located, and then determine the offset of the position of the thread variable in the segment from the beginning of the segment. For example, the thread variable is the nth thread variable defined in the segment. If the size of each variable is m, then the offset of the thread variable from the header of the segment is (n-1)*m.
[0187] Similarly, a so file can also include multiple segments, and the thread variable can be determined in which segment of the multiple segments, and then the offset of the thread variable in the segment from the beginning of the segment can be determined. For example, if the thread variable is the nth thread variable defined in the segment, and the size of each variable is m, then the offset of the thread variable from the beginning of the segment is (n-1)*m.
[0188] The module ID of the module where the thread variable is located is the process ID of the process where the thread variable is located or the dynamic library ID of the dynamic library where the thread variable is located. The process ID is the process number. After the process is running, the process ID is unique. The dynamic library ID is the dynamic library number. After the dynamic library is running, the dynamic library ID is unique.
[0189] S203, assigning a value to the offset of the first thread variable in the GOT table.
[0190] After determining the first thread variable referenced by the patch file, the offset of the first thread variable can be determined. Therefore, the offset of the first thread variable can be directly written into the GOT table, that is, the offset of the first thread variable in the GOT table is assigned a value.
[0191] S204: Assign an initial value to the module ID of the module where the first thread variable in the GOT table is located.
[0192] After determining the first thread variable referenced by the patch file, it is also necessary to assign a value to the module ID of the module where the first thread variable is located in the GOT table.
[0193] S204 includes but is not limited to the following two implementations.
[0194] Method 1: Do not distinguish whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library. Directly assign an initial value to the module ID of the module where the first thread variable is located, and the initial value may be a preset value.
[0195] After the patch is loaded, it will be distinguished according to whether the first thread variable is defined in the process or the dynamic library. If the first thread variable is a thread variable defined in the process, the process ID of the first process can be obtained, and then the module ID in the new GOT table is modified from the initial value to the process ID of the first process. If it is a thread variable defined in the dynamic library, the dynamic library ID of the first dynamic library can be obtained, and then the module ID in the new GOT table is modified from the initial value to the dynamic library ID of the first dynamic library.
[0196] Method 2: It is necessary to distinguish whether the first thread variable is a thread variable in the process or a thread variable in the dynamic library.
[0197] In the case where the first thread variable is a thread variable in a process, the process ID of the process where the first thread variable is located can be determined, and the process is the process to be patched. For example, the process can be the corresponding process position of the software fault shown in S101, for example, the process can be called the first process. The first process has been running without restarting, so the process ID of the first process can be determined. After determining the process ID of the first process where the first thread variable is located, the module ID of the module where the first thread variable is located in the GOT table can be assigned to the process ID of the first process.
[0198] In the case where the first thread variable is a thread variable in a dynamic library, since the patch file is made offline, the patch file cannot determine what the dynamic library ID of the dynamic library that calls the dynamic library is. Only after the patch file is loaded, the dynamic library ID of the first dynamic library where the first thread variable is located can be dynamically obtained. Therefore, before loading and running the patch file, the dynamic library ID of the first dynamic library where the first thread variable is located can be assigned an initial value. After loading and running the patch file, after determining that the dynamic library ID of the first dynamic library is the first value, the dynamic library ID of the first dynamic library where the first thread variable is located in the GOT table is modified from the initial value to the first value. Among them, it is also necessary to store the one-to-one correspondence between the dynamic library ID (first value) of the first dynamic library and the name of the first dynamic library.
[0199] For example, the first process may call the first thread variable in the first dynamic library. At this time, the dynamic library ID of the first dynamic library called by the first process may be 1. Afterwards, the first process may call the second thread variable in the second dynamic library. At this time, the dynamic library ID of the second dynamic library called by the first process may be 2. Afterwards, the first process may call the third thread variable in the third dynamic library. At this time, the dynamic library ID of the third dynamic library called by the first process may be 3.
[0200] At the same time, the second process can also call the dynamic library. The second process can call the second thread variable in the second dynamic library. At this time, the dynamic library ID of the second dynamic library called by the second process can be 1. Afterwards, the second process can call the first thread variable in the first dynamic library. At this time, the dynamic library ID of the first dynamic library called by the first process can be 2.
[0201] It can be seen from this that different processes calling dynamic libraries are isolated from each other and do not interfere with each other. The dynamic library IDs of different dynamic libraries called by the same process are related to the order in which the dynamic libraries are called by the same process.
[0202] Therefore, if the patch file calls the thread variable in the dynamic library. After the patch file is loaded, the dynamic library ID of the dynamic library called by the patch file can be dynamically obtained, and the dynamic library ID of the dynamic library cannot be obtained offline. The dynamic library called by the patch file may or may not have been called by the first process before. If it has been called by the first process before, the dynamic library ID of the dynamic library is determined, but it cannot be obtained offline. The dynamic library ID of the dynamic library can only be obtained after the patch file is loaded. If it has not been called by the first process before, the dynamic library ID of the dynamic library is unknown, and it cannot be obtained offline. The dynamic library ID of the dynamic library can only be obtained after the patch file is loaded.
[0203] After the process is loaded, the process ID of the process is uniquely determined, for example, 1. Therefore, when the thread variable called in the patch file is a thread variable in the process, the process ID of the process can be obtained offline.
[0204] S205. Modify the first instruction in the patch file for calling the first thread variable into a second instruction, where the second instruction includes obtaining the address of the first thread variable through the first function and accessing the first thread variable through the address of the first thread variable.
[0205] In S205, it is not distinguished whether the first thread variable is a thread variable in the process or a thread variable in the dynamic library. The first instruction for calling the first thread variable in the patch file is directly obtained. Before executing S205, it is necessary to confirm whether the first instruction is implemented by obtaining the address of the first thread variable through a function and then accessing the first thread variable. If not, the first instruction needs to be modified to a second instruction, and the second instruction includes obtaining the address of the first thread variable through a first function, and accessing the first thread variable through the address of the first thread variable. In this way, it can be avoided that when the first thread variable is a thread variable in the dynamic library, an error occurs when accessing the first thread variable through the first instruction. If so, there is no need to modify the first instruction. The first instruction itself is implemented by obtaining the address of the first thread variable through a function and then accessing the first thread variable, which can ensure that there will be no error when accessing the thread variable in the process or the thread variable in the dynamic library.
[0206] The purpose of the above-mentioned execution judgment step is that after the process is running, before the process is closed and restarted, the address of the thread variable in the process is uniquely determined. The process can directly obtain the address of the first thread variable.
[0207] However, the dynamic library can be called by different processes. When the first thread in the first process calls the thread variable (for example, the first thread variable) in the first dynamic library, in order to isolate the data of the same thread variable called by different threads. A thread control block can be created for each thread, and the thread control block is used to store the data of different threads, and the addresses of different thread control blocks are also different. For example, a first thread control block is created, and the first thread control block is used to store the data of the first thread, and the corresponding relationship between the first thread ID and the first thread control block ID is stored. After the first thread control block of the thread is created, the segment copy of the first thread variable in the first dynamic library will be stored in the first thread control block. And the first thread control block is stored in the memory space allocated by the first process.
[0208] For another example, when the second thread in the first process calls the thread variable (e.g., the first thread variable) in the first dynamic library, a second thread control block is also created. The second thread control block is used to store the data of the second thread and stores the corresponding relationship between the second thread ID and the second thread control block ID. After the second thread control block is created, the segment copy of the first thread variable in the first dynamic library is stored in the second thread control block. The second thread control block is stored in the memory space allocated by the first process.
[0209] Since different processes load dynamic libraries randomly, and the same dynamic library can be called by multiple different processes at the same time. Therefore, when threads in the same process call thread variables in the same dynamic library at different times, the storage addresses of the segments where the thread variables in the same dynamic library are located are different, that is, the storage addresses of the thread control blocks are different. For example, when the first thread in the first process calls the first thread variable in the first dynamic library for the first time, the storage address of the first thread control block is the first address, and when the first thread variable in the first dynamic library is called for the second time after the first process is restarted, the storage address of the first thread control block is the second address, and the second address and the first address may be different, and may also be the same in some embodiments. Moreover, the address of the first thread control block is randomly assigned, and the address of the first thread control block has nothing to do with the offset of the first thread variable defined in the first dynamic library from the first address of the first dynamic library, and the first process cannot obtain the address of the first thread control block corresponding to the first thread variable in the dynamic library each time it is called.
[0210] After loading the patch file, if the first thread variable is called in the patch file, it is necessary to determine the address of the first thread control block corresponding to the first thread. Then determine the address of the first thread variable. Since the first process cannot obtain the address of the first thread control block corresponding to the first thread variable in the dynamic library. At this time, a system function, such as a first function, can be called to obtain the address of the first thread control block through the first function. Specifically, the dynamic library ID and the first offset of the first dynamic library can be used as input parameters of the first function. The first function can obtain the addresses of multiple thread control blocks corresponding to the first thread variable in the first dynamic library based on the dynamic library ID of the first dynamic library. Because the first thread variable can be called by multiple threads, it is necessary to create a thread control block corresponding to each thread. The first function then determines the address of the first thread control block from multiple thread control blocks based on the first thread ID. The first thread control block is used to store the data of the first thread. The first function then obtains the address of the first thread variable in the first dynamic library based on the address of the first thread control block and the first offset. Then, the first thread variable can be called based on the address of the first thread variable. Here, the first offset can be the offset of the first thread variable recorded in the GOT table.
[0211] Therefore, when the first thread variable called by the patch file is a thread variable in the first dynamic library, the first process cannot obtain the address of the first thread control block corresponding to the first thread variable. At this time, the address of the first thread variable called in the patch file cannot be obtained. After loading the patch file, it is necessary to obtain the address of the first thread control block through the system function. Therefore, it is necessary to determine whether the first instruction is implemented by obtaining the address of the first thread variable through the system function and then accessing the first thread variable. If so, there is no need to modify the first instruction to the second instruction. If not, the first instruction needs to be modified to the second instruction, and the second instruction includes the address of the first thread variable obtained through the first function.
[0212] Based on the above analysis, in other possible implementations, S205 may also be replaced by other implementations.
[0213] Specifically, it is necessary to distinguish whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library. In the case where the first thread variable is a thread variable in the first process, and the first instruction does not obtain the address of the first thread variable through a function and then accesses the first thread variable, but directly obtains the address of the first thread variable to access the first thread variable, the first instruction may not be modified to the second instruction, and the first thread variable may be accessed directly based on the first instruction. Of course, the first instruction may also be modified to the second instruction, and the first thread variable may be accessed through the second instruction.
[0214] In the case where the first thread variable is a thread variable in the first dynamic library, and the first instruction is not to obtain the address of the first thread variable through a function and then access the first thread variable, but to directly obtain the address of the first thread variable to access the first thread variable, the first instruction needs to be modified to a second instruction, and the first thread variable is accessed through the second instruction to avoid access errors. In the case where the first instruction is to obtain the address of the first thread variable through a function and then access the first thread variable, the first thread variable can be accessed through an address instruction.
[0215] After the first instruction is modified to the second instruction, the two table entries in the GOT table may be used as input parameters of the first function, so that the first function can obtain the address of the first thread variable and access the first thread variable. In the case where the first thread variable is a thread variable in the first dynamic library, since the patch file is made offline, the dynamic library ID of the first dynamic library where the first thread variable is located in the GOT table cannot be determined. Therefore, in S205, the address of the first thread variable cannot be obtained through the first function. At this time, the input parameters of the first function can be prepared first, and after the dynamic library ID of the first dynamic library is determined later, the dynamic library ID of the first dynamic library where the first thread variable is located in the GOT table is modified, so that the first function can obtain the address of the first thread variable.
[0216] After the first instruction is modified into the second instruction, obtaining the address of the first thread variable through the first function specifically includes:
[0217] In the case where the first thread variable is a thread variable defined in the first process, the first function can obtain the addresses of multiple thread control blocks corresponding to the first thread variable in the first process through the process ID of the first process. Because the first thread variable can be called by multiple threads, it is necessary to create a thread control block corresponding to each thread. The first function then determines the address of the first thread control block from the multiple thread control blocks based on the first thread ID. The first function then obtains the address of the first thread variable based on the address of the first thread control block and the offset of the first thread variable.
[0218] When the first thread variable is a thread variable defined in the first dynamic library, and when the first thread variable is called by the first thread, the first function can obtain the thread control block ID of one or more thread control blocks in the first dynamic library through the dynamic library ID of the first dynamic library, and the first function then obtains the first thread control block ID corresponding to the first thread ID from the one or more thread control block IDs based on the first thread ID, and the first function then obtains the address of the first thread control block based on the first thread control block ID, and finally the first function obtains the address of the first thread variable based on the address of the first thread control block and the offset of the first thread variable, and the first function then passes the address of the first thread variable to the first thread in the first process, and then the first thread can call the first thread variable based on the address of the first thread variable.
[0219] In the case where the first thread variable is a thread variable in the first process, in S205, the first instruction can be directly executed to obtain the address of the first thread variable through the first process. The offset of the first thread variable defined in the first process from the first process head address is determined. For example, the first process includes p segments, and the segments may include data segments, code segments, symbol table segments, etc. The first thread variable is in the p+1th segment. The total length of the first p segments is q, and the first thread variable is the nth thread variable defined in the p+1th segment. If the size of each variable is m, the offset of the first thread variable from the first process header is q+(n-1)*m.
[0220] Here, the offset of the first thread variable in the first process from the first process header is fixed. The offset of the first instruction in the first process from the first process header is also fixed. Then the offset of the first thread variable in the first process from the first instruction in the first process is also fixed. The offset of the first thread variable in the first process from the first instruction in the first process can be recorded as the second offset, and the second offset is a fixed value. The second offset is similar to the offset of the first thread variable from the first process header.
[0221] After the first process is running, a storage address is allocated for the first thread variable in the first process. The storage address is used to store the content of the segment where the first thread variable is located. The storage address can be obtained based on the first address of the first process and the second offset.
[0222] For example, when a first thread in a first process calls a thread variable (e.g., a first thread variable) in the first process, in order to isolate the data of different threads calling the same thread variable from each other. A thread control block can be created for each thread, for example, a first thread control block can be created for the first thread, and a copy of the segment of the first thread variable in the first process is stored in the first thread control block, the segment of the first thread variable in the first process can be obtained based on the storage address indicated by the first address of the first process and the second offset, and the segment of the first thread variable in the first process can also be obtained from the first process file. The storage address of the first thread control block can be obtained based on the address of the first instruction in the first process, the second offset, and a third offsets, the third offset is a preset value, a is a positive integer greater than or equal to 1, for example, the size of the third offset can be the size of a thread control block. When a second thread in the first process calls the first thread variable in the first process, a second thread control block can be created for the second thread, and a copy of the segment of the first thread variable in the first process is stored in the second thread control block, the segment of the first thread variable in the first process can be obtained based on the storage address indicated by the first address of the first process and the second offset, and the segment of the first thread variable in the first process can also be obtained from the first process file. The storage address of the second thread control block can be obtained based on the address of the first instruction in the first process, the second offset and b third offsets, where b is a positive integer greater than 1, and b is greater than a, for example, a can be 1, and b can be 2.
[0223] The thread control block is used to store data of different threads, and the addresses of different thread control blocks are also different. However, the addresses of one or more thread control blocks corresponding to one or more threads that call the first thread variable can be determined based on the address and the second offset of the first instruction in the first process. The first process can directly obtain the address and the second offset of the first instruction in the first process, so the first process can directly obtain the address of the thread control block corresponding to the thread that calls the first thread variable in the first process.
[0224] After loading the patch file, if the first thread variable is called in the patch file, it is necessary to determine the address of the first thread control block corresponding to the first thread. Then determine the address of the first thread variable. The first process can directly obtain the address of the first thread control block corresponding to the first thread variable. Therefore, the first instruction can be directly executed to obtain the address of the first instruction and the second offset. The first process can obtain multiple thread control block addresses based on the address and the second offset of the first instruction. The first process then determines the address of the first thread control block from the multiple thread control block addresses based on the first thread ID. The first process then obtains the address of the first thread variable based on the address of the first thread control block and the first offset.
[0225] Optionally, when the first thread variable is a thread variable in the first process, there is no need to create a GOT table in the patch file.
[0226] It should be noted that, in the present application, S204 may also be executed before S203, and S205 may also be executed between, before or after any one of S202, S203, and S204. Figure 2 There is no limitation on the various execution steps in the embodiments.
[0227] The following is a detailed introduction on how to make a patch file based on the .obj file.
[0228] Figure 3A A schematic diagram showing how to generate a patch file.
[0229] Among them, the .obj file can be generated based on the patch code written by the user.
[0230] The .obj file includes multiple segments, such as the ".text" segment, the ".tdata" segment, the ".rodata" segment, the ".bss" segment, and the ".rela.text" segment. The contents recorded in different segments are different. For example, the ".text" segment can record multiple execution instructions of the patch code. The ".tdata" segment records the call to TSL1. The ".rela.text" segment records the relocation information of TLS1, which is used to find the position of TLS1 in the ".text" segment.
[0231] It should be noted that the .obj file may also include other more segments, which are not limited in this application. TSL1 may also be referred to as the first thread variable.
[0232] When making a patch file, it is necessary to determine whether the instruction for calling TLS1 in the ".text" segment of the .obj file is obtained through a function.
[0233] The ".rela.text" segment is used to find the location of the instruction for calling TLS1 in the ".text" segment. After determining the location of the instruction for calling TLS1 in the ".text" segment, the instruction for calling TLS1 needs to be modified. Because, if TLS1 is accessed directly based on the address, when TLS1 is a thread variable in a dynamic library, the address of the thread variable in the dynamic library is not fixed and cannot be accessed directly based on the address. Therefore, in order to avoid the failure of the call due to direct address-based access to TLS1, the instruction for calling TLS1 in the ".text" segment needs to be modified from accessing TLS1 based on the address to accessing TSL1 by obtaining the address of TSL1 through the first function. The input parameters of the first function are the offset in the segment of the file where TLS1 is located and the module ID in the module where TLS1 is located. The first function can accurately obtain the address of TLS1 based on the offset in the segment of the file where TLS1 is located and the module ID in the module where TLS1 is located.
[0234] In other embodiments, when the instruction for calling TLS1 is implemented by obtaining the address of TSL1 through the first function to access TSL1, there is no need to modify the instruction.
[0235] After that, copy the segments in the .obj file to the .pat file. For example, copy the ".text" segment, ".tdata" segment, ".rodata" segment, and ".bss" segment in the .obj file to the .pat file.
[0236] In other embodiments, when TLS1 is a thread variable in a dynamic library, the instruction for calling TLS1 may be modified to obtain the address of TSL1 by the first function to access TSL1, or it may not be modified, and this application does not limit this.
[0237] In order to record the offset in the segment of the file where TLS1 is located and the module ID in the module where TLS1 is located, it is necessary to create GOT table 1 in the .pat file. GOT table 1 includes two table entries, which are the offset value of TLS1 and the module ID of the module where TLS1 is located.
[0238] It should be noted that if the .obj file calls multiple thread variables, multiple GOT tables need to be created in the .pat file. Different TLS use different GOT tables.
[0239] Optionally, in some embodiments, different thread variables may also share the same GOT table, but the table entries of each thread variable are different. This application does not limit this.
[0240] After creating GOT table 1 in the .pat file, you need to fill in the offset value of TLS1 in GOT table 1. The offset value of TLS1 is the offset in the segment of the bin file or so file where TLS1 is located. Since the patch file is made offline, the module ID of the module where TLS1 is located is unknown, and the module ID of the module where TLS1 is located in GOT table 1 cannot be obtained at this time. At this time, you can first assign the module ID to an initial value and modify it later.
[0241] Among them, the offset in the segment of the bin file or so file where TLS1 is located can be directly obtained from the bin file or so file.
[0242] like Figure 3A As described above, there are also multiple segments in the bin file or so file, such as the ".text" segment, the ".tdata" segment, and the ".symtab" segment. Among them, the bin file or so file can define TLS1 in the ".tdata" segment. The bin file or so file can record the offset of TLS1 in the ".tdata" segment in the ".symtab" segment. Then the offset of TLS1 can be directly obtained from the bin file or so file.
[0243] Figure 3B A schematic diagram of a software structure in which a patch takes effect is shown.
[0244] like Figure 3B As shown, Figure 3A The patch file generated in the patch area can be preset in the patch area, which is located in the upper layer of the hardware and the operating system (OS). When the patch file in the patch area is run, the patch code area can call the GOT table 1 in the patch data, and obtain the address of TSL1 through the function based on the information in the GOT table 1. Then, when the patch file is run, TSL1 can be called based on the address of TSL1.
[0245] The following is a detailed description of how to load and run the patch function.
[0246] Figure 4 A schematic diagram of a method for loading and running a patch function is shown.
[0247] S401: Load a patch file.
[0248] The patch file can be Figure 2 and Figure 3A The patch file is shown below.
[0249] S402: Obtain the module ID of the module where the first thread variable is located.
[0250] After the patch file is loaded, the module ID of the module where the first thread variable is located can be obtained.
[0251] When the module where the first thread variable is located is the first dynamic library, after the patch file is loaded, the first dynamic library is run by the first process, and the dynamic library ID of the first dynamic library is uniquely determined. At this time, the dynamic library ID of the first dynamic library where the first thread variable is located can be obtained.
[0252] When the module where the first thread variable is located is the first process, the module ID of the first process where the first thread variable is located can be determined in S402 or in S204, and this application does not limit this.
[0253] S403: rewrite the module ID of the module where the first thread variable is located into the GOT table in the patch file to obtain an updated patch file.
[0254] When the module where the first thread variable is located is the first dynamic library, after the patch file is loaded and the dynamic library ID of the first dynamic library is determined, the module ID of the module where the first thread variable is located in the GOT table is modified from a preset value to the dynamic library ID of the first dynamic library.
[0255] In the case where the module where the first thread variable is located is the first process, in a possible implementation, after the patch file is loaded, after the process ID of the first process is determined, the module ID of the module where the first thread variable is located in the GOT table can be modified from a preset value to the process ID of the first process. In other possible implementations, the module ID of the module where the first thread variable is located in the GOT table can be determined in S204, and there is no need to execute S403, which is not limited in this application.
[0256] In this way, after the module ID of the module where the first thread variable is located in the GOT table and the offset of the first thread variable are determined, the update patch file can be obtained.
[0257] S404: The input parameter table entry of the first function (the module ID of the module where the first thread variable is located) is also modified accordingly.
[0258] In S205, the GOT table has been used as the input parameter of the first function. Then in S403, after the module ID of the module where the first thread variable is located in the GOT table is updated, the input parameter table item of the first function (the module ID of the module where the first thread variable is located) also needs to be modified accordingly.
[0259] Optionally, when the first thread variable is a thread variable in the process, the module ID of the module where the first thread variable is located in the GOT table can be determined in S204. Then in S205, the input parameter of the first function is also correct, and there is no need to modify the input parameter table item of the first function (the module ID of the module where the first thread variable is located), and there is no need to execute S404.
[0260] S405. Obtain the address of the first thread variable through the first function.
[0261] S406: Run the update patch file and call the first thread variable through the address of the first thread variable.
[0262] After the input parameters of the first function are modified, the address of the first thread variable can be obtained through the first function. Then, when the update patch file is run, the first thread variable can be called through the address of the first thread variable obtained by the first function.
[0263] Optionally, when the first thread variable is a thread variable in a process, the address of the first thread variable may not be obtained through the first function, and the address of the first thread variable in the first process is uniquely determined, so when running the update patch file, the first thread variable may be directly called through the address of the first thread variable in the first process, thereby patching the first process and improving defects in the first process.
[0264] Next, a patch method provided by the present application is described with reference to specific examples.
[0265] This application can be applied to the patch scenario of Datacom V8 platform. This application can also be applied to the patch scenario of Wireless and Guangqi product lines. Based on the patch mechanism of DOPRA, a set of patch management mechanisms are encapsulated and implemented. Corresponding verification is performed on the ARM32 and ILP32 environments of Wireless, as well as the ARM32 environment of Guangqi, and the global and static thread variables in the process / dynamic library can be referenced in the patch.
[0266] For example, the Datacom V8 platform may be patched.
[0267] Figure 5 The figure shows the patch loading process of the Datacom V8 platform, in which the patch loading interface provided by DOPRA is called during the patch file loading and running phase, and the implementation of obtaining the thread variable module ID designed by the present invention is integrated into the patch file loading and running process. When the thread variable in the process / dynamic library is referenced in the patch file, the interface designed by the present invention is used, so that after the patch file is loaded onto the single board, the address of the thread variable can be successfully obtained, so that the patch can take effect normally and the problem is repaired.
[0268] S501, pre-patch inspection phase.
[0269] S501 also includes the following steps:
[0270] 5011. Integrity check of patch file (for example, whether the patch file includes a digital signature).
[0271] 5012. Check the compatibility of patch files with devices (version, form, etc.).
[0272] 5013. Verify the increase or decrease of the patch already loaded.
[0273] S502: Patch file downloading stage.
[0274] S502 also includes the following steps:
[0275] 5021, MPU moun patch package.
[0276] 5022. The non-MPU downloads the required patch files from the MPU.
[0277] S503: Patch file activation stage.
[0278] S503 also includes the following steps:
[0279] 5031. Call the pre-effective policy function.
[0280] 5032. Send activation information.
[0281] The activation information sent includes: 50321, calling the DOPRA interface to load the patch.
[0282] 5033. Call the post-effective policy function.
[0283] S504, post-patch inspection phase.
[0284] The post-patch check phase also includes: 5041, checking whether all the effective patch units have been loaded.
[0285] It should be noted that if any one of steps S502, S503 and S504 fails, the patch process may be terminated.
[0286] Taking the test patch on the Datacom V8 platform as an example, the global thread variable g_iTlsId and the static thread variable gStatic_iTlsId in the process (monitor process) and the global thread variable g_iDllTlsId and the static thread variable gStatic_iDllTlsId in the dynamic library (libpatch_dopra.so dynamic library) are referenced in the patch file.
[0287] Fig. 6A A schematic diagram of code implementation in an ARM64 environment is shown.
[0288] root-> / opt / vrpv8 / home / test / src$readelf–h monitor
[0289] ELF Header:
[0290] Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
[0291] Class:ELF64
[0292] Data:2's complement,little endian
[0293] Version:1(current)
[0294] OS / ABI:UNIX–SystemV
[0295] ABIVersion:0
[0296] Type:EXEC(Executable file)
[0297] Machine:AArch64
[0298] Version:0x1
[0299] Figure 6B Shows the code implementation of thread variables defined in the process.
[0300] _thread int g_iTlsId -= -1;
[0301] static_thread int gStatic_iTlsId=0;
[0302] Figure 6C The code implementation of thread variables defined in a dynamic library is shown.
[0303] _thread int g_iDl1TlsId-=10;
[0304] static_thread int gStatic_iDllTlsId=20;
[0305] Fig.6DA code implementation of referencing a thread variable in a process and a patch file corresponding to the thread variable in a dynamic library is shown.
[0306] root-> / opt / vrpv8 / home / test / src$readelf-sw monitor|grep g_iTlsId
[0307] 32:00000000000000004TLSGLOBAL DEFAULT18 g_iTlsId
[0308] 117:00000000000000004TLSGLOBAL DEFAULT18 g_iTlsId
[0309] root-> / opt / vrpv8 / home / test / src$readelf-sW monitor|grep gStatic_iTlsId
[0310] 70:00000000000000044TLSLOCALDEFAULT19 gStatic_iTlsId
[0311] root-> / opt / vrpv8 / home / test / src$readelf-sw libpatch_dopra.so I grep g_iDllTlsId
[0312] 7:00000000000000004TLSGLOBAL DEFAULT15 g_iDllTlsId
[0313] 67:00000000000000004TLSGLOBAL DEFAULT15 g_iDllTlsId
[0314] root-> / opt / vrpv8 / home / test / src$readelf-sw libpatch_dopra.so|grep_gStatic_iDllTlsId
[0315] 49:00000000000000044TLSLOCALDEFAULT15 gStatic iDllTlsId
[0316] After the patch file is loaded and activated, if the value of the thread variable can be printed out, it means that the thread variable referenced in the patch file has been successful.
[0317] Fig. 6EA successful code implementation of the thread variables referenced in the patch file is shown.
[0318] root-> / opt / vrpv8 / home / test / src$. / monitor
[0319] call patch func SISP_PAT_PatchRestoreForTargetLib
[0320] g_iTlsId=-1
[0321] gStatic_iTlsId=0
[0322] g_iDllTlsId=10
[0323] gStatic iDllTlsId=20
[0324] Fig. 6F Another code implementation of referencing the patch files corresponding to the thread variables in the process and the thread variables in the dynamic library is shown.
[0325] For example, the example in the X64 environment.
[0326] root@ / opt / vrpv8 / home / test / build / bin]readelf-h monitor
[0327] ELF Header:
[0328] Magic:7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
[0329] class:ELF64
[0330] Data:2's complement,little endian
[0331] Version:1(current)
[0332] OS / ABI:UNIX-System V
[0333] ABI Version:0
[0334] Type:EXEC(Executable file)
[0335] Machine:Advanced Micro Devices X86-64
[0336] Version:0x1
[0337] After the patch file is loaded and activated, if the value of the thread variable can be printed out, it means that the thread variable referenced in the patch file has been successful.
[0338] Figure 6G Another successful code implementation of the thread variables referenced in the patch file is shown.
[0339] [root@ / opt / vrpv8 / home / test / build / bin]. / monitor
[0340] call patch func SISP_PAT_PatchRestoreForTargetLib
[0341] g_iTlsId=-1
[0342] gStatic_iTlsId=0
[0343] g_iDllTlsId=10
[0344] gStatic iDllTlsId=20
[0345] In other embodiments, the wireless and Guangqi product lines use patches in a similar way to Datacom, and encapsulate and implement a patch management mechanism based on the DOPRA patch mechanism. In the wireless ARM32 and ILP32 environments, as well as Guangqi's ARM32 environment, global thread variables and static thread variables in the process / dynamic library can be referenced in the patch.
[0346] Figure 7 A flowchart of a function execution method provided in this application.
[0347] S701: Obtain a patch file, where the patch file is used to repair a defect in a first process. The patch file references a first thread variable, where the first thread variable is a thread variable defined in the first process or a first dynamic library.
[0348] S702: Add a GOT table to the patch file. The GOT table includes a first table entry and a second table entry. The first table entry is the offset of the first thread variable, and the second table entry is the module ID of the module where the first thread variable is located.
[0349] S703: The offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID.
[0350] S704: Update the first offset and the first ID into the GOT table to obtain an update patch file.
[0351] In a possible implementation, the first offset and the first ID are updated to the GOT table to obtain an updated patch file, specifically including: before loading the patch file, obtaining the offset of the first thread variable as the first offset, setting the module ID of the module where the first thread variable is located to the second value, and updating the first offset and the second value to the GOT table; after loading the patch file, obtaining the module ID of the module where the first thread variable is located as the first value, and modifying the module ID of the module where the first thread variable is located in the GOT table from the second value to the first value to obtain an updated patch file. In this way, regardless of whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library, the module ID of the module where the first thread variable is located is obtained after loading the patch file.
[0352] In a possible implementation, the first offset and the first ID are updated to the GOT table to obtain an updated patch file, specifically including: before loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table; after loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain the updated patch file. In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, after loading the patch file, the dynamic library ID of the first dynamic library where the first thread variable is located is obtained.
[0353] Exemplarily, the interface dl_iterate_phdr may be called to access all loaded dynamic libraries, and obtain the value of the ti_module field when the dynamic library is loaded, which is the dynamic library ID of the dynamic library.
[0354] In a possible implementation, the method further includes: before loading the patch file, when the first thread variable is a thread variable defined in the first process, obtaining the offset of the first thread variable as the first offset and the module ID of the module where the first thread variable is located as the first ID, and updating the first offset and the first ID to the GOT table to obtain an updated patch file. In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first process, before loading the patch file, the process ID of the first process where the first thread variable is located can be obtained.
[0355] S705 , running the update patch file, obtaining the address of the first thread variable through the first function, and the first function obtains the address of the first thread variable through the first offset and the first ID in the GOT table.
[0356] In a possible implementation, before obtaining the address of the first thread variable through the first function, the method also includes: obtaining the first instruction in the patch file that references the first thread variable; in the case where the first instruction does not obtain the address of the first thread variable through a function, modifying the first instruction to a second instruction, the second instruction is to obtain the address of the first thread variable through the first function; running the update patch file, obtaining the address of the first thread variable through the first function, specifically including: running the update patch file and executing the second instruction in the update patch file, obtaining the address of the first thread variable through the first function. In this way, in the case where the first thread variable is a thread variable in the first process and / or the first dynamic library, if the first instruction does not obtain the address of the first thread variable through a function, modifying the first instruction to a second instruction, the second instruction is to obtain the address of the first thread variable through a system function, to ensure that the patch file can normally call the first thread variable in the first process, and can also call the first thread variable in the first dynamic library.
[0357] In a possible implementation, when the first instruction is not for obtaining the address of the first thread variable through a function, the first instruction is modified to a second instruction, specifically including: when the first instruction is not for obtaining the address of the first thread variable through a function and the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified to the second instruction. In this way, only when the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified to the second instruction, ensuring that the patch file can normally call the first thread variable in the first dynamic library.
[0358] In a possible implementation, the method further includes: when the first thread variable is a thread variable defined in the first process, running the update patch file and executing the first instruction in the update patch file to obtain the address of the first thread variable.
[0359] In a possible implementation, the first thread control block stores the content of the segment including the first thread variable in the first dynamic library or the first process, and the first thread control block is used to store the data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library or the process ID of the first process; the address of the first thread variable is obtained through the first function, specifically including: obtaining the addresses of multiple thread control blocks based on the first ID through the first function; obtaining the address of the first thread control block from the addresses of multiple thread control blocks based on the first thread ID; obtaining the address of the first thread variable based on the address of the first thread control block and the first offset through the first function. Afterwards, the address of the first thread variable is passed to the first thread through the first function. In this way, whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0360] In a possible implementation, the first thread control block stores the content of the segment where the first thread variable in the first dynamic library is located, and the first thread control block is used to store the data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library; the address of the first thread variable is obtained through the first function, specifically including: obtaining the addresses of multiple thread control blocks based on the first ID through the first function; obtaining the address of the first thread control block from the addresses of multiple thread control blocks based on the first thread ID through the first function; obtaining the address of the first thread variable based on the address of the first thread control block and the first offset through the first function; passing the address of the first thread variable to the first thread through the first function. In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0361] In a possible implementation, the first thread control block stores the content of the segment where the first thread variable in the first process is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the process ID of the first process; running the update patch file and executing the first instruction in the update patch file to obtain the address of the first thread variable specifically includes:
[0362] Run the update patch file and execute the first instruction in the update patch file.
[0363] In response to the first instruction, a first address of the first process is acquired through the first process.
[0364] The addresses of multiple thread control blocks are determined by the first process based on the first address, second offset and third offset of the first process, the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value.
[0365] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID through the first process.
[0366] The address of the first thread variable is acquired through the first process based on the address of the first thread control block and the first offset.
[0367] The address of the first thread variable is passed to the first thread by the first process.
[0368] The third offset may be the size of a thread control block.
[0369] In this way, when the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable can be directly obtained through the first process.
[0370] S706: Call the first thread variable through the address of the first thread variable.
[0371] Through this method, the patch file can call the thread variables in the process and the thread variables in the dynamic library.
[0372] Figure 8 A schematic diagram of a patch execution device provided for this application.
[0373] like Figure 8 As shown, the patch execution device 800 includes an acquisition module 810, an execution module 820 and a calling module 830. The acquisition module 810 is used to acquire a patch file, which is used to repair defects in the first process. The patch file references a first thread variable, which is a thread variable defined in the first process or the first dynamic library.
[0374] Execution module 820 is used for: adding a new GOT table to the patch file, the GOT table includes a first table entry and a second table entry, the first table entry is the offset of the first thread variable, the second table entry is the module ID of the module where the first thread variable is located, the offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is the first ID; updating the first offset and the first ID into the GOT table to obtain an updated patch file; running the updated patch file, obtaining the address of the first thread variable through the first function, and the first function obtains the address of the first thread variable through the first offset and the first ID in the GOT table.
[0375] The calling module 830 is used to call the first thread variable through the address of the first thread variable.
[0376] Through this method, the patch file can call the thread variables in the process and the thread variables in the dynamic library.
[0377] In one possible implementation, the execution module 820 is also used to obtain the first instruction in the patch file that references the first thread variable; when the first instruction is not for obtaining the address of the first thread variable through a function, the first instruction is modified to a second instruction, and the second instruction is for obtaining the address of the first thread variable through the first function; the execution module 820 is specifically used to run the update patch file and execute the second instruction in the update patch file to obtain the address of the first thread variable through the first function.
[0378] In this way, when the first thread variable is a thread variable in the first process and / or the first dynamic library, if the first instruction does not obtain the address of the first thread variable through a function, the first instruction is modified to a second instruction, and the second instruction obtains the address of the first thread variable through a system function, thereby ensuring that the patch file can normally call the first thread variable in the first process and the first thread variable in the first dynamic library.
[0379] In a possible implementation, the execution module 820 is specifically configured to modify the first instruction into the second instruction when the first instruction is to obtain the address of the first thread variable without using a function and the first thread variable is a thread variable defined in the first dynamic library.
[0380] In this way, only when the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified to the second instruction, ensuring that the patch file can normally call the first thread variable in the first dynamic library.
[0381] In a possible implementation, the execution module 820 is further configured to run the update patch file and execute the first instruction in the update patch file to obtain the address of the first thread variable when the first thread variable is a thread variable defined in the first process.
[0382] The first instruction is to obtain the address of the first thread variable through the first process. In this way, when the first thread variable is a thread variable defined in the first process, the first process can directly obtain the address of the first thread variable, thereby eliminating the need to modify the first instruction into the second instruction.
[0383] In one possible implementation, the execution module 820 is specifically used to: before loading the patch file, obtain the offset of the first thread variable as the first offset, set the module ID of the module where the first thread variable is located to the second value, and update the first offset and the second value to the GOT table; after loading the patch file, obtain the module ID of the module where the first thread variable is located as the first value, modify the module ID of the module where the first thread variable is located in the GOT table from the second value to the first value, and obtain an updated patch file.
[0384] In this way, regardless of whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library, the module ID of the module where the first thread variable is located is obtained after the patch file is loaded.
[0385] In one possible implementation, the execution module 820 is specifically used to: before loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, obtain the offset of the first thread variable as the first offset, set the module ID of the module where the first thread variable is located to the second value, and update the first offset and the second value to the GOT table; after loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, obtain the module ID of the module where the first thread variable is located as the first value, modify the module ID of the module where the first thread variable is located in the GOT table from the second value to the first value, and obtain an updated patch file.
[0386] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, after loading the patch file, the dynamic library ID of the first dynamic library where the first thread variable is located is obtained.
[0387] In one possible implementation, the execution module 820 is also used to, before loading the patch file, obtain the offset of the first thread variable as the first offset and the module ID of the module where the first thread variable is located as the first ID when the first thread variable is a thread variable defined in the first process, and update the first offset and the first ID into the GOT table to obtain an updated patch file.
[0388] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first process, the process ID of the first process where the first thread variable is located can be obtained before loading the patch file.
[0389] In a possible implementation, the first thread control block stores the content of the segment where the first thread variable is located in the first dynamic library or the first process, and the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library or the process ID of the first process; the acquisition module 810 is specifically used to: obtain the addresses of multiple thread control blocks based on the first ID through the first function; obtain the address of the first thread control block from the addresses of the multiple thread control blocks based on the first thread ID; obtain the address of the first thread variable based on the address of the first thread control block and the first offset through the first function; pass the address of the first thread variable to the first thread through the first function.
[0390] In this way, whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0391] In a possible implementation, the first thread control block stores the content of the segment where the first thread variable in the first dynamic library is located, and the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library; the acquisition module 810 is specifically used to: obtain the addresses of multiple thread control blocks based on the first ID through the first function; obtain the address of the first thread control block from the addresses of multiple thread control blocks based on the first thread ID through the first function; obtain the address of the first thread variable based on the address of the first thread control block and the first offset through the first function; pass the address of the first thread variable to the first thread through the first function.
[0392] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0393] In a possible implementation, the first thread control block stores the content of the segment where the first thread variable in the first process is located, and the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the process ID of the first process; the acquisition module 810 is specifically used to:
[0394] Run the update patch file and execute the first instruction in the update patch file.
[0395] In response to the first instruction, a first address of the first process is acquired through the first process.
[0396] The addresses of multiple thread control blocks are determined by the first process based on the first address, second offset and third offset of the first process, the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value.
[0397] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID through the first process.
[0398] The address of the first thread variable is acquired through the first process based on the address of the first thread control block and the first offset.
[0399] The address of the first thread variable is passed to the first thread by the first process.
[0400] The third offset may be the size of a thread control block.
[0401] In this way, when the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable can be directly obtained through the first process.
[0402] In this way, when the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable can be directly obtained through the first process.
[0403] Fig. 9 A schematic diagram of another patch execution device 900 provided in the present application.
[0404] like Fig. 9 As shown, the patch execution device 900 includes a memory 920 and a processor 910 .
[0405] The memory 920 is used to store computer program codes, and the computer program codes include computer instructions.
[0406] The processor 910 calls computer instructions to cause the patch execution device 900 to execute:
[0407] A patch file is obtained, where the patch file is used to repair defects in the first process. The patch file references a first thread variable, where the first thread variable is a thread variable defined in the first process or a first dynamic library.
[0408] A GOT table is added in the patch file. The GOT table includes a first table entry and a second table entry. The first table entry is the offset of the first thread variable, and the second table entry is the module ID of the module where the first thread variable is located.
[0409] The offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID.
[0410] Update the first offset and the first ID into the GOT table to obtain an update patch file.
[0411] The update patch file is run, and the address of the first thread variable is obtained through the first function. The first function obtains the address of the first thread variable through the first offset and the first ID in the GOT table.
[0412] The first thread variable is called by the address of the first thread variable.
[0413] In this way, the patch file can call the thread variables in the process and the thread variables in the dynamic library.
[0414] In a possible implementation, the processor 910 calls a computer instruction to enable the patch execution device 900 to execute:
[0415] The first instruction referencing the first thread variable in the patch file is obtained.
[0416] In the case where the first instruction is for obtaining the address of the first thread variable not through a function, the first instruction is modified into a second instruction, and the second instruction is for obtaining the address of the first thread variable through the first function.
[0417] The update patch file is run and the second instruction in the update patch file is executed, and the address of the first thread variable is obtained through the first function.
[0418] In this way, when the first thread variable is a thread variable in the first process and / or the first dynamic library, if the first instruction does not obtain the address of the first thread variable through a function, the first instruction is modified to a second instruction, and the second instruction obtains the address of the first thread variable through a system function, thereby ensuring that the patch file can normally call the first thread variable in the first process and the first thread variable in the first dynamic library.
[0419] In a possible implementation, the processor 910 calls a computer instruction to enable the patch execution device 900 to execute:
[0420] In a case where the first instruction is to obtain the address of the first thread variable without using a function and the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified into a second instruction.
[0421] In this way, only when the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified to the second instruction, ensuring that the patch file can normally call the first thread variable in the first dynamic library.
[0422] In a possible implementation, the processor 910 calls a computer instruction to enable the patch execution device 900 to execute:
[0423] In the case where the first thread variable is a thread variable defined in the first process, the update patch file is run and the first instruction in the update patch file is executed to obtain the address of the first thread variable.
[0424] The first instruction is to obtain the address of the first thread variable through the first process. In this way, when the first thread variable is a thread variable defined in the first process, the first process can directly obtain the address of the first thread variable, thereby eliminating the need to modify the first instruction into the second instruction.
[0425] In a possible implementation, the processor 910 calls a computer instruction to enable the patch execution device 900 to execute:
[0426] Before loading the patch file, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table.
[0427] After loading the patch file, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain an updated patch file.
[0428] In this way, regardless of whether the first thread variable is a thread variable in a process or a thread variable in a dynamic library, the module ID of the module where the first thread variable is located is obtained after the patch file is loaded.
[0429] In a possible implementation, the processor 910 calls a computer instruction to enable the patch execution device 900 to execute:
[0430] Before loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to the second value, and the first offset and the second value are updated to the GOT table.
[0431] After loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain an updated patch file.
[0432] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, after loading the patch file, the dynamic library ID of the first dynamic library where the first thread variable is located is obtained.
[0433] In a possible implementation, the processor 910 calls a computer instruction to enable the patch execution device 900 to execute:
[0434] Before loading the patch file, when the first thread variable is a thread variable defined in the first process, the offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID, and the first offset and the first ID are updated to the GOT table to obtain an updated patch file.
[0435] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first process, the process ID of the first process where the first thread variable is located can be obtained before loading the patch file.
[0436] In one possible implementation, the first thread control block stores the contents of a segment in a first dynamic library or in a first process including a first thread variable. The first thread control block is used to store data of the first thread calling the first thread variable. The first ID is the dynamic library ID of the first dynamic library or the process ID of the first process.
[0437] The processor 910 calls computer instructions to cause the patch execution device 900 to execute:
[0438] The addresses of the plurality of thread control blocks are acquired based on the first ID through the first function.
[0439] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID.
[0440] The address of the first thread variable is obtained through the first function based on the address of the first thread control block and the first offset. Afterwards, the address of the first thread variable is transferred to the first thread through the first function.
[0441] In this way, whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0442] In a possible implementation, the first thread control block stores the content of the segment where the first thread variable in the first dynamic library is located. The first thread control block is used to store data of the first thread calling the first thread variable. The first ID is the dynamic library ID of the first dynamic library.
[0443] The processor 910 calls computer instructions to cause the patch execution device 900 to execute:
[0444] The addresses of the plurality of thread control blocks are acquired based on the first ID through the first function.
[0445] The address of the first thread control block is obtained from the addresses of the plurality of thread control blocks based on the first thread ID through the first function.
[0446] The address of the first thread variable is obtained based on the address of the first thread control block and the first offset through the first function. The address of the first thread variable is transferred to the first thread through the first function.
[0447] In this way, it is necessary to distinguish whether the first thread variable is a thread variable in the first process or a thread variable in the first dynamic library. When the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable is obtained through the first function.
[0448] In a possible implementation, the first thread control block stores the content of the segment where the first thread variable in the first process is located. The first thread control block is used to store data of the first thread calling the first thread variable. The first ID is the process ID of the first process.
[0449] The processor 910 calls computer instructions to cause the patch execution device 900 to execute:
[0450] Run the update patch file and execute the first instruction in the update patch file.
[0451] In response to the first instruction, a first address of the first process is acquired through the first process.
[0452] The addresses of multiple thread control blocks are determined by the first process based on the first address, second offset and third offset of the first process, the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value.
[0453] The address of the first thread control block is acquired from the addresses of the plurality of thread control blocks based on the first thread ID through the first process.
[0454] The address of the first thread variable is acquired through the first process based on the address of the first thread control block and the first offset.
[0455] The address of the first thread variable is passed to the first thread by the first process.
[0456] The third offset may be the size of a thread control block.
[0457] In this way, when the first thread variable is a thread variable in the first dynamic library, the address of the first thread variable can be directly obtained through the first process.
[0458] The present application provides a computer-readable storage medium, when a computer program product is run on a function tracing device, so that the function tracing device executes Figure 7 A function tracing method is shown.
[0459] The present application provides a computer program product, when the computer program product is run on a function tracing device, the function tracing device executes Figure 7 A function tracing method is shown.
[0460] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0461] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0462] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0463] In short, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
Claims
1. A patch execution method, characterized in that: The method comprises: A patch file is obtained, where the patch file is used to repair a defect in the first process, where the patch file references a first thread variable, where the first thread variable is a thread variable defined in the first process or a first dynamic library; A GOT table is added to the patch file, wherein the GOT table includes a first table entry and a second table entry, wherein the first table entry is an offset of the first thread variable, and the second table entry is a module ID of a module where the first thread variable is located; The offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID; Update the first offset and the first ID into the GOT table to obtain an update patch file; Run the update patch file, and obtain the address of the first thread variable through a first function, wherein the first function obtains the address of the first thread variable through the first offset and the first ID in the GOT table; The first thread variable is called by the address of the first thread variable.
2. The method according to claim 1, characterized in that Before acquiring the address of the first thread variable through the first function, the method further includes: Obtaining a first instruction in the patch file that references the first thread variable; In a case where the first instruction is not for obtaining the address of the first thread variable through a function, modifying the first instruction into a second instruction, where the second instruction is for obtaining the address of the first thread variable through the first function; The step of running the update patch file and obtaining the address of the first thread variable through the first function specifically includes: The update patch file is run and the second instruction in the update patch file is executed, and the address of the first thread variable is obtained through the first function.
3. The method according to claim 2, characterized in that The step of modifying the first instruction to a second instruction when the first instruction is not for obtaining the address of the first thread variable through a function specifically includes: In a case where the first instruction is to obtain the address of the first thread variable without using a function and the first thread variable is a thread variable defined in the first dynamic library, the first instruction is modified into the second instruction.
4. The method according to claim 3, characterized in that The method further comprises: In the case where the first thread variable is a thread variable defined in the first process, the update patch file is run and the first instruction in the update patch file is executed to obtain the address of the first thread variable.
5. The method according to claim 2 or 3, characterized in that: The updating of the first offset and the first ID into the GOT table to obtain an update patch file specifically includes: Before loading the patch file, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to a second value, and the first offset and the second value are updated to the GOT table; After loading the patch file, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain the update patch file.
6. The method according to claim 5, characterized in that The updating of the first offset and the first ID into the GOT table to obtain an update patch file specifically includes: Before loading the patch file, in the case where the first thread variable is a thread variable defined in the first dynamic library, the offset of the first thread variable is obtained as the first offset, the module ID of the module where the first thread variable is located is set to a second value, and the first offset and the second value are updated in the GOT table; After loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain the updated patch file.
7. The method according to claim 5 or 6, characterized in that: The method further comprises: Before loading the patch file, when the first thread variable is a thread variable defined in the first process, the offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID, and the first offset and the first ID are updated to the GOT table to obtain the updated patch file.
8. The method according to any one of claims 1 to 7, characterized in that: The first thread control block stores the content of the segment including the first thread variable in the first dynamic library or the first process, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library or the process ID of the first process; The acquiring the address of the first thread variable through the first function specifically includes: Acquire addresses of multiple thread control blocks based on the first ID through the first function; Acquire the address of the first thread control block from the addresses of the plurality of thread control blocks based on the first thread ID; The address of the first thread variable is obtained through the first function based on the address of the first thread control block and the first offset.
9. The method according to claim 2 or 3, characterized in that: The first thread control block stores the content of the segment where the first thread variable in the first dynamic library is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library; The acquiring the address of the first thread variable through the first function specifically includes: Acquire addresses of multiple thread control blocks based on the first ID through the first function; Acquire the address of the first thread control block from the addresses of the plurality of thread control blocks based on the first thread ID through the first function; Acquire the address of the first thread variable based on the address of the first thread control block and the first offset through the first function; The address of the first thread variable is passed to the first thread through the first function.
10. The method according to claim 4, characterized in that The first thread control block stores the content of the segment where the first thread variable in the first process is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the process ID of the first process; Running the update patch file and executing the first instruction in the update patch file to obtain the address of the first thread variable specifically includes: Running the update patch file and executing the first instruction in the update patch file; In response to the first instruction, obtaining, through the first process, a first address of the first process; Determine addresses of multiple thread control blocks through the first process based on the first address, the second offset and the third offset of the first process, wherein the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value; Acquire the address of the first thread control block from the addresses of the plurality of thread control blocks based on the first thread ID through the first process; Acquire, through the first process, an address of the first thread variable based on the address of the first thread control block and the first offset; The address of the first thread variable is passed to the first thread by the first process.
11. A patch execution device, characterized in that: The device comprises an acquisition module, an execution module and a calling module; The acquisition module is used to acquire a patch file, the patch file is used to repair a defect in the first process, the patch file references a first thread variable, and the first thread variable is a thread variable defined in the first process or the first dynamic library; The execution module is used to: add a GOT table to the patch file, the GOT table includes a first table entry and a second table entry, the first table entry is the offset of the first thread variable, and the second table entry is the module ID of the module where the first thread variable is located The offset of the first thread variable is obtained as the first offset and the module ID of the module where the first thread variable is located is obtained as the first ID; Update the first offset and the first ID into the GOT table to obtain an update patch file; Run the update patch file, and obtain the address of the first thread variable through a first function, wherein the first function obtains the address of the first thread variable through the first offset and the first ID in the GOT table; The calling module is used to call the first thread variable through the address of the first thread variable.
12. The device according to claim 11, characterized in that The execution module is further used to: obtain a first instruction in the patch file that references the first thread variable; In a case where the first instruction is not for obtaining the address of the first thread variable through a function, modifying the first instruction into a second instruction, where the second instruction is for obtaining the address of the first thread variable through the first function; The execution module is specifically used to run the update patch file and execute the second instruction in the update patch file, and obtain the address of the first thread variable through the first function.
13. The device according to claim 12, characterized in that The execution module is specifically configured to modify the first instruction into the second instruction when the first instruction is to obtain the address of the first thread variable without using a function and the first thread variable is a thread variable defined in the first dynamic library.
14. The device according to claim 13, characterized in that The execution module is further configured to, when the first thread variable is a thread variable defined in the first process, run the update patch file and execute the first instruction in the update patch file to obtain the address of the first thread variable.
15. The device according to claim 12 or 13, characterized in that The execution module is specifically used to: before loading the patch file, obtain the offset of the first thread variable as the first offset, set the module ID of the module where the first thread variable is located to a second value, and update the first offset and the second value into the GOT table; After loading the patch file, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain the update patch file.
16. The device according to claim 15, characterized in that The execution module is specifically configured to: before loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, obtain the offset of the first thread variable as the first offset, set the module ID of the module where the first thread variable is located to a second value, and update the first offset and the second value into the GOT table; After loading the patch file, when the first thread variable is a thread variable defined in the first dynamic library, the module ID of the module where the first thread variable is located is obtained as the first value, and the module ID of the module where the first thread variable is located in the GOT table is modified from the second value to the first value to obtain the updated patch file.
17. The device according to claim 15 or 16, characterized in that The execution module is also used to, before loading the patch file, obtain the offset of the first thread variable as the first offset and the module ID of the module where the first thread variable is located as the first ID when the first thread variable is a thread variable defined in the first process, and update the first offset and the first ID to the GOT table to obtain the updated patch file.
18. The device according to any one of claims 11 to 17, characterized in that: The first thread control block stores the content of the segment including the first thread variable in the first dynamic library or the first process, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library or the process ID of the first process; The acquisition module is specifically used for: Acquire addresses of multiple thread control blocks based on the first ID through the first function; Acquire the address of the first thread control block from the addresses of the plurality of thread control blocks based on the first thread ID; Acquire the address of the first thread variable based on the address of the first thread control block and the first offset through the first function; The address of the first thread variable is passed to the first thread through the first function.
19. The device according to claim 12 or 13, characterized in that The first thread control block stores the content of the segment where the first thread variable in the first dynamic library is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the dynamic library ID of the first dynamic library; The acquisition module is specifically used for: Acquire addresses of multiple thread control blocks based on the first ID through the first function; Acquire the address of the first thread control block from the addresses of the plurality of thread control blocks based on the first thread ID through the first function; Acquire the address of the first thread variable based on the address of the first thread control block and the first offset through the first function; The address of the first thread variable is passed to the first thread through the first function.
20. The device according to claim 14, characterized in that The first thread control block stores the content of the segment where the first thread variable in the first process is located, the first thread control block is used to store data of the first thread calling the first thread variable, and the first ID is the process ID of the first process; The acquisition module is specifically used for: Running the update patch file and executing the first instruction in the update patch file; In response to the first instruction, obtaining, through the first process, a first address of the first process; Determine addresses of multiple thread control blocks through the first process based on the first address, the second offset and the third offset of the first process, wherein the second offset is the offset between the first thread variable defined in the first process and the first instruction in the first process, and the third offset is a preset value; Acquire the address of the first thread control block from the addresses of the plurality of thread control blocks based on the first thread ID through the first process; Acquire, through the first process, an address of the first thread variable based on the address of the first thread control block and the first offset; The address of the first thread variable is passed to the first thread by the first process.
21. A computer-readable storage medium, characterized in that: Used to store computer instructions, when the computer instructions are run on a patch execution device, the patch execution device executes any one of the methods described in claims 1-10.
22. A computer program product, characterized in that When the computer program product runs on a patch execution device, the patch execution device is caused to execute the method described in any one of claims 1 to 10.
Citation Information
Cited By
Patch execution method and apparatus
EP4682711A1
Patch execution method and apparatus
WO2024199116A1
