Sounds like your describing a File -Infecting Virus
A file-infecting virus is one of the most common types of virus. Typically, it infects files with .exe or .com extensions. When the infected file is accessed or executed, it may be partially or completely overwritten by the virus. A file-infecting virus can also spread across the system and over the network to infect other systems. Moreover, a severe form of file-infecting virus can also completely reformat a hard drive. Win32.Sality.BK is a popular file-infecting virus that was among the top 10 malware infections in 2011 and 2012.
Viruses may use a separate file to run the program and rename the original file to another extension so the exe is run before the com.