What kind of malicious thing would be dreamt up? Would the hacker give the AI nightmares? A bad LSD trip? There was a science fiction novel (that became a bad movie) where people could plug a chip into their head, and relive someone’s memories. Someone decided that it would be “fun” to use that to turn people into raging animals.

If a robot were injected with a “virus,” what would happen?

I would not be surprised that, in the future, AIs were constructed using biological components, i.e., neural material. A few years ago, rat-to-rat brain interface was done, and the next year a human-to-rat brain interface was done at Harvard. And let’s see, there were the four rat brains ganged together, the rat brain cells used to drive a car, and the rat brain simulated in a computer. In a century, I would easily expect products using neural material.