@automattic/yara 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.dockerignore ADDED
@@ -0,0 +1,6 @@
1
+ Dockerfile
2
+ README.md
3
+ build/
4
+ deps/yara-*
5
+ example/
6
+ node_modules/
@@ -0,0 +1,14 @@
1
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2
+ # https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#package-ecosystem
3
+ version: 2
4
+
5
+ updates:
6
+ - package-ecosystem: "npm"
7
+ directory: "/"
8
+ schedule:
9
+ interval: "daily"
10
+
11
+ - package-ecosystem: "github-actions"
12
+ directory: "/"
13
+ schedule:
14
+ interval: daily
@@ -0,0 +1,108 @@
1
+ # Here we build the yara.node binary, package it and copy it to the repository.
2
+ # Both MacOS and Linux (Debian-based) versions are built here.
3
+ name: Build the binary
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+
10
+ # allow these jobs to commit to the repository
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ # We need to use the node-yara binary on Debian 10.x machines
16
+ # hence we're using the container to build it
17
+ build-debian:
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ node-version:
22
+ # - '14'
23
+ - '16'
24
+ # - '18'
25
+
26
+ runs-on: ubuntu-22.04
27
+
28
+ steps:
29
+ - uses: actions/checkout@v3
30
+
31
+ - name: Build binaries inside the container
32
+ run: |
33
+ set -x
34
+
35
+ # what's the package version?
36
+ # e.g. Binary staged at "build/stage/Automattic/node-yara/raw/master/binaries/yara-v2.5.0-linux-x64.tar.gz"
37
+ export PACKAGE_VERSION=$(jq -r .version package.json)
38
+
39
+ # build inside the container and copy the package to the host
40
+ docker build -t yara/debian .
41
+ docker images
42
+ docker run --rm --volume /tmp:/tmp yara/debian cp ./binaries/yara-v${PACKAGE_VERSION}-linux-x64.tar.gz /tmp
43
+ ls -lh /tmp/yara-v${PACKAGE_VERSION}-*
44
+
45
+ # copy it to the repository clone and see if there's a difference
46
+ cp /tmp/yara-v${PACKAGE_VERSION}-* ./binaries
47
+ git status --porcelain
48
+
49
+ # By default, the commit is made in the name of "GitHub Actions"
50
+ # and co-authored by the user that made the last commit.
51
+ # https://github.com/marketplace/actions/git-auto-commit
52
+ - name: Commit the changes to the binary files
53
+ if: false # node-gyp builds are not reproducible, hence each build would create a "new" commit -> disabling for now (comment out this line if needed)
54
+ uses: stefanzweifel/git-auto-commit-action@v4
55
+ with:
56
+ ref: ${{ github.head_ref }} # https://github.com/marketplace/actions/git-auto-commit#checkout-the-correct-branch
57
+ commit_message: Commit the binary package changes for Linux / Node.js ${{ matrix.node-version }}
58
+ file_pattern: './binaries/*.tar.gz'
59
+
60
+
61
+ build-macos:
62
+ strategy:
63
+ fail-fast: false
64
+ matrix:
65
+ node-version:
66
+ # - '14'
67
+ - '16'
68
+ # - '18'
69
+
70
+ runs-on: macos-12
71
+
72
+ steps:
73
+ - uses: actions/checkout@v3
74
+
75
+ - name: Setup MacOs
76
+ run: brew install autoconf automake libmagic
77
+
78
+ - name: Use Node.js ${{ matrix.node-version }}
79
+ uses: actions/setup-node@master
80
+ with:
81
+ node-version: ${{ matrix.node-version }}
82
+
83
+ - name: Build binaries with node-pre-gyp
84
+ run: |
85
+ set -x
86
+ npm install --ignore-scripts
87
+ time -p npx node-pre-gyp configure rebuild
88
+
89
+ otool -L build/Release/yara.node
90
+
91
+ npx node-pre-gyp configure package
92
+
93
+ cp ./build/stage/Automattic/node-yara/raw/master/binaries/yara-*.tar.gz ./binaries
94
+ git status --porcelain
95
+
96
+ - name: Run tests
97
+ run: npm test
98
+
99
+ # By default, the commit is made in the name of "GitHub Actions"
100
+ # and co-authored by the user that made the last commit.
101
+ # https://github.com/marketplace/actions/git-auto-commit
102
+ - name: Commit the changes to the binary files
103
+ if: false # node-gyp builds are not reproducible, hence each build would create a "new" commit -> disabling for now (comment out this line if needed)
104
+ uses: stefanzweifel/git-auto-commit-action@v4
105
+ with:
106
+ ref: ${{ github.head_ref }} # https://github.com/marketplace/actions/git-auto-commit#checkout-the-correct-branch
107
+ commit_message: Commit the binary package changes for MacOS / Node.js ${{ matrix.node-version }}
108
+ file_pattern: './binaries/*.tar.gz'
@@ -0,0 +1,44 @@
1
+ # Check if the binaries we have in this repository actually work when "npm i" is run
2
+ name: Install and test the binary
3
+
4
+ on:
5
+ push:
6
+ branches: [ master ]
7
+ pull_request:
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ node-version:
15
+ # - '14'
16
+ - '16.16'
17
+ # - '18'
18
+ container:
19
+ - 'node:16.16-buster-slim'
20
+ - 'node:16.16-bullseye-slim'
21
+ - 'debian:unstable-slim'
22
+
23
+ runs-on: 'ubuntu-22.04' # the host system for the Action to be run, tests will be run inside the containers defined above
24
+
25
+ container:
26
+ image: ${{ matrix.container }}
27
+
28
+ steps:
29
+ - uses: actions/checkout@v3
30
+
31
+ - name: Use Node.js ${{ matrix.node-version }}
32
+ if: matrix.container == 'debian:unstable-slim' # node:16.16 containers already have Node.js installed, obviously :)
33
+ uses: actions/setup-node@master
34
+ with:
35
+ node-version: ${{ matrix.node-version }}
36
+
37
+ - name: Print distro and Node.js version information
38
+ run: cat /etc/os-release && node -v && npm -v
39
+
40
+ - name: Install the package
41
+ run: npm install
42
+
43
+ - name: Run the tests
44
+ run: npm test
@@ -13,7 +13,7 @@ jobs:
13
13
  publish-npm:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
