Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 4th, 2006, 11:20 PM   #1
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
Decompiler

I'd just like to know how much information you would get back if you were to decompile a project? Do you get the .h and .cpp files back if the program was programmed in c/ c++?

Would you know where i can find a c++ decompiler? i downloading a few from google and they gave me errors upon starting the program.
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote
Old Apr 4th, 2006, 11:34 PM   #2
Mad_guy
Hobbyist Programmer
 
Mad_guy's Avatar
 
Join Date: Oct 2004
Location: Sandstorm, Techno Club
Posts: 239
Rep Power: 5 Mad_guy is on a distinguished road
Send a message via AIM to Mad_guy Send a message via MSN to Mad_guy
There are decompiler projects, such as Boomerang, but, I don't exactly trust projects like that, you will never get the original source code that the author wrote back, however, it seems like projects such as Boomerang get decent results (but then again I've also heard the results suck, so I'm not one to really pass judgement.)


The best you'll really get is a disassembly listing, which is basically all you will need if you really want to work out the internals of a program, but it takes time.

On an related note you also might want to check out REC, it basically parses a disassembly and gives it weird constructs which are to me hard to follow due to the lack of syntax highlighting.
__________________
os: mac os 10.5.4
revision control: git
editor: emacs

site
Mad_guy is offline   Reply With Quote
Old Apr 4th, 2006, 11:43 PM   #3
Kaja Fumei
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 134
Rep Power: 4 Kaja Fumei is on a distinguished road
First, although this article is a little old, read: http://www.tech-faq.com/c-decompiler.shtml

Decompiler technology is advancing but it still has a long way to go. There are links to two decompiler projects here: http://www.tech-faq.com/decompiler.shtml
Kaja Fumei is offline   Reply With Quote
Old Apr 5th, 2006, 10:34 AM   #4
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
Your OS is Win XP - MS actually listened to programmers back about the beginning of VB 5 and VC 5. It was too easy to decompile and "steal" code.

There were decompilers for VB 4 that really did re-create VB & VC code fairly well.
MS changed the way the linker worked, and removed symbols. Now Windows decompilers give you assembly output, frequently without the original function names.

Decompilers are really meant for shops that have an .exe without source code and they need changes.
jim mcnamara is offline   Reply With Quote
Old Apr 5th, 2006, 12:27 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I might write assembler code to result in the operation, "a = b + *c" in a number of different ways. You might narrow them all down to that with the machine language. More complex operation might be tougher to intuit. Without symbolic information you could not distinguish "a = b + *c" from "jazz = dogMeat + *hopolite". Consider that you decompiled an executable with a C decompiler and with a Fortran decompiler. Could you tell which language originally produced the executable? If the program was produced in C and you decompiled perfectly with a Fortan compiler, would you have "reproduced the original"? You get the picture.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Apr 5th, 2006, 4:25 PM   #6
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3 King is on a distinguished road
Why do you need a decompiler? There is a lot of open source out there for you to look at.
__________________
I am Addicted to Linux!
King is offline   Reply With Quote
Old Apr 5th, 2006, 4:31 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Incidentally, .h files are incorporated into the source code BEFORE the compiler sees it. Anything that would pluck it out would probably have to have enough wasteful information buried in the code that it would gag an armpit.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Apr 5th, 2006, 5:24 PM   #8
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
Okay thanks.
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote
Old Apr 5th, 2006, 8:25 PM   #9
Mad_guy
Hobbyist Programmer
 
Mad_guy's Avatar
 
Join Date: Oct 2004
Location: Sandstorm, Techno Club
Posts: 239
Rep Power: 5 Mad_guy is on a distinguished road
Send a message via AIM to Mad_guy Send a message via MSN to Mad_guy
Quote:
Originally Posted by King
Why do you need a decompiler? There is a lot of open source out there for you to look at.
Because the most interesting things are also the most hidden and secretive. Just because there's open source doesn't mean there isn't a use for something like a decompiler technology like Reflector.NET or Spices.net.
__________________
os: mac os 10.5.4
revision control: git
editor: emacs

site
Mad_guy is offline   Reply With Quote
Old Apr 5th, 2006, 11:17 PM   #10
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
Quote:
Originally Posted by Mad_guy
Because the most interesting things are also the most hidden and secretive. Just because there's open source doesn't mean there isn't a use for something like a decompiler technology like Reflector.NET or Spices.net.
lol.. That's exactly why.
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:32 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC