dump hex value in to a binary file
I am trying to dump hex value 6DA810
into binary file out.bin but when I open the file in hexeditot it shows asci converted values. how can i dump hex value as it is into a binary file ? |
why would you write a hex string to a binary file? What does "binary file" even mean?? where is this string coming from in the first place??
|
thanks for the quick reply
i have a bash script Code:
FILESIZE=6DA810 |
Maybe you mean that
Code:
echo -e '\x6d\xa8\x10' > out.bin |
Final output is as intended. But how to do it with variable?
\x$FILESIZE Will escape first nibble. |
Code:
echo -e '\x6da810' > out.bin |
simple echo command with sed and pipes
I am trying to dump some hex value to a binary file. i will get the intended result if i do
Code:
echo -e '\xAF\x12\x3A' > out.bin Code:
int=AF123A Code:
'\xAF\x12\x3A' |
I think you are trying to do a reverse hexdump, you can do this with xxd:
Code:
echo AF123A | xxd -r -p > out.bin |
All times are GMT -5. The time now is 04:11 PM. |