CN114610406A - Code injection method, device, storage medium and electronic equipment - Google Patents

Code injection method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114610406A
CN114610406A CN202210206492.4A CN202210206492A CN114610406A CN 114610406 A CN114610406 A CN 114610406A CN 202210206492 A CN202210206492 A CN 202210206492A CN 114610406 A CN114610406 A CN 114610406A
Authority
CN
China
Prior art keywords
program
injection
code
target
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210206492.4A
Other languages
Chinese (zh)
Inventor
刘现坤
沈标标
邹懋
陈飞
王鲲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vita Technology Beijing Co ltd
Original Assignee
Vita Technology Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vita Technology Beijing Co ltd filed Critical Vita Technology Beijing Co ltd
Priority to CN202210206492.4A priority Critical patent/CN114610406A/en
Publication of CN114610406A publication Critical patent/CN114610406A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure relates to a code injection method, a device, a storage medium and an electronic device, belonging to the field of code injection, wherein the method is applied to a terminal and comprises the following steps: responding to an injection configuration updating operation executed by a user based on a target application program, and determining updated injection configuration information, wherein the injection configuration information comprises at least one target program and codes to be injected, which are in one-to-one correspondence with the target program; in response to intercepting a program execution notification, determining whether a second program matching a first program corresponding to the program execution notification exists in the target program; and under the condition that a second program matched with the first program exists in the target program, injecting a code to be injected corresponding to the second program into the first program, so that the terminal executes the first program after code injection.

Description

