how do you know it is illegal? If you have a valid or alternate windows key, you should be able to enter that. The installation, or the disk, or the iso is not necessarily the illegal part. It is the method of activation used.
I like aford10's advice.
If it's an unlicensed copy you won't need to remove it. Just get a valid license / product key and use that to update/change the status from illegal to legal.