From 7e54e08c90b1ff2cdf07d4610f8d6995f6c26dae Mon Sep 17 00:00:00 2001 From: wangsiyuan <2392948297@qq.com> Date: Mon, 4 Sep 2023 17:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20test.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/test.py b/test.py index 3f8dff9..a5d4a6b 100644 --- a/test.py +++ b/test.py @@ -1,24 +1,22 @@ 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.")