update
This commit is contained in:
@@ -62,9 +62,20 @@ class MachineLearning {
|
||||
MachineLearning();
|
||||
~MachineLearning();
|
||||
|
||||
// 主函数:提取特征并导出到CSV
|
||||
bool ExtractFeatures(const uint8_t* buffer, size_t bufferSize,
|
||||
const std::string& outputPath);
|
||||
// 提取特征并返回特征向量
|
||||
std::vector<double> ExtractFeatures(const uint8_t* buffer,
|
||||
size_t bufferSize);
|
||||
|
||||
// 将特征导出到CSV
|
||||
bool ExportToCSV(const std::vector<double>& features,
|
||||
const std::string& outputPath);
|
||||
|
||||
// 批量处理目录中的样本并生成CSV
|
||||
bool ProcessDirectory(const std::string& directoryPath,
|
||||
const std::string& outputCsvPath);
|
||||
|
||||
// 读取文件到内存
|
||||
std::vector<uint8_t> ReadFileToBuffer(const std::string& filePath);
|
||||
|
||||
private:
|
||||
// 特征提取辅助函数
|
||||
@@ -81,10 +92,6 @@ class MachineLearning {
|
||||
int GetOpcodeType(const void* code, bool isX64);
|
||||
double CalculateEntropy(const uint8_t* data, size_t size);
|
||||
|
||||
// 将特征导出到CSV
|
||||
bool ExportToCSV(const std::vector<double>& features,
|
||||
const std::string& outputPath);
|
||||
|
||||
// 常量定义
|
||||
std::vector<std::string> _properties;
|
||||
std::vector<std::string> _libraries;
|
||||
|
||||
Reference in New Issue
Block a user