技巧性极强的strings命令
打印文件中的可打印字符串(print the strings of printable characters in files)。常用来在二进制文件中查找字符串,与grep配合使用。strings命令输出的字符串长度为4个或4个以上的,长度小于4的字符串将不予打印,我们可以通过-n参数调整,strings -n 2 filename
strings命令是在对象文件或者二进制文件中查找可打印的字符串,有很多的用途,例如一个用法就是在编译的so中定义字符串常量作为动态库的版本号,然后就可以使用strings+grep 组合命令查看当前编译的so的版本号了。输入strings -h查看strings命令的用法:
用法:strings [选项] [文件]
打印 [文件] (默认为标准输入) 中可打印的字符串
选项为:
-a - --all Scan the entire file, not just the data section [default]
-d --data Only scan the data sections in the file
-f --print-file-name Print the name of the file before each string
-n --bytes=[number] Locate & print any NUL-terminated sequence of at
-<number> least [number] characters (default ).
-t --radix={o,d,x} Print the location of the string in base , or
-w --include-all-whitespace Include all whitespace as valid string characters
-o An alias for --radix=o
-T --target=<BFDNAME> Specify the binary file format
-e --encoding={s,S,b,l,B,L} Select character size and endianness:
s = -bit, S = -bit, {b,l} = -bit, {B,L} = -bit
-s --output-separator=<string> String used to separate strings in output.
@<file> Read options from <file>
-h --help Display this information
-v -V --version Print the program's version number
strings:支持的目标: elf64-x86- elf32-i386 elf32-iamcu elf32-x86- a.out-i386-linux pei-i386 pei-x86- elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86- pe-bigobj-x86- pe-i386 plugin srec symbolsrec verilog tekhex binary ihex
将 bug 报告到 <http://www.sourceware.org/bugzilla/>
在libc.so.6是c标准库,而这个标准库的制作者为了让库的使用者知道该库兼容哪些版本的标准库,就在这个库中定义了一些字符串常量,比如我的系统是centos6.8-x64,我的c标准库在/lib64/libc.so.6,可以直接运行该标准库文件,或者使用ldd --version查看当前版本,以下显示当前版本为2.12

而使用strings /lib64/libc.so.6 | grep GLIBC,可查看向下兼容的版本:
[root@localhost ~]# strings /lib64/libc.so. | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_PRIVATE
https://blog.csdn.net/stpeace/article/details/46641069
技巧性极强的strings命令的更多相关文章
- 抗干扰性极强非接触式读卡13.56mhz芯片:SI522
由于智能门锁产品不断地火爆,市场上的不断出现破解的方法.对此中科微联合深圳市动能世纪科技有限公司不断满足市场需求,推出一款抗干扰性极强的13.56mhz芯片. 该芯片出了抗干扰性强以外还直接PIN2P ...
- linux中的strings命令简介2
摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 之前我们聊过linux strings的用法和用 ...
- linux中的strings命令简介
摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 在linux下搞软件开发的朋友, 几乎没有不知道 ...
- linux中的strings命令
strings - print the strings of printable characters in files. 意思是, 打印文件中可打印的字符. 我来补充一下吧 ...
- Sort功能极强!
Sort功能极强! 可以排string: sort(a.begin(),a.end()); 普通数组 结合结构体 逆序 而且贼快
- 用strings命令查看kafka-log内容
kafka的log内容格式还不没怎么了解,想快速浏览消息内容的话,除了使用它自带的kafka-console-consumer.sh脚本,还可以直接去看log文件本身,不过内容里有部分二进制字符,通过 ...
- 用strings命令查看kafka-log内容 过滤二进制编码
kafka的log内容格式还不没怎么了解,想快速浏览消息内容的话,除了使用它自带的kafka-console-consumer.sh脚本,还可以直接去看log文件本身,不过内容里有部分二进制字符,通过 ...
- centos Linux系统日常管理2 tcpdump,tshark,selinux,strings命令, iptables ,crontab,TCP,UDP,ICMP,FTP网络知识 第十五节课
centos Linux系统日常管理2 tcpdump,tshark,selinux,strings命令, iptables ,crontab,TCP,UDP,ICMP,FTP网络知识 第十五节课 ...
- strings命令的实现 2014-06-02 00:17 355人阅读 评论(0) 收藏
本程序实现从文件中提取连续4个以上的可打印字符.模仿linux中string命令 #include <stdio.h> #include<stdlib.h> #include ...
随机推荐
- 将vcf文件转化为plink格式并且保持phasing状态
VCFtools can convert VCF files into formats convenient for use in other programs. One such example i ...
- DAY2---Python---While循环,格式化输出,运算符,编码
一.while循环 while 条件: 代码块(循环体) 流程:判断条件是否为真,如果是真,执行代码块.然后再次判断条件是否为真,如果为真继续执行代码块... 直到条件变成了假,退出循环 #死循环:永 ...
- Dubbo新版管控台
地址:https://github.com/apache/incubator-dubbo-ops 下载下来,解压 打开cmd 注意:它的前端用到了Vue.js,打包需要npm,所以你要有node.js ...
- rm刷机 root
http://www.miui.com/download-290.html http://www.miui.com/shuaji-329.html 小米稳定版 不可以root 只有升级到上面的开 ...
- Ajax结合Json进行交互数据(四)
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...
- 在中国使用苹果Mac电脑的都是些什么人?
来源:PConline 资讯 文章收录于:风云社区(提供上千款各类Mac软件下载) (图片来源于互联网分享,如涉及版权问题请联系作者删除) 在中国用Mac的都是什么人?腾讯CDC用户研究中心对 Q ...
- django补充
通过表名获取app的name models.UserInfo._meta.app_label >>> from repository import models >>&g ...
- go官方的http.request + context样例
go官方的http.request + context样例 https://github.com/DavadDi/go_study/blob/master/src/httpreq_context/ma ...
- awk 处理文本:行转列,列转行
[root@centos ~]# cat f 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 51 2 3 4 5 awk '{for(i=1;i<=NF;i++)a ...
- ruby----%使用法
%{String} 用于创建一个使用双引号括起来的字符串,这个表示法与%Q{String}完全一样 result = %{hello} puts "result is: #{result} ...