How does a computer virus work in general?
Generally, a computer virus attacks a file/program, and then injects a bunch of complex direction codes that make the program a zombie. So the virus basically kills and then mutates the code of a program, either making that infected program another copy of the virus that attacked it, or a powerhouse factory that automatically makes copies of the virus, which means that the program now is like a mass production factory making copy after copy after copy of the virus.