• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Question for the experts: Good C De-Compiler

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Question for the experts: Good C De-Compiler

    Afternoon Experts,

    I need to look at some compiled c code.

    Can anyone recommend a good C De-Compiler ?

    Ta,

    Milan.

    #2
    You can disassemble object code to assembly fairly easily but getting back to C is approximate at best.

    There are so called decompilers out there but bit of a waste of time IMO. You also need to specify platform...
    While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

    Comment


      #3
      Someone walked off with the source code? Or was it 'archived'?
      "I can put any old tat in my sig, put quotes around it and attribute to someone of whom I've heard, to make it sound true."
      - Voltaire/Benjamin Franklin/Anne Frank...

      Comment


        #4
        If you're on solaris you can use dtrace to trace execution, function entry and exit and so on.

        If the executable has debug info in you can attach a debugger (you can do it without debug info but it's not as useful)

        Strings will dump the string table.

        Both of those will give you some insight into what it does.
        While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

        Comment


          #5
          Originally posted by milanbenes View Post
          Afternoon Experts,

          I need to look at some compiled c code.

          Can anyone recommend a good C De-Compiler ?

          Ta,

          Milan.
          For what architecture? Intel? ARM? Motorola?

          Also, is the compiled code in intermediate binary files, which can easily be parsed as these files have a documented structure with short parcels of data and code etc, or is it an executable file?

          In the latter case, does the program use dynamic/shared linked libraries, or is the relevant library code embedded statically in the EXE file itself?

          An EXE program with embedded library code is next to impossible to decompile, because the actual code is a small proportion of the whole, and very hard to distinguish from the library code, unless the file also includes symbol tables.

          IDA (formerly called IDA Pro) is the most well known, and I think that can recognise code from many standard embedded libraries

          Also, do you really mean C, or is it C++? A disassembly of the latter will be _much_ harder to follow, due to all the crud and bells and whistles automatically associated with the code.

          In general, disassembly of an executable program of any significant length, without a symbol table or patterns of disassembled earlier similar versions available, is _very_ hard, painstaking, and time-consuming work, and often well-nigh impossible!

          edit: If you have a serious requirement for this, for example if some baboon has lost vital source code which you have to reconstruct, I have a fair bit of experience and might be available for some freelance work in the evening if you'd like to PM me with details. (I once wrote my own Intel disassembler, so I know the Intel instruction set backwards) But I'm not promising anything!
          Last edited by OwlHoot; 25 January 2013, 17:11.
          Work in the public sector? Read the IR35 FAQ here

          Comment


            #6
            Originally posted by milanbenes View Post
            Afternoon Experts,

            I need to look at some compiled c code.

            Can anyone recommend a good C De-Compiler ?

            Ta,

            Milan.
            What you doing messing with that tulip

            You want to get into .Net

            Comment


              #7
              IDA is best.

              Comment


                #8
                Originally posted by doodab View Post
                You can disassemble object code to assembly fairly easily but getting back to C is approximate at best.

                There are so called decompilers out there but bit of a waste of time IMO. You also need to specify platform...
                It'll be for an HP Printer.
                What happens in General, stays in General.
                You know what they say about assumptions!

                Comment


                  #9
                  Looks like Milan's been bungey posting again, judging by his conspicuous absence.

                  He's probably forgotten all about this thread by now.
                  Work in the public sector? Read the IR35 FAQ here

                  Comment


                    #10
                    Originally posted by milanbenes View Post
                    Afternoon Experts,

                    I need to look at some compiled c code.

                    Can anyone recommend a good C De-Compiler ?

                    Ta,

                    Milan.
                    PM threaded. He'll knock one up for you tomorrow lunchtime.

                    Comment

                    Working...
                    X