Author Topic: reverse engineering old dos program  (Read 18589 times)

nobody

  • Guest
reverse engineering old dos program
« on: April 05, 2008, 11:38:52 AM »
Since the 1980's I have used this wonderful kaleidascope screensaver called Dazzle. It's the best 2d screensaver I have ever seen. I would like to take a look at the assembly code for this program to see how it does what it does. Then port this code to 32bit code. I'm assumming it was done in 16bit code that long ago, but would not really know how to tell. should I download the nasm 16bit binaries or will the 32bit binaries be ok? Can someone give me an idea how to proceed with this. I would really love to preserve this great program.

nobody

  • Guest
Re: reverse engineering old dos program
« Reply #1 on: April 05, 2008, 03:42:43 PM »
There are a number of questions there... start with Nasm, I guess. If you're on a 286 or less, you want "nasm16". It's a "truncated" version to run in small memory, and has exhibited bugs not present in the "grown up" versions. Otherwise, you want the appropriate 32-bit binaries - no difference except which platform they're built to run on. The 32-bit dos executables will run under Windows (AFAIK), but may not know about long file names. I uses to use 'em under Win98 all the time. The "w" builds will produce 16-bit output - or disassemble 16-bit input, in this case. Any version *but* nasm16 would be good...

A google for "dazzle screensaver" comes up with a bunch of Windows stuff. I vaguely remember something called "dazzle"... or was it "dazzler"?... that I *wasn't* too impressed with... Is the particular version you like "available" someplace?

What you propose may be illegal, depending on the license, and perhaps on where you live. You're unlikely to get arrested - *I* certainly don't care, but it would *not* be appropriate to post anything "dubious" here on SourceForge!!!

Beyond that, it may not help much. A lot of graphics - especially the "tricks" - is done completely differently in 32-bit code (Windows or Linux, or whatever... not a "law of nature"). What you'd learn from a disassembly may well not work - and it might jump through "bank switching" hoops the you'd no longer need. It can be "adapted", of course, but it *might* be easier (and legaler) to observe what the program does, and "do it" from scratch.

But charging blindly ahead anyway... We can distinguish a 16-bit executable from a 32-bit (Windows - "Portable Executable") one by loading it up in... a text editor will do. The first two bytes would be "MZ" in any case (or it's something else entirely). The 32-bit version would also have a "PE" sig - I forget the offset, but it shouldn't be hard to find.

An alternative would be to disassemble it with ndisasm -b 16 vs ndisasm -b 32. One or the other won't "make sense". For code that includes both 16- and 32-bit code, you'd want to disassemble it twice and paste the appropriate parts together to get it "right". Presumbably it's *not* 64-bit code - be thankful for small favors.

It won't "make sense" regardless of bitness if you're disassembling data instead of code. Learning to read the .exe header will help locate code (if it's a .com file, you're in luck!!!)... I often rely on trial-and-error... In any case, it'll probably take multiple tries to "refine" the command line to disasm - might be worth writing a batch file to run it from. You don't need a "perfect disassembly" to learn something about how the code does what it does.

You'll want some sort of a "hexdump" utility, besides a disassembler - I like "Biew" (which disassembles, too) - available here at SF - mostly because it's available for Windows or Linux, and works about the same... There are others, including "homemade".

If your "dazzle" isn't readily available... I can be found at fbkotler at verizon dot net... Wouldn't want to encourage you to do anything illegal, of course... Shame to "lose" some of the old code...

Best,
Frank

nobody

  • Guest
Re: reverse engineering old dos program
« Reply #2 on: April 07, 2008, 12:56:05 AM »
> Since the 1980's I have used this wonderful kaleidascope screensaver called Dazzle.

License = ??? Post download link of possible. Or can you send it by mail ?

> should I download the nasm 16bit binaries or will the 32bit binaries be ok?

32-bit HOSTED NASM and NDISASM support 16-bit as well ;-)

> I would really love to preserve this great program.

No problem. Just keep DOS ... or download a new one:

http://www.freedos.org
http://www.drdos.org

nobody

  • Guest
Re: reverse engineering old dos program
« Reply #3 on: April 07, 2008, 01:36:09 AM »
If the software was that good you may find that what you are asking has already been done. Google lists software similar if not the same to that you described

http://perishablepress.com/press/2007/03/03/dazzle-marvel-and-wonder/

Version 4.1 1991, there also seems to be a 5.2 version 1997 (both 30day shareware).