by linuxdeveloper on 6/16/20, 9:29 PM with 7 comments
I recently came upon some school work of mine, code I wrote, from high school in 2001 as a sophomore.
For my high school CS101 class, I wrote a C++ game called Snake. The game was written using a graphics library called Allegro (https://www.allegro.cc/). Allegro was a lovely library.
It is still possible to download the original zipped binaries which I uploaded 19 years ago. They can be downloaded here: https://www.allegro.cc/depot/snake2
I also put them online here: https://github.com/natehouk/snake
(There is also a second game Mastermind available here https://github.com/natehouk/mastermind and here https://www.allegro.cc/depot/mastermind)
Unfortunately, I can not find the source code anywhere. I am very saddened by this. I thought it would be very fun to see code I wrote when I was 15, nearly 20 years ago. It would be especially fun to see how I've improved, or what neat tricks I came up with at that young age.
I have the .exe and the .dat data files and the original readme.txt. I have tried running my program on Windows 10 and with Wine. In both cases, the program crashes. I have tried all of the compatibility modes in Windows 10 and none of them work.
The year was 2001, so I believe we must have been using Windows 98 in the classroom, maybe Windows NT 2000? I can't remember.
I know that my program ran great back in the day. It even got 100,000 downloads off Download.com back then before cnet ruined them.
I want to play my game. What can I do to get my program running again? It seems like Allegro is barely supported these days. I think I need to try a native Windows 2000 install. Was it naive of me to think I would easily be able to run a program from nearly 20 years back?
What tools are available and what is state of the art for decoding a compiled binary back into readable source code?
Thanks for any info.
by alltakendamned on 6/16/20, 11:42 PM
It will not give you code that you can recompile, but it should be possible to understand and recreate the code based on the result of decompiling the software
An alternative approach can be to emulate the binary under e.g. qemu
by non-entity on 6/16/20, 10:23 PM
I suppose you could always reverse engineer it worst case, but that's probably a much more work than you're looking to do, especially without any debug symbol info.
by jg23497 on 6/17/20, 3:24 PM
The Hex-Rays Decompiler for IDA Pro will produce a remarkably good result in functional terms, but its output won't closely resemble the code you remember writing.
Ghidra looks like a good open-source alternative, though I haven't tried it myself.
by kleer001 on 6/17/20, 5:13 PM
by im3w1l on 6/16/20, 11:33 PM