disassembling code on system V

disassembling code on system V

Post by Mart » Fri, 02 Feb 1990 16:58:00



I want to disassemble some library code on a Sys V.2 system to get an idea how
efficient the library is (specifically the memory and string instructions)
without having the source code.

I've played some with adb and sdb and I can get it to do an assembler trace as
it executes.  But how do I just say:

        disassemble from Address A to Address B, and if you understand the symbols,
print them out too.

Any magic sequence of commands in adb or sdb?  Or try something else?  

(It seems SDB will mix the assembler and source in code I generate.  But I want
it to give me an indication how complicated the library code is).

marty

GV:  leisner.henr
NS:  martin leisner:henr801c:xerox

 
 
 

disassembling code on system V

Post by Cherry.ST.. » Fri, 02 Feb 1990 23:54:00


On Jupiter:STC WR:Xerox]UNIX/...  somewhere you will find a 68k disassembler.
If you are running System-V on a 680x0 based system this will do what you want.

I have changed access to this drawer so that you may copy items of interest out
of it. [  Leisner:HENR801c:xerox  Access: Read ]

I have used this disassembler to perform similiar functions on both Sun (BSD
derived) and Heurikon (System-V) systems.

B.C. & Zot

   _   /|               PUP/GV : Cherry.STCWR
   \`o_O'                  XNS : Robert Cherry:STC WR:Xerox
    =( )= Aachk! Phft!    ARPA | rocksanne!anb02!cherry%rochester:ARPA:Xerox
      U                        : rocksanne!bob

                          UUCP : rocksanne!bob
       :=work, |=home          | {rocksanne | gryphon | wright}!anb02!cherry

                           TPC : (714) 474-2273
                           XPC : 8 * 825-2273
                            MS : LARH 5007

 
 
 

disassembling code on system V

Post by Mike Stroy » Fri, 02 Feb 1990 01:32:00


Quote:>I want to disassemble some library code on a Sys V.2 system to get an idea how
>it executes.  But how do I just say:

>    disassemble from Address A to Address B, and if you understand the symbols,
>print them out too.

>Any magic sequence of commands in adb or sdb?  Or try something else?  

You can disassemble with adb by typing "<symbol>?i" or "<address>?i".
It will take an instruction count before "i", but I don't know any way
to specify an address range rather than a number of instructions.  A
simple way to use this as a disassembler is to make a command file
containing "0?i" followed by a few thousand blank lines, then executing
"adb a.out < command_file > backlist".  The many blank lines will repeat
the single "?i" command, which works better than a large count because
it labels every instruction with a symbolic address.  This approach will
try to interpret everything as instructions, so data areas may look like
strange code, and real code after data may take a few instructions to
'sync up'.

Mike Stroyan, [hplabs!]hpfcla!stroyan

 
 
 

disassembling code on system V

Post by Joel Cla » Fri, 02 Feb 1990 17:32:00



>>I want to disassemble some library code on a Sys V.2 system to get an idea how
>>it executes.  But how do I just say:

>>        disassemble from Address A to Address B, and if you understand the symbols,
>>print them out too.

>>Any magic sequence of commands in adb or sdb?  Or try something else?  

>You can disassemble with adb by typing "<symbol>?i" or "<address>?i".
>It will take an instruction count before "i", but I don't know any way
>to specify an address range rather than a number of instructions.  A
>simple way to use this as a disassembler is to make a command file
>containing "0?i" followed by a few thousand blank lines, then executing
>"adb a.out < command_file > backlist".  The many blank lines will repeat
>the single "?i" command, which works better than a large count because
>it labels every instruction with a symbolic address.  

>Mike Stroyan, [hplabs!]hpfcla!stroyan

In `adb` displaying addresses can be achieved with "symbol,200?ia" or
"address,200?ia".   This will print 200 lines of disassembly with addresses
starting at symbol.  The '?' means to display from the text (code) section,
any address not found in the text section will display "Text address not found"
messages.  In `sdb` this would be done by "symbol?200i" or "address:?200i".
 
 
 

1. Disassembling executable;how to?

Can anyone help me here? I have an executable on one of the Sun SPARCstations I
support, the code to which is lost. I took over support of these machines
recently and the guy who wrote the code has left the company.
When I do a file on it the output is sparc demand paged dynamically linked executable. Is there an FTP site where I can get something to disassemble the
executable? And then look at the code?

Thanks,
Pete Fieschko, AT&T software support

2. timing of transcendental functions

3. How to disassemble an AIX 4.1 binary

4. anno: free file encryptor for solaris

5. Backward disassembling (was: Re: 2.5.63 accesses below %esp)

6. LINUX LAPTOP SURVEY

7. Disassembling a DOS device driver

8. Broken KDE 2.2 RPM source packages?

9. GDB disassemble & instruction singlestep

10. Disassembling Linux Binaries

11. Disassemble to asm source?

12. Disassembling Object files?

13. Disassemble RPM and assemble again