WO2022206259A1 - 一种依赖函数的处理方法、装置、设备及存储介质 - Google Patents

一种依赖函数的处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022206259A1
WO2022206259A1 PCT/CN2022/078555 CN2022078555W WO2022206259A1 WO 2022206259 A1 WO2022206259 A1 WO 2022206259A1 CN 2022078555 W CN2022078555 W CN 2022078555W WO 2022206259 A1 WO2022206259 A1 WO 2022206259A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
library
name
dependent
dependency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/078555
Other languages
English (en)
French (fr)
Inventor
刘洪凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Publication of WO2022206259A1 publication Critical patent/WO2022206259A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Definitions

  • the present disclosure relates to the field of data processing, and in particular, to a function-dependent processing method, apparatus, device, and storage medium.
  • a dependent function of a dependent library needs to be adjusted, it is usually implemented based on the dynamic hook technology. Specifically, in the process of running the application, the target dependency function in the target dependency library is intercepted, and the preset dependency function is called, so as to realize the adjustment of the target dependency function in the target dependency library.
  • the present disclosure provides a processing method, device, device and storage medium for dependent functions, which can complete the processing of dependent functions before the application program runs, and avoid the need for application programs to be processed. Consumption of system resources at runtime.
  • the present disclosure provides a method for processing dependent functions, the method comprising:
  • the target dependency library determine the position corresponding to the name of the target dependency library, as the first position, determine the position corresponding to the field type of the field to which the name belongs, as the second position, and determine the name corresponding to the target dependency function position as the third position;
  • the character string at the first position is replaced with the name of the preset dependency library, and the value of the d_tag member in the structure at the second position is replaced with the DT_NEEDED identifier, and replacing the character string at the third position with the name of a preset dependency function; wherein, the preset dependency function is a dependency specified to replace the target dependency function and belonging to the preset dependency library function.
  • the target dependency library determine the position corresponding to the name of the target dependency library, as the first position, including:
  • the structure array includes a plurality of structures
  • the offset address obtained by adding the third offset address to the value of the d_val member in the second structure is determined as the first position.
  • the position corresponding to the field type of the field to which the name belongs is determined as the second position, including:
  • the position corresponding to the name of the determined target-dependent function, as the third position includes:
  • the offset address obtained by adding the third offset address to the value of the st_name member in the fourth structure is determined as the third position.
  • the length of the name of the preset dependent function is not greater than the length of the name of the target dependent function; the length of the name of the preset dependent library is not greater than the name of the target dependent library. length.
  • the device further includes:
  • the present disclosure also provides a function-dependent processing device, the device comprising:
  • a determination module is used to determine the position corresponding to the name of the target dependent library in the target dependent library, as the first position, to determine the position corresponding to the field type of the field to which the name belongs, as the second position, and to determine the target
  • the position corresponding to the name of the dependent function is used as the third position;
  • the replacement module is used to replace the string at the first position with the name of the preset dependency library in the target dependency library, and replace the value of the d_tag member in the structure at the second position with the value of the d_tag member Replace with the DT_NEEDED identifier, and replace the character string at the third position with the name of the preset dependency function; wherein, the preset dependency function is designated to replace the target dependency function and belongs to the preset Dependent functions in dependent libraries.
  • the present disclosure provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is made to implement the above method.
  • An embodiment of the present disclosure provides a method for processing a dependency function.
  • a position corresponding to the name of the target dependency library is determined, and as the first position, the field type corresponding to the field to which the name belongs is determined.
  • the position, as the second position, and the position corresponding to the name of the determined target dependent function as the third position.
  • the target dependent library replace the string at the first position with the name of the preset dependency library, and replace the value of the d_tag member in the structure at the second position with DT_NEEDED identification, and replace the character string at the third position with the name of the preset dependency function; wherein, the preset dependency function is designated to replace the target dependency function and belongs to the preset dependency library dependency function.
  • the embodiment of the present disclosure determines the position to be adjusted in the target dependency library, directly modifies the content of the corresponding position, and finally realizes the processing of the dependency function in the target dependency library. Since the embodiment of the present disclosure completes the processing of the dependent functions before the application is running, it will not cause system resource consumption when the application is running.
  • FIG. 1 is a flowchart of a method for processing a dependent function provided by an embodiment of the present disclosure
  • FIG. 2 is a flowchart of another method for processing dependent functions provided by an embodiment of the present disclosure
  • FIG. 3 is a schematic structural diagram of an apparatus for processing a dependency function according to an embodiment of the present disclosure
  • the dependent library A depends on the funcB function in another dependent library B, that is, the funcB function in the dependent library B will be called during the running of the dependent library A. If based on the adjustment requirements of the application functions, it is necessary to call the funcB function in the dependent library B in the dependent library A, execute the funcC function in the dependent library C, and no longer call the funcB function in the dependent library B, you can use
  • the dynamic hook technology intercepts the call of the dependent library A to the funcB function in the dependent library B, and then executes the funcC function in the dependent library C.
  • an embodiment of the present disclosure provides a method for processing dependent functions. Before the application runs, based on the static hook technology, the position that needs to be adjusted in the target dependency library is determined, and then the content corresponding to the position that needs to be adjusted is modified. Implements the processing of dependent functions in the target dependent library.
  • the target dependency library determine the position corresponding to the name of the target dependency library, as the first position, determine the position corresponding to the field type of the field to which the name belongs, as the second position, and determine the target dependency function The position corresponding to the name of , as the third position. Then, in the target dependent library, replace the string at the first position with the name of the preset dependency library, and replace the value of the d_tag member in the structure at the second position with DT_NEEDED identification, and replace the character string at the third position with the name of the preset dependency function; wherein, the preset dependency function is designated to replace the target dependency function and belongs to the preset dependency library dependency function. It can be seen that, since the embodiment of the present disclosure completes the adjustment of the dependent functions in the target dependent library before the application is running, it is unnecessary to occupy system resources when the application is running.
  • an embodiment of the present disclosure provides a method for processing a dependency function.
  • a flowchart of a method for processing a dependency function provided by an embodiment of the present disclosure includes:
  • S101 In the target dependency library, determine the position corresponding to the name of the target dependency library, as the first position, determine the position corresponding to the field type of the field to which the name belongs, as the second position, and determine the target dependency function The position corresponding to the name, as the third position.
  • the target-dependent library in the embodiment of the present disclosure may be a dynamic library, wherein the dynamic library is also called a dynamic link library (Dynamic Link Library; DLL), which contains one or more compiled, linked and stored separately from the process using them The function.
  • DLL Dynamic Link Library
  • a dynamic library usually declares the information of other libraries it depends on. For example, if dependent library A calls the funcB function of dependent library B, the dependent library A will declare that the function of funcB in dependent library B will be affected. function dependencies. If you want to adjust the position of calling the funcB function in the dependent library A to call the funcC function in the dependent library C, you need to add the declaration of the funcC function in the dependent library C to the declaration in the dependent library A, and add the dependent library The position where the function funcB is called in A is replaced by the function funcC, so as to realize the processing of the dependent function in the dependent library A.
  • the embodiment of the present disclosure firstly determines the position where modification is required for the processing of the dependent function in the target dependent library.
  • the target dependent function on which the target dependent library depends with the preset dependent function, for example, replace the funcB function in the dependent library A with the funcC function
  • Set the name of the dependent function For this purpose, it is necessary to determine the position corresponding to the name of the target dependent function in the target dependent library.
  • the preset dependent function used to replace the target dependent function belongs to the preset dependent library, in order to ensure the normal operation of the replaced preset dependent function, the name of the preset dependent library needs to be added to the dependent library list of the target dependent library .
  • the dependent library list of the target dependent library there is no free field in the dependent library list of the target dependent library. Therefore, which field is used to store the name of the preset dependent library is a problem to be solved in the embodiments of the present disclosure.
  • the embodiments of the present disclosure can use this field.
  • the embodiment of the present disclosure it is also necessary to adjust the field type of the field for storing the name of the target dependent library, so as to indicate that what is stored in this field is the preset dependent library on which the target dependent library depends, rather than its own name. To this end, the embodiment of the present disclosure also needs to determine the location corresponding to the field type of the field to which the name of the target dependent library belongs in the target dependent library.
  • S102 In the target dependent library, replace the character string at the first position with the name of the preset dependency library, and replace the value of the d_tag member in the structure at the second position with DT_NEEDED identification, and replace the character string at the third position with the name of the preset dependency function; wherein, the preset dependency function is designated to replace the target dependency function and belongs to the preset dependency library dependency function.
  • the contents of the corresponding positions are replaced, so as to realize the processing of the dependency functions in the target dependency library.
  • the string at the first position in the target dependency library is the name of the target dependency library.
  • the name of the dependency library to which the preset dependency function belongs is added to the target.
  • the string in the first position that is, the name of the target dependent library, can be replaced with the name of the preset dependent library.
  • the field type used to store the name of the preset dependent library needs to be replaced with the DT_NEEDED flag, which is used to indicate that the name of the dependent library on which the target dependent library depends is stored in the corresponding field.
  • the embodiment of the present disclosure replaces the value of the d_tag member in the structure at the second position in the target dependency library with the DT_NEEDED identifier.
  • the embodiment of the present disclosure will be in the third position
  • the character string at that is, the name of the target dependent function
  • the position corresponding to the name of the target dependency library is determined, and as the first position, the position corresponding to the field type of the field to which the name belongs is determined. , as the second position, and, determine the position corresponding to the name of the target-dependent function, as the third position.
  • the embodiment of the present disclosure determines the position to be adjusted in the target dependency library, directly modifies the content of the corresponding position, and finally realizes the processing of the dependency function in the target dependency library. Since the embodiment of the present disclosure completes the processing of the dependent functions before the application is running, it will not cause system resource consumption when the application is running.
  • the embodiments of the present disclosure further provide a method for processing a dependency function.
  • FIG. 2 a flowchart of another method for processing a dependency function provided by an embodiment of the present disclosure is provided, wherein the method includes: :
  • the target-dependent library may be any dynamic library
  • the first structure in the target-dependent library is denoted as pElfHeader and includes the e_phoff member.
  • the value of the e_phoff member in pElfHeader is determined as the first structure
  • the offset address, denoted as file_e_phoff, is used to determine the first position.
  • the target dependent library may be a 32-bit dynamic library or a 64-bit dynamic library. Assuming that the target dependent library is a 64-bit dynamic library, the first structure located in the target dependent library is Elf64_Ehdr , where the structure of Elf64_Ehdr is as follows:
  • the first structure located in the target dependent library is Elf32_Ehdr
  • the structure of Elf32_Ehdr is basically the same as that of the above-mentioned Elf64_Ehdr, and will not be repeated here.
  • the value of the e_phoff member in the first structure pElfHeader in the target-dependent library is used to record the offset of the program header table file.
  • the embodiment of the present disclosure uses the value of the e_phoff member in the first structure pElfHeader as the first offset address file_e_phoff, which is used to find the first position in the target dependent library.
  • S202 Determine a structure array pointed to by the first offset address in the target dependent library; wherein the structure array includes a plurality of structures.
  • the position pointed to by the first offset address in the target dependent library is determined. Since the location pointed to by the first offset address file_e_phoff in the target dependent library stores a structure array, the structure array pointed to by the first offset address in the target dependent library can be obtained, wherein the structure array includes multiple structures .
  • the structure array pointed to by the first offset position file_e_phoff in the target dependent library refers to an array composed of Elf64_Phdr structures, where the Elf64_Phdr structures are as follows:
  • the structure array pointed to by the first offset in the target dependent library refers to an array composed of Elf32_Phdr structures.
  • the structures of Elf32_Phdr structures and Elf64_Phdr structures are basically the same. It is not repeated here.
  • S203 Determine that the value of the p_type member in the structure array is a structure identified by PT_DYNAMIC, and obtain the value of the p_offset member in the structure as a second offset address.
  • the value of the p_type member is the structure identified by PT_DYNAMIC, which is denoted as pPhdrDynamic, and then the value of the p_offset member in pPhdrDynamic is obtained as the second offset address , denoted as file_dyn_offset.
  • PT_DYNAMIC is a constant defined by the system.
  • the value of the p_type member is the Elf64_Phdr structure pPhdrDynamic identified by PT_DYNAMIC, and then the value of the p_offset member in pPhdrDynamic is obtained as the second offset address file_dyn_offset, Used to continue to determine the first position in the target dependency library.
  • the value of the p_offset member is used to record the offset of the partial file.
  • S204 Determine the structure array pointed to by the second offset address in the target dependency library, and determine that the values of the d_tag members in the structure array are the structures of DT_STRTAB and DT_SONAME respectively, which are corresponding to the first structure and the second structure.
  • the structure array pointed to by the second offset address file_dyn_offset in the target dependent library is determined.
  • the structure array pointed to by the second offset address file_dyn_offset in the target dependent library is an array composed of Elf64_Dyn structures.
  • the structure of the Elf64_Dyn structure is as follows:
  • the structure array pointed to by the second offset in the target dependent library refers to an array composed of Elf32_Dyn structures.
  • the structures of Elf32_Dyn structures and Elf64_Dyn structures are basically the same. Here No longer.
  • the values of the d_tag members in the structure array are the structures of DT_STRTAB and DT_SONAME, which are respectively recorded as pDynStrtab and pDynSoname.
  • DT_STRTAB and DT_SONAME are system-defined constants.
  • the structure whose d_tag member value is DT_STRTAB is determined as the first structure pDynStrtab, and the structure whose d_tag member value is DT_SONAME is determined as the second structure pDynSoname.
  • the value of the d_tag member is used to record the dynamic entry type
  • DT_STRTAB is the symbol table type
  • DT_SONAME is its own dynamic library name type.
  • S205 Convert the value of the d_ptr member in the first structure into an offset address relative to the target dependent library, as a third offset address.
  • the value of the d_ptr member in the first structure pDynStrtab is obtained, which is recorded as pDynStrtab.d_ptr. Since pDynStrtab.d_ptr is a virtual address, it is necessary to convert pDynStrtab.d_ptr into a The offset address of the dependent library, recorded as strtabOffset.
  • a convertVaddr2fileOffset function may be predefined, and the function of the convertVaddr2fileOffset function is to convert the virtual address into an offset address. Specifically, input pDynStrtab.d_ptr as a parameter (virtual address, denoted as vaddr) into the convertVaddr2fileOffset function, and the convertVaddr2fileOffset function converts it into an offset address relative to the target dependent library, as the third offset address strtabOffset, used for The first position is subsequently determined.
  • This embodiment of the present disclosure does not limit other ways of implementing offset address translation.
  • the third offset address strtabOffset converted from the value of the d_ptr member in the first structure pDynStrtab refers to the offset address of the string table relative to the target dependency library, and the string table is used to store the target dependency A string in the library, such as the name of the dependent library, etc.
  • S206 Determine an offset address obtained by adding the third offset address and the value of the d_val member in the second structure as the first position.
  • the value of the d_val member in the second structure pDynSoname is obtained, which is recorded as pDynSoname.d_val.
  • the value of the d_val member in the Elf64_Dyn structure is used to record the address of the name of the target dependent library in the string table, that is, the address relative to the string table.
  • the target dependency In order to find the location of the name of the target dependency library in the target dependency library, it is necessary to determine the target dependency based on the third offset address of the string table relative to the target dependency library and the address of the target dependency library name relative to the string table.
  • the name of the library is relative to the offset address of the target dependent library.
  • the offset address obtained by adding the third offset address strtabOffset and the value pDynSoname.d_val of the d_val member in the second structure pDynSoname is denoted as sonameOffset, and determined as the first position, that is, the target dependency library is used for The location of the field that stores the name of the target dependency library.
  • the second structure pDynSoname is a structure whose d_tag member value is DT_SONAME, and the offset address of the second structure pDynSoname relative to the target dependent library is obtained, which is recorded as offsetForDynSoname.
  • offsetForDynSoname you can Determines where to store the field type of the field to which the name of the target dependency library belongs.
  • the structure array pointed to by the second offset address file_dyn_offset in the target dependent library is determined.
  • the structure array pointed to by the second offset address file_dyn_offset in the target dependent library is an array composed of Elf64_Dyn structures. Then, the value of the d_tag member in each Elf64_Dyn structure in the structure array is obtained, and the value of the d_tag member is determined to be the Elf64_Dyn structure of DT_SYMTAB as the third structure, which is denoted as pDynSymtab.
  • the value of the d_ptr member in the third structure pDynSymtab is obtained, which is recorded as pDynSymtab.d_ptr. Since pDynSymtab.d_ptr is a virtual address, it is necessary to convert pDynSymtab.d_ptr into an offset address relative to the target dependent library, denoted as symtabOffset, as the fourth offset address.
  • S210 Determine the structure array pointed to by the fourth offset address in the target dependent library as the target array.
  • S211 Obtain the value of the st_name member in each structure in the target array, and use the string corresponding to the position after adding the third offset address as the value of the st_name member of the name of the target-dependent function.
  • the structure is determined as the fourth structure.
  • the structure array pointed to by the fourth offset address symtabOffset in the target dependency library is obtained as the target array, and then the st_name in each structure in the target array is obtained member's value.
  • the structure included in the structure array pointed to by the fourth offset address symtabOffset is the Elf64_Sym structure, and the value of the st_name member in each Elf64_Sym structure is obtained, and the value of the st_name member is used The index in the record string table.
  • the value of the st_name member in each Elf64_Sym structure is recorded as theSym.st_name, and added to the third offset address strtabOffset respectively,
  • the corresponding structure is recorded as theSym, and determined as the fourth Structure, that is to say, the position of the fourth structure theSym is the position of the name of the target dependent function, and the name of the target dependent function can be determined based on the fourth structure later, so as to realize the modification of the name of the target dependent function to the default Depends on the name of the function.
  • the structure included in the structure array pointed to by the fourth offset address is the Elf32_Sym structure.
  • the Elf32_Sym structure is basically the same as the Elf64_Sym structure. Repeat.
  • S212 Determine an offset address obtained by adding the third offset address and the value of the st_name member in the fourth structure as the third position.
  • the value of the st_name member in the fourth structure theSym is denoted as theSym.st_name
  • the offset address obtained by adding the third offset address strtabOffset is denoted as theSym.st_name It is hookStrOffset, which is determined as the third position, which is used to determine the position of the name of the target-dependent function in the target-dependent library.
  • S213 In the target dependent library, replace the string at the first position with the name of the preset dependency library, and replace the value of the d_tag member in the structure at the second position with DT_NEEDED identification, and replace the character string at the third position with the name of the preset dependency function; wherein, the preset dependency function is designated to replace the target dependency function and belongs to the preset dependency library dependency function.
  • the string at the first position that is, the sonameOffset offset
  • the string at the sonameOffset offset is determined in the target dependent library, and is replaced with the name of the preset dependent library.
  • the string at the sonameOffset offset is the target dependent library. , that is, replace the name of the target dependent library with the name of the default dependent library.
  • the target dependency library determine the string at the second position, that is, the offset of hookStrOffset, and replace it with the name of the preset dependency function.
  • the string at the offset of hookStrOffset is the name of the target dependency function, that is, The name of the target dependent function is replaced with the name of the default dependent function.
  • the position that needs to be modified in the target dependency library is determined through the flow of the offset address in the target dependency library, and the content of the corresponding position is directly modified, and finally the target dependency is realized. Handling of dependent functions in the library. Since the embodiment of the present disclosure completes the processing of the dependent functions before the application is running, it will not cause system resource consumption when the application is running.
  • the name of the preset dependent function is stored in the location where the name of the target dependent function is stored, it is necessary to ensure that the length of the name of the preset dependent function is not greater than the length of the name of the target dependent function, otherwise it will be caused by insufficient storage space. Occurrence of memory overflow, etc.
  • the name of the preset dependent library is stored in the location where the name of the target dependent library is stored, it is also necessary to ensure that the length of the name of the preset dependent library is not greater than the length of the name of the target dependent library.
  • the dependency libraries corresponding to the multiple preset dependency functions can be encapsulated into one.
  • the positions of the names of multiple target dependent functions may be determined in the target dependency library, and the positions of the respective names may be replaced with the names of the corresponding preset dependent functions.
  • the target dependency library includes a section named .gnu.version. Specifically, the .gnu.version section stores version information of the dependent functions in the target dependency library.
  • the target dependent library calls a dependent function
  • the version information of the preset dependency function added to the target dependency library is not stored in the .gnu.version section. Therefore, , when the target dependent library calls the preset dependent function, it may not be possible to call the preset dependent function due to unsuccessful version information verification.
  • the embodiment of the present disclosure can remove the section named .gnu.version in the target dependency library, so that the target dependency library does not need to perform version information verification when calling the preset dependency function, Thus, a successful call to the preset dependent function is achieved.
  • the strip command can be used to remove the section named .gnu.version in the target dependency library.
  • the specific command is as follows:
  • strip--remove-section .gnu.version [the name of the target dependency library]
  • the present disclosure also provides a processing apparatus for a dependent function.
  • a processing apparatus for a dependent function provided by an embodiment of the present disclosure, the apparatus includes:
  • the determining module 301 is used to determine the position corresponding to the name of the target dependency library in the target dependency library, as the first position, to determine the position corresponding to the field type of the field to which the name belongs, as the second position, and to determine The position corresponding to the name of the target dependent function, as the third position;
  • the replacement module 302 is used to replace the character string at the first position with the name of the preset dependency library in the target dependency library, and replace the d_tag member of the structure at the second position with the name of the preset dependency library.
  • the value is replaced with the DT_NEEDED identifier, and the character string at the third position is replaced with the name of the preset dependency function; wherein, the preset dependency function is designated to replace the target dependency function and belongs to the preset dependency function.
  • the determining module includes:
  • the first acquisition submodule is used to acquire the value of the e_phoff member in the first structure in the target dependency library as the first offset address;
  • a first determination submodule configured to determine the structure array pointed to by the first offset address in the target dependent library; wherein, the structure array includes a plurality of structures;
  • the second determination submodule is used to determine the value of the p_type member in the structure array as the structure identified by PT_DYNAMIC, and obtain the value of the p_offset member in the structure as the second offset address;
  • the third determination submodule is used to determine the structure array pointed to by the second offset address in the target dependency library, and determine that the values of the d_tag members in the structure array are the structures of DT_STRTAB and DT_SONAME respectively, corresponding to as the first structure and the second structure;
  • the first conversion submodule is used to convert the value of the d_ptr member in the first structure into an offset address relative to the target dependent library, as a third offset address;
  • the first adding submodule is configured to determine the offset address obtained by adding the third offset address and the value of the d_val member in the second structure as the first position.
  • the determining module includes:
  • the second conversion submodule is configured to convert the value of the d_ptr member in the second structure into an offset address relative to the target dependent library, as the second position.
  • the determining module includes:
  • the fourth determination submodule is used to determine, after determining the structure array pointed to by the second offset address in the target dependent library, the structure whose value of the d_tag member in the structure array is DT_SYMTAB, as the third structure. structure;
  • the third conversion submodule is used to convert the value of the d_ptr member in the third structure into an offset address relative to the target dependent library, as the fourth offset address;
  • the fifth determination submodule is used to determine the structure array pointed to by the fourth offset address in the target dependency library as the target array;
  • the sixth determination sub-module is used to obtain the value of the st_name member in each structure in the target array, and the string corresponding to the position after adding the third offset address is the name of the target-dependent function.
  • the structure corresponding to the value of the st_name member is determined to be the fourth structure;
  • the second adding submodule is configured to determine the offset address obtained by adding the third offset address and the value of the st_name member in the fourth structure as the third position.
  • the length of the name of the preset dependent function is not greater than the length of the name of the target dependent function; the length of the name of the preset dependent library is not greater than the name of the target dependent library. length.
  • the device further includes:
  • Remove module used to remove the section named .gnu.version in the target dependency library.
  • the position to be adjusted in the target dependency library is determined, and the content of the corresponding position is directly modified, so as to finally realize the processing of the dependency function in the target dependency library . Since the embodiment of the present disclosure completes the processing of the dependent functions before the application is running, it will not cause system resource consumption when the application is running.
  • embodiments of the present disclosure also provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is made to implement the present invention.
  • the processing method of the dependent function described in the embodiment is disclosed.
  • Embodiments of the present disclosure also provide a computer program product, including a computer program/instruction, characterized in that, when the computer program/instruction is executed by a processor, the method for processing dependent functions described in the embodiments of the present disclosure is implemented.
  • an embodiment of the present disclosure also provides a function-dependent processing device, as shown in FIG. 4 , which may include:
  • Processor 401 memory 402 , input device 403 and output device 404 .
  • the number of processors 401 in the function-dependent processing device may be one or more, and one processor is taken as an example in FIG. 4 .
  • the processor 401 , the memory 402 , the input device 403 and the output device 404 may be connected by a bus or in other ways, wherein the connection by a bus is taken as an example in FIG. 4 .
  • the memory 402 can be used to store software programs and modules, and the processor 401 executes various functional applications and data processing of function-dependent processing devices by running the software programs and modules stored in the memory 402 .
  • the memory 402 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like. Additionally, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input device 403 may be used to receive input numerical or character information, and to generate signal input related to user settings and function control of the function-dependent processing device.
  • the processor 401 loads the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the executable files stored in the memory 402 application program, thereby realizing various functions of the above-mentioned function-dependent processing device.

