My agency has a dog that does nothing except bodies, explosives, and guns. He is part black lab mixed with something else. The dog is flat out incredible. There have been many times he has been called out to find a gun thrown after a chase or otherwise disposed of. Not only has he found the weapon in question, but frequently finds multiple other guns that were not the subject of the search. He is also trained to sniff out explosives.
I can ask next week when I go back to work, but I'm pretty sure he smells the chemicals produced by the combustion of the powder.
He is also trained to find bodies and boy is he good. One of the boats our dive/search/recovery team uses has a special platform built on the front. The dog lies down on the platform and sticks his head out over the water. He can actually detect bodies underwater. According to his handler, what he smells is the methane (and other chemicals from the decaying body) bubbling up to the surface. In fact, this is the second dog our agency has had that can do this. The platform on the boat was actually constructed for the previous dog. On more than one occasion, both dogs have smelled the chemicals so strongly that they dove off the platform.
I have watched both the retired and the active dog search for both guns and bodies. it is impressive. Each dog has or had a very specific indicator for explosives, guns, or bodies. I am always amazed when I watch my agency's canines work.