{"id":19808201,"url":"https://github.com/anonym0uswork1221/c-android-memory-tool","last_synced_at":"2025-05-01T07:32:14.384Z","repository":{"id":172026989,"uuid":"648732227","full_name":"Anonym0usWork1221/C-Android-Memory-Tool","owner":"Anonym0usWork1221","description":"Android Memory Access at Runtime: Reading and Writing Using Memory Files and Maps","archived":false,"fork":false,"pushed_at":"2023-09-22T10:07:06.000Z","size":44,"stargazers_count":68,"open_issues_count":1,"forks_count":24,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T11:11:15.528Z","etag":null,"topics":["android","android-library","cpp","game","game-cheat","game-cheats","game-engine-development","game-hacking","hacking-tool","memory","memory-allocation","memory-allocator","memory-hacking","memory-management","memory-tool"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anonym0usWork1221.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-02T17:07:02.000Z","updated_at":"2025-02-14T15:55:36.000Z","dependencies_parsed_at":"2023-09-23T05:42:35.304Z","dependency_job_id":"81555754-f02d-4e49-a326-c760fb6ab190","html_url":"https://github.com/Anonym0usWork1221/C-Android-Memory-Tool","commit_stats":null,"previous_names":["anonym0uswork1221/c-android-memory-tool"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anonym0usWork1221%2FC-Android-Memory-Tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anonym0usWork1221%2FC-Android-Memory-Tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anonym0usWork1221%2FC-Android-Memory-Tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anonym0usWork1221%2FC-Android-Memory-Tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anonym0usWork1221","download_url":"https://codeload.github.com/Anonym0usWork1221/C-Android-Memory-Tool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251840381,"owners_count":21652338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","cpp","game","game-cheat","game-cheats","game-engine-development","game-hacking","hacking-tool","memory","memory-allocation","memory-allocator","memory-hacking","memory-management","memory-tool"],"created_at":"2024-11-12T09:13:16.945Z","updated_at":"2025-05-01T07:32:14.152Z","avatar_url":"https://github.com/Anonym0usWork1221.png","language":"C++","readme":"C-Android-Memory-Tool\n====\n[![GitHub stars](https://img.shields.io/github/stars/Anonym0usWork1221/C-Android-Memory-Tool.svg)](https://github.com/Anonym0usWork1221/C-Android-Memory-Tool/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/Anonym0usWork1221/C-Android-Memory-Tool.svg)](https://github.com/Anonym0usWork1221/C-Android-Memory-Tool/network/members)\n[![GitHub issues](https://img.shields.io/github/issues/Anonym0usWork1221/C-Android-Memory-Tool.svg)](https://github.com/Anonym0usWork1221/C-Android-Memory-Tool/issues)\n[![GitHub watchers](https://img.shields.io/github/watchers/Anonym0usWork1221/C-Android-Memory-Tool.svg)](https://github.com/Anonym0usWork1221/C-Android-Memory-Tool/watchers)\n[![Python](https://img.shields.io/badge/language-cpp-blue.svg)](https://www.python.org)\n[![GPT_LICENSE](https://img.shields.io/badge/license-MIT-red.svg)](https://opensource.org/licenses/)\n![code size](https://img.shields.io/github/languages/code-size/Anonym0usWork1221/C-Android-Memory-Tool)\n\n-----------\n\nThe MemoryTool is a C++ tool that provides functionality for reading and writing memory in a target process. It allows you to search for specific values in memory, modify memory addresses, freeze and unfreeze memory values, and perform various system-related operations. This documentation provides an overview of the tool's functionality, along with code snippets to demonstrate how to use each feature.\n\n# Introduction\nI don't know who initially wrote this memory tool. I have put in a lot of effort to correct non-working functions, fix errors, optimize the code, add proper documentation, and implement proper object-oriented programming structures to ensure the smooth running of the script. I have also added new functions.\n\nPlease note that this tool only works for rooted devices as the non-rooted (virtual environment) functionality has not been implemented yet.\n\nIf you encounter any non-working functions, please open an issue and report it.\n\n*  Date   : 2023/06/02\n*  Author : **__Abdul Moez__**\n*  Version : 0.1 (Bug Fixed version)\n*  Study  : UnderGraduate in GCU Lahore, Pakistan\n*  Repository  : https://github.com/Anonym0usWork1221/C-Android-Memory-Tool\n*  Documentation: Starts From Below\n\n# Samples\n``main.cpp`` is the sample file to run the MemoryTool\n### main.cpp File Explanation\nThe sample code provided demonstrates the usage of the memory tool. Let's go through it step by step:\n\n```cpp\n#include \u003ciostream\u003e\n#include \"MemoryTools.h\"\n\nint main(int arc, char argv[]) {\n\t/* 1. Package Name of the game\n\t2. ROOT_MODE (tells you are using rooted device (not reooted device not implimented yet))\n\t*/\n\tchar game_package[] = \"com.tencent.ig\";\n\tMemoryTool memory_tool;\n\tmemory_tool.initXMemoryTools(game_package, MODE_ROOT);\n```\n\nThe code includes necessary headers and initializes the memory tool by calling initXMemoryTools(). It takes two parameters: the process name (in this case, \"com.tencent.ig\") and the mode (\"MODE_ROOT\" for rooted devices).\n\n```cpp\n   memory_tool.SetSearchRange(ALL);\n```\nThe SetSearchRange() function sets the search range for memory operations. In this case, it is set to \"ALL,\" which means searching in all memory ranges.\n\n```cpp\n   memory_tool.MemorySearch(\"1\", TYPE_BYTE);\n```\nThe MemorySearch() function is used to search for a specific value in memory. In this example, it searches for the value \"1\" of type TYPE_BYTE.\n\n```cpp\n    memory_tool.MemoryOffset(\"2\", 2, /*offset*/ TYPE_BYTE);\n```\nThe MemoryOffset() function is used to search for a specific value at an offset from a base address. It searches for the value \"2\" of type TYPE_BYTE with an offset of 2.\n\n```cpp\n    memory_tool.MemoryWrite(\"0\", 2, /*offset*/ TYPE_BYTE);\n```\nThe MemoryWrite() function is used to write a value to a specific memory address. In this example, it writes the value \"0\" of type TYPE_BYTE with an offset of 2.\n\n```cpp\n    memory_tool.ClearResults();\n```\nThe ClearResults() function clears the linked list of results and frees up memory.\n```cpp\n    return 0;\n}\n```\nThe program ends and returns 0.\n\n----\n# Start of Memory Tool Documentation\n\n## Table of Contents\n1. Data Structures\n2. Initialization\n3. Reading Memory\n4. Searching Memory\n5. Writing Memory\n6. Freezing Memory\n7. System Operations\n8. Utility Functions\n\n## 1. Data Structures\nThe MemoryTool tool uses the following data structures:\n\n### MAPS\n```cpp\nstruct MAPS {\n    long int addr;\n    long int taddr;\n    int type;\n    struct MAPS *next;\n};\n```\n\n* addr: The memory address.\n* taddr: The target address.\n* type: The type of memory.\n* next: Pointer to the next MAPS structure.\n\n### RESULT\n```cpp\nstruct RESULT {\n    long int addr;\n    struct RESULT *next;\n};\n```\n\n* addr: The memory address.\n* next: Pointer to the next RESULT structure.\n\n### FREEZE\n```cpp\nstruct FREEZE {\n    long int addr; // address\n    char *value; // value\n    int type; // type\n    struct FREEZE *next; // pointer to the next node\n};\n```\n\n* addr: The memory address.\n* value: The value at the memory address.\n* type: The type of memory.\n* next: Pointer to the next FREEZE structure.\n\n## 2. Initialization\nTo use the MemoryTool, you need to create an instance of the MemoryTool class. Here's how to initialize the tool:\n\n```cpp \nMemoryTool memTool;\n```\n\n## 3. Reading Memory\nThe MemoryTool provides functions to read memory from the target process. The following functions are available:\n\n### Read Maps File\n```cpp\nPMAPS readmaps(int pid);\n```  \n* pid: The process ID of the target process.\n* Returns a linked list of MAPS structures containing information about the memory mappings in the target process.\n\n### Read All Memory Maps\n```cpp\nPMAPS readmaps_all();\n```\n* Returns a linked list of MAPS structures for all memory mappings in the target process.\n\n### Read Specific Memory Maps\n```cpp\nPMAPS readmaps_bad();\nPMAPS readmaps_c_alloc();\nPMAPS readmaps_c_bss();\nPMAPS readmaps_c_data();\nPMAPS readmaps_c_heap();\nPMAPS readmaps_java_heap();\nPMAPS readmaps_a_anonmyous();\nPMAPS readmaps_code_system();\nPMAPS readmaps_stack();\nPMAPS readmaps_ashmem();\n```\n\n* Returns a linked list of MAPS structures for specific memory mappings in the target process. Each function corresponds to a specific memory range or type.\n\n## 4. Searching Memory\nThe MemoryTool allows you to search for specific values in the memory of the target process. You can search for values within a specific range or across the entire memory. The following functions are available for memory search:\n\n### Base Address Search\n```cpp\nvoid BaseAddressSearch(char* value, int type, long int address);\n```\n* value: The value to search for.\n* type: The type of memory to search for (see type enum for options).\n* address: The base address to start the search from.\n\n### Range Memory Search\n```cpp\nvoid RangeMemorySearch(char* value, char* range, int type);\n```\n* value: The value to search for.\n* range: The memory range to search in (see Range enum for options).\n* type: The type of memory to search for (see type enum for options).\n\n### Memory Search\n```cpp\nvoid MemorySearch(char* value, int type);\n```\n* value: The value to search for.\n* type: The type of memory to search for (see type enum for options).\n\n### Memory Offset Search\n```cpp\nvoid MemoryOffset(char* value, long int offset, int type);\n```\n\n* value: The value to search for.\n* offset: The offset from the base address to search.\n* type: The type of memory to search for (see type enum for options).\n\n### Range Memory Offset Search\n```cpp \nvoid RangeMemoryOffset(char* value, char* range, long int offset, int type);\n```\n* value: The value to search for.\n* range: The memory range to search in (see Range enum for options).\n* offset: The offset from the base address to search.\n* type: The type of memory to search for (see type enum for options).\n\n## 5. Writing Memory\nThe MemoryTool allows you to write values to memory addresses in the target process. The following functions are available for memory write:\n\n### Memory Write\n```cpp\nvoid MemoryWrite(char* value, long int address, int type);\n```\n* value: The value to write to memory.\n* address: The memory address to write the value to.\n* type: The type of memory to write to (see type enum for options).\n### Write Address\n```cpp\nint WriteAddress(long int address, char* value, int type);\n```\n* address: The memory address to write the value to.\n* value: The value to write to memory.\n* type: The type of memory to write to (see type enum for options).\n* Returns 1 if the write operation is successful, 0 otherwise.\n\n## 6. Freezing Memory\nThe MemoryTool allows you to freeze and unfreeze memory values in the target process. The freezing feature allows you to keep a memory value constant while the target process is running. The following functions are available for freezing memory:\n\n### Start Freezing\n```cpp\nint StartFreeze();\n```\n* Starts the freezing process.\n\n### Stop Freezing\n```cpp\nint StopFreeze();\n```\n* Stops the freezing process.\n\n### Set Freeze Delay\n```cpp\nint SetFreezeDelay(long int delay);\n```\n\n* delay: The delay in microseconds between each freeze operation.\n* Sets the delay between each freeze operation.\n\n### Add Freeze Item\n```cpp\nint AddFreezeItem(long int address, char* value, int type, long int offset = 0);\n```\n* address: The memory address to freeze.\n* value: The value to freeze.\n* type: The type of memory to freeze (see type enum for options).\n* offset: The offset from the base address to freeze (optional, default is 0).\n* Adds a memory address and its frozen value to the freeze list.\n\n### Remove Freeze Item\n```cpp\nint RemoveFreezeItem(long int address);\n```\n* address: The memory address to remove from the freeze list.\n* Removes a memory address from the freeze list.\n\n### Remove All Freeze Items\n```cpp\nint RemoveFreezeItem_All();\n```\n* Removes all memory addresses from the freeze list.\n\n### Print Freeze Items\n```cpp \nint PrintFreezeItems();\n```\n* Prints the current freeze list.\n\n## 7. Getting Memory Values\nThe MemoryTool allows you to retrieve the values from memory addresses in the target process. The following functions are available for getting memory values:\n\n### Get Address Value\n```cpp\nchar* GetAddressValue(ADDRESS address, int type);\n```\n\n* address: The memory address to retrieve the value from.\n* type: The type of memory value to retrieve (see type enum for options).\n* Returns a character pointer containing the retrieved memory value.\n### Get Address Value DWORD\n```cpp\nDWORD GetAddressValue_DWORD(ADDRESS address);\n```\n* address: The memory address to retrieve the DWORD value from.\n* Returns the retrieved DWORD value.\n\n### Get Address Value FLOAT\n```cpp\nFLOAT GetAddressValue_FLOAT(ADDRESS address);\n```\n\n* address: The memory address to retrieve the FLOAT value from.\n* Returns the retrieved FLOAT value.\n\n### Get Address Value DOUBLE\n```cpp\nDOUBLE GetAddressValue_DOUBLE(ADDRESS address);\n```\n* address: The memory address to retrieve the DOUBLE value from.\n* Returns the retrieved DOUBLE value.\n\n### Get Address Value WORD\n```cpp\nWORD GetAddressValue_WORD(ADDRESS address);\n```\n* address: The memory address to retrieve the WORD value from.\n* Returns the retrieved WORD value.\n\n### Get Address Value BYTE\n```cpp\nBYTE GetAddressValue_BYTE(ADDRESS address);\n```\n* address: The memory address to retrieve the BYTE value from.\n* Returns the retrieved BYTE value.\n\n### Get Address Value QWORD\n```cpp\nQWORD GetAddressValue_QWORD(ADDRESS address);\n```\n* address: The memory address to retrieve the QWORD value from.\n* Returns the retrieved QWORD value.\n\n## 8. Miscellaneous Functions\nThe MemoryTool provides additional miscellaneous functions for interacting with the target process:\n\n### Get Result Count\n```cpp\nint GetResultCount();\n```\n* Returns the number of search results found.\n\n### Print Results\n```cpp\nvoid PrintResults();\n```\n* Prints the contents of the search results.\n\n### Clear Results\n```cpp\nvoid ClearResults();\n```\n* Clears the search results and frees up memory.\n\n### Clear Maps\n```cpp\nvoid ClearMaps(PMAPS maps);\n```\n* maps: The pointer to the maps data structure to be cleared.\n* Clears the maps data structure and frees up memory.\n\n### Get Results\n```cpp\nPMAPS GetResults();\n```\n\n* Returns the pointer to the head of the search results.\n\n### Get PID\n```cpp\nint getPID(char package[64]);\n```\n\n* package: The package name of the target process.\n* Returns the process ID (PID) of the target process.\n### Get Process State\n```cpp\nchar GetProcessState(char* package);\n```\n* package: The package name of the target process.\n* Returns the state of the target process.\n### isapkinstalled\n```cpp\nint isapkinstalled(char* package);\n```\n* package: The package name of the app.\n* Checks if the specified app is installed.\n\n### isapkrunning\n```cpp\nint isapkrunning(char* package);\n```\n* package: The package name of the app.\n* Checks if the specified app is running.\n\n### killprocess\n```cpp\nint killprocess(char* package);\n```\n* package: The package name of the process to kill.\n* Kills the specified process.\n\n\n# Contributor\n\n\u003ca href = \"https://github.com/Anonym0usWork1221/android-memorytool/graphs/contributors\"\u003e\n  \u003cimg src = \"https://contrib.rocks/image?repo=Anonym0usWork1221/C-Android-Memory-Tool\"/\u003e\n\u003c/a\u003e\n\n\nAssistance\n----------\nIf you need assistance, you can ask for help on my mailing list:\n\n* Email      : abdulmoez123456789@gmail.com\n\nI also created a Discord group:\n\n* Server     : https://discord.gg/RMNcqzmt9f\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonym0uswork1221%2Fc-android-memory-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanonym0uswork1221%2Fc-android-memory-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonym0uswork1221%2Fc-android-memory-tool/lists"}