How ocatak/malware_api_class works
Below are step-by-step instructions and guidelines specific to this project:
Main Components
a. Data Storage and Dataset:
• The “hashes” directory contains a mass of subfolders with numbered directories that likely store API call fingerprints or hashed representations.
• Additional dataset files such as “labels.csv”, “ApiIndex.txt”, and the zipped archive “mal-api-2019.zip” represent the raw data.
b. Data Analysis & Processing Modules:
• The “src” folder is the heart of the analysis. It contains sub-modules:
– “src/common” for utility functions like “HashMap.py” and WinApi related helpers.
– “src/multiclass” where various machine learning parameters and runners (e.g., AnalizeRunner.py, DTParameter.py, KNNParameter.py, LSTMMultiClass.py, SVMParameter.py) are implemented.
– “src/other” hosting an alternate set of analysis scripts, possibly for a different analysis workflow.
– “src/utility” which hosts additional support scripts. This includes integration with external services (e.g., VTService.py for VirusTotal API), filtering and extraction routines, and results management.
c. External Dependencies / Services:
• The README indicates that API calls to VirusTotal are performed (via VTService.py) to gather malware family information.
• There are also external datasets referenced (the sample_analysis_data.csv, official dataset links, etc.).
Relationships and Interactions
• Data Flow: The dataset from “hashes”, “labels.csv”, or the zip file is input for various analysis routines.
• The “src/multiclass” and “src/other” modules are responsible for processing this data using different machine learning algorithms. They likely interact with data provided via “src/common” and “src/utility” for pre-/post-processing.
• External integration: The VTService module in “src/utility” communicates with the VirusTotal API, indicating that some processing steps include external API calls.
• Support Scripts: Utility scripts like “analize_filter.py”, “group_malware_accordingto_type.py”, and others manage specific utility tasks (e.g., grouping, filtering, converting API call logs).
Architectural Patterns & Design Principles
• Modularity: The clear partitioning of code into “common”, “multiclass”, “other”, and “utility” suggests a modular design—each folder encapsulates a slice of the functionality.
• Separation of Concerns: Data management (dataset files and directories) is separated from algorithmic processing (analysis modules) and from external integrations (VTService and API-related operations).
• Extensibility: With different scripts and modules for various ML methods (SVM, LSTM, etc.) and different analysis workflows, it is designed to allow easy extension or substitution of the analysis components.