A Digital Age Deserves A Digital Leader

Decompiler for C/C++

Decompiler for C/C++

Postby REDJ » Mon Jun 07, 2004 2:39 pm

I need a C/C++ decompiler so I can decompile a few EXE and DLL files, I know they aren't copyrighted and all that, I actually have permission from a certain orginization to edit them (considering I'm helping with the next build of the program). So yeah I just need a program that would allow me to see and edit the source code of DLL and EXE's. Any help would be appreciated. :)
PRO Level 2
User avatar
Posts: 32
Joined: Sun Nov 16, 2003 5:16 am
Location: Virginia, MN, USA

Postby Weaver » Mon Jun 07, 2004 7:02 pm

I don't know of any C/C++ "decompilers" per se. However, if you are interested in disassembling W32 programs, you should look into W32dASM. It will disassemble the executable (or DLL) into assembly, so you had better be familiar with assembly.

You should be able to download W32dASM below:

http://www.downseek.com/download/21279.asp

-Weaver
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

Postby REDJ » Tue Jun 08, 2004 12:01 am

......um, I dunno, but I think no. :p well, taht program,confused me really bad. Anyway, I may be wrong about the way I worded what kind of program I need. Here's what I need to do:

Take a small program (let's call it anti-entry) out of a bigger program that it is contained in (we'll call it downloader) and replace anti-entry with a different program called protowall.

So:

downloader contains anti-entry in itself when opened, but I needf to replace anti-entry with protowall, just need a program to do that with. Boy am I confused now :p
PRO Level 2
User avatar
Posts: 32
Joined: Sun Nov 16, 2003 5:16 am
Location: Virginia, MN, USA

Postby Weaver » Tue Jun 08, 2004 3:07 pm

What you are trying to do is not the kind of task you learn as an introductory programmer. There are a couple of ways to accomplish the task you mention. To be honest, I don't quite know how I would go about doing it. If the only copy of the program you have is in machine-code form, then it is going to be a more difficult task.

Disassembly is going to be your only way to go as far as I am concerned.

-Weaver
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

Postby REDJ » Thu Jun 10, 2004 2:20 pm

ok, I've tried a few things, and I can't get it.

The programs I have aren't written in machine code, there actually able to be executed and used over a large network. If I could get a "disassembler", or however you would word it, that would allow me to edit the DLL (the source code of it) this would be quite simple.
PRO Level 2
User avatar
Posts: 32
Joined: Sun Nov 16, 2003 5:16 am
Location: Virginia, MN, USA

Postby Weaver » Thu Jun 10, 2004 2:25 pm

REDJ wrote:The programs I have aren't written in machine code, there actually able to be executed and used over a large network.


I am not familiar with your background in programming, but that is machine code.

For the layman:

machine code == binary (ISA specific formatting) == 1010101010

-Weaver
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

Postby REDJ » Fri Jun 11, 2004 12:39 pm

I would be programming in C and a language called O'Caml. Not machine code.
PRO Level 2
User avatar
Posts: 32
Joined: Sun Nov 16, 2003 5:16 am
Location: Virginia, MN, USA

Postby egkenny » Sat Jun 19, 2004 9:11 am

I don't think you understand. Once a program is compiled and linked to produce an "exe" executable all traces of the orginal language are gone. All variable names, data structures, classes, etc, are gone. No matter what language you start out with you still end up with a binary file. The binary file contains sections which contain code and data sections. The code sections are in assembly language. I have done this for a living. It is a tedious job. To do what you want is possible. The steps would be:
1. Disassemble the binary code into assembly langage
2. Examine the result for entry points, code sections, variables, etc.
3. Repeat steps 1 and 2 as necessary to make the code more readible
4. Analyze the code to identify known subroutines, parameters, and return values

Once you have done this you should be able to find the routines you are looking for. If the orginal code is relocatable (all addresses are relative) then it is possible to replace routines with other ones. As long as you keep the parameters and returns the same it is pretty straight forward.

In theory it would be possible to analyze the assembly language for a simple program and reengineer or recreate the C code for it. For a more complex program it would be very difficult if not impossible. The best you can do is work with the assembly language and patch it. And this is only after you analyze it well enough to understand it enough to do what you need to do with it.
PRO Level 3
User avatar
Posts: 51
Joined: Sun Jun 06, 2004 7:52 pm
Location: Alabama

Postby mjwaters » Sat Jun 19, 2004 1:23 pm

Not to confuse things more, but would there then be a program that is able to take assemply code, and convert it back into the original language, in this case C?

I think, just for argument's sake, that would be really cool; decompiling programs into assembly language then converting them back into whatever language they were originally built in.
PRO Level 2
User avatar
Posts: 15
Joined: Thu Jun 17, 2004 2:07 am
Location: Wilmington, Delaware, USA

decompilation

Postby thechuck1023 » Tue Jul 20, 2004 3:55 am

If they made programs that did that,
1) Program security would be nonexistant, knowing anyone could just change the code of the finished program
2) If the "decompiler" was that smare they should just write our programs for us, if they can figure out how to automaticly write code on the fly, why couldn't they assemble code from a scratch idea on the fly? Because its at this point in technology...Impossable
3) If you really want to edit some source code for some popular programs A) Download and install linux B) Knock yourself out ;-)
PRO Level 2
User avatar
Posts: 14
Joined: Fri Jul 02, 2004 1:01 am
Location: Williamstown (Near Philladelphia) NJ, USA

Next

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 5 guests

cron
cron