![]() |
Panoptes 1.0.0
Endpoint Detection and Response
|
#include "PanoptesML.h"#include <algorithm>#include <cstring>#include <iostream>#include <mutex>#include <stdexcept>Go to the source code of this file.
Functions | |
| BOOL APIENTRY | DllMain (HMODULE module, DWORD reason, LPVOID reserved) |
| PANO_API int | PanoBind (int ContainerPort) |
| Registers with the Panoptes Service: the extensibility type and the port of the container this module runs in. | |
| PANO_API bool | PanoEntry (PeScan *data) |
| Scores one file with the model and reports the result to the service. The file is only read: its static features are computed from its bytes and headers. | |
| PANO_API int | PanoMlScoreFile (const wchar_t *Path, PanoMlTestResult *Result) |
| Computes a file's features and scores them with the model (embedded, or model.onnx from the DLL's folder). The file is only read. Thread-safe. | |
| PANO_API int | PanoMlFeatureName (int Index, char *Buffer, int BufferSize) |
| Copies the name of feature Index (e.g. "byte_4d", "section_entropy_max") into Buffer. | |
| PANO_API bool | PanoUnbind () |
| Called once when the container shuts down. | |
| BOOL APIENTRY DllMain | ( | HMODULE | module, |
| DWORD | reason, | ||
| LPVOID | reserved ) |
Definition at line 60 of file dllmain.cpp.
| PANO_API int PanoBind | ( | int | ContainerPort | ) |
Registers with the Panoptes Service: the extensibility type and the port of the container this module runs in.
Definition at line 72 of file dllmain.cpp.
References EXTENSIBILITY_TYPE_ML, PanoptesServiceClient::Hello(), and PANO_API.
Scores one file with the model and reports the result to the service. The file is only read: its static features are computed from its bytes and headers.
A result is reported for every file, including one that couldn't be scored (Error says why), so the service and a scanner waiting on it know the ML scan has finished.
Definition at line 87 of file dllmain.cpp.
References MlScanResult::Error, ExtractPeFeatures(), PeScan::FileHash, MlScanResult::IsPe, PeFeatures::IsPe, MlScanResult::Malicious, MlScanResult::Model, MlModel::Name(), PANO_API, PANO_ML_THRESHOLD, PeScan::PePath, MlModel::Score(), MlScanResult::Score, PanoptesServiceClient::SendResults_ML(), and PeFeatures::Values.
| PANO_API int PanoMlFeatureName | ( | int | Index, |
| char * | Buffer, | ||
| int | BufferSize ) |
Copies the name of feature Index (e.g. "byte_4d", "section_entropy_max") into Buffer.
Definition at line 181 of file dllmain.cpp.
References FeatureName(), and PANO_API.
| PANO_API int PanoMlScoreFile | ( | const wchar_t * | Path, |
| PanoMlTestResult * | Result ) |
Computes a file's features and scores them with the model (embedded, or model.onnx from the DLL's folder). The file is only read. Thread-safe.
Definition at line 141 of file dllmain.cpp.
References PanoMlTestResult::Error, ExtractPeFeatures(), FEATURE_COUNT, PanoMlTestResult::FeatureCount, PanoMlTestResult::Features, PanoMlTestResult::FeatureVersion, PanoMlTestResult::IsPe, PeFeatures::IsPe, PanoMlTestResult::Malicious, PanoMlTestResult::Model, MlModel::Name(), PANO_API, PANO_ML_FEATURE_VERSION, PANO_ML_TEST_FAILED, PANO_ML_TEST_NO_MODEL, PANO_ML_TEST_OK, PANO_ML_THRESHOLD, MlModel::Score(), PanoMlTestResult::Score, PanoMlTestResult::StructSize, PanoMlTestResult::Threshold, and PeFeatures::Values.
| PANO_API bool PanoUnbind | ( | ) |
Called once when the container shuts down.
Definition at line 198 of file dllmain.cpp.
References PANO_API.