frida.get_usb_device() can not works at first time.
还没有人认领这个 Issue。
评估
调研方向
使用 Python 3.9 和 Frida 14.0.0 重现首次调用失败,然后根据 traceback 检查 frida/init.py 中的 get_usb_device 和 get_device_matching 方法,以及 frida/core.py:get_device_matching。完成的标准是,初始调用 frida.get_usb_device() 无需重试或 sleep 即可找到 USB 设备。
由索引模型根据 Issue 内容生成。
描述
Please check the error logs as follow: (frida --version 14.0.0)
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import frida
>>> frida.get_usb_device()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\__init__.py", line 82, in get_usb_device
return get_device_matching(lambda d: d.type == 'usb', timeout, **kwargs)
File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\__init__.py", line 90, in get_device_matching
return get_device_manager().get_device_matching(predicate, timeout, **kwargs)
File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\core.py", line 26, in wrapper
return f(*args, **kwargs)
File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\core.py", line 58, in get_device_matching
return Device(self._impl.get_device_matching(lambda d: predicate(Device(d)), raw_timeout))
frida.InvalidArgumentError: device not found
>>> frida.get_usb_device()
Device(id="89EX0A89A", name="Pixel 3", type='usb')
As you saw it, went I call frida.get_usb_device() first time it will get an error. But if you try to call it second time, it's OK!
So I try to solve this problem as follow and it works:
try:
device = frida.get_usb_device()
except BaseException:
time.sleep(3)
device = frida.get_usb_device()
- 主要语言
- Python
- 星标
- 873
- 派生
- 173
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
frida/frida-python 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
frida/frida-python#265 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
frida/frida-python#262 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
frida/frida-python#247 · 2 条评论 · 2 个 reaction ·
-
After a long period of hooking applications on Ubuntu, Python and JavaScript are unable to interact. 未关闭
难度 4/5 3-5 天 新手友好度 25/100
frida/frida-python#246 ·
-
难度 4/5 3-5 天 新手友好度 20/100
frida/frida-python#243 ·
查看 frida/frida-python 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·