Decompiling Bill

      • I dunno that much about programming (yet), but,
  • One of the arguments about Microsoft’s dominance/monopoly is that they’ve never released the source code to Windows. Well shoot, it seems to me that anyone who has a Windows OS CD has a pretty good copy of the machine code. Why can’t ya just write another program to read what’s on the disk, detrmine the language you’d need to duplicate it, and then have the computer “translate” it into that language? Or is that what people do? - (I’ve not heard of any source code being available on the net, but I don’t move in those circles. I would be amazed if it ain’t already out there somewhere.) - The EULA says you agree not to decompile it, but it also says you agree not to copy it too and the entire eastern half of the planet runs on pirated versions of Windows. - MC

It would be possible to get the machine code translated back up to a higher language… but it still wouldn’t look anything like the original source code. None of the variables or procedures would have names that indicated their purpose. The structure of programs is optimised when compiling, so information that is useful to reading and understanding code is lost when translated to machine code.

All in all, it would be theoretically possible, but Windows is too huge for anyone to actually spend the time deciphering the machine generated reverse engineered code that would result.

At least, that’s why I haven’t done it yet. :slight_smile:

Look at it this way:

Let’s say that you are trying to access a supercomputer so that you can save the world from an alien invasion. You know that the password to the computer consists of 10 numbers, and that the sum of these 10 numbers all add up to 1000. You can also assume that SOME of the numbers will be the same, but others won’t. That’s ALL you know.

Out of all the possible combinations, there is simply no way that you’ll get all 10 numbers right (in the correct order, too!) on the first try. EVENTUALLY, you’ll get it–but what if there were a million numbers and they all added up to 500 Trillion?

That’s kinda how decompiling goes…you know what the final outcome is, and you can make an educated guess about how many components there are. But the actual “guts” of the code remain unknown.

Smaller programs can eventually be decompiled and ported to other formats (it’s some serious work, though!) For an entire OS, especially one as complex as Windows, then without the source to use as a map, forget it!

If you ARE interested in decompiling, Visual Basic programs are fairly easy to break down…that would probably be a good place to start. After that, get SoftIce and see what you can do on C++/Assembly programs.


Nothing is truly random, not even computer generated codes…But then again it would still take years and years and years…most likely

The whole closed-source thing is a bunch of crybaby nonsense anyway. I don’t know of any commercial OS that is open source. MacOS, Solaris, Digital Unix, MVS, IRIX et. al are all closed source, at least at the kernel level. This is basically required in order to protect your R&D costs from being exploited by someone (and if a foreigner did it, depending on where they are it could well be impossible to protect a copyright).

Man-o-man, that code is bad enough in its original source state. I get a headache even THINKING about what it might look like decompiled. Yes, I’ve had the pleasure of working with some of Microsoft’s code. It ain’t pretty, to say the least. But then, whose is?

This might have been a practical thing back when 6502 and 8080/Z80 processors were dominant in the Apple II,Commodore 64 and CP/M days. Processors and programs were vastly more simple then so an assembly language program even without comments or meaningful variable and routine names could still be useful. If you were able to disassemble W89 I think you’d be hatin’ life.

Did anyone see the Futurama episode where the X-ray gun revealed a 6502 in Bender’s head?

Sorry, W98. And two pickets to tittsburgh please.

If anyone would like to see a sample of MS Windows source, then get any of the various MFCxxx.h files and open it up.

The MFC stands for Microsoft Foundation Class, and it is exactly what its name implies. The .h file, when compiled, makes the .DLL file of the same name (MFC40.H will compile to MFC40.DLL, for instance.)

It ships with MS Visual Studio, but I’m sure that it’s also on the web.


Pedant point here: The .h files contain declarations, not actual code… the actual code is found in several .c or .cpp files (something as big as the MFC DLL wouldn’t have all of its code in a single file).

I believe the MFC source code is included with higher-end versions of the compiler, but the .h files need to be included with every version in order for programs to be written that use MFC.

Speaking of MFC, I once won 256 meg of RAM in a contest where you were asked to say in one sentence what you would do with 256 meg of RAM. (That was back when that was a lot.) My answer was: If I had 256 meg of RAM, I would write a “hello world” program using the Microsoft Foundation Classes.

“It is lucky for rulers that men do not think.” — Adolf Hitler

Cute, Libertarian :slight_smile:

Mr2001–you’re correct, of course.

I could have sworn that I had the .c and .cpp files for at least one of the MFCs, but alas… Good save!

Libertarian–TOO funny!