A Semantics-Based Approach to Malware Detection