Skip to content

Commit 6786596

Browse files
Repository Upgraded
1 parent b9752d7 commit 6786596

22 files changed

+4516
-0
lines changed

README.md

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
AndroidMemoryTool
2+
====
3+
4+
5+
AndroidMemoryTool is a memory reader and writer tool designed for android and linux os's
6+
.This Tool is written in python using ctypes not affective as c.
7+
If you find any bug or not working function you can contact me.
8+
9+
* @date : 2022/03/23
10+
* @author : Abdul Moez
11+
* @Study : UnderGraduate in GCU Lahore, Pakistan
12+
* @repos :(https://github.com/Anonym0usWork1221/android-memorytool)
13+
14+
GNU General Public License
15+
16+
Copyright (c) 2022 AbdulMoez
17+
18+
The GNU General Public License is a free, copyleft license for software and other kinds of works.
19+
20+
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
21+
22+
23+
Requirments
24+
-----------
25+
No additional libraries need this tool is made with python built-in libraries
26+
27+
* Needed python version 3.x
28+
29+
* Android Requirments -> Rooted Device Needed
30+
31+
Installation, Documentation and Examples
32+
----------------------------------------
33+
Simply install it by pip and use it in your project
34+
35+
```pip install androidMemoryTool==0.2```
36+
37+
or by cloning and then run command
38+
39+
``` pip install .```
40+
41+
Project live at
42+
```https://pypi.org/project/androidMemoryTool/0.2/```
43+
44+
45+
Memory Tool with some examples which can be found in the `examples` folder.
46+
47+
## Usage
48+
1. import the module and grab process id of target process.
49+
50+
For Linux os
51+
```py
52+
import androidMemoryTool
53+
from androidMemoryTool import AndroidMemoryTool
54+
pid = androidMemoryTool.get_pid("ac_client")
55+
```
56+
57+
For Android os use packagename of target application
58+
```py
59+
import androidMemoryTool
60+
from androidMemoryTool import AndroidMemoryTool
61+
pid = androidMemoryTool.get_pid("com.jaratools.org")
62+
```
63+
64+
2. After getting PID we are ready to read or write target process memory
65+
Next steps are sath for both os's
66+
67+
```py
68+
values_replaced = AndroidMemoryTool.write_dword_all(pid, 23, 100)
69+
70+
print(values_replaced)
71+
```
72+
73+
3. Read process memory
74+
75+
```py
76+
import androidMemoryTool
77+
from androidMemoryTool import AndroidMemoryTool
78+
pid = androidMemoryTool.get_pid("ac_client")
79+
80+
offsets, total_values_found = AndroidMemoryTool.read_xor_all(pid, 23)
81+
82+
print(offsets[0], total_values_found)
83+
```
84+
85+
4. Read direct lib offsets
86+
```py
87+
import androidMemoryTool
88+
from androidMemoryTool import AndroidMemoryTool
89+
90+
pid = androidMemoryTool.get_pid("com.somegame.org")
91+
base_addr = AndroidMemoryTool.get_module_base_address(pid, "libUE4.so")
92+
read = AndroidMemoryTool.read_lib_offsets_DOUBLE(pid, base_addr, 0xfff)
93+
print(read)
94+
```
95+
96+
4. Write direct lib offsets
97+
```py
98+
import androidMemoryTool
99+
from androidMemoryTool import AndroidMemoryTool
100+
101+
pid = androidMemoryTool.get_pid("com.somegame.org")
102+
base_addr = AndroidMemoryTool.get_module_base_address(pid, "libUE4.so")
103+
AndroidMemoryTool.write_lib_offsets_DOUBLE(pid, base_addr, 0xfff, 23)
104+
105+
```
106+
107+
this will find all the values realated to your search and replace them with replaced value
108+
and return the number of values it changed
109+
110+
Supported Data Types before update
111+
-------------------
112+
All data types are signed.
113+
114+
| **Range** | **Name** | **Ctype** |
115+
| ------- | -------- | ------------|
116+
| -2,147,483,648 to 2,147,483,647 | DWORD | signed int
117+
| 3.4E +/- 38 (7 digits) | FLOAT | float
118+
| 1.7E +/- 308 (15 digits) | DOUBLE | double
119+
| -32,768 to 32,767 | WORD | signed short int
120+
| -128 to 127 | BYTE | signed char
121+
| -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | QWORD | signed long long
122+
| -2,147,483,648 to 2,147,483,647 | XOR | signed long
123+
| Random | UTF-8 | Text
124+
| Random | UTF-16LE | Text
125+
126+
Supported Map Ranges
127+
--------------------
128+
| **Short Name** | **Name** | **Description** |
129+
| ------- | -------- | ------------|
130+
| CA | C++ alloc | RAM c++ Allocated memory
131+
| A | Anonymous | Range with r-w access only
132+
| XA | Code App | shared libs memory
133+
| ALL | Whole Memory | Whole Memory of current process (slow)
134+
135+
136+
137+
## Update 0.2
138+
139+
* Expanded Supported Maps Ranges
140+
141+
--------------------
142+
| **Short Name** | **Name** | **Description** |
143+
| ------- | -------- | ------------|
144+
| ALL | Whole Memory | Whole Memory of current process (slow)
145+
| CA | C++ alloc | RAM c++ Allocated memory
146+
| A | Anonymous | Range with r-w access only
147+
| Xa | Code App | shared libs memory (dangerous)
148+
|Jh|Java Heap| Java heap
149+
|Ch|C++ Heap| Heap memory of cpp
150+
|Cd|C++ .data| .Data Memory
151+
|Cb|C++ .bss| .bss section memory
152+
|J|Java| Java memory section
153+
|S|Stack| Stack Memory
154+
|As|Ashmen| Ashmen Memory
155+
|V|Video| Video memory range
156+
|B_Bad|Bad| Bad Memory (dangerous)
157+
|Xs|Code system| Code system memory (dangerous)
158+
159+
* Improved old mapping methods
160+
* Added Structures in order to work easy
161+
* Fixed crashing on UTF-8 and UTF-16 DataTypes
162+
* Set mapping address to r-w permissions only to avoid I/O errors
163+
* For Linux only use ALL memory range
164+
* Improved Speed
165+
* Added Support of multiple maps Ranges
166+
* Fixed utf data types (values were not changing)
167+
* Added data classes for fast search methods
168+
* Changed License To GNU Public
169+
* Added Fast Search algorithms
170+
* Added Workers support in order to increase cpu speed up searches
171+
* Fixed xrash on termux
172+
* Created package
173+
174+
* UPDATED Usage
175+
For Linux os
176+
```py
177+
from androidMemoryTool import AndroidMemoryTool
178+
import androidMemoryTool
179+
# initialize tool
180+
181+
androidMemoryTool.SettingUpTool().init_setup(PKG="ac_client", TYPE=androidMemoryTool.DataTypes.DWORD,
182+
SPEED_MODE=True, WORKERS=55)
183+
184+
# set True to maps you want to use
185+
androidMemoryTool.InitMemoryTool().init_tool(pMAP=androidMemoryTool.PMAP(ALL=True, C_ALLOC=True, C_DATA=False
186+
, C_HEAP=False, CODE_APP=False, C_BSS=False
187+
, JAVA_HEAP=False, J_Java=False, CODE_SYSTEM=False
188+
, A_ANONYMOUS=False, ASHMEM=False, STACK=False
189+
, B_BAD=False))
190+
191+
192+
# if you are reading you will get tuple of two values offset list and total values found
193+
194+
values = AndroidMemoryTool.read_value(100)
195+
196+
founded_offsets = values[0]
197+
founded_values = values[1]
198+
print(founded_offsets)
199+
200+
# if you are writing only return total value wrote
201+
202+
values1 = AndroidMemoryTool.read_write_value(100, 10)
203+
print(values1)
204+
205+
```
206+
207+
For Android
208+
```py
209+
from androidMemoryTool import AndroidMemoryTool
210+
import androidMemoryTool
211+
# initialize tool
212+
213+
androidMemoryTool.SettingUpTool().init_setup(PKG="jaradevlopers.site", TYPE=androidMemoryTool.DataTypes.DWORD,
214+
SPEED_MODE=True, WORKERS=55)
215+
216+
# set True to maps you want to use
217+
androidMemoryTool.InitMemoryTool().init_tool(pMAP=androidMemoryTool.PMAP(ALL=True, C_ALLOC=True, C_DATA=False
218+
, C_HEAP=False, CODE_APP=False, C_BSS=False
219+
, JAVA_HEAP=False, J_Java=False, CODE_SYSTEM=False
220+
, A_ANONYMOUS=False, ASHMEM=False, STACK=False
221+
, B_BAD=False))
222+
223+
224+
# if you are reading you will get tuple of two values offset list and total values found
225+
226+
values = AndroidMemoryTool.read_value(100)
227+
228+
founded_offsets = values[0]
229+
founded_values = values[1]
230+
print(founded_offsets)
231+
232+
# if you are writing only return total value wrote
233+
234+
values1 = AndroidMemoryTool.read_write_value(100, 10)
235+
print(values1)
236+
237+
238+
```
239+
240+
Assistance
241+
----------
242+
If you need assistance, you can ask for help on my mailing list:
243+
244+
* Email : abdulmoez123456789@gmail.com
245+
246+
I also created a Discord group:
247+
248+
* Server : https://discord.gg/RMNcqzmt9f
249+
250+
251+
Buy Me a coffe
252+
--------------
253+
If you want to support me you can buy me coffe.
254+
255+
BitCoin_addr: ``` 19vwfRXfthPY7f2aqDBpxQvZa6AJFKcdBS ```
256+

0 commit comments

Comments
 (0)