CN116820593A - Program running method, device, equipment and storage medium - Google Patents

Program running method, device, equipment and storage medium Download PDF

Info

Publication number
CN116820593A
CN116820593A CN202210278982.5A CN202210278982A CN116820593A CN 116820593 A CN116820593 A CN 116820593A CN 202210278982 A CN202210278982 A CN 202210278982A CN 116820593 A CN116820593 A CN 116820593A
Authority
CN
China
Prior art keywords
instruction
calling
target
program
function
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
CN202210278982.5A
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.)
3600 Technology Group Co ltd
Original Assignee
3600 Technology Group 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 3600 Technology Group Co ltd filed Critical 3600 Technology Group Co ltd
Priority to CN202210278982.5A priority Critical patent/CN116820593A/en
Publication of CN116820593A publication Critical patent/CN116820593A/en
Pending legal-status Critical Current

Links

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

Landscapes

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

Abstract

The invention belongs to the technical field of computers, and discloses a program running method, a program running device, program running equipment and a storage medium. The method comprises the following steps: acquiring a source code of a target program; determining a first calling instruction according to the sequence source code; interpreting the first calling instruction to obtain a second calling instruction; calling corresponding target dynamic library functions or module information according to the second calling instruction; and operating the target program according to the target dynamic library function or the module information. By the method, the android program calling instruction is reacted, so that the android program calling instruction can call a dynamic library function in an arm control, an android system is not required to be started, an android application program is operated on a PC system by utilizing a JVM, and the method is convenient, quick and efficient, and discards heavy system burden brought by starting the android system.

Description

