Decompile a .exe

Program written in C++

Page 1 of 1

13 Replies - 291795 Views - Last Post: 24 March 2009 - 06:53 PM Rate Topic: -----

#1 jtoara  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-May 06

Decompile a .exe

Posted 22 May 2006 - 04:29 AM

Hi all,
I had this .exe written i c++. Would like to know if someone can help me decombile it or rewrite the pram based on the .exe.

thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Decompile a .exe

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Decompile a .exe

Posted 22 May 2006 - 09:11 AM

Good question, and one that comes with a bit of an unsatisfying answer. there are many decompilers out there (simply google c++ decompiler), but here are a few:
http://www.itee.uq.e...istina/dcc.html
http://www.backerstr...com/rec/rec.htm
I would point out, however, that you may not get the results you wish. the compilation process for c and C++ is a complex one, with several steps. Decompilers have to work on some well known assumptions, as there are many instances in which a block of code could be structured numerous ways. Each compiler is also different...implementing certain structures in different ways during compilation. All this to say, the code you get from a decompiler will NOT be the exact source code written by the programmer, it will be a representation of that code. You should also know that you will likely lose comments, classes, includes, and that sort of thing during the decompilation process.

Decompiling is a complex subject...you may wish to read an article about it before continuing:
http://www.codeproje...versedisasm.asp
It can be done, but if the expectation is to see as a result the code as originally done by the programmer, you may wish to contact the programmer themselves, becasue decompiling will not give it to you. :)
Was This Post Helpful? 0

#3 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: Decompile a .exe

Posted 22 May 2006 - 10:16 AM

Yeah, I've never seen a decomplier spit back out the same code I put in. At least not in C++. Usually they send it back out as assembly or hex. If you can understand these languages then your well on your way. Otherwise your probably going to be pretty disappointed like Amadeus said.
Was This Post Helpful? 0
  • +
  • -

#4 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: Decompile a .exe

Posted 22 May 2006 - 10:50 AM

Every Machine Code (That's your compiled EXE) has an assembly equivalent.
A Disassembler just gives you the Assembly code of the executable file.

I've only heard of one C++ Decompiler (not so great though) and it isn't even a bit accurate.

To disassemble a file you need to have a thorough understanding of the Assembly Language as well as the code generation process of each Compiler.

Visual C++ and Borland C++ give different code in certain situations and its interesting to study such things.

If you are really interested in Disassembly and Reverse Engineering then I suggest you grab a book on 32-bit Assembly before starting.

I use IDA Pro.It's the Best Disassembler by far.

I can help you disassemble your file but post your queries on the forums...and not via Personal Messages.

The Difficulty of Rewriting code based on it's EXE file is directly proportional to its file size.
More the size, the more you will have to understand and rewrite (Reading pages of Assembly is extremely cumbersome).
Some files are packed,compressed or encrypted and to disassemble such files you will need to decrypt the EXE file either manually or by a cracker.

I used to try to write C++ key generation code(to learn and not to distribute it) from the Disassembled Listings of certain programs and though difficult I got it in the end.

You can start off by compiling a simple Hello World printf statement and disassembling it.

I've written a few tutorials relating Assembly and C++.
See if they help or interest you.
Was This Post Helpful? 0

#5 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Decompile a .exe

Posted 22 May 2006 - 11:15 AM

I use IDA pro most often, but i have many occassions to use olly debugger as well, they are both reasonable dissasemblers.
C++ has the most headway in trying to reconstruct the original code, but that isn't saying much as there are millions of ways to inturpret the assembly back to C++ but only one way to do the reverse.
Most other high level languages are impossible to bring back in any form (eg java)
Assembly is the best way to go if you wish to view the code of a program.
Was This Post Helpful? 0
  • +
  • -

#6 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: Decompile a .exe

Posted 22 May 2006 - 11:24 AM

Great to hear you're an OllyDebug Fan too.
Many people (still) prefer SoftIce to OllyDebug.

(To jtoara)
Debuggers help you execute code,set breakpoints as well as keeping track of the registers,stack and memory.

Debuggers are equally important for Reverse Engineering. Instead of looking at the disassembled code and wondering on how an instruction affects a register, a debugger will allow you to execute that instruction and shows you the values on the fly.

But be careful that many programs use Anti-debugger Tricks like the INTERRUPT 3 Instruction.
Was This Post Helpful? 0
  • +
  • -

#7 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Decompile a .exe

Posted 22 May 2006 - 01:03 PM

Haha, the good old days when I was messing around with SoftIce. I am not sure if I've even seen an XP version...
There are Java decompilers, too. A good example is DJ Java Decompiler. Btw, the structure of Java bytecode is an open standard like .NET), so these languages can be decompiled, too - but just like all the others, not to the original code, just something equivalent. Some decompilers might be able to take advantage of debug information, but it is only relevant if the programmer was sloppy enough to release a debug build (happens sometimes!)...
Was This Post Helpful? 0
  • +
  • -

