androidMemoryTool


NameandroidMemoryTool JSON
Version 0.6.3 PyPI version JSON
download
home_pagehttps://github.com/Anonym0usWork1221/android-memorytool
SummaryProficiently Managing Runtime RAM Memory for Windows, Android, and Linux Platforms
upload_time2023-10-06 14:34:45
maintainer
docs_urlNone
authorAbdul Moez
requires_python>=3.6
licenseGPL-3.0 license
keywords ps top kill free lsof netstat nice tty ionice uptime taskmgr process df iotop iostat ifconfig taskset who pidof pmap smem pstree monitoring ulimit prlimit smem performance metrics agent observability memory profiler memory tool memory leak detection cross-platform memory analysis windows memory profiling linux memory monitoring android memory analyzer memory performance metrics memory optimization software development tool memory management memory churn analysis memory profiling library memory debugging resource monitoring performance metrics memory analysis software cross-platform development memory efficiency memory improvement
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            AndroidMemoryTool
====
![PyPI - Version](https://img.shields.io/pypi/v/androidMemoryTool?label=pypi%20package)
![PyPI - Downloads](https://img.shields.io/pypi/dm/androidMemoryTool)
[![GitHub stars](https://img.shields.io/github/stars/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/network/members)
[![GitHub issues](https://img.shields.io/github/issues/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/issues)
[![GitHub watchers](https://img.shields.io/github/watchers/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/watchers)
[![Python](https://img.shields.io/badge/language-Python%203-blue.svg)](https://www.python.org)
[![GPT_LICENSE](https://img.shields.io/badge/license-GPL-red.svg)](https://opensource.org/licenses/)
![code size](https://img.shields.io/github/languages/code-size/Anonym0usWork1221/android-memorytool)


<br>
<br>
<p align="center">
  <img src="https://raw.githubusercontent.com/Anonym0usWork1221/android-memorytool/main/assets/android_memory_tool.jpg"  title="Android Memory Tool" width="500px">
</p>

-----------

__*AndroidMemoryTool*__: A Powerful Memory Reader and Writer Tool for Android, Linux, and Windows Operating Systems

AndroidMemoryTool 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/30
 *  Author : **__Abdul Moez__**
 *  Version : 0.6.3 (Linux Pid Bug Fixed)
 *  Study  : UnderGraduate in GCU Lahore, Pakistan
 *  Repository  : [Main Branch](https://github.com/Anonym0usWork1221/android-memorytool)
 *  Documentation: [AndroidMemoryToolExtensiveDocumentation](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation)


 GNU General Public License  
 Copyright (c) 2023 AbdulMoez

-----------

# Note
    1. 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 error

-----------

# Version 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 Platforms
-----------
* Windows Support (Started from 0.6 Version)
* Linux Support (Started From 0.2 Version)
* Android Support (Started From 0.1 Version)

-----------
Supported ByteOrders
-----------
* Little-Endian
* Big-Endian

-----------
Tested Platforms
-----------
> Our 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.

-----------
Requirements
-----------

* Python 3.5+
* Android Requirements: Rooted Device Required
* Linux Requirements: Root access may be necessary on certain Linux platforms.
* Windows Requirements: Administrator permissions required


-----------
Dependencies
-----------
* Pip Dependencies (Automatically Installed in Requirements): `psutil`

-----------
Installation
----------------------------------------
1. **Installation via Pip for Easy Integration into Your Project**  
    To effortlessly incorporate the Android Memory Tool into your project, execute the following pip command:  
    > pip install androidMemoryTool==0.6.1

2. **Installation by Cloning the Repository and Running Commands**  
    Alternatively, you can acquire the Android Memory Tool by cloning the GitHub repository and executing the 
    subsequent commands:
   > git clone https://github.com/Anonym0usWork1221/android-memorytool/tree/main   
    cd android-memorytool  
    pip install .

3. **Project live at**  
    [PyPi-0.6.3](https://pypi.org/project/androidMemoryTool/0.6.3/)


Utilize our cutting-edge Memory Tool, replete with intricate examples, readily accessible within the designated folder.
[Access Android-Py-Cheats-Script @ 9d2520e](https://github.com/Anonym0usWork1221/Android-Py-Cheats-Script/tree/014497b78538930082109e8dd3da123e7f75197e).

-----------
Video Demo - 0.6
-----------
[![Video Demo](https://img.youtube.com/vi/5jV1haoEyWQ/0.jpg)](https://www.youtube.com/watch?v=5jV1haoEyWQ)

-----------

## Documentation  

* **Getting Process ID**  
To obtain the Process ID (PID) of a target process, you can use the following code snippet:

```py
from androidMemoryTool import AndroidMemoryTool
# 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 Base**  
To retrieve the base address of a specific module in the target process, you can use the following code snippet:

```py
from androidMemoryTool import AndroidMemoryTool

tool = AndroidMemoryTool(PKG="ac_client")
base_addr = tool.get_module_base_address("client.so")
print(base_addr)
```

* **Searching and Reading Process Memory**  
To search for a specific value in the process memory and read the results, use the following code:

```py
from androidMemoryTool import AndroidMemoryTool, 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 Memory**  
You can search for a specific value in the process memory and replace it with a new value using the following code:

```py
from androidMemoryTool import AndroidMemoryTool, 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 Value**  
To read the value at a specific memory address, use the following code:

```py
from androidMemoryTool import AndroidMemoryTool, DataTypes

tool = 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 Value**  
To write a value to a specific memory address, use the following code:

```py
from androidMemoryTool import AndroidMemoryTool, DataTypes

tool = 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 Memory**  
You can dump the memory of a process using the following code:

```py
from androidMemoryTool import AndroidMemoryTool

tool = AndroidMemoryTool(PKG="ac_client")
dump = tool.raw_dump(lib_name='client.so', path='./')
print(dump)
```

* **Address Refiner**  
To refine addresses based on a value, use the following code:

```py
from androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP

tool = 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):

```python
from androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP

tool = 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")
for index in range(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):

```python
from androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP

tool = 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")
for index in range(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 Maps**  
You can dump the memory maps of a process using the following code:

```python
from androidMemoryTool import AndroidMemoryTool

tool = AndroidMemoryTool(PKG="ac_client")
is_dumped = tool.dump_maps(path="./")
print(is_dumped)
```

* **Group Search**  
Perform a group search to read and modify multiple values at once in specific range:

```python
from androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP

tool = 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)
for value in values[0]:
    tool.write_lib(value, '0x0', 1000)
print(f"Total Values Modified: {values[1]}")
```

* **Prebuilt Memory Profiler**  
Utilize the prebuilt Memory Profiler to analyze memory usage:

```python
from androidMemoryTool import AndroidMemoryTool

tool = AndroidMemoryTool(PKG="Tutorial-x86_64.exe")
memory_profiler = tool.get_memory_profiler()
memory_profiler.start_profiling(logging=False)
```

* **Static Methods**  
The AndroidMemoryTool also provides static methods for various functionalities:

```python
from androidMemoryTool import AndroidMemoryTool

# Get the name of the developer
print(AndroidMemoryTool.get_developer())

# Get the version code of the tool
print(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-rooted
print(AndroidMemoryTool.is_root_acquired())
```

-----------
## Error Handling Enhancements
> We 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**:  
The `PIDException` is 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.  

```python
try:
    from androidMemoryTool import AndroidMemoryTool, PIDException
    tool = AndroidMemoryTool(PKG="ac_client")
except PIDException as e:
    print(f"An error occurred while trying to connect to the process: {e}")
```

*  **WINAPIException (Only occur on Windows)**:  
The `WINAPIException` is 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.

```python
try:
    from androidMemoryTool import AndroidMemoryTool, WINAPIException
    tool = AndroidMemoryTool(PKG="ac_client")
    tool.read_value(read="some_wrong_value")
except WINAPIException as e:
    print(f"An error occurred while reading a value: {e}")

```

-----------
## Android Memory Tool CLI Documentation
> CLI Documentation Relocated: The CLI documentation has been relocated to the Documentation folder. 
> You can access it by visiting the [AndroidMemoryToolCLIDOCS](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation) on GitHub.

-----------
## Custom Android Memory Profiling Documentation
> You can make custom Profiling tools by going to [MemoryProfilerDOCS](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation) on GitHub.

-----------
# Comprehensive Documentation
> For in-depth and comprehensive documentation, please refer to the following link:
 [Comprehensive Documentation](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation)
-----------

# Troubleshooting Errors
* **Windows ERROR ON `SPEED_MODE`**  
An 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 found [here](https://github.com/Anonym0usWork1221/android-memorytool/blob/main/ERRORS.md)   

-----------

Supported Data Types (For all Linux, Android and Windows)
-------------------

All data types are signed.

| **Range**                                               | **Name** | **Type**         | **Bytes** |
|---------------------------------------------------------|----------|------------------|-----------|
| -2,147,483,648 to 2,147,483,647                         | DWORD    | signed int       | 4         |
| 3.4E +/- 38 (7 digits)                                  | FLOAT    | float            | 4         |
| 1.7E +/- 308 (15 digits)                                | DOUBLE   | double           | 8         |
| -32,768 to 32,767                                       | WORD     | signed short int | 2         |
| -128 to 127                                             | BYTE     | signed char      | 1         |
| -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | QWORD    | signed long long | 8         |
| -2,147,483,648 to 2,147,483,647                         | XOR      | signed long      | 4         |
| Random                                                  | UTF_8    | char[]           | Random    |
| Random                                                  | UTF_16LE | char[]           | Random    |



Supported Map Ranges (Linux and Android only)
--------------------
| **Script Name** | **Name**     | **Description**                        |
|-----------------|--------------|----------------------------------------|
| ALL             | Whole Memory | Whole Memory of current process (slow) |
| C_ALLOC         | C++ alloc    | RAM c++ Allocated memory               |
| A_ANONYMOUS     | Anonymous    | Range with r-w access only             |
| CODE_APP        | Code App     | shared libs memory (dangerous)         |
| JAVA_HEAP       | Java Heap    | Java heap                              |
| C_HEAP          | C++ Heap     | Heap memory of cpp                     |
| C_DATA          | C++ .data    | .Data Memory                           |
| C_BSS           | C++ .bss     | .bss section memory                    |
| J_Java          | Java         | Java memory section                    |
| STACK           | Stack        | Stack Memory                           |
| ASHMEM          | Ashmen       | Ashmen Memory                          |
| V_video         | Video        | Video memory range                     |
| B_Bad           | Bad          | Bad Memory (dangerous)                 |
| CODE_SYSTEM     | Code system  | Code system memory (dangerous)         |

-----------

# Contributor

<a href = "https://github.com/Anonym0usWork1221/android-memorytool/graphs/contributors">
  <img src = "https://contrib.rocks/image?repo=Anonym0usWork1221/android-memorytool"/>
</a>

-----------
Support and Contact Information
----------
> If you require any assistance or have questions, please feel free to reach out to me through the following channels:  
* **Email**: `abdulmoez123456789@gmail.com`

> I have also established a dedicated Discord group for more interactive communication:  
* **Discord Server**: `https://discord.gg/RMNcqzmt9f`


-----------

Buy Me a coffee
--------------
__If 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.com`

> Your support is greatly appreciated and helps me continue providing valuable assistance and resources. 
Thank you for your consideration.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Anonym0usWork1221/android-memorytool",
    "name": "androidMemoryTool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "ps,top,kill,free,lsof,netstat,nice,tty,ionice,uptime,taskmgr,process,df,iotop,iostat,ifconfig,taskset,who,pidof,pmap,smem,pstree,monitoring,ulimit,prlimit,smem,performance,metrics,agent,observability,Memory Profiler,Memory Tool,Memory Leak Detection,Cross-Platform Memory Analysis,Windows Memory Profiling,Linux Memory Monitoring,Android Memory Analyzer,Memory Performance Metrics,Memory Optimization,Software Development Tool,Memory Management,Memory Churn Analysis,Memory Profiling Library,Memory Debugging,Resource Monitoring,Performance Metrics,Memory Analysis Software,Cross-Platform Development,Memory Efficiency,Memory Improvement",
    "author": "Abdul Moez",
    "author_email": "abdulmoez123456789@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b4/c5/4b71d7f77f481a2fc993897fa064bee37ea403e8e7578c5243b9f5360372/androidMemoryTool-0.6.3.tar.gz",
    "platform": null,
    "description": "AndroidMemoryTool\r\n====\r\n![PyPI - Version](https://img.shields.io/pypi/v/androidMemoryTool?label=pypi%20package)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/androidMemoryTool)\r\n[![GitHub stars](https://img.shields.io/github/stars/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/stargazers)\r\n[![GitHub forks](https://img.shields.io/github/forks/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/network/members)\r\n[![GitHub issues](https://img.shields.io/github/issues/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/issues)\r\n[![GitHub watchers](https://img.shields.io/github/watchers/Anonym0usWork1221/android-memorytool.svg)](https://github.com/Anonym0usWork1221/android-memorytool/watchers)\r\n[![Python](https://img.shields.io/badge/language-Python%203-blue.svg)](https://www.python.org)\r\n[![GPT_LICENSE](https://img.shields.io/badge/license-GPL-red.svg)](https://opensource.org/licenses/)\r\n![code size](https://img.shields.io/github/languages/code-size/Anonym0usWork1221/android-memorytool)\r\n\r\n\r\n<br>\r\n<br>\r\n<p align=\"center\">\r\n  <img src=\"https://raw.githubusercontent.com/Anonym0usWork1221/android-memorytool/main/assets/android_memory_tool.jpg\"  title=\"Android Memory Tool\" width=\"500px\">\r\n</p>\r\n\r\n-----------\r\n\r\n__*AndroidMemoryTool*__: A Powerful Memory Reader and Writer Tool for Android, Linux, and Windows Operating Systems\r\n\r\nAndroidMemoryTool is a sophisticated memory manipulation tool meticulously crafted for use on Android, Linux, and \r\nWindows operating systems. This versatile tool is meticulously coded in Python, utilizing ctypes and struct datatypes, \r\nensuring efficiency comparable to C.\r\n\r\nOur commitment to excellence extends to our support system. If you encounter any bugs or non-functional features, \r\nplease do not hesitate to contact us. Your feedback is invaluable in our pursuit of continuous improvement.\r\n\r\n *  Date   : 2023/09/30\r\n *  Author : **__Abdul Moez__**\r\n *  Version : 0.6.3 (Linux Pid Bug Fixed)\r\n *  Study  : UnderGraduate in GCU Lahore, Pakistan\r\n *  Repository  : [Main Branch](https://github.com/Anonym0usWork1221/android-memorytool)\r\n *  Documentation: [AndroidMemoryToolExtensiveDocumentation](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation)\r\n\r\n\r\n GNU General Public License  \r\n Copyright (c) 2023 AbdulMoez\r\n\r\n-----------\r\n\r\n# Note\r\n    1. This documentation is for 0.6 version (UPDATED)\r\n    2. You can find old version on pypi if you want to use them\r\n    3. For Linux and Android Users use 0.6.3 Build other wise you will get PID error\r\n\r\n-----------\r\n\r\n# Version 0.6.3\r\n\r\n````\r\n-----------------------------------------MODIFICATION LOG--------------------------------------------------\r\n\r\n1. Added Support for Windows OS (while maintaining compatibility with existing API calls).\r\n2. Introduced a Robust Memory Profiler capable of threshold-based memory leak and churn detection using process IDs.\r\n3. Customizability of the Memory Profiler has been enhanced (Please refer to the documentation for details).\r\n4. Introduced several static methods, including:\r\n  - get_developer\r\n  - get_version_code\r\n  - get_cpu_counts\r\n  - get_platform\r\n  - is_root_acquired\r\n5. We are pleased to announce the addition of group search support with a new parameter, \"is_grouped,\" \r\n   which can be set to True. This enhancement allows users to perform grouped searches effectively and efficiently. \r\n   By default, the value of the range is set to 512, aligning with the capabilities of Game Guardian.\r\n\r\n6. We have recently introduced two new error classes to enhance the functionality of our memory tool: \r\n   WINAPIException and PIDException. These additions further bolster our product's robustness and error-handling \r\n   capabilities, ensuring a more seamless and reliable user experience.\r\n7. We've meticulously updated and expanded our documentation to ensure that it's more informative, user-friendly, \r\n   and grammatically impeccable than ever before.\r\n--------------------------------------------TO-DO LIST----------------------------------------------------\r\n\r\n1. FIXME: Resolve the speed mode bug on Windows OS.\r\n2. TODO: Implement Reverse Engineering Support for offline binaries using renowned disassemblers such as Capstone, \r\n         Keystone, and R2pipe.\r\n3. TODO: Add Assembly support for runtime memory reading and writing.\r\n4. TODO: Incorporate wildcard support in Windows API.\r\n5. TODO: Expand the functionality with additional API handling methods.\r\n\r\n----------------------------------------SUGGESTIONS-------------------------------------------------------\r\n\r\nYour valuable suggestions are welcome through either direct messages or our Discord server.\r\n\r\n-------------------------------------------NOTICE--------------------------------------------------------\r\n\r\nThis update has significantly increased the complexity of the Memory Tool, making it increasingly challenging for a \r\nsingle individual to manage its development. Therefore, we warmly welcome contributions from anyone interested in \r\ncollaborating on its further enhancement.\r\n````\r\n\r\n\r\n-----------\r\nSupported Platforms\r\n-----------\r\n* Windows Support (Started from 0.6 Version)\r\n* Linux Support (Started From 0.2 Version)\r\n* Android Support (Started From 0.1 Version)\r\n\r\n-----------\r\nSupported ByteOrders\r\n-----------\r\n* Little-Endian\r\n* Big-Endian\r\n\r\n-----------\r\nTested Platforms\r\n-----------\r\n> Our tool has been rigorously tested and proven to run seamlessly on the following platforms:\r\n\r\n* Windows 11 (64-bit)\r\n* Linux - Kali Linux (64-bit)\r\n* Android - Xiaomi 11T (Termux, 64-bit, Android 13)\r\n\r\n> Rest assured, our commitment to compatibility ensures a smooth and efficient user experience across these platforms.\r\n\r\n-----------\r\nRequirements\r\n-----------\r\n\r\n* Python 3.5+\r\n* Android Requirements: Rooted Device Required\r\n* Linux Requirements: Root access may be necessary on certain Linux platforms.\r\n* Windows Requirements: Administrator permissions required\r\n\r\n\r\n-----------\r\nDependencies\r\n-----------\r\n* Pip Dependencies (Automatically Installed in Requirements): `psutil`\r\n\r\n-----------\r\nInstallation\r\n----------------------------------------\r\n1. **Installation via Pip for Easy Integration into Your Project**  \r\n    To effortlessly incorporate the Android Memory Tool into your project, execute the following pip command:  \r\n    > pip install androidMemoryTool==0.6.1\r\n\r\n2. **Installation by Cloning the Repository and Running Commands**  \r\n    Alternatively, you can acquire the Android Memory Tool by cloning the GitHub repository and executing the \r\n    subsequent commands:\r\n   > git clone https://github.com/Anonym0usWork1221/android-memorytool/tree/main   \r\n    cd android-memorytool  \r\n    pip install .\r\n\r\n3. **Project live at**  \r\n    [PyPi-0.6.3](https://pypi.org/project/androidMemoryTool/0.6.3/)\r\n\r\n\r\nUtilize our cutting-edge Memory Tool, replete with intricate examples, readily accessible within the designated folder.\r\n[Access Android-Py-Cheats-Script @ 9d2520e](https://github.com/Anonym0usWork1221/Android-Py-Cheats-Script/tree/014497b78538930082109e8dd3da123e7f75197e).\r\n\r\n-----------\r\nVideo Demo - 0.6\r\n-----------\r\n[![Video Demo](https://img.youtube.com/vi/5jV1haoEyWQ/0.jpg)](https://www.youtube.com/watch?v=5jV1haoEyWQ)\r\n\r\n-----------\r\n\r\n## Documentation  \r\n\r\n* **Getting Process ID**  \r\nTo obtain the Process ID (PID) of a target process, you can use the following code snippet:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool\r\n# Initialize the tool and set the speed_mode to off for Windows in this version only.\r\ntool = AndroidMemoryTool(PKG=\"ac_client\")\r\npid = tool.get_pid()\r\nprint(pid)\r\n```\r\n* **Getting Module Base**  \r\nTo retrieve the base address of a specific module in the target process, you can use the following code snippet:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool\r\n\r\ntool = AndroidMemoryTool(PKG=\"ac_client\")\r\nbase_addr = tool.get_module_base_address(\"client.so\")\r\nprint(base_addr)\r\n```\r\n\r\n* **Searching and Reading Process Memory**  \r\nTo search for a specific value in the process memory and read the results, use the following code:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP\r\n\r\n# Initialize the tool and set the speed_mode to off for Windows in this version only.\r\ntool = AndroidMemoryTool(PKG=\"Tutorial-x86_64.exe\",\r\n                         SPEED_MODE=False,\r\n                         TYPE=DataTypes.DWORD,\r\n                         WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),\r\n                         pMAP=PMAP(ALL=True)\r\n                         )\r\n# Search for a value in the entire memory.\r\nvalues = tool.read_value(100)\r\nfounded_offsets = values[0]\r\nfounded_values = values[1]\r\nprint(founded_values)\r\nprint(founded_offsets)\r\n```\r\n\r\n* **Searching and Writing Process Memory**  \r\nYou can search for a specific value in the process memory and replace it with a new value using the following code:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP\r\n\r\n# Initialize the tool and set the speed_mode to off for Windows in this version only.\r\ntool = AndroidMemoryTool(PKG=\"Tutorial-x86_64.exe\",\r\n                         SPEED_MODE=False,\r\n                         TYPE=DataTypes.DWORD,\r\n                         WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),\r\n                         pMAP=PMAP(ALL=True)\r\n                         )\r\n# Search for all values and replace them with a new value.\r\nvalues1 = tool.read_write_value(100, 10)\r\nprint(values1)\r\n```\r\n\r\n* **Reading Address Value**  \r\nTo read the value at a specific memory address, use the following code:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes\r\n\r\ntool = AndroidMemoryTool(PKG=\"ac_client\",\r\n                         TYPE=DataTypes.DWORD\r\n                         )\r\nbase_addr = tool.get_module_base_address(\"client.so\")\r\nvalues1 = tool.read_lib(base_addr, '0xfff150d')\r\nprint(values1)\r\n\r\n```\r\n\r\n* **Writing Address Value**  \r\nTo write a value to a specific memory address, use the following code:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes\r\n\r\ntool = AndroidMemoryTool(PKG=\"ac_client\", TYPE=DataTypes.DWORD)\r\nbase_addr = tool.get_module_base_address(\"client.so\")\r\nvalues1 = tool.write_lib(base_addr, '0xfff150d', 58)\r\nprint(values1)\r\n```\r\n\r\n* **Raw Dump Process Memory**  \r\nYou can dump the memory of a process using the following code:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool\r\n\r\ntool = AndroidMemoryTool(PKG=\"ac_client\")\r\ndump = tool.raw_dump(lib_name='client.so', path='./')\r\nprint(dump)\r\n```\r\n\r\n* **Address Refiner**  \r\nTo refine addresses based on a value, use the following code:\r\n\r\n```py\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP\r\n\r\ntool = AndroidMemoryTool(PKG=\"Tutorial-x86_64.exe\",\r\n                         SPEED_MODE=False,\r\n                         TYPE=DataTypes.DWORD,\r\n                         WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),\r\n                         pMAP=PMAP(ALL=True)\r\n                         )\r\nvalues = tool.read_value(100)\r\nfounded_offsets = values[0]\r\nrefined_address = tool.refiner_address(list_address=founded_offsets, value_to_refine=50)\r\nprint(refined_address)\r\n\r\n```\r\n\r\n* **Finding Hex Patterns (Linux and Android only)**   \r\nTo locate hex patterns in memory, use the following code (Linux and Android only):\r\n\r\n```python\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP\r\n\r\ntool = AndroidMemoryTool(PKG=\"Tutorial-x86_64.exe\",\r\n                         SPEED_MODE=False,\r\n                         TYPE=DataTypes.DWORD,\r\n                         WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),\r\n                         pMAP=PMAP(ALL=True)\r\n                         )\r\nfound_pattern = tool.find_hex_pattern(\"87 ?? 2B\")\r\nfor index in range(0, len(found_pattern[0])):\r\n    print(f\"{found_pattern[0][index]}: {found_pattern[2][index]}\")\r\nprint(f\"Total Pattern found: {found_pattern[1]}\")\r\n\r\n```\r\n\r\n* **Finding and Replacing Hex Patterns (Linux and Android only)**  \r\nTo find and replace hex patterns in memory, use the following code (Linux and Android only):\r\n\r\n```python\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP\r\n\r\ntool = AndroidMemoryTool(PKG=\"Tutorial-x86_64.exe\",\r\n                         SPEED_MODE=False,\r\n                         TYPE=DataTypes.DWORD,\r\n                         WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=2),\r\n                         pMAP=PMAP(ALL=True)\r\n                         )\r\nfound_pattern = tool.find_and_replace_hex_pattern(\"87 ?? 2B\", \"87 1D 2B\")\r\nfor index in range(0, len(found_pattern[0])):\r\n    print(f\"{found_pattern[0][index]}: {found_pattern[2][index]}\")\r\nprint(f\"Total Pattern found and replaced: {found_pattern[1]}\")\r\n```\r\n\r\n* **Dumping Memory Maps**  \r\nYou can dump the memory maps of a process using the following code:\r\n\r\n```python\r\nfrom androidMemoryTool import AndroidMemoryTool\r\n\r\ntool = AndroidMemoryTool(PKG=\"ac_client\")\r\nis_dumped = tool.dump_maps(path=\"./\")\r\nprint(is_dumped)\r\n```\r\n\r\n* **Group Search**  \r\nPerform a group search to read and modify multiple values at once in specific range:\r\n\r\n```python\r\nfrom androidMemoryTool import AndroidMemoryTool, DataTypes, PMAP\r\n\r\ntool = AndroidMemoryTool(PKG=\"Tutorial-x86_64.exe\",\r\n                         SPEED_MODE=False,\r\n                         TYPE=DataTypes.DWORD,\r\n                         WORKERS=AndroidMemoryTool.get_cpu_counts(fraction=3),\r\n                         pMAP=PMAP(ALL=True)\r\n                         )\r\nvalues = tool.read_value(read=[1000, 100], is_grouped=True, range_val=510)\r\nfor value in values[0]:\r\n    tool.write_lib(value, '0x0', 1000)\r\nprint(f\"Total Values Modified: {values[1]}\")\r\n```\r\n\r\n* **Prebuilt Memory Profiler**  \r\nUtilize the prebuilt Memory Profiler to analyze memory usage:\r\n\r\n```python\r\nfrom androidMemoryTool import AndroidMemoryTool\r\n\r\ntool = AndroidMemoryTool(PKG=\"Tutorial-x86_64.exe\")\r\nmemory_profiler = tool.get_memory_profiler()\r\nmemory_profiler.start_profiling(logging=False)\r\n```\r\n\r\n* **Static Methods**  \r\nThe AndroidMemoryTool also provides static methods for various functionalities:\r\n\r\n```python\r\nfrom androidMemoryTool import AndroidMemoryTool\r\n\r\n# Get the name of the developer\r\nprint(AndroidMemoryTool.get_developer())\r\n\r\n# Get the version code of the tool\r\nprint(AndroidMemoryTool.get_version_code())\r\n\r\n# Get the number of CPU cores available on your device (can specify a fraction)\r\nprint(AndroidMemoryTool.get_cpu_counts())\r\n\r\n# Get the platform the script is running on (Linux, Android, Windows)\r\nprint(AndroidMemoryTool.get_platform(verbose=True))\r\n\r\n# Check if the script is running on a rooted terminal or non-rooted\r\nprint(AndroidMemoryTool.is_root_acquired())\r\n```\r\n\r\n-----------\r\n## Error Handling Enhancements\r\n> We have introduced new error handling classes to enhance the robustness of our code. \r\n> These error handling classes will help you better manage and troubleshoot issues that may arise during the \r\n> execution of your code.\r\n\r\n*  **PIDException**:  \r\nThe `PIDException` is raised when there is an issue with connecting to the specified process. \r\nThis error message provides valuable information to help you diagnose and resolve the problem efficiently.  \r\n\r\n```python\r\ntry:\r\n    from androidMemoryTool import AndroidMemoryTool, PIDException\r\n    tool = AndroidMemoryTool(PKG=\"ac_client\")\r\nexcept PIDException as e:\r\n    print(f\"An error occurred while trying to connect to the process: {e}\")\r\n```\r\n\r\n*  **WINAPIException (Only occur on Windows)**:  \r\nThe `WINAPIException` is specific to Windows environments and is raised when an error occurs during a read operation. \r\nThis error message provides detailed information about the issue encountered during the reading process, making it \r\neasier for you to pinpoint and rectify the problem.\r\n\r\n```python\r\ntry:\r\n    from androidMemoryTool import AndroidMemoryTool, WINAPIException\r\n    tool = AndroidMemoryTool(PKG=\"ac_client\")\r\n    tool.read_value(read=\"some_wrong_value\")\r\nexcept WINAPIException as e:\r\n    print(f\"An error occurred while reading a value: {e}\")\r\n\r\n```\r\n\r\n-----------\r\n## Android Memory Tool CLI Documentation\r\n> CLI Documentation Relocated: The CLI documentation has been relocated to the Documentation folder. \r\n> You can access it by visiting the [AndroidMemoryToolCLIDOCS](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation) on GitHub.\r\n\r\n-----------\r\n## Custom Android Memory Profiling Documentation\r\n> You can make custom Profiling tools by going to [MemoryProfilerDOCS](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation) on GitHub.\r\n\r\n-----------\r\n# Comprehensive Documentation\r\n> For in-depth and comprehensive documentation, please refer to the following link:\r\n [Comprehensive Documentation](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation)\r\n-----------\r\n\r\n# Troubleshooting Errors\r\n* **Windows ERROR ON `SPEED_MODE`**  \r\nAn issue has been identified on Windows systems related to the SPEED_MODE option, \r\nwhich may result in the application getting stuck in a thread indefinitely. As a temporary solution, \r\nwe recommend disabling the SPEED_MODE for Windows.\r\n\r\n> Some other known errors and their solutions can be found [here](https://github.com/Anonym0usWork1221/android-memorytool/blob/main/ERRORS.md)   \r\n\r\n-----------\r\n\r\nSupported Data Types (For all Linux, Android and Windows)\r\n-------------------\r\n\r\nAll data types are signed.\r\n\r\n| **Range**                                               | **Name** | **Type**         | **Bytes** |\r\n|---------------------------------------------------------|----------|------------------|-----------|\r\n| -2,147,483,648 to 2,147,483,647                         | DWORD    | signed int       | 4         |\r\n| 3.4E +/- 38 (7 digits)                                  | FLOAT    | float            | 4         |\r\n| 1.7E +/- 308 (15 digits)                                | DOUBLE   | double           | 8         |\r\n| -32,768 to 32,767                                       | WORD     | signed short int | 2         |\r\n| -128 to 127                                             | BYTE     | signed char      | 1         |\r\n| -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | QWORD    | signed long long | 8         |\r\n| -2,147,483,648 to 2,147,483,647                         | XOR      | signed long      | 4         |\r\n| Random                                                  | UTF_8    | char[]           | Random    |\r\n| Random                                                  | UTF_16LE | char[]           | Random    |\r\n\r\n\r\n\r\nSupported Map Ranges (Linux and Android only)\r\n--------------------\r\n| **Script Name** | **Name**     | **Description**                        |\r\n|-----------------|--------------|----------------------------------------|\r\n| ALL             | Whole Memory | Whole Memory of current process (slow) |\r\n| C_ALLOC         | C++ alloc    | RAM c++ Allocated memory               |\r\n| A_ANONYMOUS     | Anonymous    | Range with r-w access only             |\r\n| CODE_APP        | Code App     | shared libs memory (dangerous)         |\r\n| JAVA_HEAP       | Java Heap    | Java heap                              |\r\n| C_HEAP          | C++ Heap     | Heap memory of cpp                     |\r\n| C_DATA          | C++ .data    | .Data Memory                           |\r\n| C_BSS           | C++ .bss     | .bss section memory                    |\r\n| J_Java          | Java         | Java memory section                    |\r\n| STACK           | Stack        | Stack Memory                           |\r\n| ASHMEM          | Ashmen       | Ashmen Memory                          |\r\n| V_video         | Video        | Video memory range                     |\r\n| B_Bad           | Bad          | Bad Memory (dangerous)                 |\r\n| CODE_SYSTEM     | Code system  | Code system memory (dangerous)         |\r\n\r\n-----------\r\n\r\n# Contributor\r\n\r\n<a href = \"https://github.com/Anonym0usWork1221/android-memorytool/graphs/contributors\">\r\n  <img src = \"https://contrib.rocks/image?repo=Anonym0usWork1221/android-memorytool\"/>\r\n</a>\r\n\r\n-----------\r\nSupport and Contact Information\r\n----------\r\n> If you require any assistance or have questions, please feel free to reach out to me through the following channels:  \r\n* **Email**: `abdulmoez123456789@gmail.com`\r\n\r\n> I have also established a dedicated Discord group for more interactive communication:  \r\n* **Discord Server**: `https://discord.gg/RMNcqzmt9f`\r\n\r\n\r\n-----------\r\n\r\nBuy Me a coffee\r\n--------------\r\n__If you'd like to show your support and appreciation for my work, you can buy me a coffee using the \r\nfollowing payment option:__\r\n\r\n**Payoneer**: `abdulmoez123456789@gmail.com`\r\n\r\n> Your support is greatly appreciated and helps me continue providing valuable assistance and resources. \r\nThank you for your consideration.\r\n\r\n",
    "bugtrack_url": null,
    "license": "GPL-3.0 license",
    "summary": "Proficiently Managing Runtime RAM Memory for Windows, Android, and Linux Platforms",
    "version": "0.6.3",
    "project_urls": {
        "Homepage": "https://github.com/Anonym0usWork1221/android-memorytool"
    },
    "split_keywords": [
        "ps",
        "top",
        "kill",
        "free",
        "lsof",
        "netstat",
        "nice",
        "tty",
        "ionice",
        "uptime",
        "taskmgr",
        "process",
        "df",
        "iotop",
        "iostat",
        "ifconfig",
        "taskset",
        "who",
        "pidof",
        "pmap",
        "smem",
        "pstree",
        "monitoring",
        "ulimit",
        "prlimit",
        "smem",
        "performance",
        "metrics",
        "agent",
        "observability",
        "memory profiler",
        "memory tool",
        "memory leak detection",
        "cross-platform memory analysis",
        "windows memory profiling",
        "linux memory monitoring",
        "android memory analyzer",
        "memory performance metrics",
        "memory optimization",
        "software development tool",
        "memory management",
        "memory churn analysis",
        "memory profiling library",
        "memory debugging",
        "resource monitoring",
        "performance metrics",
        "memory analysis software",
        "cross-platform development",
        "memory efficiency",
        "memory improvement"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "700e9eec9f517064aa11d8ed594feec061dc1e5f21f30f847b7253cdd3c71df1",
                "md5": "a00aaa7c18d1363045e2b8cef9773080",
                "sha256": "4012f222771032d2bff66f1cd0b6a97cb09dc5a734168baee43d95d76b63660d"
            },
            "downloads": -1,
            "filename": "androidMemoryTool-0.6.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a00aaa7c18d1363045e2b8cef9773080",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 80262,
            "upload_time": "2023-10-06T14:34:42",
            "upload_time_iso_8601": "2023-10-06T14:34:42.591028Z",
            "url": "https://files.pythonhosted.org/packages/70/0e/9eec9f517064aa11d8ed594feec061dc1e5f21f30f847b7253cdd3c71df1/androidMemoryTool-0.6.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4c54b71d7f77f481a2fc993897fa064bee37ea403e8e7578c5243b9f5360372",
                "md5": "3a1862c0009e876f4d4567bc20ad589a",
                "sha256": "59714a71084350d7e8c17f3b93b26f72a9eed0bb32038f0d574d47f09875e030"
            },
            "downloads": -1,
            "filename": "androidMemoryTool-0.6.3.tar.gz",
            "has_sig": false,
            "md5_digest": "3a1862c0009e876f4d4567bc20ad589a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 62475,
            "upload_time": "2023-10-06T14:34:45",
            "upload_time_iso_8601": "2023-10-06T14:34:45.035021Z",
            "url": "https://files.pythonhosted.org/packages/b4/c5/4b71d7f77f481a2fc993897fa064bee37ea403e8e7578c5243b9f5360372/androidMemoryTool-0.6.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-06 14:34:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Anonym0usWork1221",
    "github_project": "android-memorytool",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "androidmemorytool"
}
        
Elapsed time: 2.28393s