Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Re: Disassemby of Code

    In article <79645363.0307250800.17ab1c99@posting.google.com >,
    vrk1981 <vrk1981@yahoo.com> wrote:
    >Is there a tool (Linux or Solaris) that can be used to get the disassembled code
    >corresponding to the C executable code (a.out) that GNU compiler (gcc)
    >produces.
    What does "man -k disassembler" show? It should list "dis" on Solaris.

    --
    Barry Margolin, [email]barry.margolin@level3.com[/email]
    Level(3), Woburn, MA
    *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
    Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
    Barry Margolin Guest

  2. Similar Questions and Discussions

    1. Why doesn't the Code Completion occur in FlexBuilder IDEwhen source code is in an external file?
      I am seperating my .as from the MXML by using the following in my file.mxml: <mx:Script source="file.as"> When I edit file.as, the code...
    2. How would I include the Open Browser code into this lineof code?
      Hello and thankyou in advance: I have an ASP page linked to my database and I want to apply the Open Browser behaviour to the code. I have tried...
    3. Custom control fires event but ignores some code in the code behind file
      I do not quite understand the question. I will merely point out that most programming problems happen for a reason. Code works the way it is...
    4. Custom tool warning: DiscoCodeGenerator unable to initialize code generator. No code generated.
      I created a brand new WebService (HelloWorld) and when I attempt to add this WebService to a WindowsForm project I get the following error message in...
    5. Security problem with Managed Code calling Unmanaged Code in a Web Page
      Hello, I have a web page which contains an ActiveX control (unmanaged) and a Windows Forms User Control (managed). Both reside on a web page and...
  3. #2

    Default Re: Disassemby of Code

    objdump will show you the disassembled code.

    objdump --source --disassemble <executable file name>

    you can also do a
    man objdump



    "vrk1981" <vrk1981@yahoo.com> wrote in message
    news:79645363.0307250800.17ab1c99@posting.google.c om...
    > Dear Sir/Madam,
    >
    > Is there a tool (Linux or Solaris) that can be used to get the
    disassembled code
    > corresponding to the C executable code (a.out) that GNU compiler (gcc)
    > produces.
    >
    > Thank you for your time.
    >
    > Regards,
    > Ramakrishnan.V

    David Medeiros Guest

  4. #3

    Default Re: Disassemby of Code

    Dear Sir,

    I tried it in both linux and solaris and got the following
    ======
    $ man odjdump
    No manual entry for odjdump
    =========

    Thanks,
    Ramakrishnan.V

    "David Medeiros" <dmedeiros@broadbus.com> wrote in message news:<cc539f7ed1c305f6bc4c5923096b445b@free.terane ws.com>...
    > objdump will show you the disassembled code.
    >
    > objdump --source --disassemble <executable file name>
    >
    > you can also do a
    > man objdump
    >
    >
    >
    > "vrk1981" <vrk1981@yahoo.com> wrote in message
    > news:79645363.0307250800.17ab1c99@posting.google.c om...
    > > Dear Sir/Madam,
    > >
    > > Is there a tool (Linux or Solaris) that can be used to get the
    > disassembled code
    > > corresponding to the C executable code (a.out) that GNU compiler (gcc)
    > > produces.
    > >
    > > Thank you for your time.
    > >
    > > Regards,
    > > Ramakrishnan.V
    vrk1981 Guest

  5. #4

    Default Re: Disassemby of Code

    To begin with, I answered your original post on comp.lang.c, don't crosspost
    if you get an answer.

    You will need your development packages then, if you cannot find objdump. I
    told you (in comp.lang.c) to use objdump with the -D switch. What is your
    Linux distribution? On Redhat you will have to install the binutils rpm I
    believe, on Slackware, go into the D packages section, and find the
    development binaries.

    "vrk1981" <vrk1981@yahoo.com> wrote in message
    news:79645363.0307251641.7b28f2e6@posting.google.c om...
    > Dear Sir,
    >
    > I tried it in both linux and solaris and got the following
    > ======
    > $ man odjdump
    > No manual entry for odjdump
    > =========
    >
    > Thanks,
    > Ramakrishnan.V
    >
    > "David Medeiros" <dmedeiros@broadbus.com> wrote in message
    news:<cc539f7ed1c305f6bc4c5923096b445b@free.terane ws.com>...
    > > objdump will show you the disassembled code.
    > >
    > > objdump --source --disassemble <executable file name>
    > >
    > > you can also do a
    > > man objdump
    > >
    > >
    > >
    > > "vrk1981" <vrk1981@yahoo.com> wrote in message
    > > news:79645363.0307250800.17ab1c99@posting.google.c om...
    > > > Dear Sir/Madam,
    > > >
    > > > Is there a tool (Linux or Solaris) that can be used to get the
    > > disassembled code
    > > > corresponding to the C executable code (a.out) that GNU compiler (gcc)
    > > > produces.
    > > >
    > > > Thank you for your time.
    > > >
    > > > Regards,
    > > > Ramakrishnan.V

    Binary Guest

  6. #5

    Default Re: Disassemby of Code

    Dear Sir,

    Yes it lists "dis".

    i tried "dis a.out" and got a huge Assembly kanguage cide for a simlple C code!

    Just curious to know if we can get the source ( .c ) fine too!

    Thanks
    Ramakrishnan.V



    Barry Margolin <barry.margolin@level3.com> wrote in message news:<R7dUa.397$0z4.371@news.level3.com>...
    > In article <79645363.0307250800.17ab1c99@posting.google.com >,
    > vrk1981 <vrk1981@yahoo.com> wrote:
    > >Is there a tool (Linux or Solaris) that can be used to get the disassembled code
    > >corresponding to the C executable code (a.out) that GNU compiler (gcc)
    > >produces.
    >
    > What does "man -k disassembler" show? It should list "dis" on Solaris.
    vrk1981 Guest

  7. #6

    Default Re: Disassemby of Code

    vrk1981 wrote:
    > Dear Sir,
    >
    > I tried it in both linux and solaris and got the following
    > ======
    > $ man odjdump
    > No manual entry for odjdump
    That's objdump, not odjdump.

    --ag
    > =========
    >
    > Thanks,
    > Ramakrishnan.V
    >
    > "David Medeiros" <dmedeiros@broadbus.com> wrote in message news:<cc539f7ed1c305f6bc4c5923096b445b@free.terane ws.com>...
    >
    >>objdump will show you the disassembled code.
    >>
    >> objdump --source --disassemble <executable file name>
    >>
    >>you can also do a
    >> man objdump
    >>
    >>
    >>
    >>"vrk1981" <vrk1981@yahoo.com> wrote in message
    >>news:79645363.0307250800.17ab1c99@posting.google .com...
    >>
    >>>Dear Sir/Madam,
    >>>
    >>>Is there a tool (Linux or Solaris) that can be used to get the
    >>
    >> disassembled code
    >>
    >>>corresponding to the C executable code (a.out) that GNU compiler (gcc)
    >>>produces.
    >>>
    If you're looking for the original source code, forget it; do a google
    serach on `decompilation C' to see why.

    HTH,
    --ag


    --
    Artie Gold -- Austin, Texas

    Artie Gold Guest

  8. #7

    Default Re: Disassemby of Code

    On Fri, 25 Jul 2003 17:46:30 +0000, vrk1981 wrote:
    > i tried "dis a.out" and got a huge Assembly kanguage cide for a simlple C
    > code!
    >
    > Just curious to know if we can get the source ( .c ) fine too!
    Of course not. The CPU executes "opcodes". Those opcodes, in
    general, correspond to very simple operations; for example, adding two
    numbers. There is no way to convert from a stream of machine opcodes
    to statements in the C language (or any "high level" language for that
    matter). What the dis(1) and objdump(1) commands do is convert the
    numeric opcodes to assembly language statements. Those statements are
    a close approximation of the assembly language code emitted by the C
    compiler. A given statement in C can result zero, one, or many assembly
    statements (i.e., machine opcodes).

    If none of the above makes any sense you need to learn how to program
    in assembly language (as opposed to C) for your system. Then it will
    make sense :-)

    Kurtis D. Rader Guest

  9. #8

    Default Re: Disassemby of Code


    "vrk1981" <vrk1981@yahoo.com> wrote in message
    news:79645363.0307251646.7c691968@posting.google.c om...
    > i tried "dis a.out" and got a huge Assembly kanguage cide for a simlple C
    code!

    You asked for the disassembled code corresponding to that source code.
    For "simple C code" that's going to be a huge assembly language program.
    > Just curious to know if we can get the source ( .c ) fine too!
    Then you're not talking about disassembling, you're talking about
    decompiling!

    DS


    David Schwartz Guest

  10. #9

    Default Re: Disassemby of Code

    "David Schwartz" <davids@webmaster.com> wrote in message
    news:bfv1c8$6if$1@nntp.webmaster.com...
    > You asked for the disassembled code corresponding to that source code.
    > For "simple C code" that's going to be a huge assembly language program.
    Something that (when I was naive), I tried many, many times to create...all
    ending up as unfinished projects. I don't think any program (that's free or
    relatively small) can parse the mangled-assembly code from objdump (and the
    like) and form a proper C source file. I know that one exists for Java (as I
    have it), but Java compiles into a different format (bytecode). If you want
    to learn ASM and create C from it, good luck and let me know =)


    Greg P. Guest

  11. #10

    Default Re: Disassemby of Code

    In article <6n1Va.1492$Bg.209@newsread4.news.pas.earthlink.ne t>,
    Greg P. <no@spam.sam> wrote:
    >"David Schwartz" <davids@webmaster.com> wrote in message
    >news:bfv1c8$6if$1@nntp.webmaster.com...
    >> You asked for the disassembled code corresponding to that source
    >> code. For "simple C code" that's going to be a huge assembly
    >> language program.
    >
    >Something that (when I was naive), I tried many, many times to
    >create...all ending up as unfinished projects. I don't think
    >any program (that's free or relatively small) can parse the
    >mangled-assembly code from objdump (and the like) and form a proper C
    >source file. I know that one exists for Java (as I have it), but Java
    >compiles into a different format (bytecode). If you want to learn ASM
    >and create C from it, good luck and let me know =)
    This is interesting. I think I've had much the same experience as you;
    that is, I think it ought to be possible to convert the output of
    a disassembler into compilable C code (not, of course, into the original
    C code, complete with comments, or even into anything remotely
    human-readable, but merely to something that can be compiled and run).

    However, I've never been able to do it.

    At a minimum, it ought to be possible to convert it into a compilable .S
    file, but even that is apparently easier said than done.

    Kenny McCormack Guest

  12. #11

    Default Re: Disassemby of Code


    "Kenny McCormack" <gazelle@yin.interaccess.com> wrote in message
    news:bg440u$1ni$1@yin.interaccess.com...
    > >Something that (when I was naive), I tried many, many times to
    > >create...all ending up as unfinished projects. I don't think
    > >any program (that's free or relatively small) can parse the
    > >mangled-assembly code from objdump (and the like) and form a proper C
    > >source file. I know that one exists for Java (as I have it), but Java
    > >compiles into a different format (bytecode). If you want to learn ASM
    > >and create C from it, good luck and let me know =)
    > This is interesting. I think I've had much the same experience as you;
    > that is, I think it ought to be possible to convert the output of
    > a disassembler into compilable C code (not, of course, into the original
    > C code, complete with comments, or even into anything remotely
    > human-readable, but merely to something that can be compiled and run).
    > However, I've never been able to do it.
    > At a minimum, it ought to be possible to convert it into a compilable .S
    > file, but even that is apparently easier said than done.
    There are programs that do this. It's not particularly difficult. If I
    had more time right now, I'd dig up a reference for you.

    DS



    David Schwartz Guest

  13. #12

    Default Re: Disassemby of Code

    "David Schwartz" <davids@webmaster.com> wrote in message
    news:bg47sd$9j7$1@nntp.webmaster.com...
    > There are programs that do this. It's not particularly difficult. If I
    > had more time right now, I'd dig up a reference for you.
    I know that this newsgroup is pretty much a GPL-mindset (in terms of
    licenses), but imagine what would happen if such decompilation programs
    (from exe to asm to c) became widespread. I don't care much for
    closed-source, proprietary coders or programs, but I'm sure that some
    companies would get a bit unnerved! Hehe! =)


    Greg P. Guest

  14. #13

    Default Re: Disassemby of Code

    In article <ZXhVa.1444$mr1.938@newsread3.news.pas.earthlink.n et>,
    Greg P. <no@spam.sam> wrote:
    >"David Schwartz" <davids@webmaster.com> wrote in message
    >news:bg47sd$9j7$1@nntp.webmaster.com...
    >> There are programs that do this. It's not particularly difficult. If I
    >> had more time right now, I'd dig up a reference for you.
    >
    >I know that this newsgroup is pretty much a GPL-mindset (in terms of
    >licenses), but imagine what would happen if such decompilation programs
    >(from exe to asm to c) became widespread. I don't care much for
    >closed-source, proprietary coders or programs, but I'm sure that some
    >companies would get a bit unnerved! Hehe! =)
    Why? The resulting C code won't look anything like what they originally
    wrote. It doesn't have any more information than the binary code that was
    used to generate it, it's just a little "prettier".

    --
    Barry Margolin, [email]barry.margolin@level3.com[/email]
    Level(3), Woburn, MA
    *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
    Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
    Barry Margolin Guest

  15. #14

    Default Re: Disassemby of Code

    On Mon, 28 Jul 2003, Greg P. wrote:
    > I know that this newsgroup is pretty much a GPL-mindset (in terms of
    > licenses), but imagine what would happen if such decompilation programs
    YOu must be confusing us with comp.linux.programmer. :-)
    > (from exe to asm to c) became widespread. I don't care much for
    > closed-source, proprietary coders or programs, but I'm sure that some
    > companies would get a bit unnerved! Hehe! =)
    So why are you using M$ Outhouse to post?

    --
    Rich Teer, SCNA, SCSA

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: [url]http://www.rite-online.net[/url]

    Rich Teer Guest

  16. #15

    Default Re: Disassemby of Code

    "Rich Teer" <rich.teer@rite-group.com> wrote in message
    news:Pine.GSO.4.44.0307281640500.11592-100000@zaphod.rite-group.com...
    > On Mon, 28 Jul 2003, Greg P. wrote:
    > YOu must be confusing us with comp.linux.programmer. :-)
    Your statement is sorta true. I do believe that most peeps here are happy
    with GNU-based licenses though...opposed to strict UNIX ones =)
    > So why are you using M$ Outhouse to post?
    If I could pick my choice of ng readers I would, but the office does not
    allow =(


    Greg P. Guest

  17. #16

    Default Re: Disassemby of Code


    "Greg P." <no@spam.sam> wrote in message
    news:ZXhVa.1444$mr1.938@newsread3.news.pas.earthli nk.net...
    > "David Schwartz" <davids@webmaster.com> wrote in message
    > news:bg47sd$9j7$1@nntp.webmaster.com...
    > > There are programs that do this. It's not particularly difficult. If
    I
    > > had more time right now, I'd dig up a reference for you.
    > I know that this newsgroup is pretty much a GPL-mindset (in terms of
    > licenses), but imagine what would happen if such decompilation programs
    > (from exe to asm to c) became widespread. I don't care much for
    > closed-source, proprietary coders or programs, but I'm sure that some
    > companies would get a bit unnerved! Hehe! =)
    The decompiled program conveys little more useful information than the
    disassembled one.

    DS


    David Schwartz Guest

  18. #17

    Default Re: Disassemby of Code

    Greg P. <no@spam.sam> wrote:
    > I know that this newsgroup is pretty much a GPL-mindset (in terms of
    > licenses), but imagine what would happen if such decompilation programs
    > (from exe to asm to c) became widespread. I don't care much for
    > closed-source, proprietary coders or programs, but I'm sure that some
    > companies would get a bit unnerved! Hehe! =)
    I seem to recall an incident involving some form of 'compiled' basic a few
    years back (possibly an early version of visual basic) where it was
    discovered that the the 'compiled executable' was really just the interpreter
    with the source code concatinated onto the end of the executable.

    IIRC red faces were the result, but I just remember noticing this in
    story in passing so some of the details may be wrong.

    Regards, Dan.
    --
    ** The email address *IS* valid, do NOT remove the spamblock
    And on the evening of the first day the lord said...........
    ..... LX 1, GO!; and there was light.
    dmills@spamblock.demon.co.uk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139