#8 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Decompile a .exe

Posted 22 May 2006 - 09:35 PM

I have seen javadoc documentation help the decompiling a bit, but it is still far from efficient at it...
There most certainly is an XP version of softice :)
Was This Post Helpful? 0
  • +
  • -

#9 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Decompile a .exe

Posted 23 May 2006 - 02:05 PM

Well, there must be a good description of the java bytecode format somewhere, as there are several JVMs (opensourced, too) beside Sun's (Blackhole, etc.). And actually that is the point of Java, that you can use any implementation, and it is supposed to work. (.NET is similar, and an open source implementation is the mono projedt)

Yes, I know Sice is available on XP, I was just so lucky that I didn't need it so far :)
Was This Post Helpful? 0
  • +
  • -

#10 smeezekitty  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 18-December 08

Re: Decompile a .exe

Posted 24 March 2009 - 06:20 PM

View Postjtoara, on 22 May, 2006 - 03:29 AM, said:

Hi all,
I had this .exe written i c++. Would like to know if someone can help me decombile it or rewrite the pram based on the .exe.

thanks

ez go here
Was This Post Helpful? 0
  • +
  • -

#11 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5307
  • View blog
  • Posts: 27,208
  • Joined: 10-May 07

Re: Decompile a .exe

Posted 24 March 2009 - 06:28 PM

That's dissassembly, not decompile.

Also, this topic has been dead since 2006. Seeing as how the topic starter only has the one solitary post, it's doubtful that they will ever return.
Was This Post Helpful? 0
  • +
  • -

#12 Hyper  Icon User is offline

  • Banned

Reputation: 108
  • View blog
  • Posts: 2,129
  • Joined: 15-October 08

Re: Decompile a .exe

Posted 24 March 2009 - 06:31 PM

22 May, 2006 - 06:29 AM

May the dead rest in PEACE. -_-
Was This Post Helpful? 0
  • +
  • -

#13 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5307
  • View blog
  • Posts: 27,208
  • Joined: 10-May 07

Re: Decompile a .exe

Posted 24 March 2009 - 06:35 PM

*steps to podium*

Henry James once said, Sorrow comes in great waves...but it rolls over us, and though it may almost smother us it leaves us on the spot and we know that if it is strong we are stronger inasmuch as it passes and we remain.

Though I never knew this thread as well as some of you, I have learned much about the past, present, & even the near future trough experiences it shared with others.

May this thread... rest in peace.
Was This Post Helpful? 0
  • +
  • -

#14 Hyper  Icon User is offline

  • Banned

Reputation: 108
  • View blog
  • Posts: 2,129
  • Joined: 15-October 08

Re: Decompile a .exe

Posted 24 March 2009 - 06:53 PM

Amen.

That was a beautiful speech, no2pencil. </tear>
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1