-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
62 lines (48 loc) · 2.26 KB
/
main.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
59
60
61
62
# IDBA - Intelligent Dynamic Binary Analysis
# (c) 2024 Torsten Klement
import frida
import sys
from hook import hook
from inject import Inject
from agent import *
from monitor import on_message
from segment import monitor_text_access, on_txt_message
banner = """
██╗██████╗ ██████╗ █████╗
██║██╔══██╗██╔══██╗██╔══██╗
██║██║ ██║██████╔╝███████║
██║██║ ██║██╔══██╗██╔══██║
██║██████╔╝██████╔╝██║ ██║
╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝ \n\nIntelligent Dynamic Binary Analysis\n(c) Torsten Klement, Telegram: https://t.me/iamtorsten
"""
print(f"{leuchtgruen}{banner}{reset}")
def main():
try:
# Hook
if infinity_instructions:
script_code = hook(target_library=target_library, functions=functions, ignore_offsets=ignored_offsets)
else:
script_code = hook(target_library=target_library, max_instructions=max_instructions, functions=functions, ignore_offsets=ignored_offsets)
# Gerät, Sitzung und Quelle einrichten
IDBA = Inject(target=target)
device, session = IDBA.attach()
script = IDBA.source(session, script_code)
# on_message-Rückruf hinzufügen
script.on('message', on_message)
script.load()
# .text Bereich Überwachung
script = IDBA.source(session, monitor_text_access())
script.on('message', on_txt_message)
script.load()
# Skript weiterlaufen lassen
print(f"[*] IDBA [ -> {target} -> {target_library} -> {functions} ]: Überwachung gestartet. Drücken Sie Strg+C, um zu stoppen.")
print(f"module_name={target_library}")
sys.stdin.read()
except frida.ServerNotRunningError:
print("Der Server läuft nicht. Bitte starten Sie den Server auf Ihrem Gerät.")
except frida.ProcessNotFoundError:
print(f"Prozess '{target}' nicht gefunden. Stellen Sie sicher, dass die App ausgeführt wird.")
except Exception as e:
print(f"[FEHLER] {str(e)}")
if __name__ == "__main__":
main()