Crawler/APP/frida_spawn.py

32 lines
720 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import frida
APP_PACKAGE_NAME = "com.huoketuoke.www"
device = frida.get_usb_device()
# 冷启动 app处于挂起状态
pid = device.spawn([APP_PACKAGE_NAME])
print(f"[+] Spawned {APP_PACKAGE_NAME} with PID {pid}")
# 附加到挂起进程
session = device.attach(pid)
# JS 脚本内容,可替换为从文件读取
script = session.create_script("""
console.log("Frida 注入成功 - spawn 模式");
""")
# 可选:监听 JS 中的 send 消息
def on_message(message, data):
print("[*] JS 消息:", message)
script.on("message", on_message)
script.load()
# 恢复 app 执行
device.resume(pid)
print("[+] App resumed. You can now interact with it.")
input("[*] 按 Enter 键退出...")
session.detach()