更新 test.py
parent
ff00478296
commit
7e54e08c90
34
test.py
34
test.py
|
|
@ -1,24 +1,22 @@
|
||||||
import frida
|
import frida
|
||||||
|
|
||||||
|
def list_devices():
|
||||||
|
devices = frida.enumerate_devices()
|
||||||
|
for device in devices:
|
||||||
|
print(device)
|
||||||
|
|
||||||
|
# list_devices()
|
||||||
|
|
||||||
|
def connect_to_device(device_id):
|
||||||
|
device = frida.get_device(id=device_id, timeout=10)
|
||||||
|
print(device)
|
||||||
|
|
||||||
|
# Connect to the Pixel 3 device
|
||||||
|
connect_to_device("8C1X1H1YG")
|
||||||
|
|
||||||
|
def on_message(message, data):
|
||||||
|
print(message)
|
||||||
|
|
||||||
def is_frida_running(device):
|
|
||||||
try:
|
|
||||||
# 获取设备上的所有进程
|
|
||||||
processes = device.enumerate_processes()
|
|
||||||
|
|
||||||
# 检查是否存在名为 'frida-server' 的进程
|
|
||||||
for process in processes:
|
|
||||||
print(process)
|
|
||||||
if process.name == 'frida':
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error: {e}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
device = frida.get_usb_device(timeout=3)
|
|
||||||
if is_frida_running(device):
|
|
||||||
print("Frida is running on the device.")
|
|
||||||
else:
|
|
||||||
print("Frida is not running on the device.")
|
|
||||||
|
|
|
||||||
Reference in New Issue