Results 1 to 7 of 7
Hi all,
I have a binary file which display a lot of message when I run that binary. This binary file is statically linked with many files which are unknown ...
- 11-30-2010 #1Just Joined!
- Join Date
- Feb 2005
- Posts
- 28
how to get details of a binary file
Hi all,
I have a binary file which display a lot of message when I run that binary. This binary file is statically linked with many files which are unknown to me. Is there any way to know from which file (obj or static lib) does these printf come from?
There is a way to get to know about the source of a symbol, but I am interested about the source of a string.
Thanks...
- 12-01-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,977
One word - gdb. However, if the executable and libraries were stripped of symbolic information, you will have to deal with raw program addresses. Have fun!
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-01-2010 #3
If theses message are not generated entirely dynamically, you might also run grep over the source files to find the corresponding code lines.
- 12-02-2010 #4Just Joined!
- Join Date
- Feb 2005
- Posts
- 28
Problem is I don't have the full source, so if I can figure out which file contains those print statements I can ask for the specific module source. At least I know the source that I already have don't contain those print statements.
The binary is run in a target platform for which I dont have gdb facility.
Is there any way to know this using 'nm' or 'ar' or something like that?
- 12-10-2010 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,977
There is the strings command that will extract strings/messages from any file including shared libraries, executables, etc. If it is coming from a shared library, that might help. Another is hexedit which allows you to look inside the file itself, though you need to be careful not to write to the file, or you may be SOL...
A safer tool for that actually would be hexdump which will show you the internals of a binary file, but won't allow you to modify it.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-13-2010 #6Just Joined!
- Join Date
- Feb 2005
- Posts
- 28
The 'strings' command gives me all the strings/printable characters present in a binary file. Althogh it doesn't give me exactly what I wanted but still it is helpful for debugging purpose.
Thanx for your time.
- 12-14-2010 #7Just Joined!
- Join Date
- Dec 2010
- Posts
- 10
try ldd to see the dynamically linked libraris , and nm for list of symbols


Reply With Quote