Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I extract ASCII data from binary file with unknown format, in Windows?

On Windows, what is the best way to convert a binary file where the internal structure is unknown less that its contents are ASCII in nature back to plain text?

Ideally the conversion would produce a "human"-readable version. I think the file should contain something like the following:

Date: 10 FEB 2010
House: 345 Dogwood Drive
Exterior: Brick
like image 795
JustADude Avatar asked Feb 10 '10 12:02

JustADude


2 Answers

In Linux/Unix:

$ strings < unknown.dat > ascii-from-unknown.txt

This is of course not so much a "conversion" as a straight up extraction, by just filtering out the non-ASCII bytes. It's useful quite often, though.

In general, without more knowledge of the file's internal format, I don't think you can do much better.

like image 192
unwind Avatar answered Oct 03 '22 13:10

unwind


Depending on what exactly you want to achieve, a hex dump might fit the bill: It's a pure ASCII format that represents the entire file without any loss of data (but being quite wasteful with space).

It is not really human readable, but since you don't explain why you want to do that, it's the best I can offer.

There are several simple tools that produce a hex dump on Windows.

like image 44
Joachim Sauer Avatar answered Oct 03 '22 15:10

Joachim Sauer