Anti-game plug-in method, device and equipment and storage medium

By obfuscating and encrypting the game code files and disrupting their structure to generate garbled code files, and then using a preset key to decrypt and reconstruct the file structure, the problem of easily decipherable encrypted code in existing technologies is solved, thus ensuring the fairness of the game.

CN116764234BActive Publication Date: 2026-04-14GUANGZHOU JISHANG NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU JISHANG NETWORK TECH CO LTD
Filing Date
2023-06-29
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

The encrypted game source code in existing technologies is easily deciphered, allowing cheat studios to easily create cheats and making it impossible to guarantee the fairness of the game.

Method used

By obfuscating and encrypting the code files of the login program and the main program and destroying the file structure when the game starts, a garbled code file is generated. Then, a preset key is used to decrypt and reconstruct the file structure, ensuring that the code file can only run normally with the support of the login program, thus increasing the difficulty of decryption.

Benefits of technology

This significantly increases the difficulty of deciphering the game's source code, raises the cost of interpreting and deciphering the source code, reduces the success rate of creating cheats, and ensures the fairness of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116764234B_ABST
    Figure CN116764234B_ABST
Patent Text Reader

Abstract

The application discloses a game external plug-in prevention method and device, equipment and storage medium, and relates to the technical field of computer games. The method comprises the following steps: in the case of receiving a game starting request, reading a first code file of a login program in a page entry directory, and reading a second code file of a main program in a resource directory; based on a preset first key, the first code file is obfuscated and decrypted to obtain a first decrypted code, and the login program is run based on the first decrypted code; the second code file is restructured and obfuscated and decrypted by the login program and the first key to obtain a second decrypted code, and the main program is run based on the second decrypted code. Through the above technical means, the problem that the encrypted game source code is easy to be cracked in the prior art can be solved, the difficulty of cracking the game source code is increased, the cost of interpreting and cracking the game source code is increased, the success rate of making external plug-ins is reduced, and thus the invasion of external plug-ins into games is prevented, and the fairness of games is greatly ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer game technology, and in particular to a method, apparatus, device and storage medium for preventing game cheating. Background Technology

[0002] Cheats, generally speaking, refer to programs that use technical means or third-party tools to modify game rules to gain advantages for players. The two main methods of cheating are packet sending and memory injection. Packet sending involves disguising the game client and sending protocol packets to the server to gain its trust. Then, the disguised game client's data is sent to the server, causing it to process unreasonable game operations and data. Memory injection involves finding resources in a game client and injecting the cheat's business logic into those resources while preserving the original resources. This replaces a memory method in the game client's execution. When the game client program loads that resource, it is replaced by the cheat's resource, allowing the cheat to easily execute unreasonable business logic. However, both packet sending and memory injection require deciphering the game code beforehand and developing a cheat that is difficult to detect.

[0003] In existing technologies, game source code is encrypted and decrypted during game execution to execute the source code. However, the encrypted source code is stored on the user's machine, increasing the difficulty of deciphering the game source code. Simple encryption rules are easily cracked by cheat software studios, who can easily create cheats based on the deciphered game code. This makes it difficult to prevent cheat software from infiltrating the game and compromises the game's fairness. Summary of the Invention

[0004] This application provides a method, device, equipment, and storage medium for preventing game cheating, in order to solve the problem that encrypted game source code is easily deciphered in the prior art, increase the difficulty of deciphering game source code, increase the cost of deciphering game source code, reduce the success rate of cheat creation, thereby preventing cheat intrusion into the game and greatly ensuring the fairness of the game.

[0005] Firstly, this application provides a method for preventing game cheating, including:

[0006] Upon receiving a game launch request, the system reads the first code file of the login program from the page entry directory and the second code file of the main program from the resource directory.

[0007] The first code file is obfuscated and decrypted based on a preset first key to obtain a first decryption code, and the login program is run based on the first decryption code.

[0008] The login program and the first key are used to reconstruct and obfuscate the second code file to obtain the second decrypted code, and the main program is run based on the second decrypted code.

[0009] Secondly, this application provides an anti-game cheating device, comprising:

[0010] The file reading module is configured to read the first code file of the login program in the page entry directory and the second code file of the main program in the resource directory when a game launch request is received;

