It might even pass the *message* whole to the scanners.. I know most tools like clamav can deal with being fed a raw mime-822 message and parse out all the attachments, decompress them, scan them, without any external help.
But do they use their own archive code or libraries from others? I would guess that they link to the Info-Zip libraries for zip and gz formats.