Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see the 0s and 1s / machine code from a executable file / object file?

I already tried this, I opened a a.out file with a text editor but I get only a bunch of characters with some instructions in it like:

üÙ

like image 438
Manuel de Leon Avatar asked Jan 25 '11 16:01

Manuel de Leon


People also ask

Does EXE file contain machine code?

Executable files contain binary machine code that has been compiled from source code. This low-level code instructs a computer's central processing unit on how to run a program. The processor interprets the machine code and tells the computer's hardware what to do.

How do I read an object file?

Basically, to read an Object from a file, one should follow these steps: Open a FileInputStream to the file that you've stored the Object to. Open a ObjectInputStream to the above FileInpoutStream . Use readObject method of ObjectInputStream class to read the Object from the file.

What is binary or machine executable code?

In computing, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instructions", as opposed to a data file that must be interpreted (parsed) by a program to be meaningful.


1 Answers

Try hexdump. Something like:

$ hexdump -X a.out

It will give you just that: an hexadecimal dump of the file.

Having said that, another possibility might include using GDB's disassemble command.

like image 67
Pablo Santa Cruz Avatar answered Dec 28 '22 06:12

Pablo Santa Cruz