A computer program signature may be determined based on the function flow grammar for a given source code. The function flow grammar may be determined based on reduced control flow graphs generated based on control flow graphs for each function within the source code. A polymorph of a computer program may be detected by comparing the determined computer program signature with computer program signatures, which may be included in a database.