CN-116204855-B - Anti-cracking application program running method, device, computer equipment and medium
Abstract
The application relates to a cracking-resistant application program running method, a cracking-resistant application program running device, a cracking-resistant application program running computer device, a cracking-resistant medium and a cracking-resistant computer program product. The method comprises the steps of responding to starting of an application program, carrying out credibility detection on object codes in the form of byte codes of the application program loaded in a target virtual machine to obtain a detection result, loading an agent program when the detection result indicates that the object codes are not credible, obtaining a backup object code set in the form of byte codes, restoring the loaded object codes in the target virtual machine according to the backup object code set by the agent program, and running the application program in the target virtual machine based on the restored object codes. By adopting the method, the safety of the application program can be improved.
Inventors
- YI KAI
- PENG HONGYU
- WANG RISHENG
Assignees
- 金蝶软件(中国)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20221205
Claims (12)
- 1. A method of executing a tamper-resistant application, the method comprising: Responding to the starting of an application program, and performing credibility detection on target codes in the form of byte codes of the application program loaded in a target virtual machine to obtain a detection result; when the detection result indicates that the target code is not trusted, acquiring proxy program data and starting a proxy virtual machine; Establishing communication between the proxy virtual machine and the target virtual machine, and transmitting the proxy program data to the target virtual machine by the proxy virtual machine; Executing the agent data by the target virtual machine to load an agent; Acquiring a backup target code set in a byte code form, and repairing the loaded target code in the target virtual machine by the agent program according to the backup target code set; and running the application program in the target virtual machine based on the repaired target code.
- 2. The method of claim 1, wherein the application is a computer program that performs at least one specific task.
- 3. The method of claim 1, wherein the acquiring agent data comprises: Acquiring pre-configured encrypted source agent program data; And decrypting the source agent program data to obtain agent program data.
- 4. The method according to claim 1, wherein the method further comprises: And after acquiring the agent program data, acquiring backup agent program data when detecting that the agent program data is tampered, and loading the agent program through the backup agent program data.
- 5. The method of claim 1, wherein the obtaining, by the agent, the set of backup object codes in the form of bytecodes, and repairing, by the agent, the object codes loaded in the target virtual machine according to the set of backup object codes, comprises: Obtaining a preconfigured encrypted source backup target code set, and decrypting the source backup target code set to obtain a backup target code set in a byte code form; Determining a backup target code corresponding to the loaded target code in a backup target code set; and replacing the target code which is loaded in the target virtual machine and is not trusted by the agent program according to the backup target code.
- 6. The method according to claim 1, wherein the performing the trust detection for the object code in the form of the bytecode of the application program loaded in the target virtual machine, to obtain a detection result, includes: determining a loading source of object code in the form of byte codes of the loaded application program from a target virtual machine for running the application program; And obtaining a detection result which characterizes the un-trusted object code loaded under the condition that the determined loading source is different from the pre-configured loading source.
- 7. The method according to any one of claims 1 to 6, wherein the performing the trust detection for the object code in the form of the bytecode of the application program loaded in the target virtual machine to obtain the detection result includes: judging whether the target code is tampered or not according to the target code in the form of the byte code of the application program loaded in the target virtual machine; In case the object code is tampered with, a detection result is obtained that characterizes the loaded object code as not authentic.
- 8. The method of claim 7, wherein the determining, for the object code in the form of bytecodes of the application program that has been loaded in the target virtual machine, whether the object code has been tampered with, comprises: Determining a source file to which the target code belongs aiming at the target code in the form of the byte code of the loaded application program in the target virtual machine; calculating a hash value of the source file, and comparing the hash value with a preset hash value of the source file; and under the condition that the hash value is different from the preset hash value, obtaining a detection result which characterizes that the loaded target code is not credible.
- 9. A tamper-resistant application running device, the device comprising: The detection module is used for responding to the starting of the application program, carrying out credibility detection on the object code in the form of the byte code of the application program loaded in the target virtual machine, and obtaining a detection result; The system comprises a target virtual machine, a proxy program loading module, an acquisition module, a proxy program restoring module and a restoring module, wherein the target virtual machine is used for acquiring target codes in the form of byte codes when the detection result represents that the target codes are not trusted, acquiring proxy program data and starting a proxy virtual machine; And the program running module is used for running the application program in the target virtual machine based on the repaired target code.
- 10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 8 when the computer program is executed.
- 11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 8.
- 12. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 8.
Description
Anti-cracking application program running method, device, computer equipment and medium Technical Field The present application relates to the field of application technologies, and in particular, to a method, an apparatus, a computer device, a medium, and a computer program product for executing an application program for preventing cracking. Background With the development of computer technology, application programs have emerged. Through a computer programming language, applications may be written. Under the development scene, an application program is compiled by a developer by adopting a high-level language to form a source code in the high-level language form of the application program, the source code in the high-level language form can be executed by a computer after compiling, for example, the application program compiled by adopting a Java computer programming language is compiled into Java program byte codes and then is interpreted into machine codes by a Java virtual machine to be executed. When the application program is put into use after development is completed, the application program is easily decompiled and restored into a source code in a high-level language form, so that the application program is easily cracked, and the running of the cracked application program can cause security threat to a program running end. Currently, to avoid the application program from being cracked, a program source code in a high-level language is generally compiled in a mixed compiling manner. However, the obfuscated compiling mode can only compile partial codes of the application program, and is easy to be broken by a violent attempt mode, so that the security of the application program is not high. Disclosure of Invention In view of the foregoing, it is desirable to provide a method, apparatus, computer device, medium, and computer program product for executing an application program that can improve the security of the application program against cracking. In a first aspect, the present application provides a method for running an application program for preventing cracking. The method comprises the following steps: Responding to the starting of an application program, and performing credibility detection on target codes in the form of byte codes of the application program loaded in a target virtual machine to obtain a detection result; loading an agent when the detection result indicates that the target code is not trusted; Acquiring a backup target code set in a byte code form, and repairing the loaded target code in the target virtual machine by the agent program according to the backup target code set; and running the application program in the target virtual machine based on the repaired target code. In one embodiment, when the detection result indicates that the target code is not trusted, loading an agent includes: when the detection result indicates that the target code is not trusted, acquiring proxy program data and starting a proxy virtual machine; Establishing communication between the proxy virtual machine and the target virtual machine, and transmitting the proxy program data to the target virtual machine by the proxy virtual machine; And executing the agent program data through the target virtual machine to load an agent program. In one embodiment, the acquiring agent data includes: Acquiring pre-configured encrypted source agent program data; And decrypting the source agent program data to obtain agent program data. In one embodiment, the method further comprises: And after acquiring the agent program data, acquiring backup agent program data when detecting that the agent program data is tampered, and loading the agent program through the backup agent program data. In one embodiment, the obtaining, by the agent, a set of backup target codes in the form of bytecodes, and repairing, according to the set of backup target codes, the target codes that have been loaded in the target virtual machine includes: Obtaining a preconfigured encrypted source backup target code set, and decrypting the source backup target code set to obtain a backup target code set in a byte code form; Determining a backup target code corresponding to the loaded target code in a backup target code set; and replacing the target code which is loaded in the target virtual machine and is not trusted by the agent program according to the backup target code. In one embodiment, the performing the reliability detection on the target code in the form of the bytecode of the application program loaded in the target virtual machine to obtain a detection result includes: determining a loading source of object code in the form of byte codes of the loaded application program from a target virtual machine for running the application program; And obtaining a detection result which characterizes the un-trusted object code loaded under the condition that the determined loading source is different from the pre-configured loading source. In