Take the 2-minute tour ×  Some files were uploaded in the wrong
mode to the FTP (via command line). I believe I have some binary
files that were uploaded in TEXT mode and now I cannot open
them.  I dont have access to the original files, can I somehow
recover from this? Is there some tool that will allow me to get
the files in their correct format?  share|improve this question
2 Answers 2  up vote 2 down vote accepted  I recently had to
face the same problem. Linux -> Windows, ASCII mode. I've
finished writing a program in Python that allows for the
recovery of ASCII transferred binaries. It's a byte bruteforcer,
and here is how it works:    1. Open damaged archive as byte
stream.   2. Find all occurrences of 0d followed by 0a (ASCII
13, ASCII 10).   3. Remove all occurrences of 0d followed by 0a
and store the byte addresses.   4. Cycle through each of the
addresses to restore a number of 0d's in case they were supposed
to be there in the binary, restore and try to open (in my case I
was dealing with bz2 arc