hexdump 模块缺失
❌
ImportError: No module named 'hexdump'或 hexdump 渲染失败。
r0capture 的处理
r0capture 内联了 myhexdump.py,优先用它:
python
try:
import myhexdump as hexdump
except ImportError:
pass若 myhexdump.py 与 r0capture.py 同目录,正常导入。若不在同目录(如复制了 r0capture.py 没复制 myhexdump.py),hexdump 为 None,on_message 里调 hexdump.hexdump(...) 会报 NameError。
解决
1. 确保 myhexdump.py 在同目录
bash
ls r0capture.py myhexdump.py
# 两个文件都要在2. 装 pip 版 hexdump(备选)
bash
pip install hexdump但 r0capture 优先用 myhexdump,内联版与仓库代码贴合。
3. Windows 还需 win_inet_pton
bash
pip install win_inet_ptonWindows 上 IP 转换需要。Linux/macOS 不用。