Buy a legit Windows 8.1 or 8.1 Pro disk on Amazon (I recommend the system builder pack, since it's cheaper and allows clean installs.) and during the install, when asked where you want to install Windows, select the disk you're installing onto, click the hyperlink to show advanced options and choose format to remove all traces of the pirated copy. Then, delete all the partitions on that disk and install from there. Windows will automatically activate once you connect to the internet.