Landscapes

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

Abstract

本公开提供了一种依赖函数的处理方法、装置、设备及存储介质,所述方法包括:在目标依赖库中,确定目标依赖库的名字对应的第一位置,确定该名字所属字段的字段类型对应的第二位置,以及,确定目标依赖函数的名字对应的第三位置。将处于第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,将处于第三位置处的字符串替换为预设依赖函数的名字。本公开基于静态hook技术,确定目标依赖库中需要调整的位置,直接将对应位置的内容进行修改,实现对目标依赖库中的依赖函数的处理。由于是在应用程序运行之前完成依赖函数的处理,不会造成对应用程序运行时的系统资源消耗。

Description

一种依赖函数的处理方法、装置、设备及存储介质
相关申请的交叉引用
本申请要求于2021年03月30日提交的,申请号为202110340678.4、发明名称为“一种依赖函数的处理方法、装置、设备及存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及数据处理领域,尤其涉及一种依赖函数的处理方法、装置、设备及存储介质。
背景技术
目前,当某个依赖库的依赖函数存在调整需求时,通常是基于动态hook钩子技术实现的。具体的,在应用程序运行的过程中,对目标依赖库中的目标依赖函数进行拦截,并调用预设依赖函数,以实现对目标依赖库中的目标依赖函数的调整。
但是,动态hook技术需要在每一次的应用程序运行时均需要大量的执行hook方法,以调整依赖库中的依赖函数,对系统资源消耗较大。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种依赖函数的处理方法、装置、设备及存储介质,能够在应用程序运行之前完成了依赖函数的处理,避免对应用程序运行时的系统资源造成消耗。
第一方面,本公开提供了一种依赖函数的处理方法,所述方法包括:
在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置;
在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。
一种可选的实施方式中,所述在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,包括:
获取目标依赖库中首个结构体中的e_phoff成员的值,作为第一偏移地址;
确定所述目标依赖库中所述第一偏移地址指向的结构体数组;其中,所述结构体数组中包括多个结构体;
确定所述结构体数组中p_type成员的值为PT_DYNAMIC标识的结构体,并获取所述结构体中的p_offset成员的值,作为第二偏移地址;
确定所述目标依赖库中所述第二偏移地址指向的结构体数组,并确定所述结构体数组中d_tag成员的值分别为DT_STRTAB和DT_SONAME的结构体,对应的作为第一结构体和第二结构体;
将所述第一结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第三偏移地址;
将所述第三偏移地址与所述第二结构体中d_val成员的值相加后得到的偏移地址,确定为所述第一位置。
一种可选的实施方式中,所述确定所述名字所属字段的字段类型对应的位置,作为第二位置,包括:
将所述第二结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为所述第二位置。
一种可选的实施方式中,所述确定目标依赖函数的名字对应的位置,作为第三位置,包括:
在确定所述目标依赖库中所述第二偏移地址指向的结构体数组之后,确定所述结构体数组中d_tag成员的值为DT_SYMTAB的结构体,作为第三结构体;
将所述第三结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第四偏移地址;
将所述目标依赖库中所述第四偏移地址指向的结构体数组确定为目标数组;
获取所述目标数组中的各个结构体中st_name成员的值,并将与所述第三偏移地址相加后的位置对应的字符串为目标依赖函数的名字的st_name成员的值对应的结构体确定为第四结构体;
将所述第三偏移地址与所述第四结构体中st_name成员的值相加后得到的偏移地址,确定为所述第三位置。
一种可选的实施方式中,所述预设依赖函数的名字的长度不大于所述目标依赖函数的名字的长度;所述预设依赖库的名字的长度不大于所述目标依赖库的名字的长度。
一种可选的实施方式中,所述装置还包括:
移除所述目标依赖库中名字为.gnu.version的节。
第二方面,本公开还提供了一种依赖函数的处理装置,所述装置包括:
确定模块,用于在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置;
替换模块,用于在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。
第三方面,本公开提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现上述的方法。
第四方面,本公开提供了一种设备,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现上述的方法。
第五方面,本公开提供了一种计算机程序产品,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现上述的方法。
本公开实施例提供的技术方案与现有技术相比具有如下优点:
本公开实施例提供了一种依赖函数的处理方法,首先,在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置。然后,在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。本公开实施例基于静态hook技术,确定目标依赖库中需要调整的位置,并直接将对应位置的内容进行修改,最终实现对目标依赖库中的依赖函数的处理。由于本公开实施例是在应用程序运行之前完成了依赖函数的处理,因此不会造成对应用程序运行时的系统资源消耗。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言, 在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种依赖函数的处理方法流程图;
图2为本公开实施例提供的另一种依赖函数的处理方法流程图;
图3为本公开实施例提供的一种依赖函数的处理装置结构示意图;
图4为本公开实施例提供的一种依赖函数的处理设备结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
假设依赖库A依赖另一个依赖库B中的funcB函数,也就是说,依赖库A运行的过程中会调用依赖库B中的funcB函数。如果基于应用程序功能的调整需求,需要在依赖库A中调用依赖库B中的funcB函数的位置,执行依赖库C中的funcC函数,而不再调用依赖库B中的funcB函数,则可以利用动态hook技术拦截依赖库A对依赖库B中的funcB函数的调用,然后执行依赖库C中的funcC函数。
但是,由于动态hook技术需要在应用程序运行的过程中执行,一旦目标依赖库中需要调整的位置较多,则在每一次应用程序运行时均需要执行大量的hook方法,对系统资源消耗较大。
为此,本公开实施例提供了一种依赖函数的处理方法,在应用程序运行之前,基于静态hook技术,确定目标依赖库中需要调整的位置,然后对需求调整的位置对应的内容进行修改,实现对目标依赖库中依赖函数的处理。
具体的,在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置。然后,在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。可见,由于本公开实施例是在应用程序运行之前完成对目标依赖库中依赖函数的调整,因此,无需占用应用程序运行时的系统资源。
基于此,本公开实施例提供了一种依赖函数的处理方法,参考图1,为本公开实施例提供的一种依赖函数的处理方法流程图,该方法包括:
S101:在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置。
本公开实施例中的目标依赖库可以为动态库,其中,动态库又称为动态链接库(Dynamic Link Library;DLL),包含一个或多个已被编译、链接并与使用它们的进程分开存储的函数。
实际应用中,动态库通常会在其内部声明自身所依赖的其他库的信息,例如,假设依赖库A调用了依赖库B的funcB函数,则依赖库A中会声明对依赖库B中的funcB函数的依赖。如果想要将依赖库A中调用funcB函数的位置调整为调用依赖库C中的funcC函数,则需要在依赖库A中的声明中增加对依赖库C中的funcC函数的声明,以及将依赖库A中调用funcB函数的位置替换为调用funcC函数,从而实现对依赖库A中依赖函数的处理。
为此,本公开实施例首先确定针对目标依赖库中依赖函数的处理需要修改的位置。其中,由于需要将目标依赖库所依赖的目标依赖函数替换为预设依赖函数,例如将依赖库A中的funcB函数替换为funcC函数,因此需要将目标依赖库中目标依赖函数的名字替换为预设依赖函数的名字,为此,需要确定目标依赖库中目标依赖函数的名字对应的位置。
另外,由于用于替换目标依赖函数的预设依赖函数属于预设依赖库,为了保证替换后的预设依赖函数能够正常运行,需要在目标依赖库的依赖库列表中添加预设依赖库的名字。但是,目标依赖库的依赖库列表中不存在空闲字段,因此,利用哪个字段存储预设依赖库的名字本公开实施例需要解决的问题。
实际应用中,目标依赖库中存在一个用于存储自身名字的字段,即存储目标依赖库的名字的字段,由于该字段在实际应用中利用率较低,因此,本公开实施例可以利用该字段存储预设依赖库的名字。为此,在利用该字段存储预设依赖库的名字之前,首先在目标依赖库中确定目标依赖库的名字对应的位置。
另外,本公开实施例中,还需要调整用于存储目标依赖库的名字的字段的字段类型,以便说明该字段中存储的是目标依赖库所依赖的预设依赖库,而并非自身的名字。为此,本公开实施例还需要在目标依赖库中确定用于存储目标依赖库的名字所属字段的字段类型对应的位置。
本公开实施例对于确定第一位置、第二位置和第三位置的方式不做限定,后续实施例中将介绍一种可选的实施方式。
S102:在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名 字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。
本公开实施例中,在目标依赖库中确定第一位置、第二位置和第三位置之后,对应位置的内容进行替换,以实现对目标依赖库中的依赖函数的处理。
具体的,目标依赖库中处于第一位置处的字符串为目标依赖库的名字,为了实现将目标依赖函数替换为预设依赖函数,同时将预设依赖函数所属的依赖库的名字添加到目标依赖库中,可以将处于第一位置处的字符串,即目标依赖库的名字,替换为预设依赖库的名字。
另外,用于存储预设依赖库的名字的字段类型需要替换为DT_NEEDED标识,用于表示其对应的字段中存储的是目标依赖库所依赖的依赖库的名字。为此,本公开实施例将目标依赖库中处于第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识。
另外,将目标依赖库中的目标依赖函数替换为预设依赖函数,还需要将目标依赖库中目标依赖函数的名字替换为预设依赖函数的名字,因此,本公开实施例将处于第三位置处的字符串,即目标依赖函数的名字,替换为预设依赖函数的名字,实现将目标依赖库中调用目标依赖函数的位置调整为调用预设依赖库中的预设依赖函数的目的。
本公开实施例提供的依赖函数的处理方法中,首先,在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置。然后,在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。本公开实施例基于静态hook技术,确定目标依赖库中需要调整的位置,并直接将对应位置的内容进行修改,最终实现对目标依赖库中的依赖函数的处理。由于本公开实施例是在应用程序运行之前完成了依赖函数的处理,因此不会造成对应用程序运行时的系统资源消耗。
基于上述实施例中的内容,本公开实施例还提供了一种依赖函数的处理方法,参考图2,为本公开实施例提供的另一种依赖函数的处理方法流程图,其中,该方法包括:
S201:获取目标依赖库中首个结构体中的e_phoff成员的值,作为第一偏移地址。
本公开实施例中,目标依赖库可以为任意一个动态库,目标依赖库中的首个结构体,记为pElfHeader,包含e_phoff成员,本公开实施例中将pElfHeader中e_phoff成员的值确 定为第一偏移地址,记为file_e_phoff,用于确定第一位置。
本公开实施例中,目标依赖库可以为32位的动态库,也可以为64位的动态库,假设目标依赖库为64位的动态库,则位于目标依赖库中的首个结构体为Elf64_Ehdr,其中Elf64_Ehdr的结构如下:
Figure PCTCN2022078555-appb-000001
对于目标依赖库为32位的动态库,则位于目标依赖库中的首个结构体为Elf32_Ehdr,Elf32_Ehdr与上述的Elf64_Ehdr的结构基本相同,在此不再赘述。
本公开实施例中,目标依赖库中首个结构体pElfHeader中的e_phoff成员的值,用于记录程序头表文件偏移量。本公开实施例将首个结构体pElfHeader中的e_phoff成员的值作为第一偏移地址file_e_phoff,用于在目标依赖库中寻找第一位置。
S202:确定所述目标依赖库中所述第一偏移地址指向的结构体数组;其中,所述结构体数组中包括多个结构体。
本公开实施例中,在确定第一偏移地址file_e_phoff之后,确定目标依赖库中第一偏移地址指向的位置。由于目标依赖库中第一偏移地址file_e_phoff指向的位置存储有结构体数组,因此,可以获取目标依赖库中第一偏移地址指向的结构体数组,其中,结构体数组中包括多个结构体。
实际应用中,假设目标依赖库为64位的动态库,则目标依赖库中第一偏移位置file_e_phoff指向的结构体数组是指由Elf64_Phdr结构体构成的数组,其中,Elf64_Phdr结构体如下所示:
Figure PCTCN2022078555-appb-000002
另外,当目标依赖库为32位的动态库时,目标依赖库中第一偏移位置指向的结构体数组是指由Elf32_Phdr结构体构成的数组,Elf32_Phdr结构体与Elf64_Phdr结构体的结构基本相同,在此不再赘述。
S203:确定所述结构体数组中p_type成员的值为PT_DYNAMIC标识的结构体,并获取所述结构体中的p_offset成员的值,作为第二偏移地址。
本公开实施例中,遍历第一偏移地址file_e_phoff指向的结构体数组中,p_type成员的值为PT_DYNAMIC标识的结构体,记为pPhdrDynamic,然后获取pPhdrDynamic中p_offset成员的值,作为第二偏移地址,记为file_dyn_offset。其中,PT_DYNAMIC为系统定义的常量。
本公开实施例中,确定第一偏移地址file_e_phoff指向的结构体数组中,p_type成员的值为PT_DYNAMIC标识的Elf64_Phdr结构体pPhdrDynamic,然后获取pPhdrDynamic中p_offset成员的值,作为第二偏移地址file_dyn_offset,用于继续确定目标依赖库中的第一位置。其中p_offset成员的值用于记录部分文件的偏移量。
S204:确定所述目标依赖库中所述第二偏移地址指向的结构体数组,并确定所述结构体数组中d_tag成员的值分别为DT_STRTAB和DT_SONAME的结构体,对应的作为第一结构体和第二结构体。
本公开实施例中,在确定第二偏移地址file_dyn_offset之后,确定目标依赖库中第二偏移地址file_dyn_offset指向的结构体数组。
实际应用中,目标依赖库为64位动态库时,目标依赖库中第二偏移地址file_dyn_offset指向的结构体数组为由Elf64_Dyn结构体构成的数组,其中,Elf64_Dyn结构体的结构如下:
Figure PCTCN2022078555-appb-000003
当目标依赖库为32位的动态库时,目标依赖库中第二偏移位置指向的结构体数组是指由Elf32_Dyn结构体构成的数组,Elf32_Dyn结构体与Elf64_Dyn结构体的结构基本相同,在此不再赘述。
本公开实施例在确定目标依赖库中第二偏移地址file_dyn_offset指向的结构体数组之后,确定该结构体数组中d_tag成员的值分别为DT_STRTAB和DT_SONAME的结构体,依次分别记为pDynStrtab和pDynSoname。其中,DT_STRTAB和DT_SONAME为系统定义的常量。
例如,由Elf64_Dyn结构体组成的结构体数组中,将d_tag成员的值为DT_STRTAB的结构体确定为第一结构体pDynStrtab,以及将d_tag成员的值为DT_SONAME的结构体确定为第二结构体pDynSoname。其中,d_tag成员的值用于记录动态条目类型,DT_STRTAB为符号表类型,DT_SONAME为自身动态库名字类型。
S205:将所述第一结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第三偏移地址。
本公开实施例在确定第一结构体pDynStrtab之后,获取第一结构体pDynStrtab中d_ptr成员的值,记为pDynStrtab.d_ptr,由于pDynStrtab.d_ptr为虚拟地址,因此需要将pDynStrtab.d_ptr转换成相对于目标依赖库的偏移地址,记为strtabOffset。
一种可选的实施方式中,可以预先定义一个convertVaddr2fileOffset函数,convertVaddr2fileOffset函数的作用是将虚拟地址准换为偏移地址。具体的,将pDynStrtab.d_ptr作为参数(virtual address,记为vaddr)输入至convertVaddr2fileOffset函数中,由convertVaddr2fileOffset函数将其转化为相对于目标依赖库的偏移地址,作为第三偏移地址strtabOffset,用于后续确定第一位置。
其中,convertVaddr2fileOffset函数的实现过程为,首先遍历目标依赖库中首个结构体pElfHeader中e_phoff成员值,即file_e_phoff偏移处的各个Elf64_Phdr元素,直到找到一个元素thePhdr,满足p_vaddr>=thePhdr.p_vaddr并且p_vaddr<thePhdr.p_vaddr+thePhdr.p_memsz的条件,此时,convertVaddr2fileOffset函数返回的结果是p_vaddr-thePhdr.p_vaddr+thePhdr.p_offset,即为转换后相对于目标依赖库的偏移地址。
本公开实施例对于实现偏移地址转换的其他方式不做限定。
本公开实施例中,第一结构体pDynStrtab中的d_ptr成员的值转换成的第三偏移地址strtabOffset,是指字符串表相对于目标依赖库的偏移地址,字符串表用于存储目标依赖库中的字符串,例如依赖库的名字等。
S206:将所述第三偏移地址与所述第二结构体中d_val成员的值相加后得到的偏移地址,确定为所述第一位置。
本公开实施例在确定第二结构体pDynSoname之后,获取第二结构体pDynSoname中d_val成员的值,记为pDynSoname.d_val。其中,Elf64_Dyn结构体中d_val成员的值,用于记录目标依赖库的名字在字符串表中的地址,即相对于字符串表的地址。为了在目标依赖库中能够查找到目标依赖库的名字的位置,需要基于字符串表相对于目标依赖库的第三偏移地址和目标依赖库的名字相对于字符串表的地址,确定目标依赖库的名字相对于目标依赖库的偏移地址。
具体的,将第三偏移地址strtabOffset与第二结构体pDynSoname中d_val成员的值pDynSoname.d_val相加后得到的偏移地址,记为sonameOffset,确定为第一位置,即目标依赖库中用于存储目标依赖库的名字的字段所在的位置。
S207:将所述第二结构体相对于所述目标依赖库的偏移地址,作为所述第二位置。
本公开实施例中,第二结构体pDynSoname为d_tag成员的值为DT_SONAME的结构体,获取第二结构体pDynSoname相对于目标依赖库的偏移地址,记为offsetForDynSoname,作为第二位置,基于offsetForDynSoname可以确定用于存储目标依赖库的名字所属字段的字段类型的位置。
S208:在确定所述目标依赖库中所述第二偏移地址指向的结构体数组之后,确定所述结构体数组中d_tag成员的值为DT_SYMTAB的结构体,作为第三结构体。
本公开实施例中,在确定目标依赖库的第二偏移地址file_dyn_offset之后,确定目标依赖库中第二偏移地址file_dyn_offset指向的结构体数组。
假设目标依赖库为64位的动态库,则目标依赖库中第二偏移地址file_dyn_offset指向的结构体数组为由Elf64_Dyn结构体构成的数组。然后,获取该结构体数组中的各个Elf64_Dyn结构体中的d_tag成员的值,确定d_tag成员的值为DT_SYMTAB的Elf64_Dyn 结构体,作为第三结构体,记为pDynSymtab。
S209:将所述第三结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第四偏移地址。
本公开实施例中,在确定第三结构体pDynSymtab之后,获取第三结构体pDynSymtab中d_ptr成员的值,记为pDynSymtab.d_ptr。由于pDynSymtab.d_ptr为虚拟地址,因此需要将pDynSymtab.d_ptr转换成相对于目标依赖库的偏移地址,记为symtabOffset,作为第四偏移地址。
S210:将所述目标依赖库中所述第四偏移地址指向的结构体数组确定为目标数组。
S211:获取所述目标数组中的各个结构体中st_name成员的值,并将与所述第三偏移地址相加后的位置对应的字符串为目标依赖函数的名字的st_name成员的值对应的结构体确定为第四结构体。
本公开实施例中,在确定第四偏移地址symtabOffset后,获取目标依赖库中第四偏移地址symtabOffset指向的结构体数组,作为目标数组,然后,获取该目标数组中的各个结构体中st_name成员的值。
假设目标依赖库为64位的动态库,则第四偏移地址symtabOffset指向的结构体数组中包括的结构体为Elf64_Sym结构体,并获取各个Elf64_Sym结构体中st_name成员的值,st_name成员的值用于记录字符串表中的索引。
由于第三偏移地址strtabOffset为字符串表相对于目标依赖库的偏移地址,因此将各个Elf64_Sym结构体中st_name成员的值,记为theSym.st_name,分别与第三偏移地址strtabOffset相加,为字符串表中的各个字符串的位置,确定各个字符串的位置中是否存在目标依赖函数的名字,例如“funcB”,如果存在,则将对应的结构体,记为theSym,确定为第四结构体,也就是说,第四结构体theSym的位置即为目标依赖函数的名字的位置,后续可以基于第四结构体确定目标依赖函数的名字,以便实现将目标依赖函数的名字修改为预设依赖函数的名字。
其中,Elf64_Sym结构体如下:
Figure PCTCN2022078555-appb-000004
Figure PCTCN2022078555-appb-000005
另外,当目标依赖库为32位的动态库时,第四偏移地址指向的结构体数组中包括的结构体为Elf32_Sym结构体,Elf32_Sym结构体与Elf64_Sym结构体的结构基本相同,在此不再赘述。
S212:将所述第三偏移地址与所述第四结构体中st_name成员的值相加后得到的偏移地址,确定为所述第三位置。
本公开实施例中,在确定第四结构体theSym之后,将第四结构体theSym中st_name成员的值,记为theSym.st_name,与第三偏移地址strtabOffset相加后得到的偏移地址,记为hookStrOffset,确定为第三位置,用于确定目标依赖库中的目标依赖函数的名字的位置。
S213:在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。
本公开实施例中,在目标依赖库中确定处于第一位置即sonameOffset偏移处的字符串,并将其替换为预设依赖库的名字,事实上sonameOffset偏移处的字符串为目标依赖库的名字,即将目标依赖库的名字替换为预设依赖库的名字。
另外,在目标依赖库中确定处于第二位置即offsetForDynSoname偏移处的Elf64_Dyn结构体中的d_tag成员的值替换为DT_NEEDED标识,其中,DT_NEEDED为系统定义的常量。
另外,在目标依赖库中确定处于第二位置即hookStrOffset偏移处的字符串,并将其替换为预设依赖函数的名字,事实上hookStrOffset偏移处的字符串为目标依赖函数的名字,即将目标依赖函数的名字替换为预设依赖函数的名字。
本公开实施例提供的依赖函数的处理方法中,通过目标依赖库中的偏移地址的流转,确定目标依赖库中需要修改的位置,并直接将对应位置的内容进行修改,最终实现对目标依赖库中的依赖函数的处理。由于本公开实施例是在应用程序运行之前完成了依赖函数的处理,因此不会造成对应用程序运行时的系统资源消耗。
另外,由于利用存储目标依赖函数的名字的位置对预设依赖函数的名字进行存储,需要保证预设依赖函数的名字的长度不大于目标依赖函数的名字的长度,否则会因存储空间不足而导致内存溢出等情况的发生。
同样的,由于利用存储目标依赖库的名字的位置对预设依赖库的名字进行存储,因此, 也需要保证预设依赖库的名字的长度不大于目标依赖库的名字的长度。
一种可选的实施方式中,当目标依赖库中存在多个目标依赖函数需要修改为对应的多个预设依赖函数时,可以将该多个预设依赖函数分别对应的依赖库封装为一个依赖库,同时为该依赖库确定一个依赖库名字,该依赖库即为本公开实施例中的预设依赖库。
实际应用中,可以在目标依赖库中分别确定多个目标依赖函数的名字的位置,并分别将各个名字的位置替换为对应的预设依赖函数的名字即可。
另外,目标依赖库中包括名字为.gnu.version的节,具体的,.gnu.version节中存储有目标依赖库中的依赖函数的版本信息。
目前,目标依赖库在调用某依赖函数时,需要基于.gnu.version节中存储的该依赖函数的版本信息进行校验,在校验通过后才能实现对该依赖函数的调用。但是,基于本公开实施例提供的依赖函数的处理方法实现对目标依赖函数的静态hook之后,增加到目标依赖库中的预设依赖函数的版本信息并未存储于.gnu.version节中,因此,在目标依赖库调用该预设依赖函数时,可能会因版本信息校验不成功导致无法实现对该预设依赖函数的调用。
为了避免上述情况的发生,本公开实施例可以通过移除目标依赖库中名字为.gnu.version的节的方式,使得目标依赖库在调用该预设依赖函数时不需要进行版本信息校验,从而实现对该预设依赖函数的成功调用。
值得注意的是,即使未进行版本信息的校验,也不会影响本公开实施例中的目标依赖库对预设依赖函数的调用。
具体的,本公开实施例可以利用strip命令移除目标依赖库中名字为.gnu.version的节,具体命令如下:
strip--remove-section=.gnu.version【目标依赖库的名字】
基于上述方法实施例,本公开还提供了一种依赖函数的处理装置,参考图3,为本公开实施例提供的一种依赖函数的处理装置结构示意图,所述装置包括:
确定模块301,用于在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置;
替换模块302,用于在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。
一种可选的实施方式中,所述确定模块,包括:
第一获取子模块,用于获取目标依赖库中首个结构体中的e_phoff成员的值,作为第一偏移地址;
第一确定子模块,用于确定所述目标依赖库中所述第一偏移地址指向的结构体数组;其中,所述结构体数组中包括多个结构体;
第二确定子模块,用于确定所述结构体数组中p_type成员的值为PT_DYNAMIC标识的结构体,并获取所述结构体中的p_offset成员的值,作为第二偏移地址;
第三确定子模块,用于确定所述目标依赖库中所述第二偏移地址指向的结构体数组,并确定所述结构体数组中d_tag成员的值分别为DT_STRTAB和DT_SONAME的结构体,对应的作为第一结构体和第二结构体;
第一转换子模块,用于将所述第一结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第三偏移地址;
第一相加子模块,用于将所述第三偏移地址与所述第二结构体中d_val成员的值相加后得到的偏移地址,确定为所述第一位置。
一种可选的实施方式中,所述确定模块,包括:
第二转换子模块,用于将所述第二结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为所述第二位置。
一种可选的实施方式中,所述确定模块,包括:
第四确定子模块,用于在确定所述目标依赖库中所述第二偏移地址指向的结构体数组之后,确定所述结构体数组中d_tag成员的值为DT_SYMTAB的结构体,作为第三结构体;
第三转换子模块,用于将所述第三结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第四偏移地址;
第五确定子模块,用于将所述目标依赖库中所述第四偏移地址指向的结构体数组确定为目标数组;
第六确定子模块,用于获取所述目标数组中的各个结构体中st_name成员的值,并将与所述第三偏移地址相加后的位置对应的字符串为目标依赖函数的名字的st_name成员的值对应的结构体确定为第四结构体;
第二相加子模块,用于将所述第三偏移地址与所述第四结构体中st_name成员的值相加后得到的偏移地址,确定为所述第三位置。
一种可选的实施方式中,所述预设依赖函数的名字的长度不大于所述目标依赖函数的名字的长度;所述预设依赖库的名字的长度不大于所述目标依赖库的名字的长度。
一种可选的实施方式中,所述装置还包括:
移除模块,用于移除所述目标依赖库中名字为.gnu.version的节。
本公开实施例提供的依赖函数的处理装置中,基于静态hook技术,确定目标依赖库中需要调整的位置,并直接将对应位置的内容进行修改,最终实现对目标依赖库中的依赖函数的处理。由于本公开实施例是在应用程序运行之前完成了依赖函数的处理,因此不会造成对应用程序运行时的系统资源消耗。
除了上述方法和装置以外,本公开实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现本公开实施例所述的依赖函数的处理方法。
本公开实施例还提供了一种计算机程序产品,包括计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现本公开实施例所述的依赖函数的处理方法。
另外,本公开实施例还提供了一种依赖函数的处理设备,参见图4所示,可以包括:
处理器401、存储器402、输入装置403和输出装置404。依赖函数的处理设备中的处理器401的数量可以一个或多个,图4中以一个处理器为例。在本公开的一些实施例中,处理器401、存储器402、输入装置403和输出装置404可通过总线或其它方式连接,其中,图4中以通过总线连接为例。
存储器402可用于存储软件程序以及模块,处理器401通过运行存储在存储器402的软件程序以及模块,从而执行依赖函数的处理设备的各种功能应用以及数据处理。存储器402可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等。此外,存储器402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。输入装置403可用于接收输入的数字或字符信息,以及产生与依赖函数的处理设备的用户设置以及功能控制有关的信号输入。
具体在本实施例中,处理器401会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器402中,并由处理器401来运行存储在存储器402中的应用程序,从而实现上述依赖函数的处理设备的各种功能。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要 素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种依赖函数的处理方法,其特征在于,所述方法包括:
    在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置;
    在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。
  2. 根据权利要求1所述的方法,其特征在于,所述在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,包括:
    获取目标依赖库中首个结构体中的e_phoff成员的值,作为第一偏移地址;
    确定所述目标依赖库中所述第一偏移地址指向的结构体数组;其中,所述结构体数组中包括多个结构体;
    确定所述结构体数组中p_type成员的值为PT_DYNAMIC标识的结构体,并获取所述结构体中的p_offset成员的值,作为第二偏移地址;
    确定所述目标依赖库中所述第二偏移地址指向的结构体数组,并确定所述结构体数组中d_tag成员的值分别为DT_STRTAB和DT_SONAME的结构体,对应的作为第一结构体和第二结构体;
    将所述第一结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第三偏移地址;
    将所述第三偏移地址与所述第二结构体中d_val成员的值相加后得到的偏移地址,确定为所述第一位置。
  3. 根据权利要求2所述的方法,其特征在于,所述确定所述名字所属字段的字段类型对应的位置,作为第二位置,包括:
    将所述第二结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为所述第二位置。
  4. 根据权利要求2或3所述的方法,其特征在于,所述确定目标依赖函数的名字对应的位置,作为第三位置,包括:
    在确定所述目标依赖库中所述第二偏移地址指向的结构体数组之后,确定所述结构体数组中d_tag成员的值为DT_SYMTAB的结构体,作为第三结构体;
    将所述第三结构体中d_ptr成员的值转换为相对于所述目标依赖库的偏移地址,作为第四偏移地址;
    将所述目标依赖库中所述第四偏移地址指向的结构体数组确定为目标数组;
    获取所述目标数组中的各个结构体中st_name成员的值,并将与所述第三偏移地址相加后的位置对应的字符串为目标依赖函数的名字的st_name成员的值对应的结构体确定为第四结构体;
    将所述第三偏移地址与所述第四结构体中st_name成员的值相加后得到的偏移地址,确定为所述第三位置。
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述预设依赖函数的名字的长度不大于所述目标依赖函数的名字的长度;所述预设依赖库的名字的长度不大于所述目标依赖库的名字的长度。
  6. 根据权利要求1-4中任一项所述的方法,其特征在于,所述方法还包括:
    移除所述目标依赖库中名字为.gnu.version的节。
  7. 一种依赖函数的处理装置,其特征在于,所述装置包括:
    确定模块,用于在目标依赖库中,确定所述目标依赖库的名字对应的位置,作为第一位置,确定所述名字所属字段的字段类型对应的位置,作为第二位置,以及,确定目标依赖函数的名字对应的位置,作为第三位置;
    替换模块,用于在所述目标依赖库中,将处于所述第一位置处的字符串替换为预设依赖库的名字,将处于所述第二位置处的结构体中的d_tag成员的值替换为DT_NEEDED标识,以及将处于所述第三位置处的字符串替换为预设依赖函数的名字;其中,所述预设依赖函数为指定用于替换所述目标依赖函数且属于所述预设依赖库中的依赖函数。
  8. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现如权利要求1-6任一项所述的方法。
  9. 一种设备,其特征在于,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1-6任一项所述的方法。
  10. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现如权利要求1-6任一项所述的方法。
