LU102412B1 - A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device - Google Patents

A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device Download PDF

Info

Publication number
LU102412B1
LU102412B1 LU102412A LU102412A LU102412B1 LU 102412 B1 LU102412 B1 LU 102412B1 LU 102412 A LU102412 A LU 102412A LU 102412 A LU102412 A LU 102412A LU 102412 B1 LU102412 B1 LU 102412B1
Authority
LU
Luxembourg
Prior art keywords
information
dynamic library
file
application
sdk
Prior art date
Application number
LU102412A
Other languages
French (fr)
Inventor
Genbo Shao
Dejia Wang
Xiaolong Meng
Xiaoling Qian
Original Assignee
Jiangsu Payegis Information Security Tech 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 Jiangsu Payegis Information Security Tech Co Ltd filed Critical Jiangsu Payegis Information Security Tech Co Ltd
Priority to LU102412A priority Critical patent/LU102412B1/en
Application granted granted Critical
Publication of LU102412B1 publication Critical patent/LU102412B1/en

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

Abstract

A method for embedding codes in an application, which consists of integrating the SDK into an application, and according to a pre-set loading sequence, embedding loading information of the said SDK in the dynamic library information list of an executable file of the said application. According to file information of the said SDK, modifying offset information and length information of dynamic library loading information included in the said executable file. Then, modifying loading serial number information of an original dynamic library, included in the said executable file, and offset address information, in the said executable file, of the code corresponding to the said original dynamic library, and modifying serial number information of position information of the said original dynamic library in a code segment.

Description

