Valhalla Legends Archive

Programming => General Programming => Topic started by: iago on December 30, 2002, 11:21 PM

Title: Another good idea for a project..
Post by: iago on December 30, 2002, 11:21 PM
This is just an idea to throw out, since I have very little free time and am already tied up in my own projects, but eh?

Writing a good decompiler.  Basically, take a disassembler to the next level; have it convert code right back to C or C++, including known header functions it finds, various function conventions (__cdecl, __fastcall, etc).

This would probably be very difficult, but eh?

That's all for now.. it's about 6 hours past my bed time :)
Title: Re: Another good idea for a project..
Post by: Yoni on December 31, 2002, 04:39 AM
Tell me when you've made it better than IDA :)
Title: Re: Another good idea for a project..
Post by: iago on December 31, 2002, 09:37 AM
I'll get right on it :-P

It's on the bottom of my real life priority queue right now, and the queue is big and my speed is slow, so it could take awhile :)
Title: Re: Another good idea for a project..
Post by: Banana fanna fo fanna on January 05, 2003, 08:12 AM
It'd require figuring out how vc++ expands ifs and classes. You'd probably need to write a debugger too, to runtime check the types of variables PUSHed on the stack as function args.
Title: Re: Another good idea for a project..
Post by: Eibro on January 05, 2003, 09:34 AM
Good luck once you get into virtual functions/dynamic binding/inheritance/templates/polymorphism or even classes for that matter... one word: Impossible.

You might be able to get some level of conversion to C, but you'll never be able to convert it back to it's C++ equivalent. (Assuming it was written in C++)
Title: Re: Another good idea for a project..
Post by: Adron on January 05, 2003, 06:57 PM
Also note that optimization modifies all the original structures generated very much - interleaving instructions from different source code lines, removing/joining redundant instructions etc.
Title: Re: Another good idea for a project..
Post by: Skywing on January 06, 2003, 02:17 AM
Not to mention how much things can change depending on the compiler used (ebx used as this sometimes in VC7, for example).
Title: Re: Another good idea for a project..
Post by: Grok on January 06, 2003, 11:19 AM
And, and, and ... good luck when ... you know ... good luck.
Title: Re: Another good idea for a project..
Post by: iago on January 06, 2003, 04:41 PM
If it was easy, there would already be one floating around, but I've never heard of one so it must be fairly difficult :-D