“提取不到 Debian strings”这个问题比较常见,原因通常取决于你用什么方法、对什么对象提取、目标系统/文件是什么。下面按常见场景帮你梳理一下可能原因和排查办法。
一般有两种理解:
strings 命令).po、.pot、gettext)不同情况,“提取不到”的原因完全不同。
strings 命令提取不到内容strings xxx
如果文件是:
.deb 本质是 ar + tar)就可能“看起来没内容”。
✅ 解决:
file xxx
如果是 .deb:
ar x package.deb
tar -xf data.tar.*
strings usr/bin/xxx
.deb 但没解包.deb 本身不是可直接 strings 的:
ar t package.deb
应包含:
debian-binarycontrol.tar.*data.tar.*✅ 正确方式:
dpkg-deb -x package.deb outdir
strings outdir/usr/bin/xxx
strings 默认只看 ASCII。
✅ 尝试:
strings -eS file
或:
strings -n 4 file
.po / .pot很多 Debian 包:
✅ 查源码:
apt source pkgname
看:
po/*.c / *.pygettext / intltoolmsgunfmt /usr/share/locale/xx/LC_MESSAGES/xxx.mo
如果 .mo 存在但提取不到:
file xxx.mo
常见原因:
binutils(strings 属于它)which strings
apt install binutils
请告诉我:
.deb?二进制?系统文件?)我可以直接给你一条能跑的命令。