小编arv*_*ndh的帖子

是否可以反转 xxd 以从二进制文件中获取原始文件

我一直在xxd用来创建文件的六进制表示(任何文件,如 .jpg、.docx、.zip 等),像这样,..

$ xxd -p original_file.zip > hexa_format.txt
Run Code Online (Sandbox Code Playgroud)

并扭转

$ xxd -r -p hexa_format.txt > original_file.zip
Run Code Online (Sandbox Code Playgroud)

如果有人觉得这不是正确的方法,请纠正我。无论如何这不是我的问题。现在我必须将它们转换为二进制而不是六进制。所以命令是这样的,如果我是正确的。

$ xxd -p -b original_file.zip > binary_format.txt
Run Code Online (Sandbox Code Playgroud)

我的问题是
如何将其从上述命令创建的二进制文件 (binary_format.txt) 反转回原始文件。xxd 的手册页说它不能完成(在最后一行)。

-b | -bits
              Switch to bits (binary digits) dump, rather than hexdump.   This
              option  writes octets as eight digits "1"s and "0"s instead of a
              normal hexadecimal dump. Each line is preceded by a line  number
              in  hexadecimal and followed by an ascii (or ebcdic) representa?
              tion. …
Run Code Online (Sandbox Code Playgroud)

linux command-line binary-files xxd

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

binary-files ×1

command-line ×1

linux ×1

xxd ×1