├── LICENSE.md ├── PyCheats.py ├── README.md ├── process_info.json ├── readme_assets └── output_sample.png ├── requirements.txt └── utils ├── gather_information.py ├── pprints.py ├── requirements_intaller.py └── root_utilities.py /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Abdul Moez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PyCheats.py: -------------------------------------------------------------------------------- 1 | """ 2 | /* 3 | * Date : 2023/10/13 4 | * Version : 0.3 5 | * Author : Abdul Moez 6 | * Email : abdulmoez123456789@gmail.com 7 | * Affiliation : Undergraduate at Government College University (GCU) Lahore, Pakistan 8 | * GitHub : https://github.com/Anonym0usWork1221/android-memorytool 9 | * 10 | */ 11 | """ 12 | 13 | from utils.requirements_intaller import ReqInstaller 14 | 15 | ReqInstaller().install_requirements() # Install requirements 16 | 17 | # Required Libraries 18 | from androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP 19 | from utils.gather_information import GameInformationHandler 20 | from utils.root_utilities import RootUtils 21 | from utils.pprints import PPrints 22 | import asyncio 23 | import sys 24 | 25 | 26 | class PyCheats(object): 27 | """PyCheats - A Python-based Android game cheating tool.""" 28 | 29 | def __init__(self, **kwargs) -> None: 30 | """ 31 | Initialize the PyCheats object. 32 | 33 | Args: 34 | **kwargs: Additional keyword arguments. 35 | """ 36 | 37 | super().__init__(**kwargs) 38 | self._game_info_handler: GameInformationHandler = GameInformationHandler() 39 | self._event_loop: asyncio.AbstractEventLoop = asyncio.get_event_loop() 40 | self._root_utils: RootUtils = RootUtils() 41 | self._pprints: PPrints = PPrints() 42 | 43 | # Memory Tools Instances Required 44 | # CODE APP Range instances 45 | self._dword_code_app_instance = None 46 | self._utf_8_code_app_instance = None 47 | self._float_code_app_instance = None 48 | 49 | # C_ALLOC Range Instances 50 | self._dword_c_alloc_instance = None 51 | self._float_c_alloc_instance = None 52 | 53 | # A_ANONYMOUS Range Instances 54 | self._float_a_anonymous_instance = None 55 | self._dword_a_anonymous_instance = None 56 | 57 | # C_Data Range Instances 58 | self._float_c_data_instance = None 59 | self._dword_c_data_instance = None 60 | 61 | async def __async__get_ticks(self) -> None: 62 | """ 63 | Asynchronously get information about the Android game and initialize instances. 64 | This method retrieves game information, checks if the game is running, and initializes memory tool instances. 65 | Raises: 66 | SystemExit: Exits the application if the game is not running. 67 | """ 68 | 69 | await self._pprints.decoration() # Prints the PyCheat on screen 70 | await self._root_utils.is_rooted_acquired() # Get root access if the device is rooted 71 | package_name = await self._game_info_handler.upack_information() 72 | if not await self._root_utils.is_game_running(package_name=package_name): 73 | await self._pprints.pprints(text="Game is not running", info_type=3) 74 | sys.exit(1) 75 | 76 | await self._initialize_instances(package_name=package_name) 77 | await self.controller_menu() 78 | 79 | async def _initialize_instances(self, package_name: str) -> None: 80 | """ 81 | Initialize memory tool instances for various memory ranges and data types. 82 | Args: 83 | package_name (str): The package name of the Android game. 84 | This method initializes memory tool instances for different memory ranges and data types. 85 | """ 86 | 87 | # CODE APP Range instances 88 | self._dword_code_app_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, CODE_APP=True), 89 | SPEED_MODE=True, WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 90 | self._utf_8_code_app_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, CODE_APP=True), 91 | TYPE=DataTypes.UTF_8, 92 | SPEED_MODE=True, WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 93 | self._float_code_app_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, CODE_APP=True), 94 | TYPE=DataTypes.FLOAT, 95 | SPEED_MODE=True, WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 96 | 97 | # C_ALLOC Range Instances 98 | self._dword_c_alloc_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, C_ALLOC=True), 99 | SPEED_MODE=True, WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 100 | self._float_c_alloc_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, C_ALLOC=True), 101 | TYPE=DataTypes.FLOAT, 102 | SPEED_MODE=True, WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 103 | 104 | # A_ANONYMOUS Range Instances 105 | self._dword_a_anonymous_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, A_ANONYMOUS=True), 106 | SPEED_MODE=True, 107 | WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 108 | self._float_a_anonymous_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, A_ANONYMOUS=True), 109 | TYPE=DataTypes.FLOAT, SPEED_MODE=True, 110 | WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 111 | 112 | # C_Data Range Instances 113 | self._dword_c_data_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, C_DATA=True), 114 | SPEED_MODE=True, WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 115 | self._float_c_data_instance = AndroidMemoryTool(PKG=package_name, pMAP=PMAP(ALL=False, C_DATA=True), 116 | TYPE=DataTypes.FLOAT, 117 | SPEED_MODE=True, WORKERS=AndroidMemoryTool.get_cpu_counts(3)) 118 | 119 | async def logo_bypass(self) -> None: 120 | """ 121 | Perform a logo bypass to modify game values. 122 | This method modifies various game values to bypass the game's anti-cheat system. 123 | """ 124 | 125 | utf_8_anti_cheat = ["libUE4.so", "libBugly.so", "libanogs.so", "l_report", "get_report", 126 | "tss_sdk_rcv_anti_data", "AreaData.dat", "AntiCheatData", "Reports", "hack", "ban", 127 | "cheat", "qq.com" 128 | ] 129 | code_app_dword_values = [118334, 856896, 123010, 123179, 123274, 1026] 130 | code_app_float_values = [9.21970312e-41, 13073.3740234375] 131 | offsets_libUE4_dword = ['0x7E2A78', '0x7E2A80', '0x7E2A88'] 132 | 133 | replaced_value: int = 0 134 | for value in utf_8_anti_cheat: 135 | replaced_value += self._utf_8_code_app_instance.read_write_value(read=value, write="ruler_king") 136 | 137 | for value in code_app_dword_values: 138 | replaced_value += self._dword_code_app_instance.read_write_value(read=value, write=1) 139 | 140 | for value in code_app_float_values: 141 | replaced_value += self._float_code_app_instance.read_write_value(read=value, write=0.1) 142 | 143 | lib_offset = self._dword_code_app_instance.get_module_base_address("libUE4.so") 144 | for value in offsets_libUE4_dword: 145 | if self._dword_code_app_instance.write_lib(base_address=lib_offset, offset=value, 146 | write_value=1): 147 | replaced_value += 1 148 | 149 | await self._pprints.pprints(text=f"Updated {replaced_value} Values") 150 | 151 | @staticmethod 152 | async def write_group_values_with_filter(instance, read: list, write: any, refine: any = None, 153 | limit: int = -1) -> int: 154 | """ 155 | Write values to memory based on specified filter criteria. 156 | Args: 157 | instance: An instance of the memory tool. 158 | read (list): A list of values to read from memory. 159 | write: The value to write to memory. 160 | refine: A value to refine memory addresses (optional). 161 | limit: The maximum number of values to modify (optional). 162 | Returns: 163 | int: The number of values replaced. 164 | This method writes values to memory based on the specified criteria. 165 | """ 166 | 167 | value_replaced: int = 0 168 | group_values = instance.read_value(read=read, is_grouped=True) 169 | if group_values: 170 | if refine: 171 | group_values = instance.refiner_address(list_address=group_values[0], value_to_refine=refine) 172 | if limit > 0: 173 | group_values = group_values[:limit] 174 | for value in group_values: 175 | if instance.write_lib(base_address=value, offset='0x0', write_value=write): 176 | value_replaced += 1 177 | 178 | return value_replaced 179 | 180 | async def lobby_bypass(self) -> None: 181 | """ 182 | Perform a lobby bypass to remove unnecessary files and modify game values. 183 | This method removes unnecessary files and modifies game values to bypass the game's 184 | anti-cheat system in the lobby. 185 | """ 186 | 187 | unnecessary_files = [ 188 | "src/main/java/com/google/errorprone/annotations", 189 | "src/main/java/com/google/errorprone/annotations/concurrent", 190 | "third_party.java_src.error_prone.project.annotations.Google_internal" 191 | ] 192 | refine_groups = { 193 | self._dword_c_alloc_instance: [ 194 | {"value": [135682, 144387], "replace": 67109633, "refine": 135682, "limit": 50000}, 195 | {"value": [134914, 262403], "replace": 67109633, "refine": 134914, "limit": 50000}, 196 | {"value": [134658, 131586], "replace": 67109633, "refine": 134658, "limit": 50000}, 197 | {"value": [133378, 262403], "replace": 67109633, "refine": 133378, "limit": 50000}, 198 | {"value": [131842, 132098], "replace": 67109633, "refine": 131842, "limit": 50000}, 199 | ] 200 | } 201 | # Removing some unnecessary files 202 | values_replaced: int = 0 203 | for file in unnecessary_files: 204 | await self._root_utils.remove_file(file_path=file) 205 | 206 | for key, values in refine_groups.items(): 207 | for value in values: 208 | values_replaced += await self.write_group_values_with_filter( 209 | instance=key, 210 | read=value["value"], 211 | refine=value["refine"], 212 | limit=value["limit"], 213 | write=value["replace"] 214 | ) 215 | 216 | async def basic_cheats(self, cheat_code: int) -> None: 217 | """ 218 | Activate basic game cheats based on the specified cheat code. 219 | Args: 220 | cheat_code (int): The code for the desired cheat. 221 | This method activates basic game cheats such as HEADSHOT, ANTENNA, AIM-BOT, and SPEED-HACK. 222 | """ 223 | 224 | basic_cheat_sheet = { 225 | 1: "HEADSHOT", 226 | 2: "ANTENNA", 227 | 3: "AIM-BOT", 228 | 4: "SPEED-HACK" 229 | } 230 | cheat = basic_cheat_sheet.get(cheat_code, None) 231 | match cheat: 232 | case "HEADSHOT": 233 | address_list = [] 234 | address_list.extend(self._float_a_anonymous_instance.read_value(read=[9.20161819458, 23.0, 25.0, 30.5], 235 | is_grouped=True)[0]) 236 | 237 | address_list.extend(self._float_a_anonymous_instance.read_value(read=[25.0, 30.5], is_grouped=True)[0]) 238 | address_list = address_list[:10] # Get only 10 results 239 | for address in address_list: 240 | self._float_a_anonymous_instance.write_lib(base_address=address, offset='0x0', write_value=240.0) 241 | 242 | await self._pprints.pprints(text=f"Activated Headshot Cheat") 243 | 244 | case "ANTENNA": 245 | address_list = [] 246 | address_list.extend(self._float_a_anonymous_instance.read_value(read=[88.50576019287, 247 | 87.27782440186, 1], 248 | is_grouped=True, range_val=13)[0]) 249 | 250 | address_list.extend(self._float_a_anonymous_instance.read_value(read=[25.0, 30.5], is_grouped=True)[0]) 251 | address_list = address_list[:6] # Get only 6 results 252 | for address in address_list: 253 | self._float_a_anonymous_instance.write_lib(base_address=address, offset='0x0', write_value=1.96875) 254 | 255 | await self._pprints.pprints(text=f"Activated ANTENNA Cheat") 256 | 257 | case "AIM-BOT": 258 | address_list = [] 259 | address_list.extend(self._float_a_anonymous_instance.read_value(read=[360.0, 0.0001, 1478828288.0], 260 | is_grouped=True)[0]) 261 | 262 | address_list.extend(self._float_a_anonymous_instance.read_value(read=0.0001, is_grouped=False)[0]) 263 | address_list = address_list[:100] # Get only 100 results 264 | for address in address_list: 265 | self._float_a_anonymous_instance.write_lib(base_address=address, offset='0x0', write_value=9999.0) 266 | 267 | await self._pprints.pprints(text=f"Activated AIM-BOT Cheat") 268 | 269 | case "SPEED-HACK": 270 | address_list = [] 271 | address_list.extend(self._float_a_anonymous_instance.read_value(read=[1.0, 1.0, 1.0, 0.0001, 20.0, 272 | 0.0005, 0.4], 273 | is_grouped=True, range_val=50)[0]) 274 | 275 | address_list.extend(self._float_a_anonymous_instance.read_value(read=1, is_grouped=False)[0]) 276 | address_list = address_list[:100] # Get only 100 results 277 | for address in address_list: 278 | self._float_a_anonymous_instance.write_lib(base_address=address, offset='0x0', write_value=1.5) 279 | 280 | address_list.clear() 281 | address_list.extend(self._float_c_data_instance.read_value(read=[-6.1526231e27, -1.0070975e28], 282 | is_grouped=True)[0]) 283 | 284 | address_list.extend(self._float_c_data_instance.read_value(read=-6.1526231e27, is_grouped=False)[0]) 285 | address_list = address_list[:1] # Get only 100 results 286 | for address in address_list: 287 | self._float_a_anonymous_instance.write_lib(base_address=address, offset='0x0', write_value=0.01) 288 | 289 | await self._pprints.pprints(text=f"Activated SPEED-HACK Cheat") 290 | 291 | async def controller_menu(self) -> None: 292 | """ 293 | Display a controller menu to interact with the PyCheats tool. 294 | This method displays a menu with options for performing various actions using the PyCheats tool. 295 | """ 296 | 297 | while True: 298 | await self._pprints.pprints(text="1. Logo Anti-Cheat System", off_info=True) 299 | await self._pprints.pprints(text="2. Lobby Anti-Cheat System", off_info=True) 300 | await self._pprints.pprints(text="3. HEADSHOT", off_info=True) 301 | await self._pprints.pprints(text="4. ANTENNA", off_info=True) 302 | await self._pprints.pprints(text="5. AIM-BOT", off_info=True) 303 | await self._pprints.pprints(text="6. SPEED-HACK", off_info=True) 304 | await self._pprints.pprints(text="7. Dump Maps", off_info=True) 305 | await self._pprints.pprints(text="8. Exit", off_info=True) 306 | await self._pprints.pprints(text=">>>> ", off_info=True, info_type=5, no_end=True) 307 | ans = input() 308 | ans = int(ans) 309 | match ans: 310 | case 1: 311 | await self.logo_bypass() 312 | case 2: 313 | await self.lobby_bypass() 314 | case 3: 315 | await self.basic_cheats(cheat_code=1) 316 | case 4: 317 | await self.basic_cheats(cheat_code=2) 318 | case 5: 319 | await self.basic_cheats(cheat_code=3) 320 | case 6: 321 | await self.basic_cheats(cheat_code=4) 322 | case 7: 323 | self._float_c_data_instance.dump_maps() 324 | case 8: 325 | sys.exit(0) 326 | case _: 327 | await self._pprints.pprints(text="Choose given options", info_type=2) 328 | await asyncio.sleep(2) 329 | 330 | def get_ticks(self) -> None: 331 | """ 332 | Start the PyCheats tool and enter the event loop to interact with the controller menu. 333 | """ 334 | 335 | self._event_loop.run_until_complete(self.__async__get_ticks()) 336 | 337 | 338 | if __name__ == '__main__': 339 | py_cheats_object = PyCheats() 340 | py_cheats_object.get_ticks() 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PyCheats - An Ultimate Android Cheat Script 2 | ==== 3 | [![GitHub stars](https://img.shields.io/github/stars/Anonym0usWork1221/Android-Py-Cheats-Script.svg)](https://github.com/Anonym0usWork1221/Android-Py-Cheats-Script/stargazers) 4 | [![GitHub forks](https://img.shields.io/github/forks/Anonym0usWork1221/Android-Py-Cheats-Script.svg)](https://github.com/Anonym0usWork1221/Android-Py-Cheats-Script/network/members) 5 | [![GitHub issues](https://img.shields.io/github/issues/Anonym0usWork1221/Android-Py-Cheats-Script.svg)](https://github.com/Anonym0usWork1221/Android-Py-Cheats-Script/issues) 6 | [![GitHub watchers](https://img.shields.io/github/watchers/Anonym0usWork1221/Android-Py-Cheats-Script.svg)](https://github.com/Anonym0usWork1221/Android-Py-Cheats-Script/watchers) 7 | [![Python](https://img.shields.io/badge/language-Python%203-blue.svg)](https://www.python.org) 8 | [![GPT_LICENSE](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/) 9 | 10 | ----------- 11 | **This is an example of using androidMemoryTool on android** 12 | 13 | If you find any bug or not working function you can contact me. 14 | 15 | * date : 2023/10/13 16 | * Version : 0.3 17 | * author : Abdul Moez (abdulmoez123456789@gmail.com) 18 | * Study : UnderGraduate in GCU Lahore, Pakistan 19 | 20 | MIT License 21 | 22 | Copyright (c) 2022 AbdulMoez 23 | 24 | ## Introduction 25 | **_PyCheats_** is a Python-based Android game cheating tool designed to help you modify 26 | and manipulate game values for **Android games**. This tool allows you to bypass 27 | **anti-cheat** systems, **activate basic game cheats**, and perform various actions to 28 | gain an advantage in your favorite Android games. This documentation provides 29 | detailed information for both developers and simple users. 30 | 31 | > That's it! You can now use PyCheats to enhance your gaming experience and gain an advantage in your 32 | favorite Android games. Enjoy cheating responsibly! 33 | --------- 34 | ## LOGS 35 | 36 | -----------------------------------------MODIFICATION LOG-------------------------------------------------- 37 | 1. Introducing an enhanced group search system and a streamlined tool arrangement for improved efficiency. 38 | 2. Replacing the outdated search system with a cutting-edge, advanced alternative. 39 | 3. Version 0.3 offers compatibility with androidMemoryTool version 0.6.3 or higher. 40 | 41 | ------ 42 | Requirements 43 | ----------- 44 | * Python Version >= 3.7 45 | * Rooted Environment needed. 46 | 47 | Compatible 48 | ----------- 49 | * This script is made for an example the target packaged used in script was (com.tencent.ig)(PUBG MOBILE) 50 | * For other games just change the addresses or values. 51 | * This script uses ASYNC to boost work speed. 52 | 53 | Installation 54 | ---------------------------------------- 55 | * **__Manual Installation__** 56 | 1. First fulfill python requirements ``pip3 install -r ./requirements.txt`` 57 | 2. Second run script as root ``sudo python3 PyCheats.py`` 58 | 59 | * **__Auto Installation__** 60 | 1. Simply run ``python3 PyCheats.py`` it will automatically install all requirements** 61 | 62 | Video Demonstration 63 | ---------------------------------------- 64 | [![VideoDemonstration](https://img.youtube.com/vi/XgKjv0k_8pQ/0.jpg)](https://www.youtube.com/watch?v=XgKjv0k_8pQ) 65 | 66 | Old Versions 67 | ---------------------------------------- 68 | **Old versions can be found in packages section** 69 | 70 | 71 | OutPut Sample 72 | ----------- 73 |
74 |

