-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathstart.py
More file actions
34 lines (25 loc) · 878 Bytes
/
start.py
File metadata and controls
34 lines (25 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import time
import frida
def on_message(message, data):
if message['type'] == 'send':
print(message['payload'])
elif message['type'] == 'error':
print(message['stack'])
def javaByteArrayToString(data):
return ''.join(map(lambda x: chr(x % 256), data))
def start_hook(package_name):
device = frida.get_usb_device(timeout=50)
# device = frida.get_device_manager().add_remote_device("127.0.0.1:1234")
print(device)
device.attach("com.android.systemui")
pid = device.spawn([package_name])
device.resume(pid)
time.sleep(1)
session = device.attach(pid)
with open("trace.js", encoding="utf-8") as f:
script = session.create_script(f.read())
script.on("message", on_message)
script.load()
input()
if __name__ == "__main__":
start_hook("com.meitu.meipaimv")