If you do not mind using the existing command and want to describe your data in a text file, you can use binmake is a C ++ program that you can compile and use as follows:
First get and compile binmake (the binary will be in bin/ ):
$ git clone https://github.com/dadadel/binmake $ cd binmake $ make
Create your text file file.txt :
big-endian 00010203 04050607
Create your binary file.bin file:
$ ./binmake file.txt file.bin $ hexdump file.bin 0000000 0100 0302 0504 0706 0908 0b0a 0d0c 0f0e 0000008
Note: you can also use it with stdin / stdout
daouzli
source share