-
Notifications
You must be signed in to change notification settings - Fork 0
/
hook_util.py
58 lines (45 loc) · 1.12 KB
/
hook_util.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import os
import sys
import pdb
import subprocess
import pexpect
import pdb
def ob(a):
cmd = f"frida-ps -U | grep '{a}'"
a = os.popen(cmd, 'r', 1).read()
s = a.split(' ')[0]
b = f"objection -g {s} explore"
# pdb.set_trace()
sub = subprocess.run(b, shell=True)
def frida():
b = "adb shell"
s = pexpect.spawn(b)
s.expect("bullhead:*")
s.sendline("su\n")
s.expect("bullhead:/ #")
s.send("cd data/local/tmp\n")
s.expect("bullhead:/data/local/tmp #")
s.send("./frida15.22\n")
s.interact()
def copys(a):
copy(a)
os.popen(f'mkdir {a}')
os.popen(f"adb pull sdcard/{a} ./{a}")
def copy(a):
b = "adb shell"
s = pexpect.spawn(b)
s.expect("bullhead:*")
s.sendline("su\n")
s.expect("bullhead:/ #")
s.send(f"mkdir sdcard/{a}\n")
s.expect("bullhead:/ #")
s.send(f"cd data/data/{a}\n")
s.expect(f"bullhead:/data/data/{a} #")
s.send(f"cp ./file/ sdcard/{a}\n")
s.close()
def dump():
sub = subprocess.run("frida-dex-dump", shell=True)
if __name__ == '__main__':
func = sys.argv[1]
args = sys.argv[2:]
eval(func)(*args)