CN109597662B - Method and device for calling non-public library in mobile terminal and electronic equipment - Google Patents
Method and device for calling non-public library in mobile terminal and electronic equipment Download PDFInfo
- Publication number
- CN109597662B CN109597662B CN201811325972.2A CN201811325972A CN109597662B CN 109597662 B CN109597662 B CN 109597662B CN 201811325972 A CN201811325972 A CN 201811325972A CN 109597662 B CN109597662 B CN 109597662B
- Authority
- CN
- China
- Prior art keywords
- public library
- address
- calling
- application program
- mobile terminal
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic 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)
- Telephone Function (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application provides a method and a device for calling a non-public library in a mobile terminal, electronic equipment and a storage medium, and belongs to the technical field of computer application. The method comprises the following steps: acquiring a calling request of an application program, wherein the calling request comprises an identifier of the application program and an identifier of a non-public library; acquiring a return address of the application program according to the identifier of the application program; writing a jump function into a memory corresponding to a preset address, wherein the target address of the jump function is a return address, and the preset address is a legal address of an operating system in the mobile terminal; modifying the return address into a preset address; and calling a system interface function corresponding to the non-public library according to the preset address and the identification of the non-public library so as to open the non-public library. Therefore, the method for calling the non-public library in the mobile terminal realizes the purpose of bypassing the limitation of the system on the dynamic link of the application program to the non-public library, does not need to read and analyze files, has high link speed, can load the non-public library at present and improves the practicability.
Description
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a method and an apparatus for calling a non-public library in a mobile terminal, an electronic device, and a storage medium.
Background
Starting from Android 7.0, the system prevents the application program from dynamically linking the non-public NDK library so as to improve the running safety of the system. However, for some special requirements, such as plug-in, hot repair, etc., it is necessary to dynamically link the non-public libraries, and therefore this limitation of the system needs to be bypassed.
In the related art, the aim of calling the non-public NDK library function is achieved by reading a so file in a/proc/directory, analyzing a relocation table in the so file (elf format), and calculating the address of a function to be called by adding a base address of the so and an address in the relocation table. However, this method needs to read and analyze the so file, not only is slow, but also is only suitable for the loaded non-public library, and is poor in practicability.
Disclosure of Invention
The method and the device for calling the non-public library in the mobile terminal, the electronic equipment and the storage medium are used for solving the problems that in the related art, the so file needs to be read and analyzed by the existing method for bypassing the limitation of the system dynamic link non-public library, the speed is low, the method is only suitable for the loaded non-public library, and the practicability is poor.
An embodiment of the application provides a method for calling a non-public library in a mobile terminal, including: acquiring a call request of an application program, wherein the call request comprises an identifier of the application program and an identifier of a non-public library; acquiring a return address of the application program according to the identifier of the application program; writing a jump function into a memory corresponding to a preset address, wherein the target address of the jump function is the return address, and the preset address is a legal address of an operating system in the mobile terminal; modifying the return address into the preset address; and calling a system interface function corresponding to the non-public library according to the preset address and the identification of the non-public library so as to open the non-public library.
Another embodiment of the present application provides an apparatus for invoking a non-public library in a mobile terminal, including: the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a call request of an application program, and the call request comprises an identifier of the application program and an identifier of a non-public library; the second acquisition module is used for acquiring the return address of the application program according to the identifier of the application program; a write-in module, configured to write a jump function into a memory corresponding to a preset address, where a target address of the jump function is the return address, and the preset address is a legal address of an operating system in the mobile terminal; the modification module is used for modifying the return address into the preset address; and the calling module is used for calling the system interface function corresponding to the non-public library according to the preset address and the identification of the non-public library so as to open the non-public library.
An embodiment of another aspect of the present application provides an electronic device, which includes: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the method for calling a non-public library in a mobile terminal as described above when executing the program.
In another aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method for calling a non-public library in a mobile terminal as described above.
In another aspect of the present application, a computer program is provided, which is executed by a processor to implement the method for calling a non-public library in a mobile terminal according to the embodiment of the present application.
According to the calling method, the calling device, the electronic equipment, the computer readable storage medium and the computer program of the non-public library in the mobile terminal, the calling request of the application program can be obtained, the return address of the application program is obtained according to the identification of the application program included in the calling request, then the jump function with the target address as the return address of the application program is written into the memory corresponding to the preset address, the return address is modified into the preset address, the preset address is the legal address of the operating system in the mobile terminal, and then the system interface function corresponding to the non-public library is called according to the preset address and the identification of the non-public library included in the calling request, so that the non-public library is opened. Therefore, the return address of the application program is modified into the legal address of the operating system in the mobile terminal, so that the calling party is legally verified through the system interface function, then the non-public library is opened through calling the system interface function corresponding to the non-public library, the limitation that the system dynamically links the non-public library to the application program is bypassed, the file does not need to be read and analyzed, the link speed is high, the non-public library can be loaded at present, and the practicability is improved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart illustrating a method for calling a non-public library in a mobile terminal according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another method for calling a non-public library in a mobile terminal according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for calling a non-public library in a mobile terminal according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the like or similar elements throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The embodiment of the application provides a method for calling a non-public library in a mobile terminal, aiming at the problems that in the related art, the conventional method for bypassing the limitation of a system dynamic link non-public library needs to read and analyze a so file, is low in speed, is only suitable for the loaded non-public library and is poor in practicability.
The method for calling the non-public library in the mobile terminal, provided by the embodiment of the application, can obtain a calling request of an application program, obtain a return address of the application program according to an identifier of the application program included in the calling request, write a jump function with a target address as the return address of the application program into a memory corresponding to a preset address, modify the return address into the preset address, wherein the preset address is a legal address of an operating system in the mobile terminal, and then call a system interface function corresponding to the non-public library according to the preset address and the identifier of the non-public library included in the calling request so as to open the non-public library. Therefore, the return address of the application program is modified into the legal address of the operating system in the mobile terminal, so that the calling party is legally verified through the system interface function, then the non-public library is opened through calling the system interface function corresponding to the non-public library, the limitation that the system dynamically links the non-public library to the application program is bypassed, the file does not need to be read and analyzed, the link speed is high, the non-public library can be loaded at present, and the practicability is improved.
The following describes in detail a method, an apparatus, an electronic device, a storage medium, and a computer program for invoking a non-public library in a mobile terminal provided in the present application with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for calling a non-public library in a mobile terminal according to an embodiment of the present application.
As shown in fig. 1, the method for calling the non-public library in the mobile terminal includes the following steps:
The identifier of the application refers to identity authentication information that can uniquely identify the application. It will be appreciated that each application possesses a unique identity. The identifier of the non-public library refers to an identifier of the non-public library requested to be called by the application program, for example, the identifier of the non-public library may be a path of the non-public library requested to be called by the application program.
It should be noted that some mobile terminal systems on the market currently limit some applications in the terminal to dynamically link non-public libraries, so as to improve the security of the system. However, in order to meet special requirements, such as plug-in, hot repair, etc., which require dynamic linking of the non-public library, it is sometimes necessary to bypass this limitation of the system in order to satisfy these requirements and improve the functions of the mobile system, so that an application program which does not have the authority to dynamically link the non-public library itself can open and access the non-public library.
In practical use, the method for calling the non-public library in the mobile terminal according to the embodiment of the present application may be executed by the device for calling the non-public library in the mobile terminal according to the embodiment of the present application. The calling device of the non-public library in the mobile terminal provided by the embodiment of the application can be configured in any electronic equipment, obtain the calling request sent by the application program in real time, and identify the identifier of the application program in the calling request so as to determine the identity of the application program.
It should be noted that, starting from the android version 7.0, the mobile terminal of the android system starts to prevent the application program from dynamically linking the non-public library, and therefore, in a possible implementation scenario of the application embodiment, the operating system in the mobile terminal may be the android system.
And 102, acquiring a return address of the application program according to the identifier of the application program.
It should be noted that, in the operating system that restricts the application program from calling the non-public library, not all application programs are prohibited from calling the non-public library, and the system may determine, according to the return address of the application program, whether the application program is restricted from calling the non-public application program or is allowed to call the legitimate application program of the non-public library. Therefore, in the embodiment of the present application, according to the obtained identifier of the application, the return address corresponding to the identifier of the application, that is, the return address of the application, may be obtained from the cache corresponding to the identifier of the application.
And 103, writing a jump function into a memory corresponding to a preset address, wherein the target address of the jump function is the return address, and the preset address is a legal address of an operating system in the mobile terminal.
And 104, modifying the return address into the preset address.
The preset address refers to a legal address of an operating system in the mobile terminal, that is, a return address of an application program or a function having a dynamically linked non-public library.
In a possible implementation form of the embodiment of the application, in order to enable the application program to call the non-public library at any time when needed, the return address of the application program may be modified to be a legal address of the operating system of the mobile terminal, so that the application program obtains the authority to call the non-public library. However, by modifying the return address of the application program, after the application program successfully calls the non-public library, the data acquired from the public library (for example, a result returned by calling a function in the non-public library) needs to be returned to the application program requesting to dynamically link the non-public library, and when the data is returned, the data is returned according to the return address corresponding to the calling party, so that after the return address of the application program is modified to a preset address, the application program cannot acquire the returned data.
In this embodiment of the application, after the return address of the application is obtained, the memory corresponding to the preset address may be determined according to the preset address, and the jump function using the return address of the application as the target address is written in the memory, so that after the call of the non-public library is successful, the jump function may be triggered to jump to the return address of the application according to the preset address. After the jump function is written into the memory corresponding to the preset address, the return address of the application program can be modified into the preset address, so that the application program can successfully call the non-public library through legal verification.
It should be noted that, in the operating system that restricts the application program from dynamically linking the non-public library, there are fewer legal addresses that can be called from the non-public library, and in order to enable the application program to use the legal address at any time to obtain a calling authority when the application program needs to call the non-public library, and not to affect the legal address to normally call the non-public library, a legal address that cannot be used in a project may be selected as a preset address, for example, in a possible implementation form of the embodiment of the present application, the preset address may be an address of a Java local interface debugging function.
Furthermore, the jump function needs to be written into the memory corresponding to the preset address, so that the application program calling the non-public library can be returned after the non-public library is called, and therefore the memory corresponding to the preset address needs to be capable of reading and writing data. That is, in a possible implementation form of the embodiment of the present application, before the step 103, the method may further include:
and modifying the attribute of the memory corresponding to the preset address into readable and writable.
It is understood that the memory in the mobile device may have different attributes according to the data stored therein, for example, some memory areas are read-only and are not allowed to be written with data; some memory areas are readable and writable in attribute, that is, data can be read from the memory area or written into the memory area.
In the embodiment of the application, because the jump function of the jump back application program needs to be written into the memory corresponding to the preset address, the attribute of the memory corresponding to the preset address can be modified to be readable and writable, so that the jump function is written into the memory area, and data in the memory area is read when needed, so that the jump function jumps to the corresponding application program.
And 105, calling a system interface function corresponding to the non-public library according to the preset address and the identification of the non-public library so as to open the non-public library.
The system interface function corresponding to the non-public library is used for verifying whether the return address of a calling party requesting to call the non-public library is legal or not, and opening and loading the non-public library corresponding to the system interface function when the return address of the calling party is legal.
In a possible implementation form of the embodiment of the present application, the system interface function corresponding to the non-public library may be a dlopen function. The dlopen function may open the specified non-public library in the specified pattern and return a handle to the non-public library.
It should be noted that after the return address of the application program is modified to the preset address, the dlopen function corresponding to the non-public library may be called according to the preset address and the identifier of the non-public library, so that the dlopen function determines that the calling party requesting to call the non-public library is legal according to the obtained preset address, and the identifier of the non-public library is used as the first parameter of the dlopen function to designate the non-public path, so that the dlopen function opens and loads the corresponding non-public library, and returns the handle of the corresponding non-public library.
The method for calling the non-public library in the mobile terminal, provided by the embodiment of the application, can obtain a calling request of an application program, obtain a return address of the application program according to an identifier of the application program included in the calling request, write a jump function with a target address as the return address of the application program into a memory corresponding to a preset address, modify the return address into the preset address, wherein the preset address is a legal address of an operating system in the mobile terminal, and then call a system interface function corresponding to the non-public library according to the preset address and the identifier of the non-public library included in the calling request so as to open the non-public library. Therefore, the return address of the application program is modified into the legal address of the operating system in the mobile terminal, so that the calling party is legally verified through the system interface function, then the non-public library is opened through calling the system interface function corresponding to the non-public library, the limitation that the system dynamically links the non-public library to the application program is bypassed, the file does not need to be read and analyzed, the link speed is high, the non-public library can be loaded at present, and the practicability is improved.
In a possible implementation form of the application, a return address of an application program can be acquired through a register in the mobile terminal, the return address is modified into a preset address, and after a non-public library is called, a calling result is returned to the application program calling the non-public library through a jump function.
The method for calling the non-public library in the mobile terminal according to the embodiment of the present application is further described below with reference to fig. 2.
Fig. 2 is a flowchart illustrating another method for calling a non-public library in a mobile terminal according to an embodiment of the present application.
As shown in fig. 2, the method for calling the non-public library in the mobile terminal includes the following steps:
The target calling function refers to a function in a non-public library which needs to be called by an application program; the address of the target call function refers to a memory address corresponding to the target call function, and the memory corresponding to the target call function may include parameters, variables, and the like of the target call function.
Among them, the link register (LR for short) has two purposes: first, it is used to save the return address of the subprogram; the second is that when the abnormality occurs, the value saved in the LR is equal to the value of the PC when the abnormality occurs minus 4 (or minus 2), so that the execution can be continued in various abnormal modes according to the value of the LR returned to the corresponding position before the abnormality occurs.
In this embodiment of the present application, the return address of the application program may be held in the connection register, and the return address corresponding to the application identifier may be fetched from the connection register according to the identifier of the application program.
The detailed implementation process and principle of the steps 201-203 can refer to the detailed description of the above embodiments, and are not described herein again.
It should be noted that, when the connection register is used to store the return address of the application program, the return address of the corresponding application program stored in the connection register may be modified to a preset address when the return address of the application program is modified to a preset address.
It should be noted that, after the corresponding non-public library is opened and loaded by calling the system interface function, the system interface function may return a handle of the non-public library. For example, when the system interface function is a dlopen function, the dlopen function may open a corresponding non-public library according to an identifier of the non-public library, load the non-public library into a memory, load a match in the non-public library, and then return a reference (i.e., a handle) of the non-public library, and use the handle of the non-public library as a first parameter of the dlsym function to obtain an address of a symbol in the non-public library, and obtain a pointer of a specific function in the non-public library according to the address.
Further, after the non-public library is opened by calling the system interface function and loaded into the memory, the target calling function in the target non-public library can be called according to the address of the target calling function included in the calling request. That is, in a possible implementation form of the embodiment of the present application, after the step 205, the method may further include:
and calling the target calling function in the non-public library according to the address of the target calling function.
It should be noted that, a symbol corresponding to the target calling function in the non-public library may be determined according to the address of the target calling function, and then a pointer of the target calling function in the non-public library is determined according to the address of the symbol in the non-public library, and then the target calling function is called according to the pointer corresponding to the target calling function.
And step 206, returning to the memory corresponding to the preset address according to the preset address, so as to trigger the jump function in the memory corresponding to the preset address to jump to the return address.
In the embodiment of the application, after the non-public library is called and the calling result of the target calling function is obtained, the memory corresponding to the preset address can be determined according to the preset address, the jump function written in the memory is triggered, and the target address corresponding to the jump function, namely the return address of the application program calling the non-public library, is jumped to, so as to return the calling result to the corresponding application program.
According to the calling method of the non-public library in the mobile terminal, the calling request of the application program can be obtained, the return address of the application program is obtained from the connection register according to the identification of the application program included in the calling request, then the jump function with the target address as the return address of the application program is written into the memory corresponding to the preset address, the return address is modified into the preset address in the connection register, the preset address is the legal address of the operating system in the mobile terminal, the system interface function corresponding to the non-public library is called according to the preset address and the identification of the non-public library included in the calling request so as to open the non-public library, and then the jump function in the memory corresponding to the preset address is triggered to jump to the return address. Therefore, the return address of the application program is modified into the legal address of the operating system in the mobile terminal, so that the calling party is legally verified through the system interface function, then the non-public library is opened by calling the system interface function corresponding to the non-public library, the target calling function in the non-public library is called, and the calling result is returned to the application program, so that the limitation that the system dynamically links the non-public library to the application program is bypassed, the file does not need to be read and analyzed, the link speed is high, the non-public library can be loaded, and the practicability is improved.
In order to implement the above embodiments, the present application further provides a device for calling a non-public library in a mobile terminal.
Fig. 3 is a schematic structural diagram of a device for calling a non-public library in a mobile terminal according to an embodiment of the present application.
As shown in fig. 3, the apparatus 30 for calling a non-public library in a mobile terminal includes:
a first obtaining module 31, configured to obtain a call request of an application program, where the call request includes an identifier of the application program and an identifier of a non-public library;
a second obtaining module 32, configured to obtain a return address of the application program according to the identifier of the application program;
a writing module 33, configured to write a jump function into a memory corresponding to a preset address, where a target address of the jump function is the return address, and the preset address is a legal address of an operating system in the mobile terminal;
a first modification module 34, configured to modify the return address into the preset address;
the first calling module 35 is configured to call a system interface function corresponding to the non-public library according to the preset address and the identifier of the non-public library, so as to open the non-public library.
In practical use, the apparatus for calling a non-public library in a mobile terminal provided in the embodiment of the present application may be configured in any electronic device to execute the method for calling a non-public library in a mobile terminal.
The device for calling the non-public library in the mobile terminal, provided by the embodiment of the application, can obtain a call request of an application program, obtain a return address of the application program according to an identifier of the application program included in the call request, write a jump function with a target address as the return address of the application program into a memory corresponding to a preset address, modify the return address into the preset address, wherein the preset address is a legal address of an operating system in the mobile terminal, and then call a system interface function corresponding to the non-public library according to the preset address and the identifier of the non-public library included in the call request so as to open the non-public library. Therefore, the return address of the application program is modified into the legal address of the operating system in the mobile terminal, so that the calling party is legally verified through the system interface function, then the non-public library is opened through calling the system interface function corresponding to the non-public library, the limitation that the system dynamically links the non-public library to the application program is bypassed, the file does not need to be read and analyzed, the link speed is high, the non-public library can be loaded at present, and the practicability is improved.
In a possible implementation form of the present application, the operating system is an android system, the preset address is an address of a Java native interface debugging function, and the system interface function is a dlopen function.
Further, in another possible implementation form of the present application, the apparatus 30 for invoking a non-public library in the mobile terminal further includes:
and the return module is used for returning to the memory corresponding to the preset address according to the preset address so as to trigger the jump function in the memory corresponding to the preset address to jump to the return address.
Further, in another possible implementation form of the present application, the call request further includes an address of a target call function;
correspondingly, the apparatus 30 for calling a non-public library in the mobile terminal further includes:
and the second calling module is used for calling the target calling function in the non-public library according to the address of the target calling function.
Further, in another possible implementation form of the present application, the apparatus 30 for invoking a non-public library in the mobile terminal further includes:
and the second modification module is used for modifying the attribute of the memory corresponding to the preset address into readable and writable.
In a possible implementation form of the present application, the second obtaining module 32 is specifically configured to:
and acquiring the return address of the application program from a connection register according to the identifier of the application program.
In a possible implementation form of the present application, the first modifying module 34 is specifically configured to:
and modifying the return address stored in the connection register into the preset address.
It should be noted that the foregoing explanation on the embodiment of the method for calling a non-public library in a mobile terminal shown in fig. 1 and fig. 2 is also applicable to the device 30 for calling a non-public library in a mobile terminal of this embodiment, and is not repeated herein.
The device for calling the non-public library in the mobile terminal, provided by the embodiment of the application, can obtain a call request of an application program, obtain a return address of the application program from a connection register according to an identifier of the application program included in the call request, write a jump function with a target address as the return address of the application program into a memory corresponding to a preset address, modify the return address into the preset address in the connection register, wherein the preset address is a legal address of an operating system in the mobile terminal, call a system interface function corresponding to the non-public library according to the preset address and the identifier of the non-public library included in the call request so as to open the non-public library, and then return to the memory corresponding to the preset address so as to trigger the jump function in the memory corresponding to the preset address to jump to the return address. Therefore, the return address of the application program is modified into the legal address of the operating system in the mobile terminal, so that the calling party is legally verified through the system interface function, then the non-public library is opened by calling the system interface function corresponding to the non-public library, the target calling function in the non-public library is called, and the calling result is returned to the application program, so that the limitation that the system dynamically links the non-public library to the application program is bypassed, the file does not need to be read and analyzed, the link speed is high, the non-public library can be loaded, and the practicability is improved.
In order to implement the above embodiments, the present application further provides an electronic device.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
As shown in fig. 4, the electronic device 200 includes:
a memory 210 and a processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), wherein the memory 210 stores a computer program, and when the processor 220 executes the program, the method for calling the non-public library in the mobile terminal according to the embodiment of the present application is implemented.
A program/utility 280 having a set (at least one) of program modules 270, including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment, may be stored in, for example, the memory 210. The program modules 270 generally perform the functions and/or methodologies of the described embodiments of the invention.
The processor 220 executes various functional applications and data processing by executing programs stored in the memory 210.
It should be noted that, for the implementation process and the technical principle of the electronic device of this embodiment, reference is made to the foregoing explanation of the method for calling the non-public library in the mobile terminal of the embodiment of the present application, and details are not described here again.
The electronic device provided in this embodiment of the present application may execute the method for calling a non-public library in a mobile terminal as described above, obtain a call request of an application program, obtain a return address of the application program according to an identifier of the application program included in the call request, write a jump function whose target address is the return address of the application program into a memory corresponding to a preset address, modify the return address into the preset address, where the preset address is a legal address of an operating system in the mobile terminal, and call a system interface function corresponding to the non-public library according to the preset address and the identifier of the non-public library included in the call request, so as to open the non-public library. Therefore, the return address of the application program is modified into the legal address of the operating system in the mobile terminal, so that the calling party is legally verified through the system interface function, then the non-public library is opened through calling the system interface function corresponding to the non-public library, the limitation that the system dynamically links the non-public library to the application program is bypassed, the file does not need to be read and analyzed, the link speed is high, the non-public library can be loaded at present, and the practicability is improved.
In order to implement the above embodiments, the present application also proposes a computer-readable storage medium.
The computer readable storage medium stores thereon a computer program, and the computer program is executed by a processor to implement the method for calling the non-public library in the mobile terminal according to the embodiment of the present application.
In order to implement the foregoing embodiments, a further embodiment of the present application provides a computer program, which is executed by a processor to implement the method for calling a non-public library in a mobile terminal according to the embodiments of the present application.
In an alternative implementation, the embodiments may be implemented in any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the consumer electronic device, partly on the consumer electronic device, as a stand-alone software package, partly on the consumer electronic device and partly on a remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic devices may be connected to the consumer electronic device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external electronic device (e.g., through the internet using an internet service provider).
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
1. A method for calling a non-public library in a mobile terminal is characterized by comprising the following steps:
acquiring a call request of an application program, wherein the call request comprises an identifier of the application program and an identifier of a non-public library;
acquiring a return address of the application program according to the identifier of the application program;
writing a jump function into a memory corresponding to a preset address, wherein the target address of the jump function is the return address, and the preset address is a legal address of an operating system in the mobile terminal;
modifying the return address into the preset address; and
and calling a system interface function corresponding to the non-public library according to the preset address and the identification of the non-public library so as to open the non-public library.
2. The method for calling the non-public library in the mobile terminal according to claim 1, wherein the operating system is an android system, the preset address is an address of a Java local interface debugging function, and the system interface function is a dlopen function.
3. The method for calling a non-public library in a mobile terminal according to claim 1, wherein the calling a system interface function corresponding to the non-public library according to the preset address and the identifier of the non-public library to open the non-public library further comprises:
and returning to the memory corresponding to the preset address according to the preset address so as to trigger the jump function in the memory corresponding to the preset address to jump to the return address.
4. The method for calling a non-public library in a mobile terminal according to claim 1, wherein the call request further includes an address of a target call function;
the calling the system interface function corresponding to the non-public library according to the preset address and the identification of the non-public library so as to open the non-public library further comprises:
and calling the target calling function in the non-public library according to the address of the target calling function.
5. The method for calling a non-public library in a mobile terminal according to any one of claims 1 to 4, wherein before writing the jump function into the memory corresponding to the preset address, the method further comprises:
and modifying the attribute of the memory corresponding to the preset address into readable and writable.
6. The method for calling the non-public library in the mobile terminal according to any one of claims 1 to 4, wherein the obtaining the return address of the application program according to the identifier of the application program comprises:
and acquiring the return address of the application program from a connection register according to the identifier of the application program.
7. The method for calling a non-public library in a mobile terminal according to claim 6, wherein the modifying the return address to the preset address comprises:
and modifying the return address stored in the connection register into the preset address.
8. An apparatus for calling a non-public library in a mobile terminal, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a call request of an application program, and the call request comprises an identifier of the application program and an identifier of a non-public library;
the second acquisition module is used for acquiring the return address of the application program according to the identifier of the application program;
a write-in module, configured to write a jump function into a memory corresponding to a preset address, where a target address of the jump function is the return address, and the preset address is a legal address of an operating system in the mobile terminal;
the modification module is used for modifying the return address into the preset address; and
and the calling module is used for calling the system interface function corresponding to the non-public library according to the preset address and the identification of the non-public library so as to open the non-public library.
9. An electronic device, comprising: memory, processor and program stored on the memory and executable on the processor, characterized in that the processor implements a method for calling a non-public library in a mobile terminal according to any of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements a method for calling a non-public library in a mobile terminal according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811325972.2A CN109597662B (en) | 2018-11-08 | 2018-11-08 | Method and device for calling non-public library in mobile terminal and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811325972.2A CN109597662B (en) | 2018-11-08 | 2018-11-08 | Method and device for calling non-public library in mobile terminal and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109597662A CN109597662A (en) | 2019-04-09 |
CN109597662B true CN109597662B (en) | 2021-07-27 |
Family
ID=65958646
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811325972.2A Active CN109597662B (en) | 2018-11-08 | 2018-11-08 | Method and device for calling non-public library in mobile terminal and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109597662B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110502288A (en) * | 2019-08-19 | 2019-11-26 | Oppo广东移动通信有限公司 | For the call method of third-party application, device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105955762A (en) * | 2016-04-19 | 2016-09-21 | 北京金山安全软件有限公司 | Method and device for injecting dynamic link library file and electronic equipment |
CN107256349A (en) * | 2017-06-13 | 2017-10-17 | 广州阿里巴巴文学信息技术有限公司 | Dynamic base method for preventing fraudulent-using, device, electronic equipment and readable storage medium storing program for executing |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9104504B2 (en) * | 2013-03-13 | 2015-08-11 | Dell Products Lp | Systems and methods for embedded shared libraries in an executable image |
-
2018
- 2018-11-08 CN CN201811325972.2A patent/CN109597662B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105955762A (en) * | 2016-04-19 | 2016-09-21 | 北京金山安全软件有限公司 | Method and device for injecting dynamic link library file and electronic equipment |
CN107256349A (en) * | 2017-06-13 | 2017-10-17 | 广州阿里巴巴文学信息技术有限公司 | Dynamic base method for preventing fraudulent-using, device, electronic equipment and readable storage medium storing program for executing |
Non-Patent Citations (1)
Title |
---|
Android远程调试的探索与实现;武智 等;《https://tech.meituan.com/2017/07/20/android-remote-debug.html》;20170720;第1-19页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109597662A (en) | 2019-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11687645B2 (en) | Security control method and computer system | |
JP7228751B2 (en) | Method and apparatus for authority management, computer equipment and storage medium | |
CN105760787B (en) | System and method for the malicious code in detection of random access memory | |
CN109189496B (en) | Dynamic library information acquisition method and device for application program | |
CN112231702B (en) | Application protection method, device, equipment and medium | |
CN109271789B (en) | Malicious process detection method and device, electronic equipment and storage medium | |
CN109388946B (en) | Malicious process detection method and device, electronic equipment and storage medium | |
CN109062965B (en) | Big data analysis system, server, data processing method and storage medium | |
CN111427782B (en) | Android dynamic link library operation method, device, equipment and storage medium | |
CN112199720A (en) | Authority monitoring processing method, device, computer equipment and medium | |
Cho et al. | Anti-debugging scheme for protecting mobile apps on android platform | |
US20240143739A1 (en) | Intelligent obfuscation of mobile applications | |
US20230297348A1 (en) | Method for operating second system application on first system, terminal device and storage medium | |
CN112363753A (en) | Data verification method and device, electronic equipment and storage medium | |
CN110597496B (en) | Method and device for acquiring bytecode file of application program | |
US10275595B2 (en) | System and method for characterizing malware | |
CN109597662B (en) | Method and device for calling non-public library in mobile terminal and electronic equipment | |
CN116679971A (en) | Thermal repair method, device, electronic equipment and storage medium | |
CN111026609B (en) | Information auditing method, system, equipment and computer readable storage medium | |
CN114210064A (en) | Virtual model control method and device, electronic equipment and storage medium | |
CN113139190A (en) | Program file detection method and device, electronic equipment and storage medium | |
CN111008375B (en) | Data protection method and device | |
CN113391874B (en) | Virtual machine detection countermeasure method and device, electronic equipment and storage medium | |
CN116775147B (en) | Executable file processing method, device, equipment and storage medium | |
CN112905534B (en) | Sample analysis method and device based on sandbox environment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |