Package: androidMemoryTool
AndroidMemoryToolAndroidMemoryTool: A Powerful Memory Reader and Writer Tool for Android, Linux, and Windows Operating SystemsAndroidMemoryTool is a sophisticated memory manipulation tool meticulously crafted for use on Android, Linux, and
Windows operating systems. This versatile tool is meticulously coded in Python, utilizing ctypes and struct datatypes,
ensuring efficiency comparable to C.Our commitment to excellence extends to our support system. If you encounter any bugs or non-functional features,
please do not hesitate to contact us. Your feedback is invaluable in our pursuit of continuous improvement.Date   : 2023/09/30Author :Abdul MoezVersion : 0.6.3 (Linux Pid Bug Fixed)Study  : UnderGraduate in GCU Lahore, PakistanRepository  :Main BranchDocumentation:AndroidMemoryToolExtensiveDocumentationGNU General Public LicenseCopyright (c) 2023 AbdulMoezNote1. This documentation is for 0.6 version (UPDATED)
2. You can find old version on pypi if you want to use them
3. For Linux and Android Users use 0.6.3 Build other wise you will get PID errorVersion 0.6.3-----------------------------------------MODIFICATION LOG--------------------------------------------------

1. Added Support for Windows OS (while maintaining compatibility with existing API calls).
2. Introduced a Robust Memory Profiler capable of threshold-based memory leak and churn detection using process IDs.
3. Customizability of the Memory Profiler has been enhanced (Please refer to the documentation for details).
4. Introduced several static methods, including:
  - get_developer
  - get_version_code
  - get_cpu_counts
  - get_platform
  - is_root_acquired
5. We are pleased to announce the addition of group search support with a new parameter, "is_grouped," 
   which can be set to True. This enhancement allows users to perform grouped searches effectively and efficiently. 
   By default, the value of the range is set to 512, aligning with the capabilities of Game Guardian.

6. We have recently introduced two new error classes to enhance the functionality of our memory tool: 
   WINAPIException and PIDException. These additions further bolster our product's robustness and error-handling 
   capabilities, ensuring a more seamless and reliable user experience.
7. We've meticulously updated and expanded our documentation to ensure that it's more informative, user-friendly, 
   and grammatically impeccable than ever before.
--------------------------------------------TO-DO LIST----------------------------------------------------

1. FIXME: Resolve the speed mode bug on Windows OS.
2. TODO: Implement Reverse Engineering Support for offline binaries using renowned disassemblers such as Capstone, 
         Keystone, and R2pipe.
3. TODO: Add Assembly support for runtime memory reading and writing.
4. TODO: Incorporate wildcard support in Windows API.
5. TODO: Expand the functionality with additional API handling methods.

----------------------------------------SUGGESTIONS-------------------------------------------------------

Your valuable suggestions are welcome through either direct messages or our Discord server.

-------------------------------------------NOTICE--------------------------------------------------------

