Author Topic: Reading Dll Files  (Read 2231 times)

Offline Boar

  • Newbie
  • *
  • Posts: 8
Reading Dll Files
« on: April 25, 2007, 12:59:42 PM »
Is there any way to view dll files in cpp format?

Offline Brazilian Fan

  • Sr. Member
  • ****
  • Posts: 302
Reading Dll Files
« Reply #1 on: April 25, 2007, 01:49:19 PM »
I wish there was a way...

You can only "translate" the DLL and EXE files on assembly using a disassembler (like win32dasm) or you could try using 'REC' (Reverse Engineering Compiler, I think).
REC translates assembly into a pseudo c-code, but it is still not very readable because of the labels, jumps, RVAs etc.

Every program you write on delphi/c/c++ etc. is translated to an intermediary code by the compiler to perform various kinds of optimizations, then the intermediary code is translated, or to assembly code and it's assembled, or to directly to machine language. During the two translations (or three) and optimizations, lot's of information are lost including variable names, redundant commands, comments, original structure etc.
« Last Edit: April 25, 2007, 02:02:08 PM by Brazilian Fan »

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Reading Dll Files
« Reply #2 on: April 25, 2007, 01:57:12 PM »
Yeah, there isn't really any 'automatic' way to convert compiled DLL files back to the source language.

The next best thing is to, as Brazilian Fan already mentioned, learn x86 assembler and learn how to reverse engineer software for the win32 platform. This way you should be able to reconstruct the DLL source code in its entirety (the DLL files are really not that complex and you could probably write a carbon copy of the DLL in a day or two).

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Reading Dll Files
« Reply #3 on: May 04, 2007, 02:46:33 AM »
I have managed to "translate" 3 dlls back to their source: ademo1.dll ademo2.dll and ademo3.dll
All 3 of these are rather small, and it took me several hours so translate and is painstaking task. It is possible to get the assembler code from a dll file, by using a disassembler or debugger. but it will (most likely) not have any labels or function names, other than the ones that are exported. Even then it's sometimes hard to figure out what certain variables do or what their contents are.
« Last Edit: May 04, 2007, 02:46:49 AM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Nightmare24148

  • Full Member
  • ***
  • Posts: 148
Reading Dll Files
« Reply #4 on: August 10, 2007, 02:53:07 AM »
Ooooo mucho pointers in this thread :).
I look to see, in the mirror.

All I see, is that he is me.

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Reading Dll Files
« Reply #5 on: August 10, 2007, 06:11:25 PM »
Too bad this forum does not have much you can do with your points :P
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz