Most of traditional antivirus systems fail to detect unknown malcodes or variants. Data mining method solves this problem as it classifies new malcodes by matching representative features. Feature selection is a key to apply data mining to successfully detect malcodes. In this paper, we propose a method, Weighted Information Gain (WIG), which can select effective features more correctly by combining the advantages of Information Gain with feature frequency. The experiment results demonstrate that the proposed method achieves high detection and accuracy rate.