Program running method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a program running method, apparatus, device, and storage medium.
Background
In the current program running process, the complete program running can be realized by directly interacting with various dynamic libraries provided by the bottom layer according to the program codes. However, in the process of program operation, the program often needs to call different bottom dynamic libraries, and because some dynamic libraries do not belong to the current operation platform, the situation of incompatibility may occur when the dynamic libraries are forcedly added into the current operation platform for program call, so that the low program operation compatibility becomes a problem to be solved urgently.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a program running method, a device, equipment and a storage medium, which aim to solve the technical problem of low program running compatibility in the prior art.
To achieve the above object, the present invention provides a program running method comprising the steps of:
acquiring a source code of a target program;
determining a first calling instruction according to the sequence source code;
interpreting the first calling instruction to obtain a second calling instruction;
calling corresponding target dynamic library functions or module information according to the second calling instruction;
and operating the target program according to the target dynamic library function or the module information.
Optionally, the interpreting the first call instruction to obtain a second call instruction includes:
when the first call instruction is a first loading library instruction, the first call instruction is interpreted through a dynamic library call function and a preset interpreter to obtain a second loading library instruction, and the first loading library instruction and the second loading library instruction are loading instructions under different architectures respectively;
The calling the corresponding target dynamic library function or module information according to the second calling instruction comprises the following steps:
and calling a target dynamic library function from the corresponding dynamic library according to the second calling instruction.
Optionally, when the first call instruction is a first load library instruction, the interpreting the first call instruction through a dynamic library call function and a preset interpreter to obtain a second load library instruction includes:
when the first calling instruction is a first loading library instruction, inputting the first calling instruction into an arm interpreter through a dynamic library calling function to obtain a first native code corresponding to the first calling instruction;
and determining a second calling instruction according to the first native code.
Optionally, the interpreting the first call instruction to obtain a second call instruction includes:
when the first calling instruction is a first information searching instruction, the first calling instruction is interpreted through an information searching function and a preset interpreter to obtain a second information searching instruction, wherein the first information searching instruction and the second information searching instruction are respectively searching instructions under different architectures;
the calling the corresponding target dynamic library function or module information according to the second calling instruction comprises the following steps:
And calling the target module information from the corresponding dynamic library according to the second calling instruction.
Optionally, when the first call instruction is a first information search instruction, the first call instruction is interpreted by an information search function and a preset interpreter to obtain a second information search instruction, including:
when the first calling instruction is a first information searching instruction, inputting the first calling instruction into an arm interpreter through a dynamic library calling function to obtain a second native code corresponding to the first calling instruction;
and determining a second calling instruction according to the second native code.
Optionally, before the running the target program according to the target dynamic library function and the module information, the method includes:
when the target program has a preset function requirement, calling a target application programming interface through a proxy framework;
the running the target program according to the target dynamic library function and the module information comprises the following steps:
and operating the target program according to the target application programming interface, the target dynamic library function and the module information.
Optionally, the acquiring the source code of the target program includes:
generating a code acquisition instruction;
Acquiring an application program package from a resource management library according to the code instruction;
and acquiring the source code of the target program according to the application program package.
Optionally, after the calling the corresponding target dynamic library function or the module information according to the second call instruction, the method includes:
when a callback instruction is generated by a target dynamic library function in the calling process, searching a preset cross function table according to the callback instruction to determine the target callback instruction;
and completing a callback function according to the target callback instruction.
Optionally, the searching the preset cross function table according to the callback instruction to determine the target callback instruction includes:
calling a local method interface according to the callback instruction to obtain a preset cross function table;
determining a corresponding local function according to the callback instruction;
searching a preset cross function table according to the local function to determine an objective function;
and determining a target callback instruction according to the target function.
In order to achieve the above object, the present invention also provides a program running apparatus including:
the acquisition module is used for acquiring the source code of the target program;
the processing module is used for determining a first calling instruction according to the sequence source code;
The processing module is further used for explaining the first calling instruction to obtain a second calling instruction;
the processing module is also used for calling a corresponding target dynamic library function or module information according to the second calling instruction;
and the processing module is also used for running the target program according to the target dynamic library function or the module information.
Optionally, when the first call instruction is a first load library instruction, the processing module is further configured to interpret the first call instruction through a dynamic library call function and a preset interpreter to obtain a second load library instruction, where the first load library instruction and the second load library instruction are respectively load instructions under different architectures; and calling a target dynamic library function from the corresponding dynamic library according to the second calling instruction.
Optionally, when the first call instruction is a first load library instruction, the processing module is further configured to input the first call instruction into an arm interpreter through a dynamic library call function, so as to obtain a first native code corresponding to the first call instruction; and determining a second calling instruction according to the first native code.
Optionally, when the first call instruction is a first information search instruction, the processing module is further configured to interpret the first call instruction through an information search function and a preset interpreter to obtain a second information search instruction, where the first information search instruction and the second information search instruction are search instructions under different architectures respectively; and calling the target module information from the corresponding dynamic library according to the second calling instruction.
Optionally, when the first call instruction is a first information search instruction, the processing module is further configured to input the first call instruction into an arm interpreter through a dynamic library call function, so as to obtain a second native code corresponding to the first call instruction; and determining a second calling instruction according to the second native code.
Optionally, the processing module is further configured to call a target application programming interface through a proxy framework when a preset function requirement occurs in the target program; and operating the target program according to the target application programming interface, the target dynamic library function and the module information.
Optionally, the acquiring module is further configured to generate a code acquiring instruction; acquiring an application program package from a resource management library according to the code instruction; and acquiring the source code of the target program according to the application program package.
Optionally, the processing module is further configured to search a preset cross function table according to the callback instruction when the callback instruction is generated by the target dynamic library function in the calling process, so as to determine the target callback instruction; and completing a callback function according to the target callback instruction.
In addition, in order to achieve the above object, the present invention also proposes a program running apparatus comprising: a memory, a processor, and a program running program stored on the memory and executable on the processor, the program running program being configured to implement the steps of the program running method as described above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a program running program which, when executed by a processor, implements the steps of the program running method as described above.
The method acquires the source code of the target program; determining a first calling instruction according to the sequence source code; interpreting the first calling instruction to obtain a second calling instruction; calling corresponding target dynamic library functions or module information according to the second calling instruction; and operating the target program according to the target dynamic library function or the module information. By the method, the call instruction generated by the current program is interpreted, so that the running of the current program is not limited by a platform, different dynamic libraries can be called in the running process, and the running compatibility of the program is improved.
Drawings
FIG. 1 is a schematic diagram of a program running device of a hardware running environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of a method for operating a program according to the present invention;
FIG. 3 is a schematic diagram of an embodiment of a program operation method according to the present invention;
FIG. 4 is a flowchart of a second embodiment of the method for operating a program according to the present invention;
Fig. 5 is a block diagram showing the construction of a first embodiment of the program running apparatus of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a program running device of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the program running apparatus may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the program execution device, and may include more or less components than those illustrated, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a program running program may be included in the memory 1005 as one type of storage medium.
In the program running apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the program execution device of the present invention may be provided in a program execution device that calls a program execution program stored in the memory 1005 through the processor 1001 and executes the program execution method provided by the embodiment of the present invention.
An embodiment of the present invention provides a program running method, referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the program running method of the present invention.
In this embodiment, the program running method includes the following steps:
step S10: the source code of the target program is obtained.
It should be understood that the execution body of the method of this embodiment may be a program running device having data processing, network communication, and program running functions, for example, a computer, or other electronic devices capable of implementing the same or similar functions, and in this embodiment and other embodiments, a computer is taken as an example for explanation.
It should be noted that, the present embodiment is implemented in a program running scenario, for example: in the process of the reverse android program, the android program is sometimes required to be run in batches so as to extract dynamic running data; if an android system is started to run, the cost is too high, and a lightweight android virtualized running environment is needed. The code generated by the android program is java, so that the Java can be operated through the JVM (java virtual machine) of the PC system, and the arm interpreter is connected to the JVM to well operate the active code of the android, so that the android program is operated.
It should be noted that, in this embodiment, the target program is described as an android program, for example: the target program is an android program, the target program operates in a java virtual machine, and the java virtual machine operates in an x86 environment. As shown in fig. 3, in general, the instructions of a Java Virtual Machine (JVM) running in an x86 environment are suitable for interacting with the underlying hardware under the x86 architecture, in general, the interaction situation is as shown in fig. 3, the JVM sends a call instruction to a Linker (connector) in the left x86 control, and the connector directly calls a function in a dynamic library for use by an android function in the JVM, but there is a problem that the android program is generally used for running of a mobile terminal, and the purpose of program code design is to interact with an arm architecture of the mobile terminal, so that the android program cannot generally directly use a dynamic library function call mode under the original x86 architecture in this way. Therefore, the embodiment is improved on the basis of the method, so that the android program can be analyzed and operated on a computer more conveniently.
It can be understood that the target program is a program which needs to be run on the current system at present, and the program package where the target program is located is compiled to generate the target program.
In the present embodiment, a code acquisition instruction is generated; acquiring an application program package from a resource management library according to the code instruction; and acquiring the source code of the target program according to the application program package.
In a specific implementation, since the purpose of generally running a program across platforms is not mostly direct use, but rather testing the program or dynamically obtaining running data, there is often a requirement for batch operation, so a code obtaining instruction may be generated, and an application package may be obtained from a resource management library, for example: apk (android application package). And compiling or inverse compiling the application program package to obtain the source code of the target program.
Step S20: and determining a first calling instruction according to the sequence source code.
It should be noted that, the process of determining the first call instruction according to the sequence source code is the process of calling the function call instruction generated by the program when the function or module information needs to be called in the program running process, and the function can be called according to the first call instruction, for example: the target program calls the dynamic library function and the information by calling a function loadLibrary function or a findSymbol function.
Step S30: and interpreting the first calling instruction to obtain a second calling instruction.
It will be appreciated that the process of interpreting the first call instruction may be implemented by an interpreter, which requires that the arm interpreter be connected to the java virtual machine by a connector, and as shown in fig. 3, the JVM sends the call instruction to the connector by a call function, and the connector sends the instruction to the arm interpreter to perform the interpretation process. The interpretation process is that the first call instruction is interpreted into an identifiable instruction in an arm space, namely a second call instruction, and the interpreted instruction (the second call instruction) can freely call functions of an arm dynamic library in the arm space due to the action of an arm interpreter, and the virtual machine can call functions of the arm dynamic library like a local dynamic library through the interpretation process, namely a process of calling the local dynamic library is that a process of calling a dynamic library in an x86 space in the process of a java program used by a computer.
In this embodiment, when the first call instruction is a first load library instruction, the first call instruction is interpreted by a dynamic library call function and a preset interpreter to obtain a second load library instruction, where the first load library instruction and the second load library instruction are load instructions under different architectures respectively; and calling a target dynamic library function from the corresponding dynamic library according to the second calling instruction.
It should be noted that, in the process of calling a resource, different calling means need to be selected according to different resource attributes, and when the first calling instruction is a library function, function loading needs to be performed through a dynamic calling function, and this embodiment provides a preferred scheme, for example: the method comprises the steps of modifying a loadLibrary function in a java virtual machine by taking over the loadLibrary function, identifying whether the first call instruction is a load library instruction or an arm space dynamic library by the modified loadLibrary, sending the first call instruction to a connector under the x86 space to perform further function call without any adjustment when the first call instruction is a load library instruction, and forwarding the first call instruction to an arm interpreter when the first call instruction is an arm space dynamic library, and interpreting the first call instruction when the first call instruction is an arm space dynamic library, as shown in fig. 3.
It will be appreciated that the first and second load library instructions are each load instructions under different architectures, for example: the java virtual machine runs on a computer, so that a first call instruction generated in the running android program can only be identified by an x86 space, and a second call instruction after interpretation is an instruction running in an arm space.
In this embodiment, when the first call instruction is a first load library instruction, the first call instruction is input into an arm interpreter through a dynamic library call function, so as to obtain a first native code corresponding to the first call instruction; and determining a second calling instruction according to the first native code.
It should be noted that, the native code is the native code in the arm space, and the native call instruction is translated into the first native code corresponding to the first call instruction, so as to identify the dynamic library in the arm space. The first native code is the native code that performs function loading.
In this embodiment, when the first call instruction is a first information search instruction, the first call instruction is interpreted by an information search function and a preset interpreter to obtain a second information search instruction, where the first information search instruction and the second information search instruction are search instructions under different architectures respectively; and calling the target module information from the corresponding dynamic library according to the second calling instruction.
It should be noted that, in the process of calling a resource, different calling means need to be selected according to different resource attributes, and when the first calling instruction is a search instruction, function information needs to be acquired through a module information fork search function, for example: the name of the module, the status of the module, the number of times the module is referenced, etc., and this embodiment proposes a preferred solution, for example: the method comprises the steps of modifying a findSymbol function in a java virtual machine by taking over the findSymbol function, identifying whether the purpose of the findSymbol function is to call a dynamic library in x86 space or an arm space dynamic library through the modified findSymbol when a first call instruction is a library loading instruction, sending the first call instruction to a connector under x86 space to call further module information without any adjustment when the purpose is the dynamic library in x86 space as shown in fig. 3, and forwarding the first call instruction to an arm interpreter when the purpose is the dynamic library in arm space, and interpreting the first call instruction.
It will be appreciated that the first information search instruction and the second information search instruction are search instructions under different architectures, for example: the java virtual machine runs on a computer, so that a first call instruction generated in the running android program can only be identified by an x86 space, and a second call instruction after interpretation is an instruction running in an arm space.
In this embodiment, when the first call instruction is a first information search instruction, the first call instruction is input into an arm interpreter through a dynamic library call function, so as to obtain a second native code corresponding to the first call instruction; and determining a second calling instruction according to the second native code.
It should be noted that, the native code is the native code in the arm space, and the native call instruction is translated into the second native code corresponding to the first call instruction, so as to identify the dynamic library in the arm space. The second native code is the native code for searching the module information.
Step S40: and calling the corresponding target dynamic library function or module information according to the second calling instruction.
It should be noted that, after the second call instruction is obtained after the interpretation, the virtual machine can call the arm dynamic library function, which is the same as the local dynamic library, so that the module information is very convenient to obtain, and no other external tools are needed for carrying out.
Step S50: and operating the target program according to the target dynamic library function or the module information.
It should be noted that, after the function required by the target program is loaded successfully or the corresponding module information is found, the target program can be operated normally.
In this embodiment, when a preset function requirement occurs in the target program, the target application programming interface is called through the proxy framework; the running the target program according to the target dynamic library function and the module information comprises the following steps: and operating the target program according to the target application programming interface, the target dynamic library function and the module information.
It should be noted that, in order to enable the program to be supported more and run the complete function, as many interfaces as possible are needed to support, so that the lightweight framework. Jar support can be provided in the form of remote agents and caches, and more target application programming interfaces, i.e. api, can be called through the framework to ensure the complete running of the target program.
The embodiment obtains a source code of a target program; determining a first calling instruction according to the sequence source code; interpreting the first calling instruction to obtain a second calling instruction; calling corresponding target dynamic library functions or module information according to the second calling instruction; and operating the target program according to the target dynamic library function or the module information. By the method, the android program calling instruction is reacted, so that the android program calling instruction can call a dynamic library function in an arm control, an android system is not required to be started, an android application program is operated on a PC system by utilizing a JVM, and the method is convenient, quick and efficient, and discards heavy system burden brought by starting the android system.
Referring to fig. 4, fig. 4 is a flowchart of a second embodiment of a program running method according to the present invention.
Based on the first embodiment, the present embodiment routine operation method further includes, after the step S40:
step S41: and when the target dynamic library function generates a callback instruction in the calling process, searching a preset cross function table according to the callback instruction to determine the target callback instruction.
When a call is made to a dynamic library function, when there is a callback requirement in the called function, for example: when a callback function appears in the program. The information needs to be applied to the target program in turn, and the interpreter can only convert the information sent by the virtual machine into the information which can be identified in the arm space, so that callback information when the callback function is triggered needs to be handled in other modes, and an instruction generated when the callback function is required is a callback instruction, and at the moment, the cross function table can be obtained to convert the information.
In the embodiment, a local method interface is called according to a callback instruction, and a preset cross function table is obtained; determining a corresponding local function according to the callback instruction; searching a preset cross function table according to the local function to determine an objective function; and determining a target callback instruction according to the target function.
It will be appreciated that invoking the native method interface according to the callback instruction, for example: calling JNI (Java Native Interface) interface which allows Java code to interact with code written by other languages, determining target function through preset cross function table accessed to JNI interface, converting callback instruction into target callback instruction, ensuring Java virtual machine to identify callback information, and providing virtual machine JNI support to arm dynamic library function
Step S42: and completing a callback function according to the target callback instruction.
It can be appreciated that the callback function of the program can be completed according to the target callback instruction.
When a callback instruction is generated by a target dynamic library function in the calling process, searching a preset cross function table according to the callback instruction to determine the target callback instruction; and completing a callback function according to the target callback instruction. By the mode, when callback requirements appear, instructions are connected in series through the local method interface, reliability of callback functions is improved, and the programs can be guaranteed to run completely and smoothly in a cross-platform mode.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium stores a program running program, and the program running program realizes the steps of the program running method when being executed by a processor.
Referring to fig. 5, fig. 5 is a block diagram showing the configuration of a first embodiment of the program running apparatus according to the present invention.
As shown in fig. 5, the program running apparatus according to the embodiment of the present invention includes:
an acquisition module 10, configured to acquire source code of a target program.
And the processing module 20 is used for determining a first calling instruction according to the sequence source code.
The processing module 20 is further configured to interpret the first call instruction to obtain a second call instruction.
The processing module 20 is further configured to call a corresponding target dynamic library function or module information according to the second call instruction.
The processing module 20 is further configured to operate the target program according to the target dynamic library function or module information.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
The acquisition module 10 of the present embodiment acquires the source code of the target program; processing module 20 determines a first call instruction from the sequence source code; the processing module 20 interprets the first call instruction to obtain a second call instruction; the processing module 20 calls the corresponding target dynamic library function or module information according to the second call instruction; the processing module 20 runs the target program according to the target dynamic library function or module information. By the method, the android program calling instruction is reacted, so that the android program calling instruction can call a dynamic library function in an arm control, an android system is not required to be started, an android application program is operated on a PC system by utilizing a JVM, and the method is convenient, quick and efficient, and discards heavy system burden brought by starting the android system.
In an embodiment, the processing module 20 is further configured to interpret the first call instruction through a dynamic library call function and a preset interpreter to obtain a second load library instruction when the first call instruction is a first load library instruction, where the first load library instruction and the second load library instruction are load instructions under different architectures respectively; and calling a target dynamic library function from the corresponding dynamic library according to the second calling instruction.
In an embodiment, the processing module 20 is further configured to, when the first call instruction is a first load library instruction, input the first call instruction into an arm interpreter through a dynamic library call function, to obtain a first native code corresponding to the first call instruction; and determining a second calling instruction according to the first native code.
In an embodiment, the processing module 20 is further configured to interpret the first call instruction through an information lookup function and a preset interpreter to obtain a second information lookup instruction when the first call instruction is a first information lookup instruction, where the first information lookup instruction and the second information lookup instruction are lookup instructions under different architectures respectively; and calling the target module information from the corresponding dynamic library according to the second calling instruction.
In an embodiment, the processing module 20 is further configured to, when the first call instruction is a first information search instruction, input the first call instruction into an arm interpreter through a dynamic library call function, to obtain a second native code corresponding to the first call instruction; and determining a second calling instruction according to the second native code.
In an embodiment, the processing module 20 is further configured to call a target application programming interface through a proxy framework when a preset function requirement occurs in the target program; and operating the target program according to the target application programming interface, the target dynamic library function and the module information.
In an embodiment, the acquiring module 10 is further configured to generate a code acquiring instruction; acquiring an application program package from a resource management library according to the code instruction; and acquiring the source code of the target program according to the application program package.
In an embodiment, the processing module 20 is further configured to, when the callback instruction is generated by the target dynamic library function in the calling process, find a preset cross function table according to the callback instruction, and determine the target callback instruction; and completing a callback function according to the target callback instruction.
In an embodiment, the processing module 20 is further configured to call a local method interface according to a callback instruction to obtain a preset cross function table; determining a corresponding local function according to the callback instruction; searching a preset cross function table according to the local function to determine an objective function; and determining a target callback instruction according to the target function.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
In addition, technical details that are not described in detail in this embodiment may refer to the program running method provided in any embodiment of the present invention, and are not described herein again.
The invention discloses a program operation method A1, which comprises the following steps:
acquiring a source code of a target program;
determining a first calling instruction according to the sequence source code;
interpreting the first calling instruction to obtain a second calling instruction;
calling corresponding target dynamic library functions or module information according to the second calling instruction;
And operating the target program according to the target dynamic library function or the module information.
A2, the method of A1, the interpreting the first call instruction to obtain a second call instruction, includes:
when the first call instruction is a first loading library instruction, the first call instruction is interpreted through a dynamic library call function and a preset interpreter to obtain a second loading library instruction, and the first loading library instruction and the second loading library instruction are loading instructions under different architectures respectively;
the calling the corresponding target dynamic library function or module information according to the second calling instruction comprises the following steps:
and calling a target dynamic library function from the corresponding dynamic library according to the second calling instruction.
A3, the method as described in A2, wherein when the first call instruction is a first load library instruction, the method includes the steps of:
when the first calling instruction is a first loading library instruction, inputting the first calling instruction into an arm interpreter through a dynamic library calling function to obtain a first native code corresponding to the first calling instruction;
And determining a second calling instruction according to the first native code.
A4, the method of any one of A1, the interpreting the first call instruction to obtain a second call instruction, including:
when the first calling instruction is a first information searching instruction, the first calling instruction is interpreted through an information searching function and a preset interpreter to obtain a second information searching instruction, wherein the first information searching instruction and the second information searching instruction are respectively searching instructions under different architectures;
the calling the corresponding target dynamic library function or module information according to the second calling instruction comprises the following steps:
and calling the target module information from the corresponding dynamic library according to the second calling instruction.
A5, the method of A4, when the first call instruction is a first information search instruction, the first call instruction is interpreted by an information search function and a preset interpreter to obtain a second information search instruction, including:
when the first calling instruction is a first information searching instruction, inputting the first calling instruction into an arm interpreter through a dynamic library calling function to obtain a second native code corresponding to the first calling instruction;
And determining a second calling instruction according to the second native code.
A6, the method of A1, before the target program is run according to the target dynamic library function and module information, comprises the following steps:
when the target program has a preset function requirement, calling a target application programming interface through a proxy framework;
the running the target program according to the target dynamic library function and the module information comprises the following steps:
and operating the target program according to the target application programming interface, the target dynamic library function and the module information.
A7, the method of A1, the obtaining the source code of the target program, includes:
generating a code acquisition instruction;
acquiring an application program package from a resource management library according to the code instruction;
and acquiring the source code of the target program according to the application program package.
A8, the method of A1, after the corresponding target dynamic library function or module information is called according to the second call instruction, includes:
when a callback instruction is generated by a target dynamic library function in the calling process, searching a preset cross function table according to the callback instruction to determine the target callback instruction;
and completing a callback function according to the target callback instruction.
A9, the method of A8, the searching a preset cross function table according to the callback instruction to determine a target callback instruction, includes:
calling a local method interface according to the callback instruction to obtain a preset cross function table;
determining a corresponding local function according to the callback instruction;
searching a preset cross function table according to the local function to determine an objective function;
and determining a target callback instruction according to the target function.
A10, the method of any one of A1-A9, wherein the target program is an android program, the target program is operated in a java virtual machine, and the java virtual machine is operated in an x86 environment.
The invention also discloses a program running device of B11, which comprises:
the acquisition module is used for acquiring the source code of the target program;
the processing module is used for determining a first calling instruction according to the sequence source code;
the processing module is further used for explaining the first calling instruction to obtain a second calling instruction;
the processing module is also used for calling a corresponding target dynamic library function or module information according to the second calling instruction;
and the processing module is also used for running the target program according to the target dynamic library function or the module information.
B12, the apparatus of B11, the processing module is further configured to interpret the first call instruction through a dynamic library call function and a preset interpreter when the first call instruction is a first load library instruction, to obtain a second load library instruction, where the first load library instruction and the second load library instruction are respectively load instructions under different architectures; and calling a target dynamic library function from the corresponding dynamic library according to the second calling instruction.
B13, the device as described in B12, the processing module is further configured to input the first call instruction into an arm interpreter through a dynamic library call function when the first call instruction is a first load library instruction, so as to obtain a first native code corresponding to the first call instruction; and determining a second calling instruction according to the first native code.
B14, the device of B11, the said processing module, is also used for when the said first call instruction is the first information looks up the instruction, through information looks up the function and preserve the interpreter to interpret the first call instruction, get the second information looks up the instruction, said first information looks up the instruction and second information looks up the instruction and looks up the instruction under different frameworks separately; and calling the target module information from the corresponding dynamic library according to the second calling instruction.
B15, the device of B14, the said processing module, is further used for, when the said first call instruction is the first information looks up the instruction, call the function and input the said first call instruction into arm interpreter through the dynamic library, get the second native code that the first call instruction corresponds to; and determining a second calling instruction according to the second native code.
B16, the device as described in B11, the processing module is further configured to invoke a target application programming interface through a proxy framework when a preset function requirement occurs in the target program; and operating the target program according to the target application programming interface, the target dynamic library function and the module information.
B17, the apparatus of B11, the acquisition module is further configured to generate a code acquisition instruction; acquiring an application program package from a resource management library according to the code instruction; and acquiring the source code of the target program according to the application program package.
B18, the device of B11, the said processing module, when the said call process goal dynamic library function produces the callback instruction, find the preset cross function table to confirm the goal callback instruction according to the said callback instruction; and completing a callback function according to the target callback instruction.
The invention also discloses a program running device of C19, which comprises: a memory, a processor, and a program-running program stored on the memory and executable on the processor, the program-running program configured to implement the steps of the program-running method as set forth in any one of A1 to a 10.
The invention also discloses a storage medium of D20, on which a program running program is stored, which when being executed by a processor, implements the steps of the program running method of any one of A1 to a 10.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory)/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A program running method, characterized in that the program running method comprises:
acquiring a source code of a target program;
determining a first calling instruction according to the sequence source code;
interpreting the first calling instruction to obtain a second calling instruction;
calling corresponding target dynamic library functions or module information according to the second calling instruction;
and operating the target program according to the target dynamic library function or the module information.
2. The method of claim 1, wherein the interpreting the first call instruction to obtain a second call instruction comprises:
when the first call instruction is a first loading library instruction, the first call instruction is interpreted through a dynamic library call function and a preset interpreter to obtain a second loading library instruction, and the first loading library instruction and the second loading library instruction are loading instructions under different architectures respectively;
the calling the corresponding target dynamic library function or module information according to the second calling instruction comprises the following steps:
and calling a target dynamic library function from the corresponding dynamic library according to the second calling instruction.
3. The method of claim 2, wherein when the first call instruction is a first load library instruction, the interpreting the first call instruction by the dynamic library call function and the preset interpreter to obtain a second load library instruction, includes:
When the first calling instruction is a first loading library instruction, inputting the first calling instruction into an arm interpreter through a dynamic library calling function to obtain a first native code corresponding to the first calling instruction;
and determining a second calling instruction according to the first native code.
4. The method of any one of claim 1, wherein said interpreting the first call instruction to obtain a second call instruction comprises:
when the first calling instruction is a first information searching instruction, the first calling instruction is interpreted through an information searching function and a preset interpreter to obtain a second information searching instruction, wherein the first information searching instruction and the second information searching instruction are respectively searching instructions under different architectures;
the calling the corresponding target dynamic library function or module information according to the second calling instruction comprises the following steps:
and calling the target module information from the corresponding dynamic library according to the second calling instruction.
5. The method of claim 4, wherein when the first call instruction is a first information search instruction, the interpreting the first call instruction by the information search function and a preset interpreter to obtain a second information search instruction, includes:
When the first calling instruction is a first information searching instruction, inputting the first calling instruction into an arm interpreter through a dynamic library calling function to obtain a second native code corresponding to the first calling instruction;
and determining a second calling instruction according to the second native code.
6. The method of claim 1, wherein prior to running the target program according to the target dynamic library function and module information, comprising:
when the target program has a preset function requirement, calling a target application programming interface through a proxy framework;
the running the target program according to the target dynamic library function and the module information comprises the following steps:
and operating the target program according to the target application programming interface, the target dynamic library function and the module information.
7. The method of claim 1, wherein after the calling of the corresponding target dynamic library function or module information according to the second call instruction, comprising:
when a callback instruction is generated by a target dynamic library function in the calling process, searching a preset cross function table according to the callback instruction to determine the target callback instruction;
and completing a callback function according to the target callback instruction.
8. A program running apparatus, characterized in that the program running apparatus comprises:
the acquisition module is used for acquiring the source code of the target program;
the processing module is used for determining a first calling instruction according to the sequence source code;
the processing module is further used for explaining the first calling instruction to obtain a second calling instruction;
the processing module is also used for calling a corresponding target dynamic library function or module information according to the second calling instruction;
and the processing module is also used for running the target program according to the target dynamic library function or the module information.
9. A program running apparatus, characterized in that the apparatus comprises: memory, a processor and a program running program stored on the memory and executable on the processor, the program running program being configured to implement the steps of the program running method according to any one of claims 1 to 7.
10. A storage medium having stored thereon a program running program which, when executed by a processor, implements the steps of the program running method according to any one of claims 1 to 7.
CN202210278982.5A 2022-03-21 2022-03-21 Program running method, device, equipment and storage medium Pending CN116820593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210278982.5A CN116820593A (en) 2022-03-21 2022-03-21 Program running method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210278982.5A CN116820593A (en) 2022-03-21 2022-03-21 Program running method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116820593A true CN116820593A (en) 2023-09-29

