Your biggest problem maybe that your pirated copy came 'pre-infected' with Trojan or Rootkit infection.
Before you do anything else you should make sure your system is safe for you to use.
I'd suggest making a bootable CD with an AV program installed and do a thorough system scan.
AVG Rescue CD is a good option and you can read about how to use it here: http://www.avg.com/ww-en/226386
If it turns out you're system is clean you can buy a genuine copy and update with the new Product Key without having to re-install the OS.
Changing Windows 7 Product key: From the Start menu right click on Computer and choose Properties.
Click on Change Product key link after your Windows 7 at the bottom of the System Properties screen..
Enter New Product Key and click on next to activate your Windows 7 installation.