Forums: How To Decompile/unpack A C++ Exe File - Forums

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

How To Decompile/unpack A C++ Exe File program and howto

#1 User is offline   shii 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 86
  • Joined: 23-October 03

Posted 19 May 2004 - 09:16 AM

hi dudes, i'm beginning to unpack/pack compil exe files using C++ programming code, and i hope someone could help me !!!

Indeed, i would like to know how to unpack/decompile a C++ exe file !!!!

When a use an Hex editor program i got only ASCII characters....

Thanx a lot
0

#2 User is offline   twistedps 

  • Staff Sergeant
  • Icon
  • Group: Members
  • Posts: 271
  • Joined: 20-March 04

Posted 19 May 2004 - 09:31 AM

id suggest grabbing a dissassembler like ida pro. [havent ever used it but ive heard a LOT of goog things about it], as far as translating into c++, its not just gonna convert to that from opening it up. With a program like ida pro that dissassembles the exe, its gonna give you the asm output for it, and from there you have to translate the asm -> c++, which isnt easy... i know for sure i cant do it lol.

but hey man, if your willing to readup hardcore on asm and stuff i say give it a try, no harm in trying.

best of luck! :D
0

#3 User is offline   shii 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 86
  • Joined: 23-October 03

Posted 19 May 2004 - 10:09 AM

ok twistedps :rolleyes:

i'll try to grab and test your ida pro utilitie if u telle it's hard enough to translate the ASM, damn i won't be able to do it but i'll have a look anyway :blink:

thanx a lot man ;)
0

#4 User is offline   kevin007 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 51
  • Joined: 04-October 03

Posted 19 May 2004 - 10:33 AM

shii, on May 19 2004, 05:16 PM, said:

Indeed, i would like to know how to unpack/decompile a C++ exe file !!!!

I don't know if you're aware(I suspect from the nature of your post not), but, unlike say Java you can't just decompile a C++ file, the executable isnt a simple step away from getting the source code due to the nature of the compilation process (unless its been compiled in debug mode? Not sure on that).

I'm not an expert by any means, however I believe that decompiling a C++ source is not as easy as you might believe, its not like you can grab a windows .exe file and decompile it, thats why so many vulnerabilities are still hidden away in there :). Instead its pretty much a one way process as the C++ compiler just creates machine code for the machine that its compiled on (for example a windows based i386 box)
0

#5 User is offline   DaClueless 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 135
  • Joined: 29-February 04

Posted 19 May 2004 - 11:19 AM

The best way to take a part a C++ exe file is use a low-level debugger like soft-ice. And step through it.
0

#6 User is offline   JDog45 

  • Staff Sergeant
  • Icon
  • Group: Members
  • Posts: 257
  • Joined: 08-September 03

Posted 19 May 2004 - 11:21 AM

Unpacking/Dissasembling are two completely different things.

Unpacking refers to when a .exe is packed with a packer to protect the .exe from being dissasembled. Usually the packers also compress the .exe down on size as well.

If you're dissasembling something you'll be looking right at the code of the .exe. IDAPro will work, or WinDASM32 or even Olly (my favorite). Although Olly is a debugger more than a dissembler.
0

#7 Guest_F34R_*

  • Group: Guests

Posted 19 May 2004 - 12:11 PM

great info guys... I've been wondering how to decompile .exe's as well for various reasons... good to know... appreciate it... peace.
0

#8 User is offline   shii 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 86
  • Joined: 23-October 03

Posted 19 May 2004 - 01:20 PM

ok JDog45 i might have been more specific about my question :)

actually i'd like to be able to dissaembling the exe in order to be able to read the ASCII characters which means nothing for me......

anyaway i'm gonna try all those tools

thanx dudes
0

#9 User is offline   JDog45 

  • Staff Sergeant
  • Icon
  • Group: Members
  • Posts: 257
  • Joined: 08-September 03

Posted 19 May 2004 - 01:51 PM

shii, on May 19 2004, 09:20 PM, said:

ok JDog45 i might have been more specific about my question :)

actually i'd like to be able to dissaembling the exe in order to be able to read the ASCII characters which means nothing for me......

anyaway i'm gonna try all those tools

thanx dudes

If you want to Dead List an .exe use WinDASM 32. If you want to debug it, use Olly (my prefernce) or SoftICE.
0

#10 Guest_archphase_*

  • Group: Guests

Posted 19 May 2004 - 06:52 PM

RE C++ is a bitch, each compiler has its own specified, bout only unified thing is ECX holds this pointer.

My suggestion, buy Kris Kasperskys book, he teaches you how to use IDA like a Pro. He also has like 150-200 pages on just disassembling C++ from recognizing constructers, etc.
0

#11 User is offline   pr0t0type 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 104
  • Joined: 21-October 03

Posted 20 May 2004 - 02:51 AM

archphase, on May 20 2004, 02:52 AM, said:

RE C++ is a bitch, each compiler has its own specified, bout only unified thing is ECX holds this pointer.

My suggestion, buy Kris Kasperskys book, he teaches you how to use IDA like a Pro. He also has like 150-200 pages on just disassembling C++ from recognizing constructers, etc.

I can recommend that book too, complex but worth the effort. Hacker dissasembling uncovered it's called.
0

#12 User is offline   FTPServerTools 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 137
  • Joined: 29-March 04

Posted 20 May 2004 - 06:21 AM

Apart from the book you can find a nice program called rec which you can find easily with google (rec decompiler) it has a complete source code and can handle itself reasonably well. The sourcecode is free as well, it has all kinds of import files that can translate code back to printf and kernel routines etc.. The code is not optimized once it comes out of the decompiler but it is fairly easy to read.
0

#13 User is offline   belgther 

  • Master Sergeant
  • Icon
  • Group: Specialist
  • Posts: 650
  • Joined: 06-October 04

Posted 07 July 2005 - 07:18 PM

Unpacking is generally so:
1)Find a way to get to OEP as fast as you can.
2)Dump your EXE/DLL at OEP.
3)Fix the import table.
4)Fix OEP and other necessary things, and everything is fine...

I'd suggest you starting with UPX. And use olly as a debugger. Some compilers really have problem with system-level debuggers, which are hard to handle by a newbie(I also have problem with them). And if you unpack a proggy with a system-level debugger, it will be harder to decide whether your imports are all right or not. You dump a file, but don't fix the imports, but the file works perfect on your computer, then send it to a friend, and he/she gets an error on the EXE. That's why I prefer olly for unpacking purposes.
"The wisest one is the one who knows himself/herself." Quote of the life
belgther... aka... belgther
0

#14 User is offline   Zbewl 

  • Private
  • Icon
  • Group: Members
  • Posts: 5
  • Joined: 27-June 05

Posted 08 July 2005 - 05:04 AM

Try to import the exe files and dll if joined with visual studio, but firstly u have to mlake a new project in C++ windows application.
good luck, the file can have been crypted.
0

#15 User is offline   320X 

  • Master Sergeant
  • Icon
  • Group: Members
  • Posts: 473
  • Joined: 13-December 03

Posted 06 November 2005 - 08:08 AM

unpack a c++ file ? lol, or dissasemble it...
you can try this debuggers
win dasm32
ida pro
softice
ollydbg
and dont forget gdb
0

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users

  • Share



Our Sponsors:


SwiftLayer Affiliate Web Hosting