Thread: Library Conversion (Static .lib -> function)

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    2

    Library Conversion (Static .lib -> function)

    I made static library with 15 C++ functions.

    However, I lost my C++ source.

    So, I want to regenerate C++ source with my static library and header files.


    If my original codes is not perfect generated, is there any way to convert the static library to origian C++ function?

    Thanks.

    If there is any commercial tools, please recommend it.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It's not possible. You could only recreate the most rudimentary approximation with disassemblers and decompilers. It would work the same, but it would be completely unreadable.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    http://www.program-transformation.or...lationPossible
    http://www.parashift.com/c++-faq-lit....html#faq-38.4

    [38.4] How can I decompile an executable program back into C++ source code?

    You gotta be kidding, right?

    Here are a few of the many reasons this is not even remotely feasible:

    * What makes you think the program was written in C++ to begin with?
    * Even if you are sure it was originally written (at least partially) in C++, which one of the gazillion C++ compilers produced it?
    * Even if you know the compiler, which particular version of the compiler was used?
    * Even if you know the compiler's manufacturer and version number, what compile-time options were used?
    * Even if you know the compiler's manufacturer and version number and compile-time options, what third party libraries were linked-in, and what was their version?
    * Even if you know all that stuff, most executables have had their debugging information stripped out, so the resulting decompiled code will be totally unreadable.
    * Even if you know everything about the compiler, manufacturer, version number, compile-time options, third party libraries, and debugging information, the cost of writing a decompiler that works with even one particular compiler and has even a modest success rate at generating code would be significant — on the par with writing the compiler itself from scratch.

    But the biggest question is not how you can decompile someone's code, but why do you want to do this? If you're trying to reverse-engineer someone else's code, shame on you; go find honest work. If you're trying to recover from losing your own source, the best suggestion I have is to make better backups next time.

    (Don't bother writing me email saying there are legitimate reasons for decompiling; I didn't say there weren't.)
    You will probably not get your original source back, but you could try. That first page posts some commercial tools to do what little can be done to your binaries.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    2

    library conversion.

    I made my static library with Visual C++ 6.0.

    Also, I have header file.

    This is my own file which is written in two years ago. But, I didn't back it up.

    Static library is not execution file.
    I used it at my project file including it.


    This is not reverse. I have to regenerate it as soon as possible for my work.

    Thanks.

  5. #5
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Well okay.

    >> I made my static library with Visual C++ 6.0.

    Doesn't matter.

    >> This is my own file which is written in two years ago. But, I didn't back it up.

    Lesson learned?

    >> Static library is not execution file.

    Is that in reponse to what I posted? You can still try boomerang or other software on it (it is a binary)

    >> I used it at my project file including it.

    Can you not still just use the library?

    >> This is not reverse. I have to regenerate it as soon as possible for my work.

    I believe it is reversing, and I don't know what the term regenerating in this context means. What do you need it for?

    Could you possibly debug the library and find out how you implemented parts that we tricky and then re-code it?

  6. #6
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    A static library is a compiled file, and what you are asking IS a reverse compiling of the library; what you will get back is not very useful at all.

    Honestly, you'd probably be better off rewriting from scratch than trying to reverse engineer the compiled code back into the source.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM