Well I did that but I used Belarc Advisor to get the product key. You cannot use "exactly the same version of Windows 8 that the pc came with" because manufacturers no longer supply any recovery disks with their computers. You have to make your own recovery disks, which you are prompted to do but an awful lot of people do not do that. If you try to do a clean install of Windows with a basic copy of windows using the extracted product number it will not install. There are multiple settings that have to be changed in the bios to allow you to do that and unless you a) know how to get into the bios, and, b) then actually know what to change in the bios, then you will not install Windows from any different Windows disk other than the original one that was used to install that copy of Windows or from the recovery disks that you, Hopefully, made. Of course the problem with using any recovery disks that you, hopefully, remembered to make also puts puts back all the malware that the computer manufacturer put on there in the first place.
By "Exactly the same version of Windows," I am referring to either OEM or Retail, whether it's Standard/Pro, and whether it was 32 or 64 bit.
The recovery discs are NOT a fresh install of Windows, they return the original bloatware and such onto the drive. What used to be on recovery disks is now on a hidden partition on the harddrive (you can usually access it via a desktop application, or by hitting F8 on startup and accessing the repair function)
Oh, and by the way, when you create recovery discs, they are generally created using the recovery partition, so if malware is on your windows installation then no, making recovery disks will not pass the malware onto them. (Excluding malware which has somehow infected the recovery partition, which would be difficult considering it's not mounted)
Windows 7 discs came with an ei.cfg file which:
A) Specified with the use of a boolean (in the form of a 1 or 0) whether the disc was "Retail or not"
B) Specified which version of Windows the disc was for.
With these you could either modify the ei.cfg, or rename it so any version of windows could be installed (with the exception of 32 and 64 bit, these were on separate discs)
My best suggestion would be to get the Windows 8 disc image (.iso), create a bootable USB drive, search it for an equivalent to the Windows 7 ei.cfg file, and see if you can mess around with it.
Hope this helps.