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

A dynamic library and dynamic linking technology, applied in the direction of program control device, program loading/starting, program control design, etc., can solve the problem of not being able to support repeated hook and unhook operations of the same API, and achieve the convenience of repeated calls. Effect

Active Publication Date: 2017-01-11
BEIJING KINGSOFT SECURITY MANAGEMENT SYST TECH CO LTD
View PDF5 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, in the above-mentioned interception method, because the hook functions executed by the same API called by different dynamic library services are different, when a certain called API has not completed the correspond

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
  • Interception method and device applied to dynamic library API (Application Program Interface) in Linux system
  • Interception method and device applied to dynamic library API (Application Program Interface) in Linux system
  • Interception method and device applied to dynamic library API (Application Program Interface) in Linux system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] In order to clearly illustrate the solutions in the present invention, preferred embodiments are given below and detailed descriptions are given in conjunction with the accompanying drawings. The following description is merely exemplary in nature and is not intended to limit the application or uses of the present disclosure. It should be understood that throughout the drawings, corresponding reference numerals indicate like or corresponding parts and features.

[0025] Such as figure 1 As shown, the present invention provides a kind of intercepting method that is applied to dynamic library API in the linux system, comprising:

[0026] S101. Obtain the API and hook function called by the dynamic library service to be executed;

[0027] S102. Find the corresponding API from the preset two-level interception mapping table according to the API, link the hook function with the original function of the API, and replace the original function with the hook function to execut...

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 an interception method and device applied to a dynamic library API (Application Program Interface) in a Linux system. The method comprises: acquiring APIs and hook functions, which are called by dynamic library services to be performed; finding the corresponding APIs from a pre-set double-grade interception mapping table according to the APIs; hooking the hook functions and primitive functions of the APIs; replacing the primitive functions by the hook functions to perform the dynamic library services; after the dynamic library services are performed, unhooking the APIs and recovering the primitive functions. According to the interception method provided by the invention, the double-grade interception mapping table is utilized and a correlation relation of the APIs called by the different dynamic library services and corresponding ELF (Executable and Linkable Format) files thereof, the hook functions and the primitive functions is established; a plurality of API calling records can be inserted into the mapping table according to the difference of the hook functions; when the dynamic library services are performed, the APIs are recovered to the primitive functions according to the calling records and the different dynamic library services can conveniently and repeatedly call the same API for a plurality of times.

Description

technical field [0001] The invention relates to the technical field of computer API interception, in particular to an interception method and device applied to a dynamic library API in a Linux system. Background technique [0002] In order to realize the debugging of computer applications and expand the original functions, the existing computing technology generally adopts hook technology to intercept the calls of different APIs. There are many technologies for intercepting APIs, which are roughly divided into user layer and kernel layer interception. , among them, for the user-level interception technology, it is generally to directly modify the memory and program flow of the API to be intercepted, so that the program jumps to the specified address for execution, and then returns to the original address. However, in the above-mentioned interception method, because the hook functions executed by the same API called by different dynamic library services are different, when a ...

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
IPC IPC(8): G06F9/445
CPCG06F9/44521
Inventor 秦青杨锐
Owner BEIJING KINGSOFT SECURITY MANAGEMENT SYST TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products