Description A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device
TECHNICAL FIELD The present invention relates to the technical field of code integration, particularly to a method and apparatus for embedding codes in an application, and an clectronic device.
BACKGROUND SDK (Software Development Kit, software development kit) usually refers to a collection of development toois used by software engineers to build application software for specific software packages, software frameworks, hardware platforms, or operating systems. Technicians can integrate the SDK into the application so that directly use the functions provided by the SDK in the process of developing applications. Therefore, embedding the SDK in the application helps to increase the functions of the application, and thus, satisfy various requirements of users.
The prior art (CN107463359A) discloses a convenient method for embedding code in iOS ipa package. Specifically: (1) add SDK hook script: add the hook script to the engineering code in the 1OS engineering source code, and then generates the ipa (iPhone Application) release package through packing tool; (2) embed code: uncompress the ipa package. compile the codes that needs to be introduced into a dynamic library, and then, add it to the Framework directory; (3) re-signature and repackage it into a new ipa: (4) dynamic call, when run the new ipa package, the new ipa package is dynamically connected with the dynamic library through the hook script to call the function of the embedded code. Such method can reduce the workload of SDK accessed.
1
However, in the process of reaching the purpose of the present invention, the inventor found that the prior art lacks a way to embed the SDK according to the specified loading sequence, so that when the application to which the SDK is embedded runs, the SDK code can be dynamically called according to the specified loading sequence.
SUMMARY In consideration of the aforesaid problems, the present invention is presented to provide a method and apparatus for embedding codes in an application, and an electronic device which can overcome or at least partially address the aforesaid problems.
According to onc aspect of the present invention, a method for embedding codes in an application is presented, which consists of.
Integrating the SDK into an application, and according to a pre-set loading sequence, embedding loading intormation of the SDK in the dynamic library information list of an executable file of the application: According to file information of the SDK, modifying offset information and length information of dynamic library loading information included in the executable file: Modifying loading serial number information of an original dynamic library, included in the executable file, and offset address information, in the executable file, of the code corresponding to the original dynamic library, and moditying serial number information of position information of the original dynamic library in a code segment; Generating an update application file according to the modified executable file.
Optionally, the file information of the SDK specifically consists of at least one of the following: dynamic library name information, file storage path information, i file size information, and structure information: and the dynamic library loading information specifically consists of at least one of the following: redirection information and static binding information.
Optionally, modify the serial number information of position information of the original dynamic library in a code segment specifically consists of: calculating symbolic pointer information according to the paragraph number information and offset information of the dynamic library, and determining the initial position information of an original dynamic library as well as the position information of the called code according to the symbolic pointer information: Modifying the serial number information of the initial position information of an original dynamic library and the position information of the called code.
Optionally, the loading information of the SDK specifically consists of at least one of the following: file path information and name information.
Optionally, the method further consists of: Performing re-signature authentication processing on the updated application file.
Optionally, if the method is applied to IOS applications, prior to the execution, the method further consists of: Uncompressing the program application file of the IOS application, and then extracting the executable file of the IOS application; and the method further consists of: performing re-signature authentication processing on the updated application file.
According to another aspect of the present invention, an apparatus used to embed codes in an application is presented, which consists of: An integration module, which is suitable for integrating the SDK into an application. and embedding the loading information of the SDK in the dynamic library information list of the executable file of an application according to the pre- 3 set loading sequence; À first modification module, which is suitable for modifying the offset information and the length information of the dynamic library loading information included in the executable fite according to the file information of the SDK; A second modification module, which is suitable for modifying the loading serial number information of an original dynamic library, included in the executable file, and the offset address information, in the executable file, of the code corresponding to the original dynamic library, and modifying the serial number information of the position information of the original dynamic library in a code segment; An application file generation module, which is suitable for generating an updated application file according to the modified executable file.
Optionally, the file information of the SDK specifically consists of at least one of the following: dynamic library name information, file storage path information, file size information, and structure information; and the dynamic library loading information specifically consists of at least one of the following: redirection information and static binding information.
Optionally, the second modification module is further suitable for: Calculating symbolic pointer information according to the paragraph number information and offset information of the dynamic library, and determining the initial position information of an original dynamic library as well as the position information of the called code according to the symbolic pointer information; Modifying the serial number information of the initial position information of an original dynamic library and the position information of the called code.
Optionally, the loading information of the SDK specifically consists of at leust one of the following: file path information and name information.
4
Optionally, wherein, the apparatus further consists of: The extraction module, which is suitable for uncompressing the program application file of the TOS application, and then extracting the exccutable file of the IOS application; The re-signature module, which is suitable for performing re-signature authentication processing on the updated application file; According to another aspect of the present invention, an electronic device is presented, which consists of: a processor, a memory, a Communication Interface, and a communication bus. Wherein, the mutual communication among the said processor, the said memory, and the said Communication Interface is completed through the said communication bus ; The said memory is used to store at least one executable instruction, and the said executable instruction makes the said processor perform the operation corresponding to the aforesaid method for embedding codes in an application.
According to another aspect of the present invention, a kind of computer storage medium is provided, wherein, the said storage medium stores at least one executable instruction, and the said executable instruction makes the said processor perform the operation corresponding to the aforesaid method for embedding codes in an application.
As for the method and apparatus for embedding codes in an application, and an electronic device according to the present invention, the method consists of: the SDK into an application, and according to a pre-set loading sequence, and embedding loading information of the SDK in the dynamic library information list of an executable file of the application; according to file information of the SDK, modifying offset information and length information of dynamic library loading information included in the executable file: modifying loading serial number information of an original dynamic library, included in the executable file, and offset address information, in the executable file, of the code corresponding to the original dynamic library, and modifying serial number information of position information of the original dynamic library in a code segment, and generating an update application file according to the modified executable file. This method can embed, without a source code, the SDK for any application according to a specified loading sequence, such that when the application to which the SDK is added runs, the SDK codes can be dynamically called according to the specified loading sequence, and the compatibility thereof is higher.
The aforesaid specification is only an overview of the technical scheme of the present invention. For the purpose of further understanding the technical approach of the present invention, and being able to implement the technical approach according to the content of the specification, as well as making the aforesaid and other objectives, characteristics, and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are particularly cited below
BRIEF DESCRIPTION OF THE FIGURES By means of reading the detailed description of the preferred embodiments below, other various advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only used for the purpose of illustrating the preferred embodiments, rather than being considered as a limitation to the present invention. Furthermore, throughout the accompanying drawings. same reference marks are used to represent same components. Thus, in the accompanying drawings: Figure 1 shows a process diagram of the method for embedding codes in an application according to an embodiment of the present invention; Figure 2 shows a process diagram of the method for embedding codes in an application according to another embodiment of the present invention; 6
Figure 3 shows a schematic diagram of an apparatus for embedding codes in an application according to another embodiment of the present invention: Figure 4 shows a schematic diagram of an electronic device according to an embodiment of the present invention.
DESCRIPTION OF THE INVENTION The text below will describe exemplary embodiments of the present invention in detail with reference to the accompanying drawings. Although the drawings show exemplary embodiments of the present invention, it should be understood that the present invention can be realized in various forms, rather than being limited by the embodiments set forth herein. On the contrary, these embodiments are provided to facilitate better understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
Figure 1 shows a process diagram of the method for embedding codes in an application according to an embodiment of the present invention, as shown in Figure |, the method consists of: Step S101, i.e., integrate the SDK into an application, and according to a pre- set loading sequence, embed loading information of the SDK in the dynamic library information list of an executable file of the application: Integrate the SDK into the application, and then, look up the dynamic library information list in the loading command of the executable file of the application, and embed the loading information of the SDK in the dynamic library information list according to the pre-set loading sequence, such as the file path and name of the SDK, etc. Wherein, the pre-set loading sequence is the run sequence of the embedded codes. For example, the embedded codes are allowed to be run in priority or according to other specified sequences. Those skilled in the art can set the pre-set loading sequence according to actual needs.
7
Step S102, ie, according to file information of the SDK, modify offset information and length information of dynamic library loading information included in the executable file.
Firstly. read the dynamic library loading information in the executable file, such as redirection information, and static binding information, etc.; and then, according to the file information of the embedded SDK, such as the dynamic library name, the file storage path, the file size information, and the structure information, etc., after that, modify the offset and length of the dynamic library loading information.
Step S103, ie, modify loading serial number information of an original dynamic library, included in the executable file, and offset address information, in the executable file, of the code corresponding to the original dynamic library. and modify serial number information of position information of the original dynamic library in a code segment.
Due to the SDK is added, it is required to modify the dynamic library binding information in the executable file, specifically modify the loading serial number information of an original dynamic library and the offset address information of the code corresponding to the original dynamic library in the file. Meanwhile, it is also necessary to modify the serial number information of position information of the original dynamic library in a code segment.
Step S104, i.e., generate an update application file according to the modified executable file.
Use the modified executable file to replace the original executable file, and repackage it according to the modified executable file, and thus, generate an update application file. During the following process, when the update application is started. the newly added SDK will embed codes according to the aforesaid pre-set loading sequence based upon the modified dynamic library information list.
According to the method for embedding codes in an application provided by this embodiment, firstly, integrate the SDK into an application, and according to a 8 pre-set loading sequence, embed loading information of the SDK in the dynamic library information list of an executable file of the application: and then, according to file information of the SDK, modify offset information and length information of dynamic library loading information included in the executable file: after that, modify loading serial number information of an original dynamic library, included in the executable file, and offset address information, in the executable file, of the code corresponding to the original dynamic library. and modify serial number information of position information of the original dynamic library in a code segment: finally, generate an update application file according to the modified executable file. This method can embed, without a source code, the SDK for any application according to a specified loading sequence, such that when the application to which the SDK is added runs, the SDK codes can be dynamically called according to the specified loading sequence, and the compatibility thereof is higher.
Figure 2 shows a process diagram of the method for embedding codes in an application according to another embodiment of the present invention, as shown in Figure 2, the method consists of: Step S201, i.e., uncompress the program application file of the 108 application, and then, extract the executable file of the IOS application. and thus, integrate the SDK into the application.
Uncompress the ipa installation package of the IOS application, and then, extract the Mach-o file (executable file), and thus, integrate the SDK into the application.
Step S202, i.e.. embed the loading information of the SDK in the dynamic library information list of the executable file of an application according to the pre- set loading sequence.
Integrate the SDK into the application, and then, look up the dynamic library information list in the loading command of the executable file of the application, and embed the loading information of the SDK in the dynamic library information list 9 according to the pre-set loading sequence, such as the file path and name of the SDK, etc. Wherein, the pre-set loading sequence is the run sequence of the embedded codes. For example. the embedded codes are allowed to be run in priority or according to other specified sequences. Those skilled in the art can set the pre-set loading sequence according to actual needs.
It should be pointed out specifically that after the SDK is embedded into the system library based upon the existing technology, due to the system library and the added third-party library of the application itself are loaded in priority, some functions of the added SDK may not be loaded normally, and thus, cause forced termination. Thercfore, the prior art lacks a technical scheme which can load the added SDK in priority. The method provided in this embodiment makes the added SDK be loaded according to an arbitrary loading sequence, wherein, when the pre- set loading sequence is specific to the first loading sequence (that is, loading in priority), the aforesaid problem related to errors and crashes caused by loading the system library and the added third-party library of application itself in priority can be addressed.
Specifically, look up the dynamic library information list in the loading command of the executable file, and then embed the loading information of the SDK in the dynamic library information list according to the pre-set loading sequence, wherein, the loading information of the SDK consists of at [cas Step S203, i.e., modify the offset information and length information of the dynamic library loading information contained in the executable file according to the file information of the SDK.
Read the dynamic library loading information in the executable file, and then modify the offset information and length information of the dynamic loading information according to the information of the SDK file, wherein, the dynamic library loading information specifically consists of at least one of the following: redirection information and static binding information. And the file information of the SDK specificaily consists of at least one of the following: dynamic library name information, file storage path information, file size information, and structure information.
Taking the addition of PayegisSharkIV.framework as an example, wherein, obtain the increased offset length in the load command is 96 after calculating through the file path “fidexecutable_path/Frameworks/PayegisSharkIV framework/PayegisSharkIV”, and then, obtain the increment of the redirection information table is 0 and the increased length of static binding information table after traversing values of OPCODE and IMMEDIATE in the redirection information and the static binding information table, the static binding information table, and the increased length obtained after completing 0 bits is 16.
Step $204, ie, modify the loading serial number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file.
Upon traversing the dynamic library binding information in the executable file, due to the SDK is added, it is required to modify the loading serial number of the original dynamic library and the offset address of the code corresponding to the original dynamic library in the exccutable file.
Taking the condition of using the first loading sequence as the pre-set loading sequence as an example. In briefly, it refers to that there are 10 original dynamic libraries with serial numbers of 1, 2, 3...10, then. add dynamic library corresponding to the SDK prior to adding all original dynamic libraries, and thus, the serial number of the newly added dynamic library is !, and the serial numbers of the original dynamic libraries are sequentially modified to 2, 3. 4...11. Meanwhile. it is necessary to modify the offset addresses of the codes corresponding to the original dynamic libraries in the executable file.
Step S205. i.e. calculate symbolic pointer information according to the il paragraph number information and offset information of the dynamic library, and determine the initial position information of an original dynamic library as well as the position information of the called code according to the symbolie pointer information: and thus, modify the serial number information of the initial position information of an original dynamic library as well as the position information of the called code.
According to the symbolic pointer information calculated from the paragraph number information and the offset information of the dynamic library, the initial position information of the original dynamic library and the position information of the called code under the code segment can be obtained, and then, modify the serial number information of the initial position information of an original dynamic library as well as the position information of the called code.
Step S206. i.e., generate an updated application file according to the modified exccutable file. and perform re-signature authentication processing on the updated application file.
Replace the original executable file with the modified executable file, and repackage the modified executable file according to the modified dynamic library information list, and thus, generate an update application file, and then, use the re- signature tool to perform re-signature authentication. During the following process, when the update application is started, the newly added SDK will embed codes according to the aforesaid pre-set loading sequence based upon the modified dynamic library information list.
It can thus be seen that the method of this embodiment can be summarized into following processing stages: (1) uncompressing and extraction stage. (2) modification and processing stage of executable file, specifically refers to modifying the loading information and binding information of the executable file. (3) repackaging stage, specifically refers to replacing the original executable file with the modified executable file, and thus, generating a new application file, and 12 performing re-signature to the new application file as well as generating a new ipa package.
It can thus be seen that the method according to this embodiment can embed, without a source code, the SDK for any application according to a specified loading sequence, such as security components (signature validation, secondary packaging detection, jailbreak detection, and defense injection. etc.). rent for dynamic monitoring , and debugging module. etc. so that makes the SDK codes be called according to the specified loading sequence when the application runs, and with wide range of application scenarios. Wherein, when specify the first loading sequence as the pre-set loading sequence, it can also address the problem that after the SDK is embedded into the system library based upon the existing technology, there are errors occurred in the added SDK or even the added SDK crashes for the reason of other library information is loaded in priority, and the compatibility thereof is higher.
Figure 3 shows a schematic diagram of an apparatus for embedding codes in an application according to another embodiment of the present invention, as shown in Figure 3, such apparatus consists of: an integration module, a first modification module, a second modification module, and an application tile generation module.
Wherein, the integration module 31 is suitable for integrating the SDK into an application. and embedding the loading information of the SDK in the dynamic library information list of the executable file of an application according to the pre- set loading sequence; The first modification module 32, which is suitable for modifying the offset information and the length information of the dynamic library loading information included in the executable file according to the file information of the SDK; The second modification module 33, which is suitable for modifying the loading serial number information of an original dynamic library included in the executable file, and the offset address information, in the executable file, of the code corresponding to the original dynamic library, and modifying the serial number 13 information of the position information of the original dynamic library in a code segment; The application file generating module 34, which is suitable for generating an updated application file according to the modified executable file.
In an optional approach, the file information of the SDK specifically consists of at least one of the following: dynamic library name information, file storage path information, file size information, and structure information; and the dynamic library loading information specifically consists of at least one of the following: redirection information and static binding information.
In an optional approach, the second modification module 32 is further suitable for: Calculating symbolic pointer information according to the paragraph number information and offset information of the dynamic library, and determining the initial position information of an original dynamic library as well as the position information of the called code according to the symbolic pointer information; Modifving the serial number information of the initial position information of an original dynamic library and the position information of the called code.
In an optional approach, the loading information of the SDK specifically consists of at least one of the following: file path information and name information.
In an optional approach, the aforesaid apparatus for embedding code in an application further consists of: An extraction module, which is suitable for uncompressing program application files of IOS applications and extracting executable files of IOS applications: A Te-signature module, which is suitable for performing re-signature authentication processing on the updated application file.
For the concrete structure and working principle of each aforesaid module,
HH please refer to the description of the corresponding steps of the embodiment of this method, which will not be repeated here.
The embodiment of the present application provides a non-volatile computer storage medium, and the said computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the method for embedding codes in an application described in any of the aforesaid embodiments of the method.
Figure 4 shows a schematic diagram of an electronic device according to an embodiment of the present invention, and the specific embodiments of the present invention do not limit the concrete realization of the electronic device.
As shown in Figure 4, the electronic device may consist of a processor (processor) 402, a Communication Interface (Communications Interface) 404, a memory (memory) 406, and a communication bus 408.
Wherein: The mutual communication among the processor 402, the Communication Interface 404 and the memory 406 is completed through the communication bus 408.
The Communication Interface 404 is used to communicate with other devices through network elements, such as clients or other servers.
The processor 402 is used to execute the program 410, which is specific to executing the relevant steps of the aforesaid embodiment of the method for embedding codes in an application.
Specifically, the program 410 may consist of program codes, and the program codes consist of computer operation instructions.
The processor 402 may be a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be the processors of the same type, such as one or more CPUs: or the processors of different types, such as one or more CPUs and one or more ASICs.
The memory 406 is used to store the program 410. The memory 406 may consist of a high-speed RAM memory, or may also include a non-volatile memory (non- volatile memory). such as at least one disk memory.
The program 410 may be specific to being used to make the processor 402 execute any of aforesaid embodiments of the method for embedding codes in an application. For the concrete realization of each step in the program 410, please refer to the descriptions corresponding to relevant steps and units of the aforesaid embodiments of the method for embedding codes in an application, which will not be repeated here.
There is no inherent correlation between the algorithms and displays provided herein and any specific computer. virtual system, or other equipment. And various general-purpose systems can be used together with the demonstration and teaching based on this method. According to the above description, the structure required to construct this type of system is obvious. In addition, the present invention is not targeted at any specific programming language. It should be realized that various programming languages can be used to realize the content of the present invention described herein, and the above description of a specific language is inserted for disclosing the best embodiment of the present invention.
As for the specification provided here, a lot of concrete details are clarified. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some examples, the well-known methods, structures. and technologies are not illustrated in detail, so that prevent from making the understanding of this specification ambiguity.
Similarly, it should be known that in order to simplify the present invention and help to understand one or more aspects of the present invention, in the above 16 description of the exemplary embodiments of the present invention, various characteristics of the present invention are sometimes grouped together into a single embodiment, figure. or its description. However, the disclosed method should not be interpreted as reflecting following intention, that is, the present claimed invention requires more characteristics than those explicitly stated in cach claim. More precisely, as reflected in the following claims, in the aspect of the invention, it has less characteristics than all of characteristics of a single embodiment disclosed previously. Therefore, the claims following the specific embodiment are thus explicitly incorporated into the specific embodiment. wherein, each claim itself can be served as a separate embodiment of the present invention.
Those skilled in the art should understand that, it is possible to make adaptive changes in the modules of the device in the embodiment and set them in one or more devices different from the embodiment. It is allowed to combine the modules or units or components of the embodiment into one module or unit or component, furthermore, can divide them into multiple sub-modules or sub-units or sub- components. Except for that at [cast some of such characteristics and/or processes or units are mutually exclusive, any combination can be used to group all characteristics disclosed in this specification (including the accompanying claims, abstract and drawings) and all the processes or units of any method or device disclosed in this manner. Unless expressly stated otherwise, each characteristic disclosed in this specification (including the accompanying claims, abstract and drawings) may be replaced by an alternative characteristic with same, equivalent, or similar purpose.
In addition, those skilled in the art should understand that, although some of the said embodiments described herein consist of certain characteristics included in other embodiments rather than other characteristics, the combination of characteristics of different embodiments means that they fall within the scope of the present invention, and form different embodiments. For example, in the following claims, any one of the claimed embodiments can be used based upon any combination.
17
The embodiments of various components of the present invention may be realized by hardware, or by software modules running on one or more processors, or by their combination. Those skilled in the art should understand that, it is possible to realize some or all of the functions of some or all components of the electronic device according to the embodiments of the present invention in practice by using a microprocessor or a digital signal processor (DSP). The present invention also can be implemented as a device or program of apparatus (for example, a computer program and a computer program product) for executing a part or entire of the method described herein. Such program for realizing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals. Such signals can be downloaded from the Internet, or provided on signals of carrier, or provided in any other torm.
It should be noted that the aforesaid embodiments are used to illustrate rather than limit the present invention, and those skilled in the art can design alternative embodiments without departing from the scope of the accompanying claims. In the claims, any reference mark placed between brackets should not be constructed as a limitation to the claims. And the word “consist of” does not exclude the existence of elements or steps not listed in the claims. The word “a” or “an” preceding an element does not exclude the existence of multiple such elements. The present invention can be realized by means of hardware comprising several different elements and by virtue of a suitably programmed computer. In the unit claim enumerating several devices, several of these devices can be embodied through the same hardware item. The use of the words “first”, “second”, and “third” does not represent any sequence. These words can be interpreted as names.
18

Claims (12)

  1. CLAIMS |. A method for embedding codes in an application, which consists of: integrating the SDK into an application, and according to a pre-set loading sequence, embedding loading information of the said SDK in the dynamic library information list of an executable file of the said application: according to file information of the said SDK, modifying offset information and length information of dynamic library loading information included in the said executable file: modifying loading serial number information of an original dynamic library, included in the said executable file, and offset address information, in the said executable file, of the code corresponding to the said original dynamic library, and modifying serial number information of position information of the said original dynamic library in a code segment.
  2. 2. The said method according to Claim !, wherein, the file information of the said SDK specifically consists of at least one of the following: dynamic library name information, file storage path information. file size information, and structure information; and the said dynamic library loading information specifically consists of at least one of the following: redirection information and static binding information.
  3. 3. The method according to Claim !, wherein, the said modification of the serial number information of position information of the said original dynamic library in a code segment specifically consists of: calculating symbolic pointer information according to the paragraph number information and offset information of the dynamic library, and determining the initial position information of an original dynamic library as well as the position information of the called code according to the said symbolic pointer information; modifying the serial number information of the initial position information of 19 the said original dynamic library and the position information of the called code.
  4. 4, The said method according to Claim 1, wherein, the loading information of the said SDK specifically consists of at least one of the following: file path information and name information.
  5. 5. The said method according to any one of Claims 1-4, wherein, if the said method is applied to an IOS application, prior to the execution of the method, it further consists of: uncompressing the program application file of the IOS application, and then extracting the executable file of the said 108 application; and the said method further consists of: performing re-signature authentication processing on the said updated application file.
  6. 6. An apparatus used to embed codes in an application, which consists of: an integration module, which is suitable for integrating the SDK into an application, and embedding the loading information of the said SDK in the dynamic library information list of the executable file of the said application according to the pre-set loading sequence; a first modification module, which is suitable for modifying the offset information and the length information of the dynamic library loading information included in the said executable file according to the fite information of the said SDK:A second modification module, which is suitable for modifying the loading serial number information of an original dynamic library included in the said executable file, and the offset address information, in the said executable file, of the code corresponding to the said original dynamic library, and modifying the serial number information of the position information of the original dynamic library in a code segment; an application file generation module, which is suitable for gencrating an updated application file according to the modified executable file.
  7. 7. The said device according to Claim 6, wherein, the file information of the said SDK specifically consists of at least one of the following: dynamic library name information, file storage path information, file size information, and structure information: and the said dynamic library loading information specifically consists of at lcast one of the following: redirection information and static binding information.
  8. 8. The said device according to Claim 6, wherein. the said second modification module is further suitable for: calculating symbolic pointer information according to the paragraph number information and offset information of the dynamic library, and determining the initial position information of an original dynamic library as well as the position information of the called code according to the said symbolic pointer information; modifying the serial number information of the initial position information of the said original dynamic library and the position information of the called code.
  9. 9. The said device according to Claim 6, wherein, the loading intormation of the said SDK specifically consists of at least one of the following: file path information and name information.
  10. 10. The said device according to any one of Claims 6-9, wherein, the said apparatus further consists of: the extraction module, which is suitable for uncompressing the program application file of the [OS application, and then extracting the executable file of the said 108 application; the re-signature module, which is suitable for performing re-signature authentication processing on the said updated application file.
  11. 11. An electronic device. which consists of: a processor, a memory, a Communication Interface. and a communication bus, wherein, the mutual communication among the said processor, the said memory, and the said Communication Interface is completed through the said communication bus; the said memory is used to store at least one executable instruction, and the said executable instruction makes the said processor perform the operation corresponding to the said method for embedding codes in an application according to any one of Claims 1-5.
  12. 12. A kind of computer storage medium, wherein, the said storage medium 21 stores at least one executable instruction, and the said executable instruction makes the said processor perform the operation corresponding to the said method for embedding codes in an application according to any one of Claims 1-5. 22
LU102412A 2021-01-14 2021-01-14 A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device LU102412B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
LU102412A LU102412B1 (en) 2021-01-14 2021-01-14 A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
LU102412A LU102412B1 (en) 2021-01-14 2021-01-14 A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device

Publications (1)

Publication Number Publication Date
LU102412B1 true LU102412B1 (en) 2021-08-03

Family

ID=77125674

Family Applications (1)

Application Number Title Priority Date Filing Date
LU102412A LU102412B1 (en) 2021-01-14 2021-01-14 A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device

Country Status (1)

Country Link
LU (1) LU102412B1 (en)

Similar Documents

Publication Publication Date Title
CN109710384B (en) Safe Java intelligent contract interpretation execution engine and method
JP6746156B2 (en) Software repackaging prevention method and apparatus
AU2018310287A1 (en) Smart contract processing method and apparatus
WO2020177429A1 (en) Method and apparatus for embedding codes in application, and electronic device
CN104866293A (en) Method and device for extending Android application program function
CN106775781B (en) Method and device for reducing application installation packages and electronic equipment
CN103793248A (en) Method and device for upgrading application program
CN112835975A (en) Method for deploying, updating and calling intelligent contracts in block chain
CN112451972A (en) Game engine-based resource compression package construction method, device, system and medium
CN111897711A (en) Method and device for positioning bug in code, electronic equipment and readable storage medium
CN110414218B (en) Kernel detection method and device, electronic equipment and storage medium
CN103198244B (en) The method of protection dynamic link library
CN111596920A (en) File compiling method and device, compiling equipment and storage medium
US20190065223A1 (en) Disabling Just-In-Time Translation For Application Functions
LU102412B1 (en) A Method and Apparatus for Embedding Codes in an Application, and an Electronic Device
CN112230930A (en) Method and device for constructing and packaging hybrid technology stack and machine-readable storage medium
CN110688198B (en) System calling method and device and electronic equipment
CN114490103A (en) Operating system interface calling method and device and electronic equipment
EP3396536A1 (en) Application program running method and apparatus
US10606612B2 (en) Context check bypass to enable opening shared-object libraries
CN109144877B (en) Application detection method and device
CN108959915B (en) Rootkit detection method, rootkit detection device and server
CN113312073B (en) Installation package file processing method and related device
CN113342660B (en) File testing method, device, system, electronic equipment and readable storage medium
CN111045746A (en) Code expansion method and framework

Legal Events

Date Code Title Description
FG Patent granted

Effective date: 20210803