[0011] The first decryption module is configured to obfuscate and decrypt the first code file based on a preset first key to obtain a first decryption code, and then run the login program based on the first decryption code.

[0012] The second decryption module is configured to perform file structure reconstruction and obfuscation decryption on the second code file using the login program and the first key to obtain the second decryption code, and then run the main program based on the second decryption code.

[0013] Thirdly, this application provides an anti-cheating device for games, comprising:

[0014] One or more processors; a memory storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the anti-game cheating method as described in the first aspect.

[0015] Fourthly, this application provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the anti-game cheating method as described in the first aspect.

[0016] In this application, upon receiving a game launch request, the system reads a first code file from the login program in the page entry directory and a second code file from the main program in the resource directory. The first code file is obtained by obfuscating and encrypting the first source code of the login program using a first key, and the second code file is obtained by obfuscating, encrypting, and corrupting the file structure of the second source code of the main program using the first key. Since both the first and second code files are in a garbled state, they cannot be run directly. The first source code is obtained by obfuscating and decrypting the first code file using a pre-saved first key, and the login program runs based on this first source code. The login program then uses the first key to reconstruct the file structure of the second code file and obfuscate and decrypt it to obtain the second source code, which is then used to run the main program. Through these techniques, the game can run normally based on the decrypted first and second source codes, but the device running the game still stores the obfuscated and encrypted first and second code files locally. The code in the first code file is obfuscated, making it difficult to decompile it to obtain the login program. The second code file relies on the login program for decryption. The file structure of the second code file has been corrupted and the code is obfuscated. Without the login program, it is impossible to decompile the second code file to obtain the main program. This greatly increases the difficulty of deciphering the game source code, solves the problem that encrypted game source code is easily deciphered in existing technologies, increases the cost of deciphering the game source code, reduces the success rate of creating cheats, and thus prevents cheats from invading the game, greatly ensuring the fairness of the game. Attached Figure Description

[0017] Figure 1 This is a flowchart of an anti-game cheating method provided in an embodiment of this application;

[0018] Figure 2 This is a schematic diagram of functional images stored in a folder, as provided in an embodiment of this application;

[0019] Figure 3 This is a schematic diagram of a portable network graphic generated by integrating various functional images provided in the embodiments of this application;

[0020] Figure 4 This is a flowchart of sending data to the server through the main program, provided in an embodiment of this application;

[0021] Figure 5 This is a schematic diagram of the communication process between the main program and the server provided in the embodiments of this application;

[0022] Figure 6 This is a schematic diagram of the structure of an anti-game cheat device provided in an embodiment of this application;

[0023] Figure 7 This is a schematic diagram of the structure of an anti-game cheat device provided in an embodiment of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. A process can be terminated when its operation is completed, but it may also have additional steps not included in the drawings. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] In common existing implementations, to prevent the game's source code from being easily cracked, the entire game's source code is usually encrypted. It is then decrypted during game execution to execute the source code. However, the encrypted source code is stored on the user's machine, requiring decryption before it can be cracked, thus increasing the difficulty of deciphering the game's source code. However, simple encryption rules are easily cracked by cheat software studios, who can easily create cheats based on the cracked game code. This makes it difficult to prevent cheat software from infiltrating the game and compromises the game's fairness.

[0027] To address the aforementioned issues, this embodiment provides a method for preventing game cheating by increasing the difficulty of deciphering the game's source code and the cost of interpreting and deciphering it. This reduces the success rate of creating cheats, thereby preventing cheats from infiltrating the game and greatly ensuring the fairness of the game.

[0028] The anti-game cheating method provided in this embodiment can be executed by an anti-game cheating device, which can be implemented through software and / or hardware. The anti-game cheating device can consist of two or more physical entities, or it can consist of a single physical entity. For example, the anti-game cheating device can be a computer or a game console, or other devices capable of running game source code.

[0029] The anti-cheat device has at least one type of operating system installed, including but not limited to Android, Linux, and Windows. The anti-cheat device can install at least one application based on the operating system; this application can be a built-in application of the operating system or an application downloaded from a third-party device or server. In this embodiment, the anti-cheat device has at least one application capable of executing anti-cheat methods.