PCT/CN2022/078555 2021-03-30 2022-03-01 一种依赖函数的处理方法、装置、设备及存储介质 Ceased WO2022206259A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110340678.4A CN113051004B (zh) 2021-03-30 2021-03-30 一种依赖函数的处理方法、装置、设备及存储介质
CN202110340678.4 2021-03-30

Publications (1)

Publication Number Publication Date
WO2022206259A1 true WO2022206259A1 (zh) 2022-10-06

Family

ID=76516907

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/078555 Ceased WO2022206259A1 (zh) 2021-03-30 2022-03-01 一种依赖函数的处理方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN113051004B (zh)
WO (1) WO2022206259A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051004B (zh) * 2021-03-30 2022-04-15 北京字节跳动网络技术有限公司 一种依赖函数的处理方法、装置、设备及存储介质
CN115061796B (zh) * 2022-06-17 2024-09-10 特赞(上海)信息科技有限公司 子任务之间调用的执行方法、系统及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902284A (zh) * 2014-03-07 2014-07-02 中国人民解放军装甲兵工程学院 一种基于动态库api拦截的数据采集方法及系统
US8997074B1 (en) * 2006-09-29 2015-03-31 Trend Micro Incorporated Dynamic linking library (DLL) replacement in an embedded operating system environment
CN107451474A (zh) * 2016-05-31 2017-12-08 百度在线网络技术(北京)有限公司 用于终端的软件漏洞修复方法和装置
CN108460276A (zh) * 2016-12-09 2018-08-28 北京奇虎科技有限公司 一种安卓安装包的动态链接库so文件的处理方法和装置
CN111124526A (zh) * 2018-11-01 2020-05-08 北京奇虎科技有限公司 依赖库管理方法、装置、存储介质和计算机设备
CN113051004A (zh) * 2021-03-30 2021-06-29 北京字节跳动网络技术有限公司 一种依赖函数的处理方法、装置、设备及存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6651080B1 (en) * 1998-10-16 2003-11-18 Sun Microsystems, Inc. Techniques for implementing pluggable virtual machines
KR100503387B1 (ko) * 2003-03-14 2005-07-26 주식회사 안철수연구소 악성 암호화 스크립트에 대한 분석 및 해독 방법
US20110113410A1 (en) * 2009-11-05 2011-05-12 Loen Larry W Apparatus and Method for Simplified Microparallel Computation
US8949808B2 (en) * 2010-09-23 2015-02-03 Apple Inc. Systems and methods for compiler-based full-function vectorization
US8621448B2 (en) * 2010-09-23 2013-12-31 Apple Inc. Systems and methods for compiler-based vectorization of non-leaf code
CN105224452B (zh) * 2015-09-11 2018-03-16 哈尔滨工业大学 一种针对科学计算程序静态分析性能的预测代价优化方法
CN107992307B (zh) * 2017-12-11 2021-04-13 北京奇虎科技有限公司 一种函数编译方法及装置
CN109240666B (zh) * 2018-06-22 2020-08-25 北京大学 基于调用栈和依赖路径的函数调用代码生成方法及系统
CN111679852B (zh) * 2020-05-29 2023-06-02 北京五八信息技术有限公司 一种冲突依赖库的检测方法及装置
CN112035228B (zh) * 2020-08-28 2024-04-12 光大科技有限公司 一种资源调度方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8997074B1 (en) * 2006-09-29 2015-03-31 Trend Micro Incorporated Dynamic linking library (DLL) replacement in an embedded operating system environment
CN103902284A (zh) * 2014-03-07 2014-07-02 中国人民解放军装甲兵工程学院 一种基于动态库api拦截的数据采集方法及系统
CN107451474A (zh) * 2016-05-31 2017-12-08 百度在线网络技术(北京)有限公司 用于终端的软件漏洞修复方法和装置
CN108460276A (zh) * 2016-12-09 2018-08-28 北京奇虎科技有限公司 一种安卓安装包的动态链接库so文件的处理方法和装置
CN111124526A (zh) * 2018-11-01 2020-05-08 北京奇虎科技有限公司 依赖库管理方法、装置、存储介质和计算机设备
CN113051004A (zh) * 2021-03-30 2021-06-29 北京字节跳动网络技术有限公司 一种依赖函数的处理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN113051004A (zh) 2021-06-29
CN113051004B (zh) 2022-04-15