- - uses: actions/checkout@v2
16
+ - uses: actions/checkout@v3
17
17
  - uses: actions/setup-node@v1
18
18
  with:
19
19
  node-version: 14
@@ -1,7 +1,5 @@
1
- # This workflow will do a clean install of node dependencies, build the source code and run tests
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
- name: Tests
1
+ # Check if the binaries we have in this repository actually work when "npm i" is run
2
+ name: Install and test the binary
5
3
 
6
4
  on:
7
5
  push:
@@ -10,26 +8,29 @@ on:
10
8
 
11
9
  jobs:
12
10
  test:
13
- runs-on: ubuntu-latest
14
-
15
11
  strategy:
16
12
  fail-fast: false
17
13
  matrix:
18
14
  node-version:
19
- - '14.x'
20
- - '16.x'
15
+ # - '14'
16
+ - '16'
17
+ # - '18'
18
+ os:
19
+ - 'ubuntu-22.04'
20
+ - 'macos-12'
21
+
22
+ runs-on: ${{ matrix.os }}
21
23
 
22
24
  steps:
23
- - uses: actions/checkout@v2
25
+ - uses: actions/checkout@v3
26
+
24
27
  - name: Use Node.js ${{ matrix.node-version }}
25
- uses: actions/setup-node@v1
28
+ uses: actions/setup-node@master
26
29
  with:
27
30
  node-version: ${{ matrix.node-version }}
28
31
 
29
- - name: Install dependencies
30
- run: |
31
- sudo apt-get install libyara-dev
32
- npm install
32
+ - name: Install the package
33
+ run: npm install
33
34
 
