Visit Our UNIX and Linux User Community


C


 
Thread Tools Search this Thread
Top Forums Programming C
# 1  
Old 09-27-2001
C

Hi All,

I have a Binary file and I want to read the file
and write as ASCII.

If anybody knows the method, please mail me to :

kkodava@maxis.com

Thanks

Krishna
# 2  
Old 09-27-2001
If it is a data file stored in binary format, you will need to know the specifications of that format and write a program to decode it. If it is an executable you may have some limited success with a de-compiler. Also try the "strings" command.
# 3  
Old 09-28-2001
EEEKKK!!!

Okay, I've wanted to do this as well-

Here is the trick the VM mainframeers taught me, it actually did work, but keep in mind, I did this on a VM CP command env, using pipes and some VM tools translating to EBCDIC, so go easy if this doesn't translate well...

We took the binary file and converted to hex sing a converter in the editor on VM, we then took the hex and translated to EBCDIC (ascii should be a reasonable change from there, as well), and read what we could of the file.

Keep in mind, teh compiler that put the file together is going to have done some things to the file, you are WAY better off with a good de-compiler, but you didn't hear that from me...

Whatever you get back from either operation, it may not be an exact copy of the source code, unless you have a lot of time, knowledge of EXACTLY what tools were used by the developers, and the skill or luck to find a de-compiler that knows what the compiler did.


Or, maybe I'm totally out of my tree and I'm talking out of my knothole...



loadc
# 4  
Old 09-28-2001
well... if we want to get REALLY crazy...
you can use "od" (octal dump). There are
LOTS of options. Check out the man page od(1).
# 5  
Old 09-28-2001
No need to get THAT out of hand....

Flashing back a bit here,

A friend of mine used to have this nasty (Honeywell??) system that they had to program in octal, he relives that painful time in his life quite often, for the benefit of those around him, to remind us how "good" we have it with such languages as C, c++ and perl, to name a few.


But I wax rhapsodic,


later,


loadc

Previous Thread | Next Thread
Test Your Knowledge in Computers #559
Difficulty: Easy
A runtime error is an error that occurs while a program is being executed.
True or False?

Featured Tech Videos