Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for YARA 4.0 API #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/yara.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down