摘要 |
<p>The present invention provides an anti-virus method and apparatus and a firewall device. The method includes: receiving, by a first thread, data packets belonging to the same data stream and transmitted in a network, and sequentially buffering payload data of data packets bearing file content among the received data packets into a first queue; reading, by a second thread, payload data of at least one data packet from a start position of the first queue, and determining, according to the read payload data, whether payload data in the first queue is file content of a compressed file; if it is determined that the payload data in the first queue is the file content of the compressed file, identifying a compressed format of the compressed file; querying a decompression algorithm corresponding to the identified compressed format from a mapping between a compressed format and a decompression algorithm; by using the queried decompression algorithm, reading payload data of data packets one by one from the first queue, and performing decompression processing separately on payload data that is read each time; and performing anti-virus detection separately on file content that is obtained after each time of decompression processing.</p> |