forked from wvdumper/dumper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dump_keys.py
30 lines (28 loc) · 913 Bytes
/
dump_keys.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
#!/usr/bin/env python3
import time
import frida
import logging
from Helpers.Scanner import Scan
logging.basicConfig(
format='%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %I:%M:%S %p',
level=logging.DEBUG,
)
try:
device = frida.get_usb_device()
except BaseException:
time.sleep(3)
device = frida.get_usb_device()
scanner = Scan(device.name)
logging.info(f'Connected to {device.name}')
logging.info('scanning all processes for the following libraries')
for process in device.enumerate_processes():
logging.debug(process)
if 'drm' in process.name:
libraries = scanner.find_widevine_process(device, process.name)
if libraries:
for library in libraries:
scanner.hook_to_process(device, process.name, library)
logging.info('Hooks completed')
while True:
time.sleep(1000)