@litko/yara-x 0.1.0 → 0.1.2
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/README.md +13 -13
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @litko/yara-x
|
|
2
2
|
|
|
3
|
-
**v0.1.
|
|
3
|
+
**v0.1.1**
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ npm install @litko/yara-x
|
|
|
20
20
|
### Basic Example
|
|
21
21
|
|
|
22
22
|
```javascript
|
|
23
|
-
import { compile } from "yara-x";
|
|
23
|
+
import { compile } from "@litko/yara-x";
|
|
24
24
|
|
|
25
25
|
// Compile yara rules
|
|
26
26
|
const rules = compile(`
|
|
@@ -55,7 +55,7 @@ if (matches.length > 0) {
|
|
|
55
55
|
## Scanning Files
|
|
56
56
|
|
|
57
57
|
```javascript
|
|
58
|
-
import { fromFile, compile } from "yara-x";
|
|
58
|
+
import { fromFile, compile } from "@litko/yara-x";
|
|
59
59
|
import { readFileSync } from "fs";
|
|
60
60
|
|
|
61
61
|
// Load rules from a file
|
|
@@ -74,7 +74,7 @@ try {
|
|
|
74
74
|
## Asynchronous Scanning
|
|
75
75
|
|
|
76
76
|
```javascript
|
|
77
|
-
import { compile } from "yara-x";
|
|
77
|
+
import { compile } from "@litko/yara-x";
|
|
78
78
|
|
|
79
79
|
async function scanLargeFile() {
|
|
80
80
|
const rules = compile(`rule large_file_rule {
|
|
@@ -100,7 +100,7 @@ scanLargeFile();
|
|
|
100
100
|
## Variables
|
|
101
101
|
|
|
102
102
|
```javascript
|
|
103
|
-
import { compile } from "yara-x";
|
|
103
|
+
import { compile } from "@litko/yara-x";
|
|
104
104
|
|
|
105
105
|
// Create a scanner with variables
|
|
106
106
|
const rules = compile(
|
|
@@ -133,7 +133,7 @@ console.log(`Matches with overridden variables: ${matches.length}`);
|
|
|
133
133
|
## WASM Compilation
|
|
134
134
|
|
|
135
135
|
```javascript
|
|
136
|
-
import { compile, compileToWasm } from "yara-x";
|
|
136
|
+
import { compile, compileToWasm } from "@litko/yara-x";
|
|
137
137
|
|
|
138
138
|
// Compile rules to WASM
|
|
139
139
|
const rule = `
|
|
@@ -159,7 +159,7 @@ await compiledRules.emitWasmFileAsync("./output/async_rules.wasm");
|
|
|
159
159
|
## Incremental Rule Building
|
|
160
160
|
|
|
161
161
|
```javascript
|
|
162
|
-
import { create } from "yara-x";
|
|
162
|
+
import { create } from "@litko/yara-x";
|
|
163
163
|
|
|
164
164
|
// Create an empty scanner
|
|
165
165
|
const scanner = create();
|
|
@@ -194,7 +194,7 @@ const matches = scanner.scan(Buffer.from("test data with first pattern"));
|
|
|
194
194
|
## Rule Validation
|
|
195
195
|
|
|
196
196
|
```javascript
|
|
197
|
-
import { validate } from "yara-x";
|
|
197
|
+
import { validate } from "@litko/yara-x";
|
|
198
198
|
|
|
199
199
|
// Validate rules without executing them
|
|
200
200
|
const result = validate(`
|
|
@@ -219,7 +219,7 @@ if (result.errors.length === 0) {
|
|
|
219
219
|
## Advanced Options
|
|
220
220
|
|
|
221
221
|
```javascript
|
|
222
|
-
import { compile } from "yara-x";
|
|
222
|
+
import { compile } from "@litko/yara-x";
|
|
223
223
|
|
|
224
224
|
// Create a scanner with advanced options
|
|
225
225
|
const rules = compile(
|
|
@@ -260,7 +260,7 @@ const rules = compile(
|
|
|
260
260
|
### Compilation Errors
|
|
261
261
|
|
|
262
262
|
```javascript
|
|
263
|
-
import { compile } from "yara-x";
|
|
263
|
+
import { compile } from "@litko/yara-x";
|
|
264
264
|
|
|
265
265
|
try {
|
|
266
266
|
// This will throw an error due to invalid syntax
|
|
@@ -286,7 +286,7 @@ try {
|
|
|
286
286
|
### Scanning errors
|
|
287
287
|
|
|
288
288
|
```javascript
|
|
289
|
-
import { compile } from "yara-x";
|
|
289
|
+
import { compile } from "@litko/yara-x";
|
|
290
290
|
|
|
291
291
|
const rules = compile(`
|
|
292
292
|
rule test_rule {
|
|
@@ -307,7 +307,7 @@ try {
|
|
|
307
307
|
### Async Errors
|
|
308
308
|
|
|
309
309
|
```javascript
|
|
310
|
-
import { compile, compileToWasm } from "yara-x";
|
|
310
|
+
import { compile, compileToWasm } from "@litko/yara-x";
|
|
311
311
|
|
|
312
312
|
async function handleAsyncErrors() {
|
|
313
313
|
const rules = compile(`
|
|
@@ -339,7 +339,7 @@ handleAsyncErrors();
|
|
|
339
339
|
## Compiler Warnings
|
|
340
340
|
|
|
341
341
|
```javascript
|
|
342
|
-
import { compile } from "yara-x";
|
|
342
|
+
import { compile } from "@litko/yara-x";
|
|
343
343
|
|
|
344
344
|
// Create a scanner with a rule that generates warnings
|
|
345
345
|
const rules = compile(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litko/yara-x",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"napi": {
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"rust"
|
|
50
50
|
],
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"@litko/yara-x-win32-x64-msvc": "0.1.
|
|
53
|
-
"@litko/yara-x-darwin-x64": "0.1.
|
|
54
|
-
"@litko/yara-x-linux-x64-gnu": "0.1.
|
|
55
|
-
"@litko/yara-x-darwin-arm64": "0.1.
|
|
56
|
-
"@litko/yara-x-linux-arm64-gnu": "0.1.
|
|
52
|
+
"@litko/yara-x-win32-x64-msvc": "0.1.2",
|
|
53
|
+
"@litko/yara-x-darwin-x64": "0.1.2",
|
|
54
|
+
"@litko/yara-x-linux-x64-gnu": "0.1.2",
|
|
55
|
+
"@litko/yara-x-darwin-arm64": "0.1.2",
|
|
56
|
+
"@litko/yara-x-linux-arm64-gnu": "0.1.2"
|
|
57
57
|
}
|
|
58
58
|
}
|