I have to agree with the others and say it sounds hardware related. Malware for mac is pretty uncommon and when it does pop up it's usually designed to steal information, not destroy your computer. If you have the os install disk that came with it you should be able to boot from that to get into the recovery partition, provided your optical drive still works. From there you can try to read the disk to see if you'll be able to recover any data and access disk utility to try to repair the disk. It's been a while since I've been in one of those imacs but there not that hard to work on. The glass is held down by magnets and you'll need a pair of suction cups to pull it off. Just pull evenly on both sides and you should be fine. ifixit has lots off good information on repairing macs
https://www.ifixit.com/. Repairs at the apple store can be expensive. In my opinion 5 years is a good run for a computer (at work we swap ours out after 3 but my personal mac is pushing 6) and I'd say you got your money out of it now that it's going on 7. If you feel confident swapping the drive by all means go for it. Spinning disks are cheap right now, if you don't need lots of space a ssd would give a nice performance boost.
Andy