But Keygen is a Source of Hacking Software

But avast should protect only against infections and malware.
It's not intended to protect intellectual property of 3rd party softwares.
So, if it is an inoffensive keygen (i.e., only generates keys), it won't be detected.