Attack Virus

I had a problem with a virus that was downloaded along with an EA, started to operate in a messy way and emptied all my accounts. How did this happen?