Skip to content

Commit d044037

Browse files
Update 0.4
1 parent 9cc20b5 commit d044037

File tree

12 files changed

+642
-313
lines changed

12 files changed

+642
-313
lines changed

README.md

Lines changed: 159 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -10,204 +10,216 @@ AndroidMemoryTool
1010
-----------
1111

1212

13-
AndroidMemoryTool is a memory reader and writer tool designed for android and linux os's
13+
**_AndroidMemoryTool_** is a memory reader and writer tool designed for android and linux os's
1414
.This Tool is written in python using ctypes not affective as c.
1515
If you find any bug or not working function you can contact me.
1616

17-
* date : 2022/03/23
18-
* author : **__Abdul Moez__**
19-
* Version : 0.3
17+
* Date : 2022/03/23
18+
* Author : **__Abdul Moez__**
19+
* Version : 0.4
2020
* Study : UnderGraduate in GCU Lahore, Pakistan
21-
* repo : https://github.com/Anonym0usWork1221/android-memorytool
22-
23-
GNU General Public License
21+
* Repository : https://github.com/Anonym0usWork1221/android-memorytool
22+
* Documentation: https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation
23+
24+
25+
GNU General Public License
2426

2527
Copyright (c) 2022 AbdulMoez
2628

2729
# Note
28-
1. This documentation is only for 0.3 version
29-
2. You can find old version on pypi if you want to use it
30-
3. This version is totally different from old
31-
32-
# Version 0.3
33-
1. Removed complexity to use tool
34-
2. Implemented Oop Structures
35-
3. Added new data types for libs direct read/write
36-
4. Added raw dump support
37-
5. Fixed the bugs
38-
6. Fixed Search and Reading returnig offset issues
39-
7. Added Refiners inorder to check the changed in old values
30+
1. This documentation is for 0.4 version (UPDATED)
31+
2. You can find old version on pypi if you want to use them
32+
33+
# Version 0.4
34+
-> Optimized the code
35+
-> Increase Stability
36+
-> Fixed Known bugs:
37+
-> Fixed Simple Text search returning same values as previous search problem
38+
-> Fixed Increasing Values/address problem in Fast search algorithms
39+
-> Fixed output pattern in raw dump
4040

41+
-> Added Reset function for queue
42+
-> Added Hex Pattern Finder 87 ?? BB
43+
-> Added Hex search for (Float, Dword, Double)
44+
-> Added support for fork() process (by default takes first pid as parent)
45+
-> Added Manually PID entering support either in int or string (pid=714 or pid="714")
46+
-> Can raw dump from Custom start_address-end_address ("4754D6E6-5754D6E6" or "client.so")
47+
-> Added Known error files and its fixes in (ERRORS.md) file
48+
-> Added Support to dump map file
49+
-> Added UTF-8 and UTF-16E support for lib read/write
50+
-> Added a Detailed Documentation File
51+
-> Added Documentation string stub in AndroidMemoryTool class
4152

42-
Requirments
53+
54+
55+
Requirements
4356
-----------
4457

4558
* Python 3.x
4659

47-
* Android Requirments -> Rooted Device Needed
60+
* Android Requirements -> Rooted Device Needed
4861

4962
Installation
5063
----------------------------------------
51-
Simply install it by pip and use it in your project
52-
pip install androidMemoryTool==0.3
64+
1. **Simply install it by pip and use it in your project**
65+
``pip install androidMemoryTool==0.4``
5366

54-
Or by cloning and then run command
55-
pip install .
67+
2. **Or by cloning and then run command**
68+
``pip install .``
5669

57-
Project live at
58-
https://pypi.org/project/androidMemoryTool/0.3/
70+
3. **Project live at**
71+
https://pypi.org/project/androidMemoryTool/0.4/
5972

6073

61-
Memory Tool with example which can be found in the `Android-Py-Cheats-Script @ 9d2520e` sub folder.
74+
Memory Tool with example which can be found in the
75+
`Android-Py-Cheats-Script @ 9d2520e`.
6276

6377
## Documentation
6478

6579
* Getting Process ID
6680

67-
```py
68-
from androidMemoryTool import AndroidMemoryTool
69-
tool = AndroidMemoryTool.get_pid('ac_client') # for android use package name e.g(com.app.org)
70-
print(tool)
71-
72-
```
81+
```py
82+
from androidMemoryTool import AndroidMemoryTool
83+
tool = AndroidMemoryTool.get_pid('ac_client') # for android use package name e.g(com.app.org)
84+
print(tool)
85+
```
7386
* Getting Module Base
7487

75-
```py
76-
from androidMemoryTool import AndroidMemoryTool
77-
pid = AndroidMemoryTool.get_pid('ac_client')
78-
base_addr = AndroidMemoryTool.get_module_base_address(pid, "client.so")
79-
print(base_addr)
80-
81-
```
88+
```py
89+
from androidMemoryTool import AndroidMemoryTool
90+
pid = AndroidMemoryTool.get_pid('ac_client')
91+
base_addr = AndroidMemoryTool.get_module_base_address(pid, "client.so")
92+
print(base_addr)
93+
```
8294

8395
* Searching and Read process memory
8496

85-
```py
86-
from androidMemoryTool import AndroidMemoryTool
97+
```py
98+
from androidMemoryTool import AndroidMemoryTool
8799

88-
# initialize tool
89-
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD, SPEED_MODE=False, WORKERS=55,
90-
pMAP=AndroidMemoryTool.PMAP(ALL=True))
91-
values = tool.read_value(100)
92-
founded_offsets = values[0]
93-
founded_values = values[1]
94-
print(founded_values)
95-
print(founded_offsets)
96-
```
100+
# initialize tool
101+
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD, SPEED_MODE=False, WORKERS=55,
102+
pMAP=AndroidMemoryTool.PMAP(ALL=True))
103+
values = tool.read_value(100)
104+
founded_offsets = values[0]
105+
founded_values = values[1]
106+
print(founded_values)
107+
print(founded_offsets)
108+
```
97109

98110
* Search and Write process memory
99111

100-
```py
101-
from androidMemoryTool import AndroidMemoryTool
112+
```py
113+
from androidMemoryTool import AndroidMemoryTool
102114

103-
# initialize tool
104-
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD, SPEED_MODE=False, WORKERS=55,
105-
pMAP=AndroidMemoryTool.PMAP(ALL=True))
115+
# initialize tool
116+
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD, SPEED_MODE=False, WORKERS=55,
117+
pMAP=AndroidMemoryTool.PMAP(ALL=True))
106118

107-
values1 = tool.read_write_value(100, 10)
108-
print(values1)
109-
```
119+
values1 = tool.read_write_value(100, 10)
120+
print(values1)
121+
```
110122

111123
* Read address value
112-
```py
113-
from androidMemoryTool import AndroidMemoryTool
114-
pid = AndroidMemoryTool.get_pid('ac_client')
115-
base_addr = AndroidMemoryTool.get_module_base_address(pid, "client.so")
116-
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD)
117-
values1 = tool.read_lib(base_addr, 0xfff150d)
118-
print(values1)
119-
120-
```
124+
```py
125+
from androidMemoryTool import AndroidMemoryTool
126+
pid = AndroidMemoryTool.get_pid('ac_client')
127+
base_addr = AndroidMemoryTool.get_module_base_address(pid, "client.so")
128+
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD)
129+
values1 = tool.read_lib(base_addr, 0xfff150d)
130+
print(values1)
131+
```
121132

122133
* Write address value
123-
```py
124-
from androidMemoryTool import AndroidMemoryTool
125-
pid = AndroidMemoryTool.get_pid('ac_client')
126-
base_addr = AndroidMemoryTool.get_module_base_address(pid, "client.so")
127-
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD)
128-
values1 = tool.write_lib(base_addr, 0xfff150d, 58)
129-
print(values1)
130-
131-
```
134+
```py
135+
from androidMemoryTool import AndroidMemoryTool
136+
pid = AndroidMemoryTool.get_pid('ac_client')
137+
base_addr = AndroidMemoryTool.get_module_base_address(pid, "client.so")
138+
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD)
139+
values1 = tool.write_lib(base_addr, 0xfff150d, 58)
140+
print(values1)
141+
```
132142

133143
* Raw Dump Process memory
134-
```py
135-
from androidMemoryTool import AndroidMemoryTool
136-
tool = AndroidMemoryTool(PKG="ac_client")
137-
dump = tool.raw_dump(lib_name='client.so', path='/home/kali/Documents/')
138-
print(dump) # True or False
139-
140-
```
144+
```py
145+
from androidMemoryTool import AndroidMemoryTool
146+
tool = AndroidMemoryTool(PKG="ac_client")
147+
dump = tool.raw_dump(lib_name='client.so', path='/home/kali/Documents/')
148+
print(dump) # True or False
149+
```
141150

142151
* Address Refiner
143-
```py
144-
from androidMemoryTool import AndroidMemoryTool
145-
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD, SPEED_MODE=False, WORKERS=55,
152+
```py
153+
from androidMemoryTool import AndroidMemoryTool
154+
tool = AndroidMemoryTool(PKG="ac_client", TYPE=AndroidMemoryTool.DataTypes.DWORD, SPEED_MODE=False, WORKERS=55,
155+
pMAP=AndroidMemoryTool.PMAP(ALL=True))
156+
values = tool.read_value(100)
157+
founded_offsets = values[0]
158+
refined_address = tool.refiner_address(list_address=founded_offsets, value_to_refine=50)
159+
print(refined_address)
160+
```
161+
162+
* Find Hex Pattern
163+
```python
164+
from androidMemoryTool import AndroidMemoryTool
165+
tool = AndroidMemoryTool(PKG=662, SPEED_MODE=True, WORKERS=55,
146166
pMAP=AndroidMemoryTool.PMAP(ALL=True))
147-
values = tool.read_value(100)
148-
founded_offsets = values[0]
149-
refined_address = tool.refiner_address(list_address=founded_offsets, value_to_refine=50)
150-
print(refined_address)
151-
152-
```
153-
154-
155-
# Video Demonstration
156-
[![usage](https://img.youtube.com/vi/vebE1Rf1ogo/0.jpg)](https://www.youtube.com/watch?v=vebE1Rf1ogo)
157-
158-
159-
Supported Data Types For read/write 0.3
167+
found_pattern = tool.find_hex_pattern("87 ?? 2B")
168+
for index in range(0, len(found_pattern[0])):
169+
print(f"{found_pattern[0][index]}: {found_pattern[2][index]}")
170+
print(f"Total Pattern found: {found_pattern[1]}")
171+
```
172+
* Dump Maps
173+
```python
174+
from androidMemoryTool import AndroidMemoryTool
175+
tool = AndroidMemoryTool(PKG="ac_client")
176+
is_dumped = tool.dump_maps(path="./")
177+
print(is_dumped)
178+
```
179+
180+
# Detailed Documentation
181+
You can found detailed documentation [here](https://github.com/Anonym0usWork1221/android-memorytool/tree/main/Documentation)
182+
183+
# Errors
184+
Some known errors and their solutions can be found [here](https://github.com/Anonym0usWork1221/android-memorytool/blob/main/ERRORS.md)
185+
186+
Supported Data Types
160187
-------------------
161188

162189
All data types are signed.
163190

164-
| **Range** | **Name** | **Ctype** |
165-
| ------- | -------- | ------------|
166-
| -2,147,483,648 to 2,147,483,647 | DWORD | signed int
167-
| 3.4E +/- 38 (7 digits) | FLOAT | float
168-
| 1.7E +/- 308 (15 digits) | DOUBLE | double
169-
| -32,768 to 32,767 | WORD | signed short int
170-
| -128 to 127 | BYTE | signed char
171-
| -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | QWORD | signed long long
172-
| -2,147,483,648 to 2,147,483,647 | XOR | signed long
173-
| Random | UTF-8 | Text
174-
| Random | UTF-16LE | Text
175-
176-
Supported Data Types For libs direct read/write 0.3
177-
-------------------
178-
179-
All data types are signed.
191+
| **Range** | **Name** | **Type** |
192+
|---------------------------------------------------------|----------|------------------|
193+
| -2,147,483,648 to 2,147,483,647 | DWORD | signed int |
194+
| 3.4E +/- 38 (7 digits) | FLOAT | float |
195+
| 1.7E +/- 308 (15 digits) | DOUBLE | double |
196+
| -32,768 to 32,767 | WORD | signed short int |
197+
| -128 to 127 | BYTE | signed char |
198+
| -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | QWORD | signed long long |
199+
| -2,147,483,648 to 2,147,483,647 | XOR | signed long |
200+
| Random | UTF_8 | Text |
201+
| Random | UTF_16LE | Text |
180202

181-
| **Range** | **Name** | **Ctype** |
182-
| ------- | -------- | ------------|
183-
| -2,147,483,648 to 2,147,483,647 | DWORD | signed int
184-
| 3.4E +/- 38 (7 digits) | FLOAT | float
185-
| 1.7E +/- 308 (15 digits) | DOUBLE | double
186-
| -32,768 to 32,767 | WORD | signed short int
187-
| -128 to 127 | BYTE | signed char
188-
| -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | QWORD | signed long long
189-
| -2,147,483,648 to 2,147,483,647 | XOR | signed long
190203

191204

192-
Supported Map Ranges 0.3
205+
Supported Map Ranges
193206
--------------------
194-
| **Script Name** | **Name** | **Description** |
195-
| ------- | -------- | ------------|
196-
| ALL | Whole Memory | Whole Memory of current process (slow)
197-
| C_ALLOC | C++ alloc | RAM c++ Allocated memory
198-
| A_ANONYMOUS | Anonymous | Range with r-w access only
199-
| CODE_APP | Code App | shared libs memory (dangerous)
200-
|JAVA_HEAP|Java Heap| Java heap
201-
|C_HEAP|C++ Heap| Heap memory of cpp
202-
|C_DATA|C++ .data| .Data Memory
203-
|C_BSS|C++ .bss| .bss section memory
204-
|J_Java| Java |Java memory section
205-
|STACK|Stack| Stack Memory
206-
|ASHMEM|Ashmen| Ashmen Memory
207-
|V_video|Video| Video memory range
208-
|B_Bad|Bad| Bad Memory (dangerous)
209-
|CODE_SYSTEM|Code system| Code system memory (dangerous)
210-
207+
| **Script Name** | **Name** | **Description** |
208+
|-----------------|--------------|----------------------------------------|
209+
| ALL | Whole Memory | Whole Memory of current process (slow) |
210+
| C_ALLOC | C++ alloc | RAM c++ Allocated memory |
211+
| A_ANONYMOUS | Anonymous | Range with r-w access only |
212+
| CODE_APP | Code App | shared libs memory (dangerous) |
213+
| JAVA_HEAP | Java Heap | Java heap |
214+
| C_HEAP | C++ Heap | Heap memory of cpp |
215+
| C_DATA | C++ .data | .Data Memory |
216+
| C_BSS | C++ .bss | .bss section memory |
217+
| J_Java | Java | Java memory section |
218+
| STACK | Stack | Stack Memory |
219+
| ASHMEM | Ashmen | Ashmen Memory |
220+
| V_video | Video | Video memory range |
221+
| B_Bad | Bad | Bad Memory (dangerous) |
222+
| CODE_SYSTEM | Code system | Code system memory (dangerous) |
211223

212224
# Contributor
213225

@@ -227,9 +239,9 @@ I also created a Discord group:
227239
* Server : https://discord.gg/RMNcqzmt9f
228240

229241

230-
Buy Me a coffe
242+
Buy Me a coffee
231243
--------------
232-
If you want to support me you can buy me coffe.
244+
If you want to support me you can buy me coffee.
233245

234-
BitCoin_addr: ``` 19vwfRXfthPY7f2aqDBpxQvZa6AJFKcdBS ```
246+
BTC: ``` 19vwfRXfthPY7f2aqDBpxQvZa6AJFKcdBS ```
235247

0 commit comments

Comments
 (0)