Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to see contents of a.out file?

The executable file of c++ will contain linkers, modules and others, i would like to look into its contents, i'm using linux, how can i view contents of a.out? which command should use to browse a.out, text editors wont show the contents......

like image 794
Abhilash Muthuraj Avatar asked Oct 27 '25 01:10

Abhilash Muthuraj


1 Answers

You can use nm to see the internal symbols and objdump to get the disassemble. By example:

objdump -D a.out | less

Note however that during the final linking of the object files into the executable a lot of symbols and internal data get eliminated, therefore you won't be able to understand the structure as you would be with object files.

If you want to edit and modify the executable, I suggest you to use the hte editor, which can act as disassembler for x86 executables. If you are a debian/ubuntu user the package name is "ht" (not "hte").

Also I wrote a little elf disassembly library which is still incomplete but pretty funny. You can find other (more complete and probably better) implementations however!

like image 126
Dacav Avatar answered Oct 28 '25 15:10

Dacav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!