linux命令之檢視動態庫中字串 strings

2021-08-11 04:18:35 字數 1498 閱讀 7527

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

-least [number] characters (default 4).

-t --radix= print the location of the string in base 8, 10 or 16

-w --include-all-whitespace include all whitespace as valid string characters

-o an alias for --radix=o

-t --target=specify the binary file format

-e --encoding= select character size and endianness:

s = 7-bit, s = 8-bit, = 16-bit, = 32-bit

-s --output-separator=string used to separate strings in output.

@read options from -h --help display this information

-v -v --version print the program's version number

strings:支援的目標: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-bigobj-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex

將 bug 報告到

linux命令之檢視程式動態庫依賴 ldd

乙個程式依賴很多的動態庫,類似windows下的depends工具可以檢視exe程式的依賴庫是否找到。在linux下,可以通過ldd命令檢視程式是否能找到依賴的動態庫,從而排查是缺少庫還是由於環境變數配置不正確導致的程式無法啟動。在shell環境下輸入ldd help檢視ldd命令的選項 用法 ld...

Linux 檢視動態庫依賴

檢視動態庫依賴3種方法 1 ldd bin grep linux gate.so.1 0xffffe000 libc.so.6 lib libc.so.6 0xb7eca000 lib ld linux.so.2 0xb801e000 2 ld trace loaded objects 1 bin ...

linux下檢視動態庫和靜態庫

靜態庫用ar t yourfile 動態庫用 nm d yourfile 下面是ar和nm命令的一些引數說明 1.ar基本用法 ar命令可以用來建立 修改庫,也可以從庫中提出單個模組。庫是一單獨的檔案,裡面包含了按照特定的結構組織起來的其它的一些檔案 稱做此庫檔案的member 原始檔案的內容 模式...