1

There is a unix executable file and I want to read the contents of that file. It is in an unreadable format and needs to be deciphered. It does not have any extension, when I do a cat of it on the terminal its in an unreadable format.

Is there any command that I can use to decipher it or any tool that can help. Please help.

2 Answers 2

2

You don't need to decipher it (unless it has some binary-level obfuscation because it's an IOCCC entry). You can disassemble it using otool -tv or objdump and read what the program inside does.)

Sign up to request clarification or add additional context in comments.

2 Comments

I just go to know the extension of the file. It is .pc i think that is Pro C file... any suggestions how can I read this.. I am using a Mac system
@Arunabh In your question, "It does not have any extension". Now what?
2

If it's unreadable with cat then it's probably an executable format such as a.out or, more likely, ELF (though it could be a different format).

If your executable is xyzzy, you should be able to find out what type it is by using file xyzzy on it, such as with:

pax> file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386,
         version 1 (SYSV), dynamically linked
         (uses shared libs), for GNU/Linux 2.6.18,
         stripped

That file format is well documented (such as starting from here) if you search the web, and there are tools like gcb, nm, readelf and objdump which can look inside it to varying degrees, but all it's likely to deliver to you is the raw assembly language. Getting back to easily-understandable source code will be very hard.

1 Comment

I just go to know the extension of the file. It is .pc i think that is Pro C file... any suggestions how can I read this.. I am using a Mac system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.