Forum: The Classroom
Topic: C++ Decompiler
started by: Der_Teufel

Posted by Der_Teufel on Dec. 03 2000,01:17
Anyone know of a good C++ Decompiler?

This message has been edited by Der_Teufel on December 02, 2000 at 08:18 PM


Posted by aventari on Dec. 04 2000,06:04
I dont think they exist. if you want to decompile an executable you'll need softICE or similar and it will decode it into assembly language. I also heard from some friends at school that you can decompile Java programs and get the java code itself. that sounds pretty cool.

------------------
aventari
"Q: How do you tell an extrovert computer scientist? A: He looks at _your_ shoes when he talks to you."


Posted by askheaves on Dec. 04 2000,12:30
C++Decompilers do exist out there. I thought I remembered correctly that SoftICE was a decompiler, but apparently it's just a disassembler. So, I can't remember now what application I was using about a year ago, but I definitely saw C code at the very least coming out of an executable... still took a long ass time to decompile, though.
Posted by askheaves on Dec. 04 2000,19:19
quote:
Originally posted by Der_Teufel:
I have seen lots of Java decompilers, but since I don't know Jave it does me no good. I was just interested in seeing how some programs were written in C++.

A C++ Decompiler is typically not going to be real helpful in that respect. Since there are a lot of ways you can write code that boil down to the same assembly after optimizations (ie. rolled out loops, lookup tables, templates, other ickies), you're probably not going to get a very good glimpse at what the original source code was. There are exceptions, mostly in the C rhealm, but C++ is a trickier beast underneighth. Not to mention most programs you would want to try this on (games?) have the most critical routines written in inline assembly and have no real good counterparts in the C++ world.

So, for educational purposes involved in learning programming techniques, it's probably not going to be very helpful. If you're curious as to how to hack a program, there is a lot more benefit.


Posted by Der_Teufel on Dec. 04 2000,20:21
The game I was interested in decompiling was "Quadnet" it is a little freeware that the says was written in C++. I was interested in how to make a game in C++.

This message has been edited by Der_Teufel on December 04, 2000 at 03:26 PM


Posted by hyperponic on Dec. 04 2000,23:14
even if you do manage to decompile C++ code, good luck making any sense out of it. more than likely, you'll end up with a bunch of meaningless crap that will take you forever to sort out. remember, when a program is compiled, comments, variable names, etc are all thrown away. if you want to learn how to code a feature, or how to code for specific platform, you'd have better luck either obtaining source code for an app, or sortin' through docs.

------------------
"It's not peer pressure, its just your turn." - Unknown


Posted by aventari on Dec. 04 2000,23:25
since it's freeware maybe the dude will send you the source code for free (or a small donation) Have you emailed the author yet?

I'd like to run one of those c decompilers on some of my code and see what it actually comes up with :]

------------------
aventari
"Q: How do you tell an extrovert computer scientist? A: He looks at _your_ shoes when he talks to you."


Posted by Der_Teufel on Dec. 05 2000,05:06
I have seen lots of Java decompilers, but since I don't know Jave it does me no good. I was just interested in seeing how some programs were written in C++.
Posted by Der_Teufel on Dec. 05 2000,16:54
Another reason I wanted to get a decompiler was to see how it decompiles the stuff that I have written.
Posted by vandlo on Dec. 05 2000,19:36
Hey Der_Teufel, I'm a CS major at Georgia Tech, I'm going to ask one of my professors that I think would know that on Wednesday, I'll post their response that night.
Posted by Der_Teufel on Dec. 05 2000,19:46
Cool. Thanks alot.
Posted by aventari on Dec. 14 2000,03:12
Sorry to bring this up again, but did anyone find out anything about the c++ decompiler??
Posted by MinscBoo on Dec. 23 2000,02:09
I think i saw an online c++ compiler, anyone know which one I am talking about? or was it just a java one. Either way, I tried it out and it seemed that the code was pretty accurate, even moreso than the programs I had downloaded.
Posted by Wen on Jan. 01 2001,18:12
Decompilers work like the following:

They take what the program does and translate the operations into a language...
The original sourcecode isn't somehow stored in the program... so it doesnt know what the programmer called the variables.

Therefore it doesnt have anything else to call the variables except variable1, variable2 etc.

------

Try IDA Pro... it's only 赨!! And when you get it... send me a copy. I've been looking for it for 7 months.

(It's easy to BUY a copy... but i'm looking for a cd burner discount here)

------------------
"* Wenner pushes the "locate penis" button"


Posted by Cyclone on Jan. 01 2001,18:16
Heh...nice signature, Wen...

Anyway though, I have also been looking for a somewhat good decompiler...hopefully a free one...well, if a decompiler out there DOES, in fact exsist, I'm gonna find it, and soon

------------------
-Sometimes a dagger in the dark is more effective than a hundred swords at dawn. -Officio Assassinonium, Warhammer


Posted by Wen on Jan. 01 2001,18:17
haha good luck cyclone... it would be faster to learn assembly, disassemblers are out there in abundance.

if your a creative programmer the only thing u'd need a decompiler for is to find out how programs encrypt/decrypt thing (eg. Kali serials stored in your registry)

This message has been edited by Wen on January 02, 2001 at 01:19 PM


Posted by Alarion on Jan. 02 2001,05:31
I had one at one time, but it was totally worthless.

Output was something in the nature of:

if (variable1 == variable2)
{
variable1 = function5(variable3);
}

I mean, seriously.. that's just an "if" statement.. the rest was absolutely horrendous...

------------------
< www.rabid-wolf.com : Food for your brain >
Lead (only) developer of Data-Admin: < http://dadmin.sourceforge.net >
< My Seksi WebCam >

This message has been edited by Alarion on January 02, 2001 at 12:32 PM


Posted by TonyD on Jan. 07 2001,10:25
Yeah, what you will wind up with is what they call "Pure" C++. See, when you run your code through a compiler, it first converts the code to pure C++. This means all comments are removed, and I think the variable and function names are removed. Functions are turned into their simplest form. Then all the optimizations are run, and it is converted to assembly. Finally, it's turned into machine code.

So if you look at that, the farthest you can go backwards is Pure C++, which does not include any of the original programming style, or variable and function names. So, as Wen said, the only thing it would be useful for is to make a serial generator.


Posted by Wen on Jan. 07 2001,20:44
quote:
Originally posted by TonyD:
So, as Wen said, the only thing it would be useful for is to make a serial generator.

Only if your a creative programmer tho Some things can be really difficult to figure out how someone did something.

You could also use it to make a different client for a program (eg a different icq client)

------------------
"* Wenner pushes the "locate penis" button"


Posted by RenegadeSnark on Jan. 07 2001,21:47
It also seems to me (although I've never decompiled a C program) that the resulting output being recompiled would be terribly inefficient. It seems to me that some decompilers will just recreate the program so that it contains valid syntax... and not really worry about "easy" or "hard" way to do something.

To get a really good decompiler we'd need some really damn smart AI, and that's something we just don't have.


Powered by Ikonboard 3.1.4 © 2006 Ikonboard