[0030] For ease of understanding, this embodiment uses a computer as the main body for implementing the anti-game cheating method.

[0031] Figure 1 A flowchart of an anti-game cheating method provided in an embodiment of this application is given. (Reference) Figure 1 The specific methods for preventing game cheating include:

[0032] S110. Upon receiving a game launch request, read the first code file of the login program from the page entry directory and the second code file of the main program from the resource directory.

[0033] For example, when a user enters the command to start the game into the computer, the computer receives a game launch request and accesses the game project's distribution directory based on this request. The game project's distribution directory includes a page entry directory and a resource directory. The page entry directory stores the first code file of the game's login program, as well as the login page and its JavaScript (JavaScript, a programming language) code. The resource directory stores the second code file of the game's main program, most of the game resources required for the game to run, and configuration files. The login program is used to log into the game and decrypt the second code file of the main program, while the main program is used to load game content. The first code file is obtained by obfuscating and encrypting the first source code of the login program using a pre-defined first key. The second code file is obtained by obfuscating and encrypting the second source code of the main program using the first key and disrupting its file structure.

[0034] During game development, if the game's overall source code has been developed, the code used for logging into the game can be extracted from it. This code can then be modified to add decryption code, resulting in the first source code for the login program. The remaining code after extraction is then used as the second source code for the main program. If the game's overall source code has not yet been developed, the first source code for the login program and the second source code for the main program can be written separately.

[0035] Traditional game frameworks involve the main program retrieving components from a basic component library for the game's user interface. To improve the overall utilization of the game's user interface, this basic component library can be extracted into an independent codebase during game development. This removes redundant code structures from the user interface, making the overall business logic clearer. Furthermore, the underlying rendering functionality can be integrated into an engine library. This engine library is configured with a corresponding underlying library that provides tool-like assistance for its implementation. The engine library allows for more centralized rendering logic, reduces the entry and exit points for performance control, and unifies performance management. By configuring the independent codebase and engine library as the first and second underlying libraries that the main program can reference, the second source code of the main program, after the framework adjustment, facilitates code encapsulation and encryption.

[0036] After obtaining the first source code of the login program and the second source code of the main program, a first key is defined to obfuscate the first and second source codes. This first key can be generated based on the game version number, for example, the first key is an MD5 hash generated from the game version number. The second source code is then obfuscated and encrypted using the first key, further disrupting its file structure to obtain the second code file. The second code file not only has garbled code but also a changed file structure. General decompilation tools will directly indicate that the file is corrupted and cannot be deciphered, making it costly for cheat developers to decipher it. The first source code cannot be encrypted with a disrupted file structure, otherwise the login program would fail to run. Therefore, when obfuscating and encrypting the first source code using the first key, the package body of the first source code can be obfuscated and encrypted, as well as its attributes, class names, and function names, to obtain the first code file. Because most of the directory names in the first source code have been obfuscated, and class names, function names, and properties are also largely obfuscated in the actual code content, the readability of the first source code file is greatly reduced, increasing the difficulty of logical understanding. Plugin studios also need to spend a lot of time deciphering the first source code file.

[0037] The game also relies on configuration files. To further increase the difficulty of deciphering the game, a configuration file closely coupled with the code can be obtained. Based on the first key, this configuration file is obfuscated, encrypted, and its file structure is disrupted to obtain an encrypted configuration file. The encrypted configuration file and the second code file are stored in the resource directory, while the first code file is stored in the page entry directory.

[0038] S120. Obfuscate and decrypt the first code file based on the preset first key to obtain the first decrypted code, and run the login program based on the first decrypted code.

[0039] For example, after the computer reads the first code file of the login program in the page entry directory, it generates a first key based on the game version number. Using this first key, it obfuscates and decrypts the package body of the first code file, as well as its attributes, class names, and function names, to recover the first source code of the login program. The computer can then read the login page and its JavaScript code in the page entry directory, render the game's login interface based on these codes, and, after the user enters their account, run the first source code to log in to the game.

[0040] S130. The second decryption code is obtained by reorganizing and obfuscating the second code file using the login program and the first key, and the main program is run based on the second decryption code.

[0041] For example, the computer reconstructs the file structure of the second code file using a login program, restores the file structure of the code, and obfuscates and decrypts the restored code based on the first key, thus recovering the second source code of the main program. The computer can then run the second source code to load game content through the main program.

[0042] When the computer runs the main program and loads game resources, a cheat program can find the corresponding game resources and inject its own business logic into them while preserving the original resources. This replaces a memory method that runs after the main program starts. When the main program loads the resource, it is replaced by the cheat program's resource, and the cheat program begins executing unreasonable business logic. Therefore, to prevent cheat resource injection, various game resources can be compressed and encrypted in multiple ways while ensuring their quality, thus increasing the difficulty of cheat resource injection.

[0043] In one embodiment, during game development, for various functional images in game resources, such as name images of non-game players and name images of game players, functional images of the same category can be grouped into the same folder based on the category of image content. All functional images in a folder are deduplicated, and the deduplicated functional images are integrated into a portable network graph. A data interaction format (JSON) file that can access each functional image in the portable network graph is generated. Figure 2 This is a schematic diagram of functional images stored in a folder, provided in an embodiment of this application. Figure 3 This is a schematic diagram of a portable network graphic generated by integrating various functional images provided in the embodiments of this application. For example... Figure 2 As shown, a folder contains functional images of squares, circles, and triangles. Using an image stitching tool such as TexturePacker, these three functional images can be deduplicated and combined to obtain a .tps file. The .tps file extension is used to generate a data exchange format, such as... Figure 3 The portable network graph shown is a single image. A folder typically contains hundreds of functional images. Image stitching tools can combine these hundreds of images into a single 512*1024 portable network graph. Since the size of the portable network graph is defined as a power of 2, rendering efficiency is improved, and rendering commands are not interrupted by other functional images. Combining multiple functional images into one image is equivalent to compressing multiple input / output requests into a single request, significantly optimizing the game's input / output processes. Afterward, the portable network graph and its corresponding data interaction format are compressed and encrypted to obtain the functional image resource file, which is then stored in the resource directory.

[0044] When the main program loads a feature image, it can read the feature image resource file from the resource directory. The main program then decompresses the compressed and encrypted feature image resource file to obtain a data exchange format file and a portable network graph. Based on the pixel coordinates of each feature image in the data exchange format file within the portable network graph, the main program can retrieve and render the corresponding feature image from the portable network graph. Since all feature images are integrated into the same portable network graph, when an external plugin injects resources, it replaces the entire portable network graph, causing subsequent programs loading other feature images to malfunction, making the plugin easily detectable. Furthermore, the feature image resource file is encrypted, requiring the plugin to decrypt it during injection, increasing the difficulty of resource injection.

[0045] Game resources also include scene data, map data, and interface data. For scene data, the originally ordered map can be divided into multiple tiles, and these tiles can be obfuscated and encrypted to obtain a map resource file. Map data can first be converted into a binary file, and then compressed and encrypted to obtain a scene resource file. For interface data, its file header can be obfuscated and encrypted to obtain an interface resource file. Since the interface data is an SWF (Shockwave Flash, a vector-based Flash animation file format) file, header obfuscation and encryption can compromise the usability of downloaded interface data. The map resource file, scene resource file, and interface resource file are stored in a resource directory. Correspondingly, when the main program loads map resources in the game, it can read the map resource file from the resource directory, decompress the compressed and encrypted map resource file to obtain a binary file, and then restore the corresponding map data from the binary file. When the main program loads scene resources in the game, it can read the map resource file from the resource directory, decrypt the obfuscated and encrypted scene resource file to obtain ordered scene tile images, and then restore the corresponding scene data from the ordered scene tile images. When the main program loads interface resources during game execution, it can read interface resource files from the resource directory. The main program can then decrypt the interface resource files whose headers are obfuscated and encrypted to obtain the corresponding interface data.

[0046] When the computer runs the main program to communicate with the server, cheat programs can send protocols to the server using packet sending tools, forging front-end data to deceive the server into executing data logic. These cheat programs can even override the sending protocol or directly call the game's client-side sending protocol. Therefore, to prevent cheat programs from calling the protocol to send forged data to the server, a specific protocol header can be used so that the server can distinguish between the data sent by the cheat program and the data sent by the main program. For example, Figure 4 This is a flowchart illustrating the process of sending data to the server via a main program, as provided in an embodiment of this application. Figure 4 As shown, the steps for sending data to the server through the main program specifically include S1401-S1403:

[0047] S1401. Obtain the socket packet initially sent by the server through the login program, retrieve the second key from the socket packet, and pass the second key to the main program.

[0048] For example, when logging into a user's game account through a login program, the login program can establish socket communication with the server. The server generates a socket packet based on a pre-set second key and sends the socket packet to the login program via socket communication. Since the game is currently logged in, the socket packet received by the login program is the first socket packet sent by the server during this game run. The login program obtains the second key from this socket packet and transmits the second key to the main program via parameter passing.

[0049] S1402. The main program calls the protocol header generation interface to process the second key to generate a protocol header, and then generates message data based on the protocol header.

[0050] Figure 5 This is a schematic diagram illustrating the communication process between the main program and the server provided in an embodiment of this application. For example... Figure 5 As shown, after receiving the second key, the main program calls the protocol header generation interface to convert the second key into a protocol header before communicating with the server. For example, the protocol header generation interface processes the second key according to preset key modification rules and / or protocol header calculation rules to generate a protocol header. The key modification rules can be understood as converting the second key into different parameters, while the protocol header calculation rules can be understood as a set calculation formula. After processing the second key using the key modification rules and / or protocol header calculation rules, the main program obtains a protocol header unrelated to the second key. This makes it difficult for cheat programs to crack the protocol header using the second key, increasing the difficulty for cheat programs to forge data. It should be noted that the server stores key modification rules and / or protocol header calculation rules consistent with the protocol header generation interface. By processing the second key using these rules, the server can obtain the same protocol header as the one generated by the main program. Therefore, the server can accurately identify which message data is genuine game data generated by the main program and which is forged data sent by cheat programs, achieving precise monitoring of forged data sent by cheat programs.

[0051] In this embodiment, in order to further increase the cost of external plug-ins deciphering the protocol header, the key modification rules and / or protocol header calculation rules can be dynamically adjusted according to a preset period, and the server can also perform timed synchronous modifications, making it difficult for external plug-ins to determine the conversion logic between the second key and the protocol header.

[0052] refer to Figure 5After generating the protocol header, the main program can count each generated header. The count can be a periodic sequence number or an gradually increasing sequence number. For example, if the count is a periodic sequence number from 0 to 127, the main program records the sequence number of the first generated header as 0, the second as 1, the 128th as 127, and the 129th as 0. The sequence number of the header is written into the header so that the server can verify the sequence number written in the header when receiving message data. If out-of-order or disordered message data is encountered, the message data and the corresponding game client are recorded and fed back to the backend. The operations team then determines whether to ban the game, increasing the crackdown on cheating and ensuring a fair gaming environment.

[0053] Furthermore, the main program packages the protocol header and the data to be sent to the server to generate message data.

[0054] S1403. The main program calls the sending protocol interface to send message data to the server, so that the server verifies the protocol header of the received message data based on the second key, and determines the message data that fails the verification as data sent by the plug-in; wherein, the sending protocol interface and the protocol header generation interface are separated.

[0055] refer to Figure 5 The main program calls the sending protocol interface to send the currently generated message data to the server. The server processes the second key using locally stored key modification rules and / or protocol header calculation rules to obtain the protocol header. Because the sending protocol interface and the protocol header generation interface are separate, the protocol header of forged data sent by a cheat program directly calling the sending protocol interface differs from the protocol header of the message data generated by the main program. When this forged data is transmitted to the server, the server can easily detect that the protocol header of the forged data is different from the protocol header calculated by the server itself, thus identifying that the forged data was sent by a cheat program. The server can then report the cheat program sending the forged data to the backend for the operations team to ban, quickly rendering cheat programs that call the sending protocol interface ineffective. However, when the main program sends the corresponding generated message data to the server, the server can determine that the protocol header of the message data is the same as the protocol header it calculated, thus confirming that the message data is sent by the normal game client, and then processing the corresponding game operation based on this message data.

