How shreyansh26/opcodes-for-malware-detection works
Project type and purpose
• This is a standalone command-line machine-learning pipeline for malware detection.
• It takes ELF binaries as input, extracts opcode statistics, preprocesses them into ARFF/CSV datasets, applies pre-trained models (J48, JRip, Random Forest), and outputs classification results.
• It uses Python for orchestration and preprocessing, and Java (Weka) for model evaluation.
File structure
Top-level items:
• elf/ – input folder of ELF binaries (malware & benign)
• benign.csv, malware.csv – labeled opcode frequency datasets
• opcode_freq.py – Python script to extract opcode frequencies
• preprocess.ipynb – exploratory notebook for preprocessing
• run_system.py – main Python orchestrator
• models/ – stored pre-trained Weka models (.model files)
• system/
– preprocess.py – Python preprocessing module
– evaluate.java – Java code that loads ARFF and models, then classifies
– weka.jar – Weka library
– final.arff/.csv – consolidated dataset outputs
– Makefile – build/run targets
• results*.csv – output classification results
Patterns & choices:
• A linear ETL+ML pipeline
• Separation of concern: data ingestion → feature extraction → dataset assembly → model evaluation
• Mixed-language approach: Python for data prep, Java (Weka) for classification
README for additional insights
• Entry point: python run_system.py
• Models have been pre-trained; current code focuses on evaluation on new ELF files.