75 | 76 |

77 | 78 | ----- 79 | 80 | ## Simple User Documentation 81 | ### Requirements 82 | As a simple user, **you don't need to install** the required packages manually. 83 | These packages are automatically installed when you run the PyCheats tool. 84 | 85 | ### Using PyCheats 86 | To use `PyCheats` as a simple user, follow these steps: 87 | 1. Run the `PyCheats.py` script. This will start the PyCheats tool and display the 88 | controller menu. 89 | 2. Use the controller menu to perform various actions, including logo bypass, 90 | lobby bypass, and activating basic cheats. 91 | 3. Follow the on-screen instructions to interact with the `PyCheats tool`. 92 | 93 | ### Important Notes 94 | **Make sure to run the PyCheats** tool as a `superuser (root)` if required to access certain Android game memory. 95 | PyCheats may not work with all Android games and may require specific game package information. 96 | 97 | ### Version 98 | The current version of PyCheats support androidMemoryTool Version 0.6.3. 99 | Make sure to use this version when installing the tool. 100 | 101 | ----- 102 | ## Developer Documentation 103 | ### Requirements 104 | Before using PyCheats, make sure to install the required Python packages 105 | listed in the `requirements.txt` file. You can install these packages 106 | using the following command: 107 | ```shell 108 | pip install -r requirements.txt 109 | ``` 110 | 111 | ### Main File: PyCheats.py 112 | The `PyCheats.py` file is the main script that controls the PyCheats tool. 113 | It includes classes and methods for interacting with Android games, 114 | bypassing **anti-cheat systems**, and **activating cheats**. 115 | 116 | ### Installation and Usage 117 | To use PyCheats, follow these steps: 118 | 1. Create a Python virtual environment and install the required packages using the `requirements.txt` file. 119 | 2. Run the `PyCheats.py` script. This will start the PyCheats tool and display the controller menu. 120 | 3. Use the controller menu to perform various actions, including logo bypass, lobby bypass, and activating basic cheats. 121 | 122 | ### Classes and Methods 123 | The main classes and methods in `PyCheats.py` are as follows: 124 | * **_PyCheats_**: The main class that initializes the PyCheats tool and provides methods for various actions. 125 | * `__init__()`: Initialize the PyCheats object. 126 | * `__async__get_ticks()`: Asynchronously get information about the Android game and initialize instances. 127 | * `_initialize_instances()`: Initialize memory tool instances for various memory ranges and data types. 128 | * `logo_bypass()`: Perform a logo bypass to modify game values. 129 | * `lobby_bypass()`: Perform a lobby bypass to remove unnecessary files and modify game values. 130 | * `basic_cheats()`: Activate basic game cheats based on the specified cheat code. 131 | * `controller_menu()`: Display a controller menu to interact with the PyCheats tool. 132 | * `get_ticks()`: Start the PyCheats tool and enter the event loop to interact with the controller menu. 133 | 134 | > Configuration: Ensure that the `requirements.txt` file includes the necessary packages. 135 | You can specify the desired package versions in this file. 136 | 137 | ### Utility Classes 138 | `PyCheats` also includes utility classes for various tasks. 139 | These utility classes are used within the main script. 140 | 1. `RootUtils (root_utilities.py)`: 141 | This utility class handles root-related tasks and interactions with 142 | Android applications. It provides methods for checking if a game is running, 143 | acquiring root privileges, and removing files. 144 | * `is_game_running()`: Check if an Android game with the specified package name is currently running. 145 | * `is_rooted_acquired()`: Check if the script has acquired root privileges, and if not, attempt to acquire them. 146 | * `remove_file()`: Remove a file at the specified path if it exists. 147 | 148 | 2. `PPrints (pprints.py)`: 149 | This utility class is responsible for pretty-printing colored text messages in the terminal. 150 | It provides methods for displaying decorative headers and printing messages with different information 151 | types and text colors. 152 | * `decoration()`: Display a decorative header with the project name and author information. 153 | * `pprints()`: Pretty print a text message with optional formatting options. 154 | 155 | 3. `GameInformationHandler (gather_information.py)`: 156 | This class manages game information, allowing you to compare, retrieve, and update game package information. 157 | It is particularly useful for managing Android game package data. 158 | * `compare()`: Compare the current game package name with a stored one. 159 | * `get_data()`: Prompt the user to enter a game package name and store it in a JSON file. 160 | * `unpack_information()`: Retrieve the stored game package name. 161 | 162 | 4. `ReqInstaller (requirements_installer.py)`: 163 | This class manages the installation of required dependencies for the Python script. It checks for the availability 164 | of required packages and installs them if necessary. 165 | * `install_requirements()`: Installs required Python packages based on script's import availability 166 | and superuser status. 167 | 168 | 169 | 170 | # Contributor 171 | 172 | 173 | 174 | 175 | 176 | 177 | Assistance 178 | ---------- 179 | If you need assistance, you can ask for help on my mailing list: 180 | * Email : abdulmoez123456789@gmail.com 181 | 182 | I also created a Discord group: 183 | * Server : https://discord.gg/RMNcqzmt9f 184 | 185 | 186 | Buy Me a coffee 187 | -------------- 188 | If you want to support me you can buy me coffee. 189 | 190 | * Payoneer: ```abdulmoez123456789@gmail.com``` 191 | * BitCoin_addr: ``` 19vwfRXfthPY7f2aqDBpxQvZa6AJFKcdBS ``` 192 | 193 | -------------------------------------------------------------------------------- /process_info.json: -------------------------------------------------------------------------------- 1 | {"game_pkg": ""} -------------------------------------------------------------------------------- /readme_assets/output_sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anonym0usWork1221/Android-Py-Cheats-Script/723ca6b11de40d1031f210a12174b9c6b08e7b04/readme_assets/output_sample.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | androidMemoryTool==0.6.3 2 | art==6.1 3 | psutil==5.9.5 4 | -------------------------------------------------------------------------------- /utils/gather_information.py: -------------------------------------------------------------------------------- 1 | """ 2 | /* 3 | * Date : 2023/10/13 4 | * Version : 0.3 5 | * Author : Abdul Moez 6 | * Email : abdulmoez123456789@gmail.com 7 | * Affiliation : Undergraduate at Government College University (GCU) Lahore, Pakistan 8 | * GitHub : https://github.com/Anonym0usWork1221/android-memorytool 9 | * 10 | */ 11 | """ 12 | 13 | from utils.pprints import PPrints 14 | from json import loads, dump 15 | from os import path 16 | 17 | 18 | class GameInformationHandler(object): 19 | """ 20 | GameInformationHandler is a class for managing game information. 21 | This class allows you to compare, retrieve, and update game package information. 22 | It is particularly useful for managing Android game package data. 23 | Args: 24 | **kwargs: Additional keyword arguments for customization. 25 | Attributes: 26 | _pprints (PPrints): An instance of the PPrints class for pretty printing. 27 | Methods: 28 | compare() -> bool: 29 | Compare the current game package name with a stored one. 30 | get_data() -> None: 31 | Prompt the user to enter a game package name and store it in a JSON file. 32 | unpack_information() -> str: 33 | Retrieve the stored game package name. 34 | """ 35 | 36 | def __init__(self, **kwargs) -> None: 37 | super().__init__(**kwargs) 38 | self._pprints = PPrints() 39 | 40 | async def compare(self) -> bool: 41 | """ 42 | Compare the current game package name with a stored one. 43 | Returns: 44 | bool: True if the game package exists, False otherwise. 45 | """ 46 | 47 | if not path.isfile("process_info.json"): 48 | return False 49 | 50 | with open("process_info.json", 'r') as json_file: 51 | current_info = loads(json_file.read()) 52 | 53 | game_package_name = current_info["game_pkg"] 54 | 55 | if not game_package_name: 56 | return False 57 | 58 | elif path.exists(f"/storage/emulated/0/Android/data/{game_package_name}"): 59 | return True 60 | 61 | else: 62 | await self._pprints.pprints(text="Package not found. Please type it again or press Ctrl+C to exit.", 63 | info_type=3) 64 | return False 65 | 66 | async def get_data(self) -> None: 67 | """ 68 | Prompt the user to enter a game package name and store it in a JSON file. 69 | """ 70 | 71 | while not (await self.compare()): 72 | try: 73 | await self._pprints.pprints(text="Enter package name: ", info_type=4, no_end=True, off_info=True) 74 | pkg_name = input() 75 | print() 76 | process_info = {"game_pkg": pkg_name} 77 | dump(process_info, open("process_info.json", "w")) 78 | except KeyboardInterrupt: 79 | break 80 | 81 | async def upack_information(self) -> str: 82 | """ 83 | Retrieve the stored game package name. 84 | Returns: 85 | str: The stored game package name. 86 | """ 87 | 88 | await self.get_data() 89 | with open("process_info.json", 'r') as json_file: 90 | current_info = loads(json_file.read()) 91 | game_package_name = current_info["game_pkg"] 92 | 93 | return game_package_name 94 | -------------------------------------------------------------------------------- /utils/pprints.py: -------------------------------------------------------------------------------- 1 | """ 2 | /* 3 | * Date : 2023/10/13 4 | * Version : 0.3 5 | * Author : Abdul Moez 6 | * Email : abdulmoez123456789@gmail.com 7 | * Affiliation : Undergraduate at Government College University (GCU) Lahore, Pakistan 8 | * GitHub : https://github.com/Anonym0usWork1221/android-memorytool 9 | * 10 | */ 11 | """ 12 | 13 | from art import tprint 14 | import subprocess 15 | 16 | 17 | class Colors: 18 | """ 19 | This class defines various ANSI color codes for text formatting in the terminal. 20 | """ 21 | 22 | C_HEADER = '\033[95m' 23 | C_BLUE = '\033[94m' 24 | C_CYAN = '\033[96m' 25 | C_GREEN = '\033[92m' 26 | C_WARNING = '\033[93m' 27 | C_FAIL = '\033[91m' 28 | C_BOLD = '\033[1m' 29 | C_RESET = '\033[0m' 30 | 31 | 32 | class PPrints(object): 33 | """ 34 | PPrints is a utility class for pretty-printing colored text messages in the terminal. 35 | 36 | Attributes: 37 | _INFO_TAGS (dict): A dictionary that maps information types to their corresponding tags. 38 | _INFO_COLORS (dict): A dictionary that maps information types to their corresponding text colors. 39 | _RESET_COLOR (str): The ANSI color code to reset text color to default. 40 | 41 | Methods: 42 | __init__(self, **kwargs): Constructor method for PPrints class. 43 | decoration(self): Display a decorative header with the project name and author information. 44 | pprints(self, text: str, reset_text: bool = False, info_type: int = 1, no_end: bool = False, off_info: bool = False): 45 | Pretty print a text message with optional formatting options. 46 | Args: 47 | text (str): The message to be printed. 48 | reset_text (bool): If True, clears the screen and prints the message with the decorative header. 49 | info_type (int): The type of information (1 for INFO, 2 for WARNING, 3 for ERROR, 4 for NEED ATTENTION). 50 | no_end (bool): If True, the message will not end with a newline character. 51 | off_info (bool): If True, the info type tag is omitted from the printed message. 52 | """ 53 | 54 | _INFO_TAGS = { 55 | 1: "[INFO]", 56 | 2: "[WARNING]", 57 | 3: "[ERROR]", 58 | 4: "[NEED ATTENTION]", 59 | } 60 | 61 | _INFO_COLORS = { 62 | 1: Colors.C_GREEN, 63 | 2: Colors.C_WARNING, 64 | 3: Colors.C_FAIL, 65 | 4: Colors.C_BLUE 66 | } 67 | 68 | _RESET_COLOR = Colors.C_RESET 69 | 70 | def __init__(self, **kwargs) -> None: 71 | """ 72 | Constructor method for PPrints class. 73 | Args: 74 | **kwargs: Additional keyword arguments (not used in this implementation). 75 | """ 76 | 77 | super().__init__(**kwargs) 78 | 79 | async def decoration(self) -> None: 80 | """ 81 | Display a decorative header with the project name and author information. 82 | """ 83 | 84 | subprocess.call("clear") 85 | print(Colors.C_HEADER) 86 | tprint(text="PyCheats") 87 | print(f"{Colors.C_CYAN}{Colors.C_BOLD}\nBy github.com/Anonym0usWork1221\n{self._RESET_COLOR}") 88 | 89 | async def pprints(self, text: str, reset_text: bool = False, info_type: int = 1, no_end: bool = False, 90 | off_info: bool = False) -> None: 91 | """ 92 | Pretty print a text message with optional formatting options. 93 | 94 | Args: 95 | text (str): The message to be printed. 96 | reset_text (bool): If True, clears the screen and prints the message with the decorative header. 97 | info_type (int): The type of information (1 for INFO, 2 for WARNING, 3 for ERROR, 4 for NEED ATTENTION). 98 | no_end (bool): If True, the message will not end with a newline character. 99 | off_info (bool): If True, the info type tag is omitted from the printed message. 100 | """ 101 | 102 | info_tag = self._INFO_TAGS.get(info_type, "[UNK]") 103 | info_color = self._INFO_COLORS.get(info_type, Colors.C_CYAN) 104 | if not off_info: 105 | text_assembled = f"{info_color}{info_tag}-> {text}{self._RESET_COLOR}" 106 | else: 107 | text_assembled = f"{info_color}{text}{self._RESET_COLOR}" 108 | if reset_text: 109 | await self.decoration() 110 | print(text_assembled) 111 | elif no_end: 112 | print(text_assembled, end="") 113 | else: 114 | print(text_assembled) 115 | 116 | -------------------------------------------------------------------------------- /utils/requirements_intaller.py: -------------------------------------------------------------------------------- 1 | """ 2 | /* 3 | * Date : 2023/10/13 4 | * Version : 0.3 5 | * Author : Abdul Moez 6 | * Email : abdulmoez123456789@gmail.com 7 | * Affiliation : Undergraduate at Government College University (GCU) Lahore, Pakistan 8 | * GitHub : https://github.com/Anonym0usWork1221/android-memorytool 9 | * 10 | */ 11 | """ 12 | 13 | import os 14 | 15 | 16 | class ReqInstaller(object): 17 | """ 18 | ReqInstaller is a class for managing the installation of required dependencies for a Python script. 19 | Usage: 20 | - Create an instance of ReqInstaller. 21 | - Call the install_requirements method to ensure the required packages are installed. 22 | Attributes: 23 | None 24 | Methods: 25 | - install_requirements(): Installs required Python packages. 26 | If run as a superuser, it attempts to install packages globally. 27 | - _is_rooted_acquired(): Checks if the script is running with superuser privileges. 28 | Note: 29 | To use this class, you must have the 'androidMemoryTool' and 'art' Python packages available or installable. 30 | """ 31 | 32 | def __init__(self) -> None: 33 | """ 34 | Initialize a new instance of ReqInstaller. 35 | Args: 36 | None 37 | Returns: 38 | None 39 | """ 40 | ... 41 | 42 | @staticmethod 43 | def _is_rooted_acquired() -> bool: 44 | """ 45 | Check if the script is running with superuser (root) privileges. 46 | Args: 47 | None 48 | Returns: 49 | bool: True if running with superuser privileges, False otherwise. 50 | """ 51 | 52 | if os.getuid() != 0: 53 | return False 54 | return True 55 | 56 | def install_requirements(self) -> None: 57 | """ 58 | Install required Python packages based on script's import availability and superuser status. 59 | Args: 60 | None 61 | Returns: 62 | None 63 | Notes: 64 | - If 'androidMemoryTool' and 'art' are importable, no action is taken. 65 | - If not importable and the script is run with superuser privileges, it attempts to 66 | install the packages globally. 67 | - If not importable and the script is not run as superuser, it installs required packages locally. 68 | """ 69 | 70 | try: 71 | from androidMemoryTool import AndroidMemoryTool 72 | from art import tprint 73 | except ImportError: 74 | import subprocess 75 | import sys 76 | if self._is_rooted_acquired(): 77 | # Run Script without root to install requirements 78 | subprocess.call(['python3', *sys.argv]) 79 | sys.exit(0) 80 | else: 81 | print("[+] Installing requirements") 82 | os.system("pip3 install -r ./requirements.txt") 83 | subprocess.call(['sudo', 'python3', *sys.argv]) 84 | sys.exit(0) 85 | 86 | -------------------------------------------------------------------------------- /utils/root_utilities.py: -------------------------------------------------------------------------------- 1 | """ 2 | /* 3 | * Date : 2023/10/13 4 | * Version : 0.3 5 | * Author : Abdul Moez 6 | * Email : abdulmoez123456789@gmail.com 7 | * Affiliation : Undergraduate at Government College University (GCU) Lahore, Pakistan 8 | * GitHub : https://github.com/Anonym0usWork1221/android-memorytool 9 | * 10 | */ 11 | """ 12 | 13 | from androidMemoryTool import AndroidMemoryTool, PIDException 14 | from utils.pprints import PPrints 15 | from asyncio import sleep 16 | import subprocess 17 | import sys 18 | import os 19 | 20 | 21 | class RootUtils(object): 22 | """ 23 | A utility class for handling root-related tasks and interacting with Android applications. 24 | This class provides methods for checking if a game is running, acquiring root privileges, 25 | and removing files. 26 | Attributes: 27 | _pprints (PPrints): An instance of the PPrints class for pretty-printing messages. 28 | Methods: 29 | is_game_running(package_name: str) -> bool: 30 | Check if an Android game with the specified package name is currently running. 31 | Args: 32 | package_name (str): The package name of the Android game. 33 | Returns: 34 | bool: True if the game is running; False otherwise. 35 | is_rooted_acquired(): 36 | Check if the script has acquired root privileges, and if not, attempt to acquire them. 37 | If root privileges are not acquired, the script will be rebooted as root. 38 | remove_file(file_path: str): 39 | Remove a file at the specified path if it exists. 40 | Args: 41 | file_path (str): The path to the file to be removed. 42 | Note: 43 | This class assumes that the script is run on a system where root privileges can be acquired using 'sudo'. 44 | """ 45 | 46 | def __init__(self, **kwargs) -> None: 47 | """ 48 | Initialize a RootUtils instance. 49 | Args: 50 | **kwargs: Additional keyword arguments for future extensions. 51 | """ 52 | 53 | super().__init__(**kwargs) 54 | self._pprints = PPrints() 55 | 56 | @staticmethod 57 | async def is_game_running(package_name: str) -> bool: 58 | """ 59 | Check if an Android game with the specified package name is currently running. 60 | Args: 61 | package_name (str): The package name of the Android game. 62 | Returns: 63 | bool: True if the game is running; False otherwise. 64 | """ 65 | 66 | try: 67 | pid = AndroidMemoryTool(PKG=package_name).get_pid() 68 | except PIDException: 69 | return False 70 | 71 | if not pid: 72 | return False 73 | return True 74 | 75 | async def is_rooted_acquired(self) -> None: 76 | """ 77 | Check if the script has acquired root privileges, and if not, attempt to acquire them. 78 | If root privileges are not acquired, the script will be rebooted as root. 79 | """ 80 | 81 | if os.getuid() != 0: 82 | await self._pprints.pprints(text="Root Required", info_type=2) 83 | await self._pprints.pprints(text="Rebooting script as root", info_type=4) 84 | await sleep(2) 85 | subprocess.call(['sudo', 'python3', *sys.argv]) 86 | sys.exit(1) 87 | else: 88 | await self._pprints.pprints(text="Root Acquired") 89 | 90 | @staticmethod 91 | async def remove_file(file_path: str) -> None: 92 | """ 93 | Remove a file at the specified path if it exists. 94 | Args: 95 | file_path (str): The path to the file to be removed. 96 | """ 97 | try: 98 | os.remove(path=file_path) 99 | except FileNotFoundError: 100 | pass 101 | --------------------------------------------------------------------------------