[0056] In summary, the anti-game cheating method provided in this application reads a first code file of the login program from the page entry directory and a second code file of the main program from the resource directory upon receiving a game launch request. The first code file is obtained by obfuscating and encrypting the first source code of the login program using a first key, and the second code file is obtained by obfuscating, encrypting, and destroying the file structure of the second source code of the main program using the first key. Since both the first and second code files are in a garbled state, they cannot be run directly. The first source code is obtained by obfuscating and decrypting the first code file using a pre-saved first key, and the login program is run based on the first source code. The login program obtains the second source code by reconstructing the file structure and obfuscating and decrypting the second code file using the first key, and the main program is run based on the second source code. Through the above technical means, the game can run normally based on the decrypted first and second source codes, but the device running the game still locally stores the obfuscated and encrypted first and second code files. The code in the first code file is obfuscated, making it difficult to decompile it to obtain the login program. The second code file relies on the login program for decryption. The file structure of the second code file has been corrupted and the code is obfuscated. Without the login program, it is impossible to decompile the second code file to obtain the main program. This greatly increases the difficulty of deciphering the game source code, solves the problem that encrypted game source code is easily deciphered in existing technologies, increases the cost of deciphering the game source code, reduces the success rate of creating cheats, and thus prevents cheats from invading the game, greatly ensuring the fairness of the game.

[0057] Based on the above embodiments, Figure 6 This is a schematic diagram of an anti-game cheat device provided in an embodiment of this application. (Reference) Figure 6 The anti-game cheating device provided in this embodiment specifically includes: a file reading module 21, a first decryption module 22, and a second decryption module 23.

[0058] Among them, the file reading module 21 is configured to read the first code file of the login program in the page entry directory and the second code file of the main program in the resource directory when a game launch request is received;

[0059] The first decryption module 22 is configured to obfuscate and decrypt the first code file based on a preset first key to obtain the first decryption code, and then run the login program based on the first decryption code.

[0060] The second decryption module 23 is configured to perform file structure reconstruction and obfuscation decryption on the second code file through the login program and the first key to obtain the second decryption code, and run the main program based on the second decryption code.

[0061] Based on the above embodiments, the anti-game cheating device further includes: a function image decryption module, configured to decompress the compressed and encrypted function image resource file through the main program after running the main program based on the second source code, to obtain a data exchange format file and a portable network graphic, wherein the portable network graphic integrates multiple function images, and the data exchange format file is used to access the function images within the portable network graphic.

[0062] Based on the above embodiments, the anti-game cheating device further includes: a map data decryption module, configured to, after running the main program based on the second source code, decompress the compressed and encrypted map resource file through the main program to obtain a binary file, and restore the corresponding map data from the binary file; a scene data decryption module, configured to, decrypt the obfuscated and encrypted scene resource file through the main program to obtain ordered scene tile images, and restore the corresponding scene data from the ordered scene tile images; and an interface data decryption module, configured to, decrypt the interface resource file with an obfuscated and encrypted header through the main program to obtain the corresponding interface data.

[0063] Based on the above embodiments, the anti-game cheat device further includes a communication protocol module, which includes: a second key acquisition submodule, configured to, after running the main program based on the second source code, obtain the socket packet initially issued by the server through the login program, obtain the second key from the socket packet, and pass the second key to the main program; a protocol header generation submodule, configured to, through the main program, call the protocol header generation interface to process the second key to generate a protocol header, and generate message data based on the protocol header; and a message data sending submodule, configured to, through the main program, call the sending protocol interface to send message data to the server, so that the server verifies the protocol header of the received message data based on the second key, and determines the message data that fails the verification as data sent by the cheat; wherein, the sending protocol interface and the protocol header generation interface are separated.

[0064] Based on the above embodiments, the protocol header generation submodule includes: a protocol header generation unit, configured to process the second key to generate a protocol header according to preset key modification rules and / or protocol header calculation rules.

[0065] Based on the above embodiments, the communication protocol module further includes: a rule adjustment submodule, which is configured to dynamically adjust the key modification rules and / or protocol header calculation rules according to a preset period after the second key is processed by the main program to generate the protocol header by calling the protocol header generation interface.

