From: Chris Ridd on 10 Feb 2010 02:04 On 2010-02-10 06:46:26 +0000, Michael Vilain said: > In article > <4db6d75a-6a24-43e1-9aec-43a1f6c10578(a)d27g2000yqn.googlegroups.com>, > hadi motamedi <motamedi24(a)gmail.com> wrote: > >> Can you please let me know which other commands (like nm) can be used >> to bring out useful information from the *.o compiled object file ? > > .o files aren't intended for human use. They're for a link-editor (ld) > to create a running program. AFAIK, nm is it. /usr/ccs/bin/elfdump will also extract information from .o files. -- Chris
From: hadi motamedi on 10 Feb 2010 02:11 On Feb 10, 6:49 am, Doug McIntyre <mer...(a)geeks.org> wrote: > hadi motamedi <motamed...(a)gmail.com> writes: > >On Feb 8, 1:38=A0pm, hume.spamfil...(a)bofh.ca wrote: > >> hadi motamedi <motamed...(a)gmail.com> wrote: > >> > Can you please let me know if the .o file extension comes from Unix/ > >> > GCC object files and how to open them ? > > >> Yes, .o is a compiled but not linked program. =A0There are a number of > >> compilers for various languages that will spit out a .o file. > > >> You can't open them; they're not functional programs, merely the pieces > >> of one. =A0You can find out what functions it contains using 'nm'. =A0ie: > > >> =A0 =A0 =A0 =A0 nm object.o > > >> -- > >> Brandon Hume =A0 =A0- hume -> BOFH.Ca,http://WWW.BOFH.Ca/ > >Can you please let me know which other commands (like nm) can be used > >to bring out useful information from the *.o compiled object file ? > > nm will give you the best info you are going to get out of it. > > dis may be helpful if you understand assembly language that the source > is actually assembled into before the assembler takes over and creates > the .o file, but then you'll have to reverse engineer what the code is doing. > > Unless you have alot of time to reverse engineer, its usually quicker > and easier to rewrite everything from scratch. It takes quite a > special person to be able to do reverse engineering and get something usable. > > The .o file has the minimal information left needed to get everything > into a program, this is not a file format that is close to the > original source, this is a file that is bare-bones machine level in > order to get a program to run on the machine.- Hide quoted text - > > - Show quoted text - Thanks for your reply . I found the 'dis' is very helpful . But how can I extract the assembly language code by using it ?
From: hadi motamedi on 10 Feb 2010 03:13 On Feb 10, 7:04 am, Chris Ridd <chrisr...(a)mac.com> wrote: > On 2010-02-10 06:46:26 +0000, Michael Vilain said: > > > In article > > <4db6d75a-6a24-43e1-9aec-43a1f6c10...(a)d27g2000yqn.googlegroups.com>, > > hadi motamedi <motamed...(a)gmail.com> wrote: > > >> Can you please let me know which other commands (like nm) can be used > >> to bring out useful information from the *.o compiled object file ? > > > .o files aren't intended for human use. They're for a link-editor (ld) > > to create a running program. AFAIK, nm is it. > > /usr/ccs/bin/elfdump will also extract information from .o files. > -- > Chris I tried to install the gcc on my Solaris 8 , as the followings : %gunzip gcc-3.2.2-sol8-sparc-local.gz |tar xvf %pkgadd d gcc-3.2.2-sol8-sparc-local.pkg But at the end , my Solaris 8 server returned as 'gcc command not found' . Can you please let me know how can I make use of it ? Thank you
From: hadi motamedi on 10 Feb 2010 03:22 On Feb 10, 7:04 am, Chris Ridd <chrisr...(a)mac.com> wrote: > On 2010-02-10 06:46:26 +0000, Michael Vilain said: > > > In article > > <4db6d75a-6a24-43e1-9aec-43a1f6c10...(a)d27g2000yqn.googlegroups.com>, > > hadi motamedi <motamed...(a)gmail.com> wrote: > > >> Can you please let me know which other commands (like nm) can be used > >> to bring out useful information from the *.o compiled object file ? > > > .o files aren't intended for human use. They're for a link-editor (ld) > > to create a running program. AFAIK, nm is it. > > /usr/ccs/bin/elfdump will also extract information from .o files. > -- > Chris Sorry to forgot to mention this : During the package installation , it returned as 'The following files are already installed on the system - conflict with a file - Do you want to install these conflicting files?' I answered as 'n' . Can you please let me know if it has caused this problem to occur? Thank you
From: Chris Ridd on 10 Feb 2010 04:49
On 2010-02-10 08:13:50 +0000, hadi motamedi said: > On Feb 10, 7:04 am, Chris Ridd <chrisr...(a)mac.com> wrote: >> On 2010-02-10 06:46:26 +0000, Michael Vilain said: >> >>> In article >>> <4db6d75a-6a24-43e1-9aec-43a1f6c10...(a)d27g2000yqn.googlegroups.com>, >>> hadi motamedi <motamed...(a)gmail.com> wrote: >> >>>> Can you please let me know which other commands (like nm) can be used >>>> to bring out useful information from the *.o compiled object file ? >> >>> .o files aren't intended for human use. They're for a link-editor (ld) >>> to create a running program. AFAIK, nm is it. >> >> /usr/ccs/bin/elfdump will also extract information from .o files. >> -- >> Chris > > I tried to install the gcc on my Solaris 8 , as the followings : > %gunzip gcc-3.2.2-sol8-sparc-local.gz |tar xvf – > %pkgadd –d gcc-3.2.2-sol8-sparc-local.pkg > But at the end , my Solaris 8 server returned as 'gcc command not > found' . Can you please let me know how can I make use of it ? Set your PATH to include the directory that package put gcc in. If that package is from sunfreeware.com, I think it'll need /usr/local/bin. -- Chris |