Family

ID=88124435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210278982.5A Pending CN116820593A (en) 2022-03-21 2022-03-21 Program running method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116820593A (en)

Similar Documents

Publication Publication Date Title
US11354144B2 (en) Java native interface and windows universal app hooking
US9063765B2 (en) System and methods for distributed execution of computer executable programs utilizing asymmetric translation
CN107077337B (en) System and method for executing application code compiled from two instruction set architectures
US8607224B2 (en) System for packaging native program extensions together with virtual machine applications
CN108121594B (en) Process management method and device
US8756616B2 (en) System and method for reducing the static footprint of mixed-language JAVA classes
EP4099153A1 (en) Extending a virtual machine instruction set architecture
US6314445B1 (en) Native function calling
CN109240697B (en) Call processing method and device and storage medium
US7181745B1 (en) Method and system for accessing objects defined within an external object-oriented environment
CN106598662B (en) Android-based application loading method and device
CN111066000B (en) Replayable execution that optimizes page sharing in managed runtime environments
US6865738B2 (en) Method and apparatus for managing independent asynchronous I/O operations within a virtual machine
KR101195822B1 (en) Virtual Machine for application executing And thereof Method in mobile terminal
CN116820593A (en) Program running method, device, equipment and storage medium
CN114443052B (en) Dynamic specialization method and device for IL instruction operation
US10474568B2 (en) Re-playable execution optimized for page sharing in a managed runtime environment
CN115629976A (en) Kernel testing method and device and storage medium
KR20100110710A (en) Method for simplifying interfaces having dynamic libraries
CN112363804B (en) Blockchain JVM application method, device and storage medium
CN114020278A (en) Data processing method, device, equipment and storage medium
CN112214213A (en) Linux kernel development and management method and device, computer equipment and storage medium
US20230086877A1 (en) Method and apparatus for isolated execution of computer code with a native code portion
US10977095B2 (en) Side-by-side execution of same-type subsystems having a shared base operating system
CN116775165A (en) Method, device, equipment and storage medium for intercepting function parameters

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