Self Modifying code to extract CPUID information

This is a very rough and ready C program that is more intended to demonstrate self-modifying code rather than a comprehensive extraction of CPUID information. A zip file contains the code along with this README and project/workspaces for VC++ 6/7 and DevC++, a Release mode executable built with VC6 for those of you willing to trust my binaries. To build in *nix this works fine: "cc SelfModifyingCPUID.c" and produces a.out (or a.exe on cygwin). I have included several text files with output from various machines with various OSs for your amusement.

This program should work fine on any x86 based computer, but it has only been tested on Intel CPUs because that is all I have access to. Additionally, I only tested it with Win2K and Linux as that is all I had access to. If you have other results, I would love to hear about it. If you find any problems with the program I would also like to hear about it, but only if it is related to the code and not the actual CPUID information (there are plenty of programs (some even free) available that do a much better job (and are graphical!) in reporting this information). I can be reached at koxenrider[at]sol[dash]biotech[dot]com if you have constructive information to impart. If your communication is non-constructive, I have no email address.

For those of you interested in the self-modifying code bit, there is also a little code showing how to do addition with SMC, a bit more in the way of baby steps to get you started.

No warrantee expressed or implied, use at your own risk!