Unlock instant, AI-driven research and patent intelligence for your innovation.

Function compiling method and device

A compiling method and function technology, which is applied in the computer field, can solve the problem of high development cost of custom Hook functions, and achieve the effect of reducing development cost

Active Publication Date: 2018-09-18
TENCENT TECH (SHENZHEN) CO LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0014] The embodiment of the present invention provides a method and device for compiling a function to at least solve the technical problem in the related art that the custom Hook function must be written in C / C++ when the function is hooked, resulting in relatively high development costs for the custom Hook function

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Function compiling method and device
  • Function compiling method and device
  • Function compiling method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0063] According to an embodiment of the present invention, a method embodiment of a function compiling method is provided.

[0064] Optionally, in this embodiment, the above function compilation method can be applied to such as figure 2 In the hardware environment constituted by the server 102 and the terminal 104 as shown. Such as figure 2 As shown, the server 102 is connected to the terminal 104 through a network. The above-mentioned network includes but not limited to: a wide area network, a metropolitan area network or a local area network. The terminal 104 is not limited to a PC, a mobile phone, a tablet computer, and the like. The function compiling method in the embodiment of the present invention may be executed by the server 102 , may also be executed by the terminal 104 , and may also be executed jointly by the server 102 and the terminal 104 . Wherein, the execution of the function compiling method in the embodiment of the present invention by the terminal 104 ...

Embodiment 2

[0154] According to an embodiment of the present invention, a function compiling device for implementing the above function compiling method is also provided.

[0155] Figure 20 is a schematic diagram of an optional function compiling device according to an embodiment of the present invention, such as Figure 20 As shown, the device may include:

[0156] The hooking unit 22 is used to hook the second function obtained by compiling the first function into the custom proxy function to obtain a function call pointer, wherein the first function is a hooked function written in the first programming language, and the second The code in the function is allowed to be directly executed by the CPU, and the function call pointer is used to call the second function; the registration unit 24 is used to register the function call pointer, so that the function call pointer is allowed to be called by code written in the first programming language; The compiling unit 26 is configured to com...

Embodiment 3

[0174] According to an embodiment of the present invention, a terminal for implementing the above function compilation method is also provided.

[0175] Figure 22 is a structural block diagram of a terminal according to an embodiment of the present invention, such as Figure 22 As shown, the terminal may include: one or more (only one is shown in the figure) processor 201, memory 203, and transmission device 205, such as Figure 22 As shown, the terminal may also include an input and output device 207 .

[0176] Wherein, the memory 203 can be used to store software programs and modules, such as the program instructions / modules corresponding to the function compilation method and device in the embodiment of the present invention, and the processor 201 executes various functions by running the software programs and modules stored in the memory 203. A function application and data processing, that is, realizing the above-mentioned function compilation method. The memory 203 m...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a function compiling method and device. The method comprises the steps that a second function obtained by compiling a first function is hooked into a self-defined proxy function to obtain a function call pointer, wherein the first function is a hooked function written by using a first programming language, and the function call pointer is used for calling the second function; the function call pointer is registered so that the function call pointer can be allowed to be called by a code written in the first programming language; a third function is compiled by using the registered function call pointer to obtain a fourth function, wherein the third function comprises a code for calling the first function, the third function is a self-defined hook function written by using the first programming language, and the code in the second function and the code in the fourth function are allowed to be directly executed by a CPU. The method solves the technical problem that a self-defined Hook function needs to be compiled by using C / C++ when a function is hooked, and accordingly the development cost of the self-defined Hook function is relatively high.

Description

technical field [0001] The present invention relates to the field of computers, in particular to a method and device for compiling functions. Background technique [0002] Hook technology can refer to the process of replacing a certain function with a custom function. The process can involve three functions, one is the Hook function, and the other is the custom Hook function. After the Hook, a function pointer can be returned. The function pointer can complete the function of the Hooked function, that is, the function pointer can indicate the call of the Hooked function. [0003] Hook technology can be applied in testing and other fields, for example, figure 1 It is a schematic diagram of the existing technology used in the mobile game protocol testing tool, such as figure 1 As shown, it specifically includes the following steps: [0004] 1. Register the JIT completion event: use the interface mono_profiler_install_jit_end provided by Mono to register the callback functio...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/30G06F8/41G06F9/448
CPCG06F8/315G06F8/41G06F9/449
Inventor 黄柳优李源纯周江王鹏魏学峰
Owner TENCENT TECH (SHENZHEN) CO LTD