转换为十六进制方式使用linux命令为二进制 [英] Transform a hex info to binary using linux command
问题描述
我有这个二进制文件我的Linux系统上。
I have this binary file on my linux system ..
udit@udit-Dabba ~ $ cat file.enc
Salted__s�bO��<0�F���Jw!���]�:`C�LKȆ�l
使用hexdump都命令我看到这样的信息。
Using hexdump command I see its information like this ..
udit@udit-Dabba ~ $ hexdump -C file.enc
00000000 53 61 6c 74 65 64 5f 5f 1b 73 a1 62 4f 15 be f6 |Salted__.s.bO...|
00000010 3c 30 cc 46 ee 10 13 11 84 bf 4a 77 21 a4 84 99 |<0.F......Jw!...|
00000020 0e 5d ef 11 18 3a 60 43 a0 4c 4b 1e c8 86 e6 6c |.]...:`C.LK....l|
00000030
现在我给出一个文件中的一些其他的系统,其内容是这样的..
Now i am given a file on some other system whose contents are like this ..
53 61 6c 74 65 64 5f 5f 1b 73 a1 62 4f 15 be f6
3c 30 cc 46 ee 10 13 11 84 bf 4a 77 21 a4 84 99
0e 5d ef 11 18 3a 60 43 a0 4c 4b 1e c8 86 e6 6c
和我需要找出从这个hexdump都完全相同的二进制信息。
and I need to find out that same exact binary information from this hexdump.
如何继续为?
如果没有针对该交换机则C code也将正常工作。
If there is no switch for that then a C code will also work fine.
(但有一些开关Linux命令是preferable)
(but a linux command with some switch is preferable)
限制:
该文件中的二进制信息是加密算法中让内容应完全一致的输出。
The binary information in the file is output of an encryption algo so contents should exactly match ..
在advancne ..
Thanx in advancne ..
推荐答案
作为@ user786653建议,请使用 XXD(1)
计划:
As @user786653 suggested, use the xxd(1)
program:
xxd -r -p input.txt output.bin
这篇关于转换为十六进制方式使用linux命令为二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!