This update has significantly increased the complexity of the Memory Tool, making it increasingly challenging for a 
single individual to manage its development. Therefore, we warmly welcome contributions from anyone interested in 
collaborating on its further enhancement.Supported PlatformsWindows Support (Started from 0.6 Version)Linux Support (Started From 0.2 Version)Android Support (Started From 0.1 Version)Supported ByteOrdersLittle-EndianBig-EndianTested PlatformsOur tool has been rigorously tested and proven to run seamlessly on the following platforms:Windows 11 (64-bit)Linux - Kali Linux (64-bit)Android - Xiaomi 11T (Termux, 64-bit, Android 13)Rest assured, our commitment to compatibility ensures a smooth and efficient user experience across these platforms.RequirementsPython 3.5+Android Requirements: Rooted Device RequiredLinux Requirements: Root access may be necessary on certain Linux platforms.Windows Requirements: Administrator permissions requiredDependenciesPip Dependencies (Automatically Installed in Requirements):psutilInstallationInstallation via Pip for Easy Integration into Your ProjectTo effortlessly incorporate the Android Memory Tool into your project, execute the following pip command:pip install androidMemoryTool==0.6.1Installation by Cloning the Repository and Running CommandsAlternatively, you can acquire the Android Memory Tool by cloning the GitHub repository and executing the
subsequent commands:git clonehttps://github.com/Anonym0usWork1221/android-memorytool/tree/maincd android-memorytoolpip install .Project live atPyPi-0.6.3Utilize our cutting-edge Memory Tool, replete with intricate examples, readily accessible within the designated folder.Access Android-Py-Cheats-Script @ 9d2520e.Video Demo - 0.6DocumentationGetting Process IDTo obtain the Process ID (PID) of a target process, you can use the following code snippet:fromandroidMemoryToolimportAndroidMemoryTool# Initialize the tool and set the speed_mode to off for Windows in this version only.tool=AndroidMemoryTool(PKG="ac_client")pid=tool.get_pid()print(pid)Getting Module BaseTo retrieve the base address of a specific module in the target process, you can use the following code snippet:fromandroidMemoryToolimportAndroidMemoryTooltool=AndroidMemoryTool(PKG="ac_client")base_addr=tool.get_module_base_address("client.so")print(base_addr)Searching and Reading Process MemoryTo search for a specific value in the process memory and read the results, use the following code:fromandroidMemoryToolimportAndroidMemoryTool,DataTypes,PMAP# Initialize the tool and set the speed_mode to off for Windows in this version only.tool=AndroidMemoryTool(PKG="Tutorial-x86_64.exe",SPEED_MODE=False,TYPE=DataTypes.DWORD,WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),pMAP=PMAP(ALL=True))# Search for a value in the entire memory.values=tool.read_value(100)founded_offsets=values[0]founded_values=values[1]print(founded_values)print(founded_offsets)Searching and Writing Process MemoryYou can search for a specific value in the process memory and replace it with a new value using the following code:fromandroidMemoryToolimportAndroidMemoryTool,DataTypes,PMAP# Initialize the tool and set the speed_mode to off for Windows in this version only.tool=AndroidMemoryTool(PKG="Tutorial-x86_64.exe",SPEED_MODE=False,TYPE=DataTypes.DWORD,WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),pMAP=PMAP(ALL=True))# Search for all values and replace them with a new value.values1=tool.read_write_value(100,10)print(values1)Reading Address ValueTo read the value at a specific memory address, use the following code:fromandroidMemoryToolimportAndroidMemoryTool,DataTypestool=AndroidMemoryTool(PKG="ac_client",TYPE=DataTypes.DWORD)base_addr=tool.get_module_base_address("client.so")values1=tool.read_lib(base_addr,'0xfff150d')print(values1)Writing Address ValueTo write a value to a specific memory address, use the following code:fromandroidMemoryToolimportAndroidMemoryTool,DataTypestool=AndroidMemoryTool(PKG="ac_client",TYPE=DataTypes.DWORD)base_addr=tool.get_module_base_address("client.so")values1=tool.write_lib(base_addr,'0xfff150d',58)print(values1)Raw Dump Process MemoryYou can dump the memory of a process using the following code:fromandroidMemoryToolimportAndroidMemoryTooltool=AndroidMemoryTool(PKG="ac_client")dump=tool.raw_dump(lib_name='client.so',path='./')print(dump)Address RefinerTo refine addresses based on a value, use the following code:fromandroidMemoryToolimportAndroidMemoryTool,DataTypes,PMAPtool=AndroidMemoryTool(PKG="Tutorial-x86_64.exe",SPEED_MODE=False,TYPE=DataTypes.DWORD,WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),pMAP=PMAP(ALL=True))values=tool.read_value(100)founded_offsets=values[0]refined_address=tool.refiner_address(list_address=founded_offsets,value_to_refine=50)print(refined_address)Finding Hex Patterns (Linux and Android only)To locate hex patterns in memory, use the following code (Linux and Android only):fromandroidMemoryToolimportAndroidMemoryTool,DataTypes,PMAPtool=AndroidMemoryTool(PKG="Tutorial-x86_64.exe",SPEED_MODE=False,TYPE=DataTypes.DWORD,WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),pMAP=PMAP(ALL=True))found_pattern=tool.find_hex_pattern("87 ?? 2B")forindexinrange(0,len(found_pattern[0])):print(f"{found_pattern[0][index]}:{found_pattern[2][index]}")print(f"Total Pattern found:{found_pattern[1]}")Finding and Replacing Hex Patterns (Linux and Android only)To find and replace hex patterns in memory, use the following code (Linux and Android only):fromandroidMemoryToolimportAndroidMemoryTool,DataTypes,PMAPtool=AndroidMemoryTool(PKG="Tutorial-x86_64.exe",SPEED_MODE=False,TYPE=DataTypes.DWORD,WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),pMAP=PMAP(ALL=True))found_pattern=tool.find_and_replace_hex_pattern("87 ?? 2B","87 1D 2B")forindexinrange(0,len(found_pattern[0])):print(f"{found_pattern[0][index]}:{found_pattern[2][index]}")print(f"Total Pattern found and replaced:{found_pattern[1]}")Dumping Memory MapsYou can dump the memory maps of a process using the following code:fromandroidMemoryToolimportAndroidMemoryTooltool=AndroidMemoryTool(PKG="ac_client")is_dumped=tool.dump_maps(path="./")print(is_dumped)Group SearchPerform a group search to read and modify multiple values at once in specific range:fromandroidMemoryToolimportAndroidMemoryTool,DataTypes,PMAPtool=AndroidMemoryTool(PKG="Tutorial-x86_64.exe",SPEED_MODE=False,TYPE=DataTypes.DWORD,WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=3),pMAP=PMAP(ALL=True))values=tool.read_value(read=[1000,100],is_grouped=True,range_val=510)forvalueinvalues[0]:tool.write_lib(value,'0x0',1000)print(f"Total Values Modified:{values[1]}")Prebuilt Memory ProfilerUtilize the prebuilt Memory Profiler to analyze memory usage:fromandroidMemoryToolimportAndroidMemoryTooltool=AndroidMemoryTool(PKG="Tutorial-x86_64.exe")memory_profiler=tool.get_memory_profiler()memory_profiler.start_profiling(logging=False)Static MethodsThe AndroidMemoryTool also provides static methods for various functionalities:fromandroidMemoryToolimportAndroidMemoryTool# Get the name of the developerprint(AndroidMemoryTool.get_developer())# Get the version code of the toolprint(AndroidMemoryTool.get_version_code())# Get the number of CPU cores available on your device (can specify a fraction)print(AndroidMemoryTool.get_cpu_counts())# Get the platform the script is running on (Linux, Android, Windows)print(AndroidMemoryTool.get_platform(verbose=True))# Check if the script is running on a rooted terminal or non-rootedprint(AndroidMemoryTool.is_root_acquired())Error Handling EnhancementsWe have introduced new error handling classes to enhance the robustness of our code.
These error handling classes will help you better manage and troubleshoot issues that may arise during the
execution of your code.PIDException:ThePIDExceptionis raised when there is an issue with connecting to the specified process.
This error message provides valuable information to help you diagnose and resolve the problem efficiently.try:fromandroidMemoryToolimportAndroidMemoryTool,PIDExceptiontool=AndroidMemoryTool(PKG="ac_client")exceptPIDExceptionase:print(f"An error occurred while trying to connect to the process:{e}")WINAPIException (Only occur on Windows):TheWINAPIExceptionis specific to Windows environments and is raised when an error occurs during a read operation.
This error message provides detailed information about the issue encountered during the reading process, making it
easier for you to pinpoint and rectify the problem.try:fromandroidMemoryToolimportAndroidMemoryTool,WINAPIExceptiontool=AndroidMemoryTool(PKG="ac_client")tool.read_value(read="some_wrong_value")exceptWINAPIExceptionase:print(f"An error occurred while reading a value:{e}")Android Memory Tool CLI DocumentationCLI Documentation Relocated: The CLI documentation has been relocated to the Documentation folder.
You can access it by visiting theAndroidMemoryToolCLIDOCSon GitHub.Custom Android Memory Profiling DocumentationYou can make custom Profiling tools by going toMemoryProfilerDOCSon GitHub.Comprehensive DocumentationFor in-depth and comprehensive documentation, please refer to the following link:Comprehensive DocumentationTroubleshooting ErrorsWindows ERROR ONSPEED_MODEAn issue has been identified on Windows systems related to the SPEED_MODE option,
which may result in the application getting stuck in a thread indefinitely. As a temporary solution,
we recommend disabling the SPEED_MODE for Windows.Some other known errors and their solutions can be foundhereSupported Data Types (For all Linux, Android and Windows)All data types are signed.RangeNameTypeBytes-2,147,483,648 to 2,147,483,647DWORDsigned int43.4E +/- 38 (7 digits)FLOATfloat41.7E +/- 308 (15 digits)DOUBLEdouble8-32,768 to 32,767WORDsigned short int2-128 to 127BYTEsigned char1-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807QWORDsigned long long8-2,147,483,648 to 2,147,483,647XORsigned long4RandomUTF_8char[]RandomRandomUTF_16LEchar[]RandomSupported Map Ranges (Linux and Android only)Script NameNameDescriptionALLWhole MemoryWhole Memory of current process (slow)C_ALLOCC++ allocRAM c++ Allocated memoryA_ANONYMOUSAnonymousRange with r-w access onlyCODE_APPCode Appshared libs memory (dangerous)JAVA_HEAPJava HeapJava heapC_HEAPC++ HeapHeap memory of cppC_DATAC++ .data.Data MemoryC_BSSC++ .bss.bss section memoryJ_JavaJavaJava memory sectionSTACKStackStack MemoryASHMEMAshmenAshmen MemoryV_videoVideoVideo memory rangeB_BadBadBad Memory (dangerous)CODE_SYSTEMCode systemCode system memory (dangerous)ContributorSupport and Contact InformationIf you require any assistance or have questions, please feel free to reach out to me through the following channels:Email:abdulmoez123456789@gmail.comI have also established a dedicated Discord group for more interactive communication:Discord Server:https://discord.gg/RMNcqzmt9fBuy Me a coffeeIf you'd like to show your support and appreciation for my work, you can buy me a coffee using the
following payment option:Payoneer:abdulmoez123456789@gmail.comYour support is greatly appreciated and helps me continue providing valuable assistance and resources.
Thank you for your consideration.