linux 命令之strings

来源:互联网 发布:淘宝买家怎么修改中评 编辑:程序博客网 时间:2024/05/23 18:20

strings 命令是在对象文件或二进制文件中查找可打印的字符串。字符串是4个或者更多可打印字符串的任意序列,以换行符或者空字符结束。

strings语法
strings [options] file_name

options:
-a / -all : 扫描整个文件而不是只扫描目标文件初始化和装载段。
-f / -print-file-name:在显示字符串前显示文件名
-n / -bytes=[number]:找到并且输出说有NULL终止符序列
- num :设置显示的最少字符数(num是一个数字),默认是4个字符
-t {o,d,x}/-radix={o,d,x} :输出字符的位置,基于八进制,十进制或者十六进制。
-o :类似-radix=o
-T /-target= : 指定二进制文件格式
@:从文件中读取选项

示例:

$ gcc hello.c -o hello$ strings hello/lib/ld-linux.so.2__gmon_start__libc.so.6_IO_stdin_usedprintf__libc_start_mainGLIBC_2.0PTRhUWVS[^_];*2$"
$ cat test -f-t d$  strings @test hellohello:     340 /lib/ld-linux.so.2hello:     541 __gmon_start__hello:     556 libc.so.6hello:     566 _IO_stdin_usedhello:     581 printfhello:     588 __libc_start_mainhello:     606 GLIBC_2.0hello:     824 PTRhhello:    1040 UWVShello:    1132 [^_]hello:    1359 ;*2$"
1 0
原创粉丝点击