Quote:
Originally Posted by
Ophiuchus
If I convert some text file to binary with this script the output is 0s and 1s and If I convert the generated binary to text, the conversion is correct.
The issue is the file I want to convert, with this script doesn't show correctly converted to text.
Do you know another script or command to get this?
Thanks again
I suspect you're confused about what those scripts do. What those scripts refer to as "binary" is actually an ascii text string of ones and zeroes. They're simply converting ascii text input into different ascii text output. Initially, each byte is an ascii character (perhaps a letter, a digit, some punctuation). The output converts each of those ascii bytes into 8 ascii bytes, where in the output the only possible value for a byte is 48 (ascii code in decimal for the digit 0) and 49 (ascii code in decimal value for the digit 1).
If you have a binary file (a file which may contain any byte value in any sequence it sees fit), and you don't know the format, what are you trying to achieve with a conversion? What is your goal? You can't expect some random set of bytes in a binary file to be convertible to meaningful text. Are you simply trying to extract embedded strings from an executable? If so, try the
strings command.
Regards,
Alister