-
Notifications
You must be signed in to change notification settings - Fork 3
/
example_android.py
48 lines (45 loc) · 1.72 KB
/
example_android.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
import sys
from classes.Android import *
print("======================================")
print(" SandAnalyze - Malware Analysis Tool ")
print("Example : python3 example_android.py example_android_arm arm64 / arm nodebug / gdb / qdb")
print("======================================")
try:
exeloc = str(sys.argv[1])
type = str(sys.argv[2])
debugger = str(sys.argv[3])
except IndexError:
print("Example : python3 example_android.py example_android_arm arm64 / arm nodebug / gdb / qdb")
except:
print("""
[*] Since no architect (arm / arm64) is selected, it is selected 'arm'
OR
[*] Since no debugger (gdb / qdb) is selected, will not debugging!
""")
debugger = "nodebug"
type = "arm"
if exeloc is None or exeloc == "" or type is None or type == "" or debugger is None or debugger == "":
print("Example : python3 example_android.py example_android_arm arm64 / arm nodebug / gdb / qdb")
else:
if type == "arm64":
if debugger == "qdb" or debugger == "gdb":
try:
TestAndroid.debug_android_arm64(exeloc, debugger)
except Exception as e:
print("ERROR: " + str(e))
else:
try:
TestAndroid.test_android_arm64(exeloc)
except Exception as e:
print("ERROR: " + str(e))
else:
if debugger == "qdb" or debugger == "gdb":
try:
TestAndroid.debug_android_arm(exeloc, debugger)
except Exception as e:
print("ERROR: " + str(e))
else:
try:
TestAndroid.test_android_arm64(exeloc)
except Exception as e:
print("ERROR: " + str(e))