打印文件中的可打印字符串(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命令的更多相关文章

  1. 抗干扰性极强非接触式读卡13.56mhz芯片:SI522

    由于智能门锁产品不断地火爆,市场上的不断出现破解的方法.对此中科微联合深圳市动能世纪科技有限公司不断满足市场需求,推出一款抗干扰性极强的13.56mhz芯片. 该芯片出了抗干扰性强以外还直接PIN2P ...

  2. linux中的strings命令简介2

    摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 之前我们聊过linux strings的用法和用 ...

  3. linux中的strings命令简介

    摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 在linux下搞软件开发的朋友, 几乎没有不知道 ...

  4. linux中的strings命令

     strings - print the strings of printable characters in files.            意思是, 打印文件中可打印的字符.  我来补充一下吧 ...

  5. Sort功能极强!

    Sort功能极强! 可以排string:  sort(a.begin(),a.end()); 普通数组 结合结构体 逆序 而且贼快

  6. 用strings命令查看kafka-log内容

    kafka的log内容格式还不没怎么了解,想快速浏览消息内容的话,除了使用它自带的kafka-console-consumer.sh脚本,还可以直接去看log文件本身,不过内容里有部分二进制字符,通过 ...

  7. 用strings命令查看kafka-log内容 过滤二进制编码

    kafka的log内容格式还不没怎么了解,想快速浏览消息内容的话,除了使用它自带的kafka-console-consumer.sh脚本,还可以直接去看log文件本身,不过内容里有部分二进制字符,通过 ...

  8. 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网络知识 第十五节课 ...

  9. strings命令的实现 2014-06-02 00:17 355人阅读 评论(0) 收藏

    本程序实现从文件中提取连续4个以上的可打印字符.模仿linux中string命令 #include <stdio.h> #include<stdlib.h> #include ...

随机推荐

  1. numpy学习之前的必要数学知识:线性代数

    行列式 主要内容 1.行列式的定义及性质 2.行列式的展开公式 一.行列式的定义 1.排列和逆序 排列:由n个数1,2,…,n组成的一个有序数组称为一个n级排列,n级排列共有n!个 逆序:在一个排列中 ...

  2. 彻底删除与安装MySQL

    一.下载msi安装版:https://dev.mysql.com/downloads/mysql/ 二.安装前一定要彻底删除已有的MySQL:(从未安装过,忽略此步) 1.计算机处右键快捷菜单,管理, ...

  3. Map的嵌套

    package cn.lijun.demo2; import java.util.HashMap; import java.util.Iterator; import java.util.Set; p ...

  4. SQL Server 经典案例

    1.先进先出 例1 WITH [ta] ([商品编号], [批次号], [库存数量]) AS ( UNION ALL UNION ALL UNION ALL ),[tb] ([商品编号], [订货数量 ...

  5. Hibernate的入门(概念1):

    什么是持久化类? 持久化类的编写规则? 区分自然主键和代理主键? 主键生成策略?

  6. oracle 12C版本的下载安装

    首先 去官网下载自己需要的oracle对应的操作系统的版本 接受协议后可下载 1 下载解压好后 进入主目录  进行安装 在配置安全更新中把我希望通过My Oracle Support接收安全更新前面的 ...

  7. python (大文件下载及进度条展示) 验证客户端链接的合法性,socketserver

    ##########总结########### 文件校验加进度条显示 ####server import os import json import socket import struct impo ...

  8. Python高性能编程

    一.进程池和线程池 1.串行 import time import requests url_lists = [ 'http://www.baidu.com', 'http://fanyi.baidu ...

  9. Silverlight用户无法注册之MySql.Data.dll不一致

    本篇博文记录本人解决一个"用户无法注册"的问题的过程 1 问题描述: 用户可以删除:但不能注册,也不能修改权限: 图 1用户注册失败 图 2修改用户权限出错 2 解决过程 1)粗暴 ...

  10. 错误 1 “Entities.PlanPrjEntity.PlanPrjs”不可访问,因为它受保护级别限制

    本人第一次是用List做父类,写了一个类PlanPrjs,如下: class PlanPrj { public int ID { get; set; } public string Name { ge ...