34
- # - name: Run tests
35
- # run: npm test
35
+ - name: Run the tests
36
+ run: npm test
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 16.16.0
package/Dockerfile ADDED
@@ -0,0 +1,40 @@
1
+ # this container is used to build binaries for Debian 10 (aka oldstable)
2
+ FROM node:16.16-buster-slim
3
+
4
+ RUN apt-get update -y && \
5
+ apt-get install -y \
6
+ autoconf \
7
+ build-essential \
8
+ curl \
9
+ libmagic-dev \
10
+ libssl-dev \
11
+ libtool \
12
+ pkg-config \
13
+ python3 \
14
+ time
15
+
16
+ WORKDIR /opt/a8c/node-yara
17
+ ENV HOME /opt/a8c/node-yara
18
+
19
+ # leverage the build cache by copying only the dependencies definition
20
+ COPY package.json .
21
+ RUN npm install --ignore-scripts
22
+
23
+ # now, let's copy the rest of the code
24
+ COPY . .
25
+
26
+ # we do not need root anymore
27
+ RUN chown -R nobody:nogroup ${HOME}
28
+ USER nobody
29
+
30
+ # build and test it
31
+ RUN time -p npx node-pre-gyp configure rebuild && \
32
+ npm t
33
+
34
+ # see dynamic dependencies
35
+ RUN ldd build/Release/yara.node
36
+
37
+ # prepare a tar.gz package and copy it to the binaries/ directory
38
+ RUN npx node-pre-gyp package && \
39
+ cp build/stage/Automattic/node-yara/raw/master/binaries/yara-*.tar.gz ./binaries && \
40
+ ls -lh ./binaries
package/Makefile ADDED
@@ -0,0 +1,34 @@
1
+
2
+ BASE=$(shell pwd)
3
+ OSNAME=$(shell uname)
4
+
5
+ CFGOPTS += --with-crypto
6
+ CFGOPTS += --enable-magic
7
+
8
+ ifeq ($(OSNAME),Darwin)
9
+ CFLAGS += -I/usr/local/include/node
10
+ CFLAGS += -I/usr/local/include
11
+ LDFLAGS += -L/usr/local/lib
12
+ endif
13
+
14
+ YARA?=4.2.3
15
+
16
+ libyara: yara
17
+
18
+ yara:
19
+ -rm -rf $(BASE)/build/yara
20
+ -rm -rf $(BASE)/deps/yara-$(YARA)
21
+ test -f $(BASE)/deps/yara-$(YARA).tar.gz || curl -L -k https://github.com/VirusTotal/yara/archive/v$(YARA).tar.gz > $(BASE)/deps/yara-$(YARA).tar.gz
22
+ cd $(BASE)/deps && tar -xzvf yara-$(YARA).tar.gz
23
+ cd $(BASE)/deps/yara-$(YARA) && ./bootstrap.sh
24
+ cd $(BASE)/deps/yara-$(YARA) && \
25
+ CFLAGS="$(CFLAGS)" \
26
+ LDFLAGS="$(LDFLAGS)" \
27
+ ./configure \
28
+ $(CFGOPTS) \
29
+ --enable-static \
30
+ --disable-shared \
31
+ --with-pic \
32
+ --prefix=$(BASE)/build/yara
33
+ cd $(BASE)/deps/yara-$(YARA) && make
34
+ cd $(BASE)/deps/yara-$(YARA) && make install
package/README.md CHANGED
@@ -5,18 +5,7 @@ This module implements [YARA][yara] bindings for [Node.js][nodejs].
5
5
 
6
6
  **This module is supported on Linux and MacOS (using homebrew) platforms only**
7
7
 
