A virus Scanner is a component of an Antivirus software package that scans the computer drive to detect virus and other malicious items. It uses a database called a virus dictionary which has lots of codes from different known viruses. When anti-virus scans a file, it will take a snippet of that code and compare it with the codes in their virus dictionary, if the files match then the virus attack on a computer is confirmed. If you want to know more about how virus scanner works, read this article https://antivirus.comodo.com/blog/comodo-news/what-is-virus-scanner/?af=9557