Method for injecting test codes for Linux system

A technology for testing code and code injection, which is used in the field of testing code injection for Linux systems, and can solve problems such as long running time

Inactive Publication Date: 2011-03-09
NR ELECTRIC CO LTD +1
View PDF5 Cites 47 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This is powerless for some programs that ru

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
  • Method for injecting test codes for Linux system
  • Method for injecting test codes for Linux system
  • Method for injecting test codes for Linux system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0038] It is divided into five steps, and the following takes PPC Linux 2.4.25 as an example to illustrate this process.

[0039] The first step is to write, compile the bootloader and test the code. The test code is compiled as a shared library file .so or a simple .o file depending on the target process type. If the target process is formed by a dynamic shared link, the test code is also compiled into a .so file. If the target process is statically linked, it will be compiled into a .o intermediate file. The bootloader is actually a loader whose main function is to load the .so or .o files corresponding to the test code. The specific process is as figure 1 with figure 2 shown

[0040] The main functions of the bootloader corresponding to the statically linked test code are: first use the mmap system call to apply for a certain size of data space, map the test code (. Function redirection operation, and finally use the mprotect system call to set the above memory area as...

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 relates to a method for injecting test codes for a Linux system, which comprises the following steps: step 1) writing and compiling a bootstrap and the test codes, wherein the bootstrap aims at applying address space in a target process, loading the test codes, and changing the attribute of the applied memory space to be executable; step 2) relating with the process to be tested, and copying the bootstrap into the address space of the process; step 3) executing the bootstrap and loading the test codes; applying the address space in the target process, loading the test codes, andlinking with an original process symbol; step 4) executing the test codes; creating a thread in the target process, simultaneously applying the address space in the target process, loading the test codes, linking with the original process symbol, and carrying out function redirection work; and step 5) separating from the process to be tested, recovering an original process space command and recovering the original process for execution. The method can run without interrupting the target process and dynamically inject the test codes for a target program.

Description

technical field [0001] The invention relates to a method for testing code injection of a Linux operating system and a software tool using the method. Background technique [0002] Code injection is to inject a piece of executable code into the address space of the local process (target process) corresponding to the target program, and make the process execute this code to achieve some special functions. [0003] In the Linux development process, in order to test the target program, it is often necessary to inject some test code into the address space of the target process for information collection or other testing purposes. [0004] In the Linux system, each process has its own private memory space, which is isolated from each other and cannot operate beyond the boundaries of each other. To inject code into a different process address space, and then execute the injected code in the context of the process, it is necessary to access memory execution code across processes. ...

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
Inventor 李忠安李兴建
Owner NR ELECTRIC 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