Similar Documents

Publication Publication Date Title
CN110865888B (zh) 一种资源加载方法、装置、服务器及存储介质
CN103339604B (zh) 程序生成装置、程序生成方法、处理器装置以及多处理器系统
US11003625B2 (en) Method and apparatus for operating on file
CN110175174B (zh) 一种数据查询方法、装置、设备及存储介质
CN107577629B (zh) 一种数据接口处理方法、装置、服务器及介质
CN114168490A (zh) 确定内存回收阈值的方法及相关设备
CN111737564B (zh) 一种信息查询方法、装置、设备及介质
WO2020093501A1 (zh) 文件存储方法、删除方法、服务器及存储介质
US10268462B2 (en) Emulation device, emulation method, and recording medium storing emulation program
WO2022206259A1 (zh) 一种依赖函数的处理方法、装置、设备及存储介质
WO2019205365A1 (zh) 加载dom节点数据的方法、装置、计算机设备及存储介质
CN101847096A (zh) 包含栈变量函数的优化方法
CN112988686A (zh) 插件处理方法、装置、设备和存储介质
US11954510B2 (en) Native-image in-memory cache for containerized ahead-of-time applications
CN117271107A (zh) 数据处理方法、装置、电子设备以及计算机可读存储介质
JP2023540456A (ja) ガベージ・コレクションのための3色ビットマップ・アレイ
KR102456017B1 (ko) 응용 프로그램간 파일 공유 장치 및 방법
CN118690098A (zh) 网页处理方法、装置、系统及存储介质
CN115525291A (zh) 基于Go语言的结构体处理方法、装置、电子设备及介质
CN119292764A (zh) 数据处理方法、装置、电子设备以及计算机可读存储介质
CN114493875A (zh) 交易执行方法、计算机设备和存储介质
CN105183668A (zh) 缓存刷新方法及装置
US20260093549A1 (en) Host memory resource processing method and apparatus for data processing unit virtualization scenario, electronic device, and storage medium
US20260104825A1 (en) Data processing method, data processing device and electronic apparatus
CN115705211A (zh) 一种布局文件的处理方法、装置、设备及存储介质

Legal Events

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

Ref document number: 22778444

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14.02.2024)

122 Ep: pct application non-entry in european phase

Ref document number: 22778444

Country of ref document: EP

Kind code of ref document: A1