How to convert dll to cpp file

This is a discussion on How to convert dll to cpp file within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hi, I somehow deleted the source file for the dll i created. I am trying to get it using recovery ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    17

    How to convert dll to cpp file

    Hi,

    I somehow deleted the source file for the dll i created. I am trying to get it using recovery softwares, but uptil now i am unable to get it.

    Can any one help me to suggest a software which can convert the dll file to the cpp file. I made the dll file using "Microsoft Visual C 6". Please help me out. It's really important.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,403
    No way jose.

    You need to decompile your DLL. And the resuls will not bring you down to the algorithm level. You can expect to salvage function definitions and calls, variables and some of the operations performed on them. But you definitely lose your code structure. includes, classes definitions, hierarchies,... all lost.

    With enough effort you could in theory reach your source code. But this implies a deep knowledge of assembler and lots of trying and testing. The time and the effort is just not comparable to simply rewriting the whole thing from scratch.

    Which is my advise. That and next time keep backups.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    17
    Quote Originally Posted by Mario F.
    No way jose.

    You need to decompile your DLL. And the resuls will not bring you down to the algorithm level. You can expect to salvage function definitions and calls, variables and some of the operations performed on them. But you definitely lose your code structure. includes, classes definitions, hierarchies,... all lost.

    With enough effort you could in theory reach your source code. But this implies a deep knowledge of assembler and lots of trying and testing. The time and the effort is just not comparable to simply rewriting the whole thing from scratch.

    Which is my advise. That and next time keep backups.
    definitely i'll back up from next time.

    It'd be enough if i get the function definitions, calls and variables. Can you tell me any softwares like this ?

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,403
    search for c++ decompilers and cross your fingers while you also search for how to use them.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >It'd be enough if i get the function definitions, calls and variables.
    That's just about everything. You're pretty much SOL unless you know assembly and feel confident that you can reverse engineer your program.
    My best code is written with the delete key.

  6. #6
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Reverse engineering is quite difficult, I'd say. I've only reverse engineered some functions from other programs, I've never done it to the whole program or dll.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  7. #7
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,403
    Which begs the question why the OP feels he just needs function definitions and variables.

    Some people are so funny... At least he didn't go the "a friend of mine" routine.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  8. #8
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Reverse engineering is quite difficult, I'd say.
    Reverse engineering is extremely difficult, especially with a complicated application. Disassemblies are notoriously obtuse, even if you don't consider that translating assembly to C++ requires a lot of creativity. I've done a fair amount of RE, and it always feels like an exercise in futility.
    My best code is written with the delete key.

  9. #9
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Disassemblies are notoriously obtuse, even if you don't consider that translating assembly to C++ requires a lot of creativity.
    Yeah, creativity is what most of the people lack.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  10. #10
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    you know it would just be completely amazing if you had just HAPPENED to compile that DLL in debugging mode...but I guess you didnt...
    My Website

    "Circular logic is good because it is."

  11. #11
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Yeah, creativity is what most of the people lack.
    However many of us also lack knowledge. Not naming names here.

  12. #12
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    You're referring to my age, are you?

    So, I think there are 4 important things in programming: creativity, knowledge, experience and interest.
    Last edited by maxorator; 11-13-2006 at 05:29 AM.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  3. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  5. File I/O convert
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 10-03-2001, 08:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21