What do you mean by factory reset? You restored windows to original state?
Best solution would be to format the PC HDD/SSD/NVme and reinstall windows since you already lost all your files.
When you format your drive you will loose all your data this should also remove any Malware that was installed.
Change your router wifi passwords try to protect your windows login account with a password as well. Most people today don't bother doing this.
Some quick things to try.
Install and run this app can help with some Malware and restore windows Winsock to default settings after the scan completes choose
Run basic Repair.
AdwCleaner is a free program that searches for and deletes Adware, Toolbars, Potentially Unwanted Programs (PUP), and browser Hijackers from your computer. By using AdwCleaner you can easily remove many of these types of programs for a better user experience on your computer and while browsing...
www.bleepingcomputer.com
View attachment 341396
Second quick but fast Malware and Virus Scanner with very good malware detection rate.
Select Run Full system scan option.
View attachment 341397
If there is a hardware level malware then you would need professional help and I would take it to a PC shop.