Code injection method, device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of code injection, and in particular, to a code injection method, apparatus, storage medium, and electronic device.
Background
In some development, debugging and deployment scenarios, there are some cases where it is desirable to load an existing program at runtime and execute some newly developed code modules, and the existing program is generally impossible to modify directly because it is compiled and released. To deploy a specific code module into an existing program, various code injection techniques, i.e., techniques for a program to load and execute code that the program desires to execute, are used.
In the related art, code injection can be realized by using a driver module or an injection program, however, when code injection is performed through the driver module, which codes are specifically injected and which injected programs cannot be configured and changed in real time, and can only be set once when the driver module is loaded, so that the flexibility is poor, and when code injection is performed through the injection program, an additional execution process needs to be introduced, so that noninductive injection cannot be performed, and the user experience is poor.
Disclosure of Invention
In order to solve the problems in the related art, the present disclosure provides a code injection method, apparatus, storage medium, and electronic device.
In order to achieve the above object, a first aspect of the present disclosure provides a code injection method, which is applied to a terminal, and the method includes:
responding to an injection configuration updating operation executed by a user based on a target application program, and determining updated injection configuration information, wherein the injection configuration information comprises at least one target program and codes to be injected, which are in one-to-one correspondence with the target program;
in response to intercepting a program execution notification, determining whether a second program matching a first program corresponding to the program execution notification exists in the target program;
and under the condition that a second program matched with the first program exists in the target program, injecting a code to be injected corresponding to the second program into the first program, so that the terminal executes the first program after code injection.
Optionally, the terminal comprises a driver module running in a kernel layer of an operating system,
the response user executes injection configuration updating operation based on the target application program, and determines updated injection configuration information; in response to intercepting a program execution notification, determining whether there is a second program in the target program that matches the first program corresponding to the program execution notification includes:
receiving, by the driver module, updated injection configuration information in a target application in response to a user performing an injection configuration update operation based on the target application;
and intercepting a program execution notice through the drive module, and determining whether a second program matched with a first program corresponding to the program execution notice exists in the target program or not under the condition that the drive module intercepts the program execution notice.
Optionally, the injecting the code to be injected into the program corresponding to the program execution notification includes:
generating an injection command through the driving module according to the first program and the code to be injected;
and injecting the code to be injected into the first program according to the injection command so as to enable the terminal to execute the first program after code injection.
Optionally, the method further comprises:
responding to the successful generation of the injection command, generating an injection feedback message according to the first program and the code to be injected through the driving module, and sending the injection feedback message to the target application program, so that the target application program stores the injection feedback message.
Optionally, the terminal includes a user interface, and the method includes:
receiving configuration information input by a user through the user interface; and the number of the first and second electrodes,
and generating an injection feedback image according to the stored injection feedback message, and displaying the injection feedback image through the user interface.
Optionally, the method comprises:
and directly executing the first program under the condition that the second program matched with the first program does not exist in the target program.
A second aspect of the present disclosure provides a code injection apparatus applied to a terminal, the apparatus including:
the device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for responding to the fact that a user executes injection configuration updating operation based on a target application program and determining updated injection configuration information, and the injection configuration information comprises at least one target program and codes to be injected, wherein the codes to be injected correspond to the target program one by one;
the second determining module is used for responding to the intercepted program execution notice and determining whether a second program matched with the first program corresponding to the program execution notice exists in the target program;
and the injection module is used for injecting the code to be injected corresponding to the second program into the first program under the condition that the second program matched with the first program exists in the target program, so that the terminal executes the first program after the code is injected.
Optionally, the terminal comprises a driver module running in a kernel layer of an operating system,
the first determining module is specifically configured to:
receiving, by the driver module, updated injection configuration information in a target application in response to a user performing an injection configuration update operation based on the target application;
the second determining module is specifically configured to:
and intercepting a program execution notice through the drive module, and determining whether a second program matched with a first program corresponding to the program execution notice exists in the target program or not under the condition that the drive module intercepts the program execution notice.
A third aspect of the disclosure provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspects of the disclosure.
A fourth aspect of the present disclosure provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspect of the present disclosure.
Through the technical scheme, when the user performs injection configuration updating, the injection configuration information is timely acquired, so that the user can configure the code to be injected and the target program in real time, the injection configuration information is set in real time as required, the flexibility degree is improved, code injection can be performed without a specific starting mode, the non-inductive injection is effectively realized, and the user experience can be effectively improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a schematic diagram of a driver module based code injection method;
FIG. 2 is a schematic diagram of a code injection method based on an injection program;
FIG. 3 is a flow diagram illustrating a method of code injection in accordance with an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating a code injection method in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating a code injection apparatus in accordance with an exemplary embodiment;
FIG. 6 is a block diagram of an electronic device shown in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating another electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
It should be noted that all actions of acquiring signals, information or data in the present disclosure are performed under the premise of complying with the corresponding data protection regulation policy of the country of the location and obtaining the authorization given by the owner of the corresponding device.
It should be understood that the driver module in the related art refers to a code module executed in a kernel layer of an operating system, and the injection program refers to an application program executed in the user layer in the operating system and specifically performing a code injection operation on a target program, and the operating system may be a Windows system.
In order to make those skilled in the art more understand the improvement of the technical solution provided by the present disclosure, the present disclosure first introduces the related art.
Fig. 1 is a schematic diagram of a code injection method based on a driver module, as shown in fig. 1, when the driver module is used for code injection, the driver module obtains a system notification when a system executes a program, for example, a user starts a dota2.exe program, and at this time, the system may send out the system notification, which may be "program dota2.exe execution"; the driver module compares the program information to determine whether to perform code injection, e.g., determine whether the dota2.exe program is in a white list of injected configuration information; and if the comparison result represents that code injection needs to be executed, namely the comparison result is in a white list, the drive module creates an injection command so as to inject the specified injection module into the program when the drive module is loaded.
FIG. 2 is a schematic diagram of a code injection method based on an injection program, as shown in FIG. 2, a user needs to start the injection program first and specify a target program needing to inject a code, and after the specification is completed, the target program is started in a specific mode, for example, testing is performed by using Renderoc to start dota2. exe; after the target program begins to start, the injection program creates a new execution flow within the target program such that the new flow performs the injection operation, e.g., renderoc injects a particular module by creating a thread within the test program, after which the injection program terminates and resumes target program execution.
It can be seen that there are at least the following technical problems in the related art: when code injection is carried out through the driving module, which codes are specifically injected and which programs are injected cannot be configured and changed in real time, the codes can be set at one time only when the driving module is loaded, the flexibility is poor, when the codes are injected through the injection programs, an additional execution process needs to be introduced, the noninductive injection cannot be carried out, and the user experience is poor.
In order to solve the problems in the related art, the present disclosure provides a code injection method, apparatus, storage medium, and electronic device.
Fig. 3 is a flowchart illustrating a code injection method according to an exemplary embodiment, where the method is applied to a terminal, the terminal may be provided as an electronic device such as a mobile phone, a personal computer, a smart watch, and the like, and may also serve as a server, and the present disclosure does not specifically limit the type of the terminal, and the method includes:
s101, responding to an injection configuration updating operation executed by a user based on a target application program, and determining updated injection configuration information, wherein the injection configuration information comprises at least one target program and codes to be injected, which correspond to the target program one by one.
The target application may be an application designed to perform code injection operation on the target program, which is executed by a user layer in an operating system such as Windows or Linux. It will be appreciated that the target application may be configured as an injection service. The injection service may include an input module for receiving user-entered information, such as user-entered injection configuration information.
In some possible embodiments, the terminal may further include a user interface to enable a user to interact with the terminal via the user interface, for example, the input module may receive the injection configuration input by the user in the form of the user interface.
For example, the user performs the injection configuration update operation based on the target application program, which may mean that the user inputs the injection configuration in the target application program in the terminal or an input module in the injection service of the target application program, and clicks to confirm the update operation after the injection configuration input is completed.
Further, the injection configuration information may be, for example, { [ program: a, a code to be injected: a ], [ program B, code to be injected: b ], the programs A, B are respectively target programs, the code to be injected a is the code to be injected corresponding to the target program a, and B is the code to be injected corresponding to the target program B. Illustratively, where the program a may represent dota2.exe, the code a to be injected may include a statistical module, which can be used to count the number of calls of a certain function. In some possible embodiments, the code to be injected may further include a plurality of functional modules, such as a disabling module, a calculating module, and the like.
S102, responding to the intercepted program execution notice, and determining whether a second program matched with the first program corresponding to the program execution notice exists in the target program.
For example, if the program execution notification indicates that the user has executed dota2.exe, the first program corresponding to the program execution notification may be characterized as dota2.exe, and if the program field in the injected configuration information includes "dota 2. exe", it may be determined whether there is a second program matching the first program corresponding to the program execution notification in the target program.
S103, under the condition that a second program matched with the first program exists in the target program, injecting a code to be injected corresponding to the second program into the first program, so that the terminal executes the first program after code injection.
Following the example in step S101, in step S103, the code a to be injected including the statistical module may be injected into the first program dota2.exe and the first program is executed, and the executed dota2.exe can execute the code in the code a to be injected, so that after the program is successfully injected, the statistical module can execute the predetermined kinetic energy according to the original design, perform statistics on the call of the specific function, and implement the function of the statistical module.
In the embodiment of the disclosure, when the user performs injection configuration update, the injection configuration information is acquired in time, so that the user can configure the code to be injected and the target program in real time, and the injection configuration information is set in real time as required, thereby improving the flexibility, and the code injection can be performed without a specific starting mode, effectively realizing the non-inductive injection, and effectively improving the user experience.
In some optional embodiments, the terminal comprises a driver module running in a kernel layer of an operating system,
the response user executes injection configuration updating operation based on the target application program, and determines updated injection configuration information; in response to intercepting a program execution notification, determining whether a second program matching a first program corresponding to the program execution notification exists in the target program comprises:
receiving, by the driver module, updated injection configuration information in a target application in response to a user performing an injection configuration update operation based on the target application;
and intercepting a program execution notice through the drive module, and determining whether a second program matched with a first program corresponding to the program execution notice exists in the target program or not under the condition that the drive module intercepts the program execution notice.
By adopting the scheme, the injection configuration information input by the user in the target application program is acquired through the driving module running in the kernel layer of the operating system, and the program execution notice is intercepted, so that the driving module can intercept the program execution event and inject the code to be injected no matter the user starts the program in any mode.
In an embodiment of the present disclosure, the injecting the code to be injected into the program execution notification includes:
generating an injection command through the driving module according to the first program and the code to be injected;
and injecting the code to be injected into the first program according to the injection command so as to enable the terminal to execute the first program after code injection.
By adopting the scheme, the injection command is generated through the driving module, and the operating system of the terminal can execute code injection according to the injection command so as to execute a program after code injection, thereby effectively ensuring the accuracy of code injection.
In further optional embodiments, the method further comprises:
responding to the successful generation of the injection command, generating an injection feedback message according to the first program and the code to be injected through the driving module, and sending the injection feedback message to the target application program, so that the target application program stores the injection feedback message.
Further, the terminal may further include a user interface, and the method may generate an injection feedback image according to the stored injection feedback message, and display the injection feedback image through the user interface.
Specifically, the injection feedback message may include a target program corresponding to the injection command, a function module corresponding to the code to be injected, a generation time of the injection command, and the like, and the injection feedback image may be displayed on the user interface in a table form to show information in the injection feedback message saved by the terminal.
According to the scheme, when the driver module is used for code injection, the injection feedback message is generated, and the injection feedback message generated by the driver module is stored through the target application program, so that the target application program can effectively manage the injection operation record, the perfect record of the injection operation is provided, a code injection event record, management and audit mechanism is provided, and the code injection event can be effectively recorded and controlled.
In further optional embodiments, the method comprises:
and directly executing the first program under the condition that the second program matched with the first program does not exist in the target program.
By adopting the scheme, even if the program corresponding to the program execution notice is intercepted, code injection is not needed, the program can be smoothly executed, so that the normal operation of other programs is not influenced while the specific program is injected by the injection method, and the flexibility of injection operation and the system stability are considered.
In order to make the general concept of the present disclosure more understandable to those skilled in the art, the present disclosure also provides a schematic diagram of a code injection method shown in fig. 4 according to an exemplary embodiment, the method is applied to a terminal, as shown in fig. 4, the terminal is configured with a driver module, which may run at a kernel layer of an operating system, and an injection service, which may run at an application layer of the terminal, and the injection service may be a collection of a part of functional modules in a target application program.
The driving module firstly receives injection configuration information sent by injection service; responding to the fact that the drive module receives the program execution notice, matching the program corresponding to the program execution notice according to the injection configuration information sent by the injection service so as to judge whether code injection is carried out or not; the driving module creates an injection command under the condition that the matching is successful and the code injection is determined to be executed, generates injection feedback information according to the injection command, and sends the injection feedback information to the injection service to inform the injection service of the injection operation, and the injection service performs the display and proper management of the injection feedback information; and after the driver module generates the injection command, the operating system injects the code to be injected into the program corresponding to the program execution notice according to the injection command and executes the program.
Specifically, as shown in fig. 4, the injection module may further include a presentation module, an input module, and a notification module, where the presentation module may present the injection configuration information to the user in the form of a user interface; the input module may receive a user-input injection configuration in the form of a user interface; the notification module may be configured to receive the injection feedback message sent by the driver module, and display and manage the code injection information corresponding to the injection feedback message.
In the embodiment of the disclosure, no specific starting mode is needed to start the target program, and no matter what way the user starts the white list program in the injection configuration information, the drive module can effectively intercept the execution program event and inject the execution program event, so that the non-inductive injection is realized; moreover, through the design of injection service (namely target application program), after the driver module is loaded, the injection configuration information is set in real time as required, so that the flexibility of code injection is greatly improved, and different code modules can be injected into different programs; in addition, a flexible user operation and display module is provided, the injection configuration can be effectively modified and checked, the injection operation records are effectively managed, and the perfect records of the injection operation are provided.
Based on the same inventive concept, fig. 5 is a block diagram illustrating a code injection apparatus 50 according to an exemplary embodiment, the apparatus 50 being applied to a terminal, the apparatus including:
a first determining module 51, configured to determine updated injection configuration information in response to a user performing an injection configuration update operation based on a target application program, where the injection configuration information includes at least one target program and a code to be injected, which is in one-to-one correspondence with the target program;
a second determining module 52, configured to determine, in response to intercepting the program execution notification, whether a second program matching the first program corresponding to the program execution notification exists in the target program;
and an injection module 53, configured to, when it is determined that a second program that matches the first program exists in the target program, inject a code to be injected corresponding to the second program into the first program, so that the terminal executes the first program after code injection.
Optionally, the terminal comprises a driver module running in a kernel layer of an operating system,
the first determining module 51 is specifically configured to:
receiving, by the driver module, updated injection configuration information in the target application in response to a user performing an injection configuration update operation based on the target application;
the second determining module 52 is specifically configured to:
and intercepting a program execution notice through the drive module, and determining whether a second program matched with a first program corresponding to the program execution notice exists in the target program or not under the condition that the drive module intercepts the program execution notice.
Optionally, the injection module 53 is specifically configured to:
generating an injection command through the driving module according to the first program and the code to be injected;
and injecting the code to be injected into the first program according to the injection command so as to enable the terminal to execute the first program after code injection.
Optionally, the apparatus 50 further comprises:
and the feedback module is used for responding to the successful generation of the injection command, generating an injection feedback message according to the first program and the code to be injected through the driving module, and sending the injection feedback message to the target application program so that the target application program stores the injection feedback message.
Optionally, the terminal comprises a user interface, and the apparatus 50 comprises:
the receiving module is used for receiving configuration information input by a user through the user interface;
and the display module is used for generating an injection feedback image according to the stored injection feedback message and displaying the injection feedback image through the user interface.
Optionally, the apparatus 50 further comprises:
and the execution module is used for directly executing the first program under the condition that a second program matched with the first program does not exist in the target program.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 6 is a block diagram illustrating an electronic device 600 according to an example embodiment. As shown in fig. 6, the electronic device 600 may include: a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input/output (I/O) interface 604, and a communications component 605.
The processor 601 is configured to control the overall operation of the electronic device 600, so as to complete all or part of the steps of the code injection method. The memory 602 is used to store various types of data to support operation at the electronic device 600, such as instructions for any application or method operating on the electronic device 600, as well as application-related data, such as injection configuration information, code to be injected, injection feedback information, and so forth. The Memory 602 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 603 may include a screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 602 or transmitted through the communication component 605. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 604 provides an interface between the processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 605 may therefore include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the code injection methods described above.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the code injection method described above is also provided. For example, the computer readable storage medium may be the memory 602 described above that includes program instructions that are executable by the processor 601 of the electronic device 600 to perform the code injection method described above.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. For example, the electronic device 700 may be provided as a server. Referring to fig. 7, an electronic device 700 includes a processor 722, which may be one or more in number, and a memory 732 for storing computer programs that are executable by the processor 722. The computer programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processor 722 may be configured to execute the computer program to perform the code injection method described above.
Additionally, the electronic device 700 may also include a power component 726 and a communication component 750, the power component 726 may be configured to implement a power pipe of the electronic device 700The communication component 750 may be configured to enable communication of the electronic device 700, such as wired or wireless communication. The electronic device 700 may also include input/output (I/O) interfaces 758. The electronic device 700 may operate based on an operating system, such as Windows Server, stored in the memory 732TM,Mac OS XTM,UnixTM,LinuxTMAnd so on.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the code injection method described above is also provided. For example, the non-transitory computer readable storage medium may be the memory 732 described above including program instructions that are executable by the processor 722 of the electronic device 700 to perform the code injection method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the code injection method described above when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A code injection method, applied to a terminal, the method comprising:
responding to an injection configuration updating operation executed by a user based on a target application program, and determining updated injection configuration information, wherein the injection configuration information comprises at least one target program and codes to be injected, which are in one-to-one correspondence with the target program;
in response to intercepting a program execution notification, determining whether a second program matching a first program corresponding to the program execution notification exists in the target program;
and under the condition that a second program matched with the first program exists in the target program, injecting a code to be injected corresponding to the second program into the first program, so that the terminal executes the first program after code injection.
2. The method of claim 1, wherein the terminal comprises a driver module running at a kernel layer of an operating system,
the response user executes injection configuration updating operation based on the target application program, and determines updated injection configuration information; in response to intercepting a program execution notification, determining whether a second program matching a first program corresponding to the program execution notification exists in the target program comprises:
receiving, by the driver module, updated injection configuration information in a target application in response to a user performing an injection configuration update operation based on the target application;
and intercepting a program execution notice through the drive module, and determining whether a second program matched with a first program corresponding to the program execution notice exists in the target program or not under the condition that the drive module intercepts the program execution notice.
3. The method according to claim 2, wherein the injecting the code to be injected into the program execution notification corresponding to the program comprises:
generating an injection command through the driving module according to the first program and the code to be injected;
and injecting the code to be injected into the first program according to the injection command so as to enable the terminal to execute the first program after code injection.
4. The method of claim 3, further comprising:
responding to the successful generation of the injection command, generating an injection feedback message according to the first program and the code to be injected through the driving module, and sending the injection feedback message to the target application program, so that the target application program stores the injection feedback message.
5. The method of claim 4, wherein the terminal comprises a user interface, the method comprising:
receiving configuration information input by a user through the user interface; and the number of the first and second electrodes,
and generating an injection feedback image according to the stored injection feedback message, and displaying the injection feedback image through the user interface.
6. The method according to any one of claims 1-5, characterized in that the method comprises:
and directly executing the first program under the condition that the second program matched with the first program does not exist in the target program.
7. A code injection apparatus applied to a terminal, the apparatus comprising:
the device comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for responding to the fact that a user executes injection configuration updating operation based on a target application program and determining updated injection configuration information, and the injection configuration information comprises at least one target program and codes to be injected, which correspond to the target program one by one;
the second determining module is used for responding to the interception of the program execution notice, and determining whether a second program matched with the first program corresponding to the program execution notice exists in the target program;
and the injection module is used for injecting the code to be injected corresponding to the second program into the first program under the condition that the second program matched with the first program exists in the target program, so that the terminal executes the first program after the code is injected.
8. The apparatus of claim 7, wherein the terminal comprises a driver module running at a kernel layer of an operating system,
the first determining module is specifically configured to:
receiving, by the driver module, updated injection configuration information in a target application in response to a user performing an injection configuration update operation based on the target application;
the second determining module is specifically configured to:
and intercepting a program execution notice through the drive module, and determining whether a second program matched with a first program corresponding to the program execution notice exists in the target program or not under the condition that the drive module intercepts the program execution notice.
9. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 6.
CN202210206492.4A 2022-03-02 2022-03-02 Code injection method, device, storage medium and electronic equipment Pending CN114610406A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210206492.4A CN114610406A (en) 2022-03-02 2022-03-02 Code injection method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210206492.4A CN114610406A (en) 2022-03-02 2022-03-02 Code injection method, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114610406A true CN114610406A (en) 2022-06-10

Family

ID=81860818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210206492.4A Pending CN114610406A (en) 2022-03-02 2022-03-02 Code injection method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114610406A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116860358A (en) * 2023-08-30 2023-10-10 北京趋动智能科技有限公司 Method, system, device and medium for executing injection code
CN116909681A (en) * 2023-06-13 2023-10-20 北京远舢智能科技有限公司 Method and device for generating data processing assembly, electronic equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077184A (en) * 2013-03-25 2014-10-01 腾讯科技(深圳)有限公司 Progress control method of application program and computer system
CN105045605A (en) * 2015-08-28 2015-11-11 成都卫士通信息产业股份有限公司 Method and system for injecting DLL into target process
CN106201633A (en) * 2016-07-29 2016-12-07 腾讯科技(深圳)有限公司 A kind of method and device injecting dll file
CN106406852A (en) * 2016-08-25 2017-02-15 北京北信源软件股份有限公司 Optimal management method for injecting multi-DLL (dynamic link library) into target procedure
CN107608746A (en) * 2017-09-18 2018-01-19 北京奇虎科技有限公司 A kind of optimization method and device for opening application more
CN108228214A (en) * 2017-12-29 2018-06-29 北京致远互联软件股份有限公司 A kind of update method of application program, medium and equipment
CN109388403A (en) * 2018-09-26 2019-02-26 广州视源电子科技股份有限公司 Rely on method for implanting, device, equipment and storage medium
CN109522714A (en) * 2018-09-05 2019-03-26 航天信息股份有限公司 A kind of method and system that target software is protected based on plug-in securing software
CN111897711A (en) * 2020-06-15 2020-11-06 中国建设银行股份有限公司 Method and device for positioning bug in code, electronic equipment and readable storage medium
CN112445706A (en) * 2020-11-27 2021-03-05 深圳前海微众银行股份有限公司 Program abnormal code acquisition method and device, electronic equipment and storage medium
CN112631891A (en) * 2021-01-05 2021-04-09 网易(杭州)网络有限公司 Performance analysis method and device, electronic equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077184A (en) * 2013-03-25 2014-10-01 腾讯科技(深圳)有限公司 Progress control method of application program and computer system
CN105045605A (en) * 2015-08-28 2015-11-11 成都卫士通信息产业股份有限公司 Method and system for injecting DLL into target process
CN106201633A (en) * 2016-07-29 2016-12-07 腾讯科技(深圳)有限公司 A kind of method and device injecting dll file
CN106406852A (en) * 2016-08-25 2017-02-15 北京北信源软件股份有限公司 Optimal management method for injecting multi-DLL (dynamic link library) into target procedure
CN107608746A (en) * 2017-09-18 2018-01-19 北京奇虎科技有限公司 A kind of optimization method and device for opening application more
CN108228214A (en) * 2017-12-29 2018-06-29 北京致远互联软件股份有限公司 A kind of update method of application program, medium and equipment
CN109522714A (en) * 2018-09-05 2019-03-26 航天信息股份有限公司 A kind of method and system that target software is protected based on plug-in securing software
CN109388403A (en) * 2018-09-26 2019-02-26 广州视源电子科技股份有限公司 Rely on method for implanting, device, equipment and storage medium
CN111897711A (en) * 2020-06-15 2020-11-06 中国建设银行股份有限公司 Method and device for positioning bug in code, electronic equipment and readable storage medium
CN112445706A (en) * 2020-11-27 2021-03-05 深圳前海微众银行股份有限公司 Program abnormal code acquisition method and device, electronic equipment and storage medium
CN112631891A (en) * 2021-01-05 2021-04-09 网易(杭州)网络有限公司 Performance analysis method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116909681A (en) * 2023-06-13 2023-10-20 北京远舢智能科技有限公司 Method and device for generating data processing assembly, electronic equipment and storage medium
CN116860358A (en) * 2023-08-30 2023-10-10 北京趋动智能科技有限公司 Method, system, device and medium for executing injection code
CN116860358B (en) * 2023-08-30 2024-01-02 北京趋动智能科技有限公司 Method, system, device and medium for executing injection code

Similar Documents

Publication Publication Date Title
CN114610406A (en) Code injection method, device, storage medium and electronic equipment
CN109165157B (en) Method for testing application program and test platform
US11726749B2 (en) Child application development method and apparatus, computer device, and storage medium
CN106713608B (en) Application function state modification method and device and terminal
CN110908734A (en) Application combination method and device based on plug-in, terminal equipment and storage medium
CN108121560A (en) Difference bag upgrade method, device, terminal and computer readable storage medium
KR20140004495A (en) Method for testing application program automatically and an electronic device thereof
CN112256448A (en) Remote control method, device, electronic equipment, system and storage medium
KR101558301B1 (en) Apparatus and method for changing language in mobile communication terminal
US9354849B2 (en) Modification of compiled applications and application management using retrievable policies
US11023220B2 (en) Firmware update with integrated smart sequence and action engine
CN111095206B (en) Method for verifying medical application program, end user device and medical system
CN114301771B (en) Virtual machine configuration method and device and electronic equipment
CN112463199A (en) System upgrading method and terminal
CN110196741A (en) Method for setting basic input/output system, terminal and computer storage medium
CN113885914A (en) Application program processing method and device, electronic equipment and storage medium
CN109933357B (en) Application program upgrading method and device
CN112965896A (en) Test environment fault detection method and device based on dynamic byte codes
CN113553271A (en) Method for generating and testing internal test program of application program
CN114675865A (en) Method and device for upgrading over-the-air technology, storage medium and terminal equipment
CN111026651A (en) Test method, test device, storage medium and electronic equipment
CN111090879A (en) Data processing method, device, readable storage medium, electronic equipment and system
CN113326184B (en) Interface testing method and device, storage medium and electronic equipment
CN113360341B (en) Front-end application maintenance and loading method and device
CN116450534B (en) Method, device, equipment and medium for generating mobile terminal application program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 1022, Floor 10, No. 1, Zhongguancun Street, Haidian District, Beijing 100085

Applicant after: Vita Technology (Beijing) Co.,Ltd.

Address before: 819-1, floor 7, No. 8, Haidian North 2nd Street, Haidian District, Beijing 100080

Applicant before: Vita Technology (Beijing) Co.,Ltd.