[0066] Based on the above embodiments, the communication protocol module further includes: a protocol header counting submodule, which is configured to count the protocol header to determine the sequence number of the protocol header after the second key is processed by the main program through the protocol header generation interface to generate the protocol header, and write the sequence number into the protocol header.

[0067] Based on the above embodiments, the main program references a first underlying library and a second underlying library. The first underlying library is an independent code library extracted from the basic component library of the game interaction interface, and the second underlying library is an engine library integrated from the functional code of the underlying rendering.

[0068] Based on the above embodiments, the first key is generated based on the game version number; correspondingly, the first decryption module 22 includes: a first decryption submodule, configured to obfuscate and decrypt the package body of the first code file and obfuscate and decrypt the attributes, class names and function names of the first code file using the first key.

[0069] The anti-game cheating device provided in this application, upon receiving a game launch request, reads a first code file of the login program from the page entry directory and a second code file of the main program from the resource directory. The first code file is obtained by obfuscating and encrypting the first source code of the login program using a first key, and the second code file is obtained by obfuscating, encrypting, and destroying the file structure of the second source code of the main program using the first key. Since both the first and second code files are in a garbled state, they cannot be run directly. The first source code can be obtained by obfuscating and decrypting the first code file using a pre-saved first key, and the login program is run based on this first source code. Similarly, the login program obtains the second source code by reconstructing the file structure and obfuscating and decrypting the second code file using the first key, and the main program is run based on this second source code. Through these technical means, the game can run normally based on the decrypted first and second source codes, but the device running the game still locally stores the obfuscated and encrypted first and second code files. The code in the first code file is obfuscated, making it difficult to decompile it to obtain the login program. The second code file relies on the login program for decryption. The file structure of the second code file has been corrupted and the code is obfuscated. Without the login program, it is impossible to decompile the second code file to obtain the main program. This greatly increases the difficulty of deciphering the game source code, solves the problem that encrypted game source code is easily deciphered in existing technologies, increases the cost of deciphering the game source code, reduces the success rate of creating cheats, and thus prevents cheats from invading the game, greatly ensuring the fairness of the game.

[0070] The anti-game cheating device provided in this application embodiment can be used to execute the anti-game cheating method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0071] Figure 7 This is a schematic diagram of the structure of an anti-game cheat device provided in an embodiment of this application, for reference. Figure 7 The anti-cheat device includes a processor 31, a memory 32, a communication device 33, an input device 34, and an output device 35. The number of processors 31 and the number of memories 32 in the anti-cheat device can be one or more. The processor 31, memory 32, communication device 33, input device 34, and output device 35 of the anti-cheat device can be connected via a bus or other means.

[0072] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the anti-game cheating method in any embodiment of this application (e.g., file reading module 21, first decryption module 22, and second decryption module 23 in the anti-game cheating device). The memory 32 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory 32 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0073] The communication device 33 is used for data transmission.

[0074] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 32, thereby realizing the above-mentioned anti-game cheating method.

[0075] Input device 34 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 35 may include display devices such as a display screen.

[0076] The anti-game cheating device provided above can be used to execute the anti-game cheating method provided in the above embodiments, and has corresponding functions and beneficial effects.

[0077] This application also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform an anti-game cheating method. The anti-game cheating method includes: upon receiving a game launch request, reading a first code file of a login program in the page entry directory and reading a second code file of a main program in the resource directory; obfuscating and decrypting the first code file based on a preset first key to obtain a first decrypted code; running the login program based on the first decrypted code; and reconstructing and obfuscating the second code file using the login program and the first key to obtain a second decrypted code, and running the main program based on the second decrypted code.

[0078] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0079] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the anti-game cheating method described above, but can also execute related operations in the anti-game cheating method provided in any embodiment of this application.

[0080] The anti-game cheating device, storage medium, and anti-game cheating equipment provided in the above embodiments can execute the anti-game cheating method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the anti-game cheating method provided in any embodiment of this application.

[0081] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application. The scope of this application is determined by the scope of the claims.

Claims

1. A method for preventing game cheating, characterized in that, include: Upon receiving a game launch request, the system reads the first code file of the login program from the page entry directory and the second code file of the main program from the resource directory. The login program is used to log in to the game and decrypt the second code file of the main program. The main program is used to load game content. The first code file is code obtained by obfuscating and encrypting the first source code of the login program using a preset first key. The second code file is code obtained by obfuscating and encrypting the second source code of the main program and destroying its file structure using a preset first key. The main program references a first underlying library and a second underlying library. The first underlying library is an independent code library extracted from the basic component library of the game's interactive interface. The second underlying library is an engine library integrated from the functional code of the underlying rendering. The first code file is obfuscated and decrypted based on a preset first key to obtain the first source code, and the login program is run based on the first source code. The second source code is obtained by reconstructing and obfuscating the second code file using the login program and the first key, and then the main program is run based on the second source code.

2. The anti-game cheating method according to claim 1, characterized in that, After running the main program based on the second source code, the process further includes: The main program decompresses the compressed and encrypted functional image resource file to obtain a data exchange format file and a portable network graphic. The portable network graphic integrates multiple functional images, and the data exchange format file is used to access the functional images within the portable network graphic.

3. The anti-game cheating method according to claim 1, characterized in that, After running the main program based on the second source code, the process further includes: The main program decompresses the compressed and encrypted map resource file to obtain a binary file, and then restores the corresponding map data from the binary file. The main program decrypts the obfuscated and encrypted scene resource files to obtain ordered scene slice images, and then restores the corresponding scene data from the ordered scene slice images. The main program decrypts the interface resource file with its header obfuscated and encrypted to obtain the corresponding interface data.

4. The anti-game cheating method according to claim 1, characterized in that, After running the main program based on the second source code, the process further includes: The login program obtains the socket packet initially sent by the server, retrieves the second key from the socket packet, and passes the second key to the main program. The main program calls the protocol header generation interface to process the second key to generate a protocol header, and then generates message data based on the protocol header. The main program calls the sending protocol interface to send the message data to the server, so that the server verifies the protocol header of the received message data based on the second key, and determines the message data that fails the verification as data sent by the plug-in; wherein, the sending protocol interface and the protocol header generation interface are separate interfaces.

5. The anti-game cheating method according to claim 4, characterized in that, The step of processing the second key to generate a protocol header by calling the protocol header generation interface through the main program includes: The second key is processed to generate a protocol header according to preset key modification rules and / or protocol header calculation rules.

6. The anti-game cheating method according to claim 5, characterized in that, After the main program calls the protocol header generation interface to process the second key to generate the protocol header, the method further includes: The key modification rules and / or protocol header calculation rules are dynamically adjusted according to a preset period.

7. The anti-game cheating method according to any one of claims 4-6, characterized in that, After the main program calls the protocol header generation interface to process the second key to generate the protocol header, the method further includes: The protocol header is counted to determine its sequence number, and the sequence number is written into the protocol header.

8. The method for preventing game cheating according to claim 1, characterized in that, The first key is generated based on the game version number; correspondingly, the obfuscation and decryption of the first code file based on the preset first key includes: The first key is used to obfuscate and decrypt the body of the first code file and the attributes, class names, and function names of the first code file.

9. An anti-game cheating device, characterized in that, include: The file reading module is configured to read the first code file of the login program in the page entry directory and the second code file of the main program in the resource directory when a game launch request is received; The login program is used to log in to the game and decrypt the second code file of the main program. The main program is used to load game content. The first code file is code obtained by obfuscating and encrypting the first source code of the login program using a preset first key. The second code file is code obtained by obfuscating and encrypting the second source code of the main program and destroying its file structure using a preset first key. The main program references a first underlying library and a second underlying library. The first underlying library is an independent code library extracted from the basic component library of the game's interactive interface. The second underlying library is an engine library integrated from the functional code of the underlying rendering. The first decryption module is configured to obfuscate and decrypt the first code file based on a preset first key to obtain the first source code, and then run the login program based on the first source code. The second decryption module is configured to perform file structure reconstruction and obfuscation decryption on the second code file using the login program and the first key to obtain the second source code, and to run the main program based on the second source code.

10. An anti-game cheating device, characterized in that, include: One or more processors; A memory that stores one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the anti-game cheating method as described in any one of claims 1-8.

11. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the anti-game cheating method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Protection method and installation method of application program

    CN116305011A

  • System and method for secure data transmission and storage

    WO2016003525A2