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

Method and device for injecting Java bit codes into target process

A target process, bytecode technology, applied in program control design, electrical digital data processing, instruments, etc., to achieve the effect of improving functions

Active Publication Date: 2015-05-27
TENCENT TECH (SHENZHEN) CO LTD
View PDF4 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, for those bytecodes that need to rely on the virtual machine to run, it is difficult to use the above method to inject into the target process

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 and device for injecting Java bit codes into target process
  • Method and device for injecting Java bit codes into target process
  • Method and device for injecting Java bit codes into target process

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0025] This embodiment provides a method for injecting Java bytecode into the target process, see figure 2 , the above method includes the following steps:

[0026] Step S101, modify the registers of the target process through the system call provided by the host operating system to load a binary shared library.

[0027] In a computer system, there are two modes in which program code runs, one is user mode and the other is kernel mode. Applications in the application layer run in user mode, while device drivers and file systems run in kernel mode. Programs running in user mode are strictly managed and do not disrupt system-level applications. Programs running in kernel mode have full access to the computer. A system call is when code running in kernel mode provides services to code running in user mode.

[0028] Taking the Linux system as an example, its system call is implemented through int80h, and the system call is used to distinguish the entry function. The basic pr...

no. 2 example

[0036] This embodiment provides a method for injecting Java bytecode into the target process, which is similar to the method of the first embodiment, the difference is that the method of this embodiment is applied to running the Android (Android) operating system on the device.

[0037] refer to image 3 , which is a schematic diagram of an Android device architecture. Such as image 3As shown, the Android device 200 includes: a memory 102, a processor 104, and other hardware 106, which are compatible with figure 1 It is similar to what is shown, and can be referred to the above description together.

[0038] image 3 The software programs and modules in the memory 102 may include, for example: Linux kernel 222 , Delvik virtual machine 224 , Android framework 226 and Android application program 228 . The Linux kernel 122 directly controls various hardware. A Delvik virtual machine (Delvik Virtual Machine, DVM) 224 runs on the system kernel 222 . JVM124 is a stack machin...

no. 3 example

[0049] This embodiment provides a device for injecting Java bytecode into the target process, see Figure 5 , which includes: a local injection module 31, and a Java bytecode loading module 32.

[0050] The local injection module 31 is configured to modify the registers of the target process through a system call provided by the host operating system to load a binary shared library.

[0051] The Java bytecode loading module 32 is stored in the binary shared library, and is automatically executed along with the loading of the binary shared library. The Java bytecode loading module 32 is used to load the file containing the Java bytecode of the specified path into the virtual machine, and call the entry function in the file containing the Java bytecode. The Java bytecode includes specific logic codes to realize specific functions.

[0052] For other details of the device in this embodiment, please refer to the first embodiment.

[0053] According to the method of this embodim...

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

Method and System for injecting Java bytecode into a target process of an application program are disclosed. The method includes: at a device having one or more processors and memory: during execution of the target process of the application program, detecting a call to load a predetermined code injection function; in response to the detected call to load the predetermined code injection function, loading Java bytecode referenced by the code injection function into a virtual machine; in accordance with a pre-stored Java native interface corresponding to the loaded Java bytecode, calling an entrypoint function in the Java bytecode, wherein the entrypoint function is configured to perform one or more extended tasks for the application program; and executing the entrypoint function in the virtual machine to accomplish the one or more extended tasks of the application program.

Description

technical field [0001] The invention relates to computer process injection technology, in particular to a method for injecting Java bytecode into a target process. Background technique [0002] Injection technology in computer programming refers to injecting a binary file, such as an so file on linux and a dll file on windows, into a target process, so as to expand the function of the target process. On the other hand, with the development of computer technology, virtual machine technology has been widely used. However, for those bytecodes that need to rely on the virtual machine to run, it is difficult to inject them into the target process using the above method. Contents of the invention [0003] In view of this, it is necessary to provide a method and device for injecting Java bytecode into a target process, which can inject Java bytecode into the target process. [0004] A method for injecting Java bytecodes into a target process, the target process running on a hos...

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): G06F11/36
CPCG06F11/3644G06F9/44521G06F9/4484G06F9/45504
Inventor 梁家辉
Owner TENCENT TECH (SHENZHEN) 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