8
- This module uses the installed version of libyara. You should download,
9
- compile and install your preferred version, or use one of the following
10
- commands using your system package manager:
11
-
12
- # CentOS/Red Hat
13
- sudo yum install yara-devel
14
-
15
- # Debian/Ubuntu
16
- sudo apt-get install libyara-dev
17
-
18
- # MacOS (using homebrew)
19
- sudo brew install yara
8
+ This module is built [using libyara 4.2.3](https://github.com/Automattic/node-yara/blob/master/Makefile#L14) and is statically linked against [libmagic](https://linux.die.net/man/3/libmagic).
20
9
 
21
10
  This module is installed using [node package manager (npm)][npm]:
22
11
 
@@ -24,7 +13,34 @@ This module is installed using [node package manager (npm)][npm]:
24
13
  # during installation using node-gyp. A suitable build chain
25
14
  # must be configured before installation.
26
15
 
27
- npm install @automattic/yara
16
+ npm i --save "yara@npm:@automattic/yara@latest"
17
+
18
+ # Developing
19
+
20
+ Or when developing this module, run the following after cloning the repo:
21
+
22
+ 1. Clone the repo.
23
+ 2. Make sure the dependencies are installed.
24
+
25
+ For Linux see the `Dockerfile`. For MacOS run `brew install autoconf automake libmagic`.
26
+
27
+ 3. Make sure that you're using the proper Node.js version by running `nvm use`.
28
+ 4. Run:
29
+ ```
30
+ $ npm install --ignore-scripts
31
+
32
+ $ ./node_modules/.bin/node-pre-gyp configure rebuild
33
+ (...)
34
+ SOLINK_MODULE(target) Release/yara.node
35
+
36
+ $ ./node_modules/.bin/node-pre-gyp package
37
+ (...)
38
+ node-pre-gyp info package Binary staged at "build/stage/Automattic/node-yara/raw/master/binaries/yara-v2.4.0-darwin-x64.tar.gz"
39
+ node-pre-gyp info ok
40
+
41
+ $ mv build/stage/Automattic/node-yara/raw/master/binaries/yara-*.tar.gz ./binaries
42
+ ```
43
+ 5. Now you have a new `yara.tar.gz` archives in the `binaries` directory.
28
44
 
29
45
  It is loaded using the `require()` function:
30
46
 
@@ -0,0 +1,36 @@
1
+ Binaries
2
+ ========
3
+
4
+ These are pre-build binaries coming from the GH Action in this repository. They're used by `node-gyp` and fetched when you run `npm i` for `node-yara` package.
5
+
6
+ For instance:
7
+
8
+ ```
9
+ node-yara$ npm i
10
+
11
+ > @automattic/yara@2.4.0 install
12
+ > node-pre-gyp install --fallback-to-build
13
+
14
+ node-pre-gyp info it worked if it ends with ok
15
+ node-pre-gyp info using node-pre-gyp@1.0.10
16
+ node-pre-gyp info using node@16.16.0 | linux | x64
17
+ node-pre-gyp info check checked for "/tmp/node-yara/build/Release/yara.node" (not found)
18
+ node-pre-gyp http GET https://github.com/Automattic/node-yara/raw/master/binaries/yara-v2.4.0-linux-x64.tar.gz
19
+ node-pre-gyp info install unpacking Release/.deps/Release/obj.target/yara/src/yara.o.d
20
+ node-pre-gyp info install unpacking Release/.deps/Release/obj.target/yara.node.d
21
+ node-pre-gyp info install unpacking Release/.deps/Release/yara.node.d
22
+ node-pre-gyp info install unpacking Release/.deps/build/yara.d
23
+ node-pre-gyp info install unpacking Release/obj.target/yara/src/yara.o
24
+ node-pre-gyp info install unpacking Release/obj.target/yara.node
25
+ node-pre-gyp info extracted file count: 6
26
+ [@automattic/yara] Success: "/tmp/node-yara/build/Release/yara.node" is installed via remote
27
+ node-pre-gyp info ok
28
+ node-pre-gyp info install unpacking Release/yara.node
29
+
30
+ up to date, audited 119 packages in 4s
31
+
32
+ 22 packages are looking for funding
33
+ run `npm fund` for details
34
+
35
+ found 0 vulnerabilities
36
+ ```
package/binding.gyp CHANGED
@@ -1,5 +1,24 @@
1
1
  {
2
2
  "targets": [
3
+ {
4
+ "target_name": "action_before_build",
5
+ "type": "none",
6
+ "copies": [],
7
+ "conditions": [
8
+ ['OS == "linux"', {
9
+ "copies": [{
10
+ "files": [ "/usr/lib/x86_64-linux-gnu/libmagic.a" ],
11
+ "destination": "build/"
12
+ }],
13
+ }],
14
+ ['OS == "mac"', {
15
+ "copies": [{
16
+ "files": [ "/usr/local/opt/libmagic/lib/libmagic.a" ],
17
+ "destination": "build/"
18
+ }],
19
+ }],
20
+ ],
21
+ },
3
22
  {
4
23
  "target_name": "yara",
5
24
  "sources": [
@@ -10,10 +29,12 @@
10
29
  "-fno-rtti"
11
30
  ],
12
31
  "include_dirs": [
13
- "<!(node -e 'require(\"nan\")')"
32
+ "<!(node -e 'require(\"nan\")')",
33
+ "./build/yara/include"
14
34
  ],
15
35
  "libraries": [
16
- "-lyara"
36
+ "../build/libmagic.a",
37
+ "../build/yara/lib/libyara.a"
17
38
  ],
18
39
  "conditions": [
19
40
  [
@@ -24,6 +45,21 @@
24
45
  }
25
46
  }
26
47
  ]
48
+ ],
49
+ "actions": [
50
+ {
51
+ "action_name": "build_libyara",
52
+ "inputs": [
53
+ "deps"
54
+ ],
55
+ "outputs": [
56
+ "build/yara"
57
+ ],
58
+ "action": [
59
+ "make",
60
+ "libyara"
61
+ ]
62
+ }
27
63
  ]
28
64
  }
29
65
  ]
