Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method and device for intercepting APIs of dynamic libraries in Linux systems

A dynamic library and dynamic link technology, applied in program control devices, program loading/starting, instruments, etc., can solve the problem of not being able to support repeated hooking and unhooking operations of the same API, and achieve the effect of convenient repeated calls

Active Publication Date: 2019-12-17
BEIJING KINGSOFT SECURITY MANAGEMENT SYST TECH CO LTD
View PDF5 Cites 0 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 corresponding dynamic library service, other dynamic libraries that also need to call the instruction The service must be delayed and executed later, and repeated hooking and unhooking operations on the same API cannot be supported.

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
  • A method and device for intercepting APIs of dynamic libraries in Linux systems
  • A method and device for intercepting APIs of dynamic libraries in Linux systems
  • A method and device for intercepting APIs of dynamic libraries in Linux systems

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 interception method that is applied to the 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 ex...

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
Patent Type & Authority Patents(China)
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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products