| 场景 | 命令示例 | 作用与要点 |
|---|---|---|
| 快速探查可执行文件 | strings /path/to/app |
列出可打印字符串,初步了解程序功能与线索 |
| 精准筛选关键字 | `strings /path/to/app | grep -i “error|config|http”` |
| 设置长度与显示偏移 | `strings -n 6 -t x /path/to/app | head` |
| 检查链接库线索 | `strings /path/to/app | grep -i “.so|.dll|glibc”` |
| 分析核心转储 | `strings core.1234 | grep -i “exception|abort”` |
| 目标文件与库也适用 | strings libtest.so 或 strings libtest.a |
组件级分析,便于定位问题归属 |
| 全文件扫描 | `strings -a /path/to/binary | less` |
| 批量处理目录 | `find /path -type f -executable -print0 | xargs -0 strings |
find /path -type f -exec grep -l "keyword" {} + | xargs stringsprintf "%s\n" /path/to/files/* | parallel -j0 'strings {}'strings /path/to/file | head -n 100