A security protection method, device, equipment and medium
By obtaining and verifying the full amount of floating-point constant information of the application, the application is protected in real time, which solves the problems of lagging security issues and time-consuming protective measures in the existing technology, and achieves high immediacy and extensive security protection effects.
Patent Information
- Application Number
- CN201910634837.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-06-08
AI Technical Summary
Existing technologies cannot protect applications from attacks by memory modifiers and specialized hacking tools in real time, resulting in lagging security issues, and protective measures are time-consuming and narrow in coverage.
By obtaining the reference full floating point constant information of the protected object, extract and verify the current full floating point constant information in real time, perform protection based on the verification results, repair the attacked object, and achieve real-time and universal security protection.
Real-time protection of applications is achieved, labor costs are reduced, harm to applications caused by cheating can be discovered and repaired in a timely manner, and the immediacy and coverage of protection are significantly improved.
Smart Images

Figure CN110390196B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of security, and in particular to a security protection method, device, equipment and medium. Background Art
[0002] In recent years, the widespread use of memory modifiers and special hacking tools has brought increasingly severe challenges to the security of applications. Both can modify the memory information of the running program, so that attackers can use them as tools to modify the logic of the application. Taking the game scenario as an example, attackers can use memory modifiers or special hacking tools to modify the game's memory to obtain unreasonable game resources, such as countless lives, huge amounts of experience points, endless money, knowing the hiding places of all players or endless ammunition, etc., without the attacker having enough knowledge of the memory layout. The use of memory modifiers or special hacking tools reduces the cost of attacking applications, and therefore increases the risks faced by applications.
[0003] In the prior art, the solutions to the security issues caused by memory modifiers or special hacker tools are usually based on known cheating methods, and after analyzing and extracting the feature codes corresponding to each cheating method, a remedial solution is released. This solution has obvious lag. Summary of the invention
[0004] In order to solve the technical problems that the prior art cannot realize real-time protection of the protected object and the solution to the security problem caused by cheating behavior has obvious lag, the embodiments of the present invention provide a security protection method, device, equipment and medium.
[0005] In one aspect, the present invention provides a security protection method, the method comprising:
[0006] Get the protected object;
[0007] Acquire reference full floating-point constant information corresponding to the protected object according to the protected object;
[0008] Responding to a preset trigger instruction, extracting the current full floating-point constant information in real time;
[0009] Verifying the current full floating-point constant information according to the reference full floating-point constant information;
[0010] Protecting the protected object according to the verification result;
[0011] The full floating-point constant information is the sum of the floating-point constant information included in the function required to run the protection object.
[0012] In another aspect, the present invention provides a safety protection device, comprising:
[0013] A protection object acquisition module, used to acquire protection objects;
[0014] A reference full floating-point constant information acquisition module, used to acquire reference full floating-point constant information corresponding to the protection object according to the protection object;
[0015] The current full floating-point constant information extraction module is used to extract the current full floating-point constant information in real time in response to a preset trigger instruction;
[0016] A verification module, used for verifying the current full floating-point constant information according to the reference full floating-point constant information;
[0017] A protection module, used to protect the protection object according to the verification result;
[0018] The full floating-point constant information is the sum of the floating-point constant information included in the function required to run the protection object.
[0019] On the other hand, the present invention provides a device, characterized in that the device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement a security protection method.
[0020] On the other hand, the present invention provides a computer storage medium, characterized in that the storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded by a processor and executes a security protection method.
[0021] The present invention provides a security protection method, device, equipment and medium. The present invention provides real-time protection for the protected object from the perspective of full floating-point constant information, which can not only timely discover whether the protected object is harmed by cheating behavior, but also timely repair the protected object that has been harmed by cheating behavior. Compared with the technical solution of obtaining, analyzing feature codes, and publishing updates for remediation in the prior art, the embodiment of the present invention obviously has the significant advantages of high immediacy, low labor cost, and universal protection against various cheating behaviors. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 It is a schematic diagram of floating-point constant representation provided by the present invention;
[0024] Figure 2 This is an implementation scenario diagram of a security protection method provided by the present invention;
[0025] Figure 3 It is a flow chart of a safety protection method provided by the present invention;
[0026] Figure 4 It is a flow chart of the method for extracting full floating point constant information provided by the present invention;
[0027] Figure 5 It is a flow chart of a method for extracting full floating-point constant information in a Unity engine environment provided by the present invention;
[0028] Figure 6 It is a logical environment diagram of the compiled function summary table provided by the present invention;
[0029] Figure 7 It is a comparative schematic diagram of the opcode rules corresponding to two different versions of the game engines provided by the present invention;
[0030] Figure 8 It is a schematic diagram of locating the memory address where the floating-point constant information is located by using the opcode rule in the environment of the assembly statement provided by the present invention;
[0031] Fig. 9 The present invention provides a flow chart for extracting floating-point constant information pointed to by each compiled function structure information body;
[0032] Fig.10 It is a block diagram of a safety protection device provided by the present invention;
[0033] Fig.11 It is a schematic diagram of the hardware structure of a device provided by the present invention for implementing the method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0036] In order to make the purpose, technical solution and advantages disclosed in the embodiments of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention and are not used to limit the embodiments of the present invention. First, the embodiments of the present invention explain the following concepts:
[0037] Unity: A cross-platform 2D / 3D game engine developed by Unity Technologies. The Unity engine is developed based on the C# language and can be used to develop stand-alone games for Windows, MacOS and Linux platforms, video games for game console platforms such as PlayStation, Xbox, Wii, 3DS and Nintendo Switch, or games for mobile devices such as iOS and Android.
[0038] Windows: An operating system developed by Microsoft Corporation of the United States.
[0039] MacOS: An operating system that runs on Apple's Macintosh series of computers. Mac OS is the first successful graphical user interface operating system in the commercial field.
[0040] Linux: A free to use and free to distribute operating system that supports multi-user, multi-tasking, multi-threading and multi-CPU.
[0041] PlayStation: It is a Sony computer entertainment home video game console produced by Sony of Japan.
[0042] Xbox: A home video game console developed by Microsoft Corporation and released in 2001.
[0043] Wii: A home video game console launched by Nintendo on November 19, 2006.
[0044] 3DS: It is the fourth generation portable game console launched by Japanese company Nintendo in 2011.
[0045] Nintendo Switch: It is the flagship game console first released by Nintendo in March 2017.
[0046] iOS: A mobile operating system developed by Apple.
[0047] Android: A free and open source operating system based on Linux. Mainly used in mobile devices such as smartphones and tablets, it is led and developed by Google and the Open Handset Alliance.
[0048] C#: It is an object-oriented high-level programming language released by Microsoft. It is a safe, stable, simple and elegant object-oriented programming language. Its main advantages are its powerful operation ability, elegant syntax style, innovative language features and convenient component-oriented programming support.
[0049] Floating point number: A floating point number is an approximate numerical representation of a real number. It is represented by a valid digit (i.e., the mantissa) plus a power. The value represented in this representation is obtained by multiplying the integer power of a base number. Take the floating point number 1.2345 as an example. Its representation is as follows Figure 1 As shown, 12345 is the mantissa, which is multiplied by 10 to the power of -4 to express 1.2345.
[0050] Constant: A quantity that will not be modified by the program while it is running.
[0051] Assembly language: Assembly language is a low-level language used in electronic computers, microprocessors, microcontrollers or other programmable devices, also known as symbolic language. In assembly language, mnemonics are used to replace the opcodes of machine instructions, and address symbols or labels are used to replace the addresses of instructions or operands. In different devices, assembly languages correspond to different machine language instruction sets and are converted into machine instructions through the assembly process. A specific assembly language corresponds to a specific machine language instruction set one by one, and cannot be directly ported between different platforms.
[0052] In order to explain the advantages of the security protection method in the embodiment of the present invention, at the beginning of the detailed description of the technical solution of the embodiment of the present invention, the relevant contents of the prior art are first described in detail:
[0053] Memory modifiers and special hacker tools are often used to cheat in games by modifying the floating-point constants in the memory to change the logic of the game. The first step of the current conventional security solution is generally to obtain the specific implementation method of a certain cheating behavior. After obtaining the specific implementation method of the cheating behavior, the feature code of the cheating behavior is analyzed and extracted; then a remediation plan is generated based on the feature code, and the remediation plan includes developing relevant logic for detecting the cheating behavior and adding corresponding protection to the game. For example, the purpose of protecting the game from the cheating behavior can be achieved by issuing a security patch to the game, or even worse, it is necessary to achieve the purpose of protection by updating the game version. It can be seen from this that the protection method of the prior art has at least the following deficiencies:
[0054] First, the security protection in the prior art is a delayed protection, which can only take remedial measures after a certain cheating behavior occurs to avoid subsequent harm caused by the cheating behavior. However, the previous cheating behavior has already caused harm to the user.
[0055] Second, the extraction of feature codes and the generation of remediation solutions both require the intervention of developers, which is time-consuming.
[0056] Third, the remediation scheme can only be effective for one or one type of cheating behavior, and the coverage is narrow. In order to prevent multiple or multiple types of cheating behaviors, multiple remediation schemes need to be implemented in parallel, which obviously wastes resources and increases code redundancy.
[0057] Fourth, using security patches or online updates will affect user experience and reduce user stickiness.
[0058] In view of this, an embodiment of the present invention provides a security protection method, which aims to provide real-time, universal, and general security protection for a protected object, so as to protect the protected object from various cheating behaviors. First, an embodiment of the present invention discloses an implementation scenario of a security protection method.
[0059] See also Figure 2 The implementation scenario includes: a client 01, a business server 03 and a database server 05. The database server 05 is in communication with the business server 03. The database server 05 can also be arranged inside the business server 03. The database server 05 can be used to record the data content required by the business server 03, and interact with the business server 03 so that the business server 03 can interact with the client 01 based on the data content.
[0060] The client 01 can communicate with the business server 03 based on the browser / server mode (B / S) or the client / server mode (C / S) to enjoy the business provided by the business server 03. The client 01 can obtain the reference full floating point constant information corresponding to the current business from the business server 03, and implement security protection for the currently running business based on the reference full floating point constant information, and the business currently running by the client 01 becomes the protection object of the security protection. The reference full floating point constant information can also be stored in the database server 05, and is obtained by the client 01 through interaction with the business server 03.
[0061] The client 01 may include physical devices such as smart phones, tablet computers, laptops, digital assistants, smart wearable devices, and vehicle-mounted terminals, and may also include software running in physical devices, such as applications, etc. For example, the client 01 may run game software, video interaction software, social software, etc.
[0062] The business server 03 and the database server 05 may each include an independently operated server, or a distributed server, or a server cluster consisting of multiple servers.
[0063] The embodiment of the present invention provides a security protection method, such as Figure 3 As shown, the method is performed by the client in the implementation environment, and the method specifically includes:
[0064] S101. Obtain a protected object.
[0065] Specifically, the protection object is the target of security protection performed by the security protection method, which may be a thread, a process, an application program or even a system.
[0066] Taking the game scene as an example, the protection object is the game that is currently running or about to be run. The following text will focus on the game scene as an example to describe the technical solution in the embodiment of the present invention in detail.
[0067] S103. Obtain reference full floating-point constant information corresponding to the protected object according to the protected object.
[0068] Specifically, the full floating-point constant information may be the sum of the floating-point constant information included in all functions required to run the protected object. In the embodiment of the present invention, the reference full floating-point constant information is the full floating-point constant information in an unattacked state. The full floating-point constant information may be extracted and determined as the reference full floating-point constant information when it is determined that the protected object is not attacked or when the protected object is initially released.
[0069] In a feasible embodiment, the reference full floating-point constant information can be obtained by the client itself when it is just started. Specifically, the reference full floating-point constant information can be obtained by dynamically analyzing all functions in the application pointed to by the protection object when the protection object is started. In other feasible embodiments, the reference full floating-point constant information can also be written into an encrypted file in advance and obtained by the client by decrypting the encrypted file.
[0070] In another feasible embodiment, the reference full floating-point constant information may be stored in a business server or a database server, and the client may obtain the reference full floating-point constant information corresponding to the protected object through interaction with the business server.
[0071] Obtaining reference to the full floating-point constant information in the just-started state helps reduce dependence on the communication network, so that the protection object can still be protected in the just-started state. However, the process of obtaining the reference to the full floating-point constant information in the just-started state may also be attacked by attackers, and the locally stored encrypted files may also be tampered with. The business server or database server can set more stringent protection relative to the client, and the security of the reference to the full floating-point constant information stored in the business server or database server may therefore be higher. Therefore, the security of the process of obtaining the reference to the full floating-point constant information in the just-started state may be slightly lower than the security of the process of obtaining the reference to the full floating-point constant information by interacting with the business server. The two ways of obtaining the reference to the full floating-point constant information have their own advantages and disadvantages, and can be selected according to actual conditions, or they can be used simultaneously for double verification.
[0072] In a preferred embodiment, dynamic selection can be performed according to the actual situation. For example, if the current network status is good, the reference full floating point constant information corresponding to the protected object is obtained based on the interaction with the service server; if the current network status is not good, the reference full floating point constant information corresponding to the protected object is obtained offline.
[0073] Furthermore, the embodiment of the present invention discloses a method for extracting full floating point constant information, such as Figure 4 As shown, the method includes:
[0074] S1. Obtain the full function information corresponding to the protection object.
[0075] Specifically, the full function information includes function information of all functions required to run the protected object, and the function information may include function signature, function name, function parameters, function address, function size, and the library where the function is located.
[0076] In a feasible embodiment, the protected object runs based on the Unity engine. In order to obtain the full function information, the embodiment of the present invention analyzes the Unity engine source code, understands the storage method and rules of the C# function in the memory of the bottom layer of the Unity engine from the source code level, and thus proposes a specific method for obtaining the full function information corresponding to the protected object, such as Figure 5 As shown, including:
[0077] S11. Obtain a compiled function summary table.
[0078] By analyzing the Unity engine source code, the embodiment of the present invention finds that all compiled functions are stored in a table structure (Table) (compiled function summary table). In the embodiment of the present invention, the compiled function summary table is called MethodTable. Please refer to Figure 6 , which shows a logical environment diagram of the compiled function summary table. Unity-Mono is the Mono game engine for Unity. After the C# code is written, it is compiled into IL code by the C# compiler. Mono acts as an intermediate layer to divide the processing of IL code into many branches, corresponding to different platforms. When Unity is packaged, Mono will be packaged together. At the same time, Unity compiles the script into IL code package, so that as long as it is a platform supported by Mono, it can be compiled into platform local code in Mono. Domain is the domain structure information in the Unity-Mono game engine. The compiled function summary table MethodTable can be extracted from the domain structure information.
[0079] In the MethodTable, information of each function is recorded in a compiled function structure information body. In the embodiment of the present invention, the compiled function structure information body is called MethodInfo.
[0080] Specifically, each compiled function structure information body is stored in a linked list form, and each MethodInfo points to the starting position of the storage address of its corresponding compiled function in the memory.
[0081] S3. Locate each function according to the full function information to extract the floating-point constant information corresponding to each function.
[0082] Specifically, in the Unity engine environment, locating each function according to the full function information to extract the floating-point constant information corresponding to each function is specifically as follows:
[0083] S31. Traverse the compiled summary table to obtain all compiled function structure information bodies in the compiled summary table.
[0084] S33. Extract the floating-point constant information pointed to by each compiled function structure information body.
[0085] Based on the analysis of the source code of the Unity engine, the specific operations of the Unity engine when processing floating-point constants in functions written in C# were studied, and the expression rules of floating-point constant information in assembly statements were discovered. Opcode is also called operation code. The sequence of assembly statements obtained after compiling the source code is called an opcode sequence. Opcode is a part of the computer instruction that specifies the operation to be performed. The format and specification of the instruction are specified by the instruction specification of the processor. In addition to the instruction itself, there are usually operands required by the instruction. Some instructions may not require explicit operands. These operands may be values in registers, values in the stack, values in a block of memory, or values in IO ports, etc.
[0086] In the embodiment of the present invention, the expression rule of floating-point constant information in the assembly statement is used to locate the storage position of the floating-point constant based on the expression characteristics of the floating-point constant information in the opcode sequence. Therefore, in the embodiment of the present invention, the expression rule of the floating-point constant information in the assembly statement can also be called an opcode rule.
[0087] Please refer to Figure 7 , which shows a comparative schematic diagram of the opcode rules corresponding to two different versions of game engines. The opcode rules corresponding to the first version of the game engine include three sub-rules, according to which the storage location of the floating-point constant in the opcode sequence can be extracted. The opcode rules corresponding to the second version of the game engine include five sub-rules, according to which the storage location of the floating-point constant in the opcode sequence can be extracted. The opcode rules of different game engines can be different. The embodiment of the present invention focuses on providing the idea of extracting floating-point constant information based on the opcode rules, and does not limit the specific opcode rule content. Different game engines have their own corresponding opcode rules that can be used.
[0088] Please refer to Figure 8 , which shows a schematic diagram of locating the memory address where the floating-point constant information is located through the opcode rule in the environment of the assembly statement. Figure 8The framed portion is the memory address where the floating-point constant information is located, framed by the opcode rule.
[0089] Specifically, the floating point constant information pointed to by each compiled function structure information body is extracted, such as Fig. 9 As shown, including:
[0090] S331. Access the memory address pointed to by each compiled function structure information body.
[0091] S333. Access the memory with the memory address as the starting point, and extract the target memory address, where the target memory address is obtained according to the expression rule of the preset floating-point constant information in the assembly statement.
[0092] Specifically, the expression rule of the preset floating-point constant information in the assembly statement is related to the specific operating environment of the protected object, such as the version of the game engine.
[0093] S335. Access the target memory address to obtain floating-point constant information.
[0094] It can be seen from the embodiment of the present invention that the target memory address complies with the opcode rule, so the data stored in the target memory address points to the floating-point constant, and therefore the floating-point constant information can be obtained by accessing the target memory address.
[0095] S5. Summarize the floating-point constant information corresponding to each function to obtain the full floating-point constant information.
[0096] Specifically, in the Unity engine environment, the aggregating the floating-point constant information corresponding to each function to obtain the full floating-point constant information includes:
[0097] S51. Summarize the floating-point constant information pointed to by each compiled function structure information body to obtain the full floating-point constant information.
[0098] S105. In response to a preset trigger instruction, extract the current full floating-point constant information in real time.
[0099] Specifically, the method for extracting the current full floating-point constant information in real time may refer to steps S1-S5.
[0100] The preset trigger instruction can be set according to actual conditions. For example, the preset trigger instruction can be generated by a timer drive, the preset trigger instruction can be generated in response to the startup of a business server, or the preset trigger instruction can be generated in response to an interface touch instruction received by the client. The embodiment of the present invention does not limit the specific method for generating the preset trigger instruction.
[0101] S107. Verify the current full floating-point constant information according to the reference full floating-point constant information.
[0102] S109. Protect the protected object according to the verification result.
[0103] Specifically, if the reference full floating-point constant information is consistent with the current full floating-point constant information, it is determined that the protected object has not been harmed by the cheating behavior; if the reference full floating-point constant information is inconsistent with the current full floating-point constant information, it is determined that the protected object has been harmed by the cheating behavior.
[0104] In a feasible implementation, if it is determined that the protected object has been harmed by cheating, an alarm message is directly generated, or the alarm message is reported to the business server. Furthermore, the current full floating-point constant information can be restored according to the reference full floating-point constant information, so that the current full floating-point constant information is consistent with the reference full floating-point constant information, thereby repairing the damage suffered by the protected object due to cheating and playing a role of real-time protection.
[0105] Taking the scenario where the game is the protected object as an example, the resource-related functions in the game need to use floating-point constants as an important part of their logic. Take the following code as an example:
[0106] If(cond)
[0107] {
[0108] Float testRes=testNum*20f;
[0109] …
[0110] }
[0111] Where testRes and 20f are both floating point constants. If some players modify 20f to other values through the memory modifier, the value of the resource testRes will be abnormal, thereby affecting the relevant logic, and the player can obtain improper benefits, such as inexhaustible virtual items. The protection method of the embodiment of the present invention can timely detect whether the value of testRes is abnormal, and repair it in abnormal circumstances, thereby avoiding improper gains for players.
[0112] The embodiment of the present invention provides a security protection method, which performs real-time protection on the protected object from the perspective of the full amount of floating-point constant information. It can not only timely discover whether the protected object is harmed by cheating behavior, but also timely repair the protected object that has been harmed by cheating behavior. Compared with the technical solution of obtaining, analyzing feature codes, and issuing updates to remedy the existing technology, the embodiment of the present invention obviously has the significant advantages of high immediacy, low labor cost, and universal protection against various cheating behaviors. The embodiment of the present invention protects floating-point constant information and does not restrict the protected object itself. Therefore, it can be applied to various scenarios where floating-point constant information needs to be securely protected, and has broad application prospects.
[0113] The embodiment of the present invention also discloses a safety protection device, such as Fig.10 As shown, the device comprises:
[0114] A protection object acquisition module 201 is used to acquire a protection object;
[0115] A reference full floating-point constant information acquisition module 203 is used to acquire reference full floating-point constant information corresponding to the protection object according to the protection object;
[0116] The current full floating-point constant information extraction module 205 is used to extract the current full floating-point constant information in real time in response to a preset trigger instruction;
[0117] A verification module 207, configured to verify the current full floating-point constant information according to the reference full floating-point constant information;
[0118] The protection module 209 is used to protect the protection object according to the verification result.
[0119] Specifically, the safety protection device and method embodiments described in the embodiments of the present invention are based on the same inventive concept.
[0120] An embodiment of the present invention further provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing a security protection method according to an embodiment of the present invention, the method comprising at least the following steps:
[0121] A safety protection method, the method comprising:
[0122] Get the protected object;
[0123] Acquire reference full floating-point constant information corresponding to the protected object according to the protected object;
[0124] Responding to a preset trigger instruction, extracting the current full floating-point constant information in real time;
[0125] Verifying the current full floating-point constant information according to the reference full floating-point constant information;
[0126] Protecting the protected object according to the verification result;
[0127] The full floating-point constant information is the sum of the floating-point constant information included in the function required to run the protection object.
[0128] Preferably, obtaining reference full floating-point constant information corresponding to the protected object according to the protected object includes:
[0129] The reference full floating-point constant information is obtained by dynamically analyzing all functions in the application pointed to by the protection object when the protection object is started;
[0130] or,
[0131] The reference full floating-point constant information corresponding to the protected object is obtained through interaction with the business server.
[0132] Preferably, the method further includes the step of extracting full floating-point constant information, wherein the step of extracting full floating-point constant information includes:
[0133] Obtaining the full function information corresponding to the protection object;
[0134] Locating each function according to the full function information to extract floating-point constant information corresponding to each function;
[0135] Summarize the floating-point constant information corresponding to each function to obtain the full floating-point constant information.
[0136] Preferably, the obtaining of the full amount of function information corresponding to the protection object includes: obtaining a compiled function summary table;
[0137] The locating each function according to the full function information to extract the floating point constant information corresponding to each function includes:
[0138] Traversing the compiled summary table to obtain all compiled function structure information bodies in the compiled summary table;
[0139] Extract the floating-point constant information pointed to by the structure information body of each compiled function.
[0140] Preferably, extracting the floating-point constant information pointed to by each compiled function structure information body includes:
[0141] Access the memory address pointed to by each compiled function structure information body;
[0142] Accessing the memory with the memory address as the starting point, and extracting the target memory address, wherein the target memory address is obtained according to a rule for expressing the preset floating-point constant information in the assembly statement;
[0143] Access the target memory address to obtain floating-point constant information.
[0144] Preferably, protecting the protected object according to the verification result includes:
[0145] If the reference full floating-point constant information is consistent with the current full floating-point constant information, it is determined that the protected object has not been harmed by the cheating behavior; if the reference full floating-point constant information is inconsistent with the current full floating-point constant information, it is determined that the protected object has been harmed by the cheating behavior.
[0146] Preferably, it also includes:
[0147] If it is determined that the protected object has been harmed by the cheating behavior, an alarm message is directly generated, and the current full floating-point constant information is restored according to the reference full floating-point constant information, so that the current full floating-point constant information is consistent with the reference full floating-point constant information.
[0148] Further, Fig.11 A schematic diagram of the hardware structure of a device for implementing the method provided by an embodiment of the present invention is shown, and the device may participate in or include the apparatus or system provided by an embodiment of the present invention. Fig.11 As shown, the device 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.11 The structure shown is for illustration only and does not limit the structure of the electronic device. Fig.11 More or fewer components as shown, or with Fig.11 Different configurations are shown.
[0149] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0150] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above-mentioned security protection method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0151] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0152] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of device 10 (or mobile device).
[0153] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0154] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0155] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A safety protection method, characterized in that: The method comprises: Obtaining a protected object, wherein a resource-related function in the protected object uses a floating-point constant as a component of its logic; Acquire, according to the protected object, reference full floating-point constant information corresponding to the protected object, wherein the reference full floating-point constant information is full floating-point constant information in an unattacked state, and the full floating-point constant information is the sum of floating-point constant information included in all functions required to run the protected object; Responding to a preset trigger instruction, extracting the current full floating-point constant information in real time; Verifying the current full floating-point constant information according to the reference full floating-point constant information; If the reference full floating-point constant information is consistent with the current full floating-point constant information, it is determined that the protected object has not been harmed by the cheating behavior; if the reference full floating-point constant information is inconsistent with the current full floating-point constant information, it is determined that the protected object has been harmed by the cheating behavior.
2. The method according to claim 1, characterized in that The obtaining, according to the protected object, reference full floating-point constant information corresponding to the protected object includes: The reference full floating-point constant information is obtained by dynamically analyzing all functions in the application pointed to by the protection object when the protection object is started; or, The reference full floating-point constant information corresponding to the protected object is obtained through interaction with the business server.
3. The method according to claim 1, characterized in that The method further includes the step of extracting full floating point constant information, wherein the step of extracting full floating point constant information includes: Obtaining the full function information corresponding to the protection object; Locating each function according to the full function information to extract floating-point constant information corresponding to each function; Summarize the floating-point constant information corresponding to each function to obtain the full floating-point constant information.
4. The method according to claim 3, characterized in that: The obtaining of the full amount of function information corresponding to the protection object includes: obtaining a compiled function summary table; The locating each function according to the full function information to extract the floating point constant information corresponding to each function includes: Traversing the compiled function summary table to obtain all compiled function structure information bodies in the compiled function summary table; Extract the floating-point constant information pointed to by the structure information body of each compiled function.
5. The method according to claim 4, characterized in that The extracting of floating point constant information pointed to by each compiled function structure information body includes: Access the memory address pointed to by each compiled function structure information body; Accessing the memory with the memory address as a starting point, and extracting a target memory address, wherein the target memory address is obtained according to a rule for expressing preset floating-point constant information in an assembly statement; Access the target memory address to obtain floating-point constant information.
6. The method according to claim 1, characterized in that Also includes: If it is determined that the protected object has been harmed by the cheating behavior, an alarm message is directly generated, and the current full floating-point constant information is restored according to the reference full floating-point constant information, so that the current full floating-point constant information is consistent with the reference full floating-point constant information.
7. A safety protection device, characterized in that: The device comprises: A protection object acquisition module, used to acquire a protection object, wherein a resource-related function in the protection object uses a floating-point constant as a component of its logic; A reference full floating-point constant information acquisition module, used to acquire reference full floating-point constant information corresponding to the protected object according to the protected object, wherein the reference full floating-point constant information is full floating-point constant information in an unattacked state, and the full floating-point constant information is the sum of floating-point constant information included in all functions required to run the protected object; The current full floating-point constant information extraction module is used to extract the current full floating-point constant information in real time in response to a preset trigger instruction; A verification module, used for verifying the current full floating-point constant information according to the reference full floating-point constant information; The protection module is used to determine that the protected object has not been harmed by the cheating behavior if the reference full floating-point constant information is consistent with the current full floating-point constant information; if the reference full floating-point constant information is inconsistent with the current full floating-point constant information, determine that the protected object has been harmed by the cheating behavior.
8. A device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a security protection method as described in any one of claims 1-6.
9. A computer storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor according to a security protection method as described in any one of claims 1-6.
Citation Information
Patent Citations
Device test method, device and storage medium for operating system
CN109086173A
A method and device for protecting a core code on an IOS platform
CN109426703A
Anti-cheating system and method for intelligent mobile game social platform
CN109865293A