package/package.json CHANGED
@@ -1,14 +1,26 @@
1
1
  {
2
2
  "name": "@automattic/yara",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Automattic's fork of YARA support for Node.js",
5
5
  "main": "index.js",
6
6
  "directories": {
7
7
  "example": "example"
8
8
  },
9
9
  "dependencies": {
10
- "nan": "2.14.*",
11
- "typescript": "^3.8.3"
10
+ "@mapbox/node-pre-gyp": "^1.0.10",
11
+ "nan": "2.17.*",
12
+ "typescript": "^4.9.5"
13
+ },
14
+ "scripts": {
15
+ "test": "mocha test/*",
16
+ "install": "node-pre-gyp install --fallback-to-build"
17
+ },
18
+ "binary": {
19
+ "module_name": "yara",
20
+ "module_path": "./build/Release",
21
+ "host": "https://github.com/",
22
+ "remote_path": "/Automattic/node-yara/raw/master/binaries/",
23
+ "package_name": "{module_name}-v{version}-{platform}-{arch}.tar.gz"
12
24
  },
13
25
  "contributors": [
14
26
  {
@@ -31,5 +43,8 @@
31
43
  "yara"
32
44
  ],
33
45
  "author": "NoSpaceships Ltd <hello@nospaceships.com>",
34
- "license": "MIT"
46
+ "license": "MIT",
47
+ "devDependencies": {
48
+ "mocha": "^10.0.0"
49
+ }
35
50
  }
package/src/yara.cc CHANGED
@@ -7,6 +7,7 @@
7
7
  #include <string>
8
8
  #include <sstream>
9
9
  #include <mutex>
10
+ #include <iostream>
10
11
 
11
12
  #include <errno.h>
12
13
  #include <stdio.h>
@@ -42,9 +43,9 @@ enum VarType {
42
43
  #define ERROR_UNKNOWN_STRING "ERROR_UNKNOWN"
43
44
 
44
45
  void compileCallback(int error_level, const char* file_name, int line_number,
45
- const char* message, void* user_data);
46
+ const YR_RULE* rule, const char* message, void* user_data);
46
47
 
47
- int scanCallback(int message, void* data, void* param);
48
+ int scanCallback(YR_SCAN_CONTEXT* scan_context, int message, void* data, void* param);
48
49
 
49
50
  const char* getErrorString(int code) {
50
51
  size_t count = error_codes.count(code);
@@ -515,11 +516,15 @@ private:
515
516
  };
516
517
 
517
518
  void compileCallback(int error_level, const char* file_name, int line_number,
518
- const char* message, void* user_data) {
519
+ const YR_RULE* rule, const char* message, void* user_data) {
519
520
  CompileArgs* args = (CompileArgs*) user_data;
520
521
 
521
522
  std::ostringstream oss;
522
- oss << args->rule_config->index << ":" << line_number << ":" << message << ":" << file_name;
523
+ oss << args->rule_config->index << ":" << line_number << ":" << message << ":";
524
+
525
+ if (file_name != NULL) {
526
+ oss << file_name;
527
+ }
523
528
 
524
529
  if (error_level == YARA_ERROR_LEVEL_WARNING)
525
530
  args->configure->warnings.push_back(oss.str());
@@ -860,7 +865,7 @@ private:
860
865
  ScanReq* scan_req_;
861
866
  };
862
867
 
863
- int scanCallback(int message, void* data, void* param) {
868
+ int scanCallback(YR_SCAN_CONTEXT* scan_context, int message, void* data, void* param) {
864
869
  AsyncScan* async_scan = (AsyncScan*) param;
865
870
 
866
871
  YR_RULE* rule;
@@ -896,7 +901,7 @@ int scanCallback(int message, void* data, void* param) {
896
901
  }
897
902
 
898
903
  yr_rule_strings_foreach(rule, string) {
899
- yr_string_matches_foreach(string, match) {
904
+ yr_string_matches_foreach(scan_context, string, match) {
900
905
  std::ostringstream oss;
901
906
  oss << match->offset << ":" << match->match_length << ":" << string->identifier;
902
907
 
@@ -944,6 +949,8 @@ int scanCallback(int message, void* data, void* param) {
944
949
  NAN_METHOD(ScannerWrap::ReconfigureVariables) {
945
950
  Nan::HandleScope scope;
946
951
 
952
+
953
+
947
954
  ScannerWrap* scanner = ScannerWrap::Unwrap<ScannerWrap>(info.This());
948
955
 
949
956
  std::lock_guard<std::mutex> lock(scanner->mutex);
@@ -1152,7 +1159,7 @@ NAN_METHOD(ScannerWrap::Scan) {
1152
1159
 
1153
1160
  Local<Object> req = Nan::To<Object>(info[0]).ToLocalChecked();
1154
1161
 
1155
- char* filename = NULL;
1162
+ std::string filename;
1156
1163
  char *buffer = NULL;
1157
1164
  int64_t offset = 0;
1158
1165
  int64_t length = 0;
@@ -1160,8 +1167,10 @@ NAN_METHOD(ScannerWrap::Scan) {
1160
1167
  int32_t timeout = 0;
1161
1168
  int32_t matched_bytes = 0;
1162
1169
 
1170
+
1163
1171
  if (Nan::Get(req, Nan::New("filename").ToLocalChecked()).ToLocalChecked()->IsString()) {
1164
1172
  Local<String> s = Nan::To<String>(Nan::Get(req, Nan::New("filename").ToLocalChecked()).ToLocalChecked()).ToLocalChecked();
1173
+
1165
1174
  filename = *Nan::Utf8String(s);
1166
1175
  } else if (Nan::Get(req, Nan::New("buffer").ToLocalChecked()).ToLocalChecked()->IsObject()) {
1167
1176
  Local<Object> o = Nan::To<Object>(Nan::Get(req, Nan::New("buffer").ToLocalChecked()).ToLocalChecked()).ToLocalChecked();
@@ -1226,7 +1235,7 @@ NAN_METHOD(ScannerWrap::Scan) {
1226
1235
  }
1227
1236
  }
1228
1237
 
1229
- if ((! filename) && (! buffer)) {
1238
+ if ((filename.empty()) && (! buffer)) {
1230
1239
  Nan::ThrowError("Either filename of buffer is required");
1231
1240
  return;
1232
1241
  }
@@ -1246,8 +1255,9 @@ NAN_METHOD(ScannerWrap::Scan) {
1246
1255
 
1247
1256
  ScanReq* scan_req = new ScanReq();
1248
1257
 
1249
- if (filename)
1250
- scan_req->filename = filename;
1258
+ if (!filename.empty()) {
1259
+ scan_req->filename = filename.c_str();
1260
+ }
1251
1261
 
1252
1262
  scan_req->buffer = buffer;
1253
1263
  scan_req->offset = offset;
@@ -1268,6 +1278,7 @@ NAN_METHOD(ScannerWrap::Scan) {
1268
1278
  Nan::AsyncQueueWorker(async_scan);
1269
1279
 
1270
1280
  info.GetReturnValue().Set(info.This());
1281
+
1271
1282
  }
1272
1283
 
1273
1284
  }; /* namespace yara */
@@ -54,7 +54,7 @@ describe("index.js", function() {
54
54
  var expErrors = [{
55
55
  index: 0,
56
56
  line: 1,
57
- message: "syntax error, unexpected '}', expecting <condition>"
57
+ message: "syntax error"
58
58
  }]
59
59
 
60
60
  assert.deepEqual(error.errors, expErrors)
@@ -78,7 +78,7 @@ describe("index.js", function() {
78
78
  var expErrors = [{
79
79
  index: 0,
80
80
  line: 1,
81
- message: "syntax error, unexpected '}', expecting <condition>"
81
+ message: "syntax error"
82
82
  }]
83
83
 
84
84
  assert.deepEqual(error.errors, expErrors)
@@ -114,7 +114,7 @@ describe("index.js", function() {
114
114
  {
115
115
  index: 0,
116
116
  line: 4,
117
- message: 'Using literal string "stephen" in a boolean operation.'
117
+ message: 'using literal string "stephen" in a boolean operation.'
118
118
  }
119
119
  ]
120
120
 
@@ -160,7 +160,7 @@ describe("index.js", function() {
160
160
  var expErrors = [{
161
161
  index: 0,
162
162
  line: 4,
163
- message: "syntax error, unexpected hex string, expecting identifier"
163
+ message: "syntax error"
164
164
  }]
165
165
 
166
166
  assert.deepEqual(error.errors, expErrors)