From 46e14f232ebf49338f7a96ce947049c3d3cde49b Mon Sep 17 00:00:00 2001 From: S03D4-164 Date: Sat, 16 May 2020 09:25:05 +0900 Subject: [PATCH] Changes for YARA 4.0 API --- src/yara.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/yara.cc b/src/yara.cc index 43d3d46..f2fb405 100644 --- a/src/yara.cc +++ b/src/yara.cc @@ -41,9 +41,9 @@ enum VarType { #define ERROR_UNKNOWN_STRING "ERROR_UNKNOWN" void compileCallback(int error_level, const char* file_name, int line_number, - const char* message, void* user_data); + const YR_RULE* rule, const char* message, void* user_data); -int scanCallback(int message, void* data, void* param); +int scanCallback(YR_SCAN_CONTEXT* context, int message, void* data, void* param); const char* getErrorString(int code) { size_t count = error_codes.count(code); @@ -523,7 +523,7 @@ class AsyncConfigure : public Nan::AsyncWorker { }; void compileCallback(int error_level, const char* file_name, int line_number, - const char* message, void* user_data) { + const YR_RULE* rule, const char* message, void* user_data) { CompileArgs* args = (CompileArgs*) user_data; std::ostringstream oss; @@ -862,7 +862,7 @@ class AsyncScan : public Nan::AsyncWorker { ScanReq* scan_req_; }; -int scanCallback(int message, void* data, void* param) { +int scanCallback(YR_SCAN_CONTEXT* context, int message, void* data, void* param) { AsyncScan* async_scan = (AsyncScan*) param; YR_RULE* rule; @@ -898,7 +898,7 @@ int scanCallback(int message, void* data, void* param) { } yr_rule_strings_foreach(rule, string) { - yr_string_matches_foreach(string, match) { + yr_string_matches_foreach(context, string, match) { std::ostringstream oss; oss << match->offset << ":" << match->match_length << ":" << string->identifier;