yara-ffi 3.1.0 → 4.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8093d210271e152cfd1d66f69169f9efaf46838ad93dd5473a0b11a242bc0164
4
- data.tar.gz: a73687b9d7a3e7d098d4706c7c558954f1963a8bf8b3206984cdccd8dd757d2d
3
+ metadata.gz: fbff0f40a5c38903311cc68831538ee87fd1e88089188187560c25b401886ac4
4
+ data.tar.gz: c554613d1be85c26e2e7ddc87ac9509a60f7b5b25296de64017b7b067ef13c4f
5
5
  SHA512:
6
- metadata.gz: 879454866631eb296874a07aed2848a3252d547b45b593245114a0bb57404b5bea0badfecb553f77bd0029727112bfd9cde527f8722c3dfcf55e73f16a0cb6f7
7
- data.tar.gz: 6cc31a9d0e330897c3133fd17d90ddac3e7b54a1b073af31235185e3e70a2738fa8041e9adc8c087e5867d34dc4ffaed3f75c7c54d4be08bdfe60059d5c0e672
6
+ metadata.gz: f09c36c15253e02a2267373561064434b77fc9dcacdd445a1ec28357fa4e01cc09940496f5b645b1dbd920bc2f6c822d8d8215361ff71c8bebe73f42e01897ce
7
+ data.tar.gz: 52e22658f2b1eb0f9adddc3642db98f715ed0db7c2d8291808547fa4be86e9f088998e3785204fe1655f2935d5e3dff62588f285120c9375a1603da36458193b
@@ -0,0 +1,148 @@
1
+ # yara-ffi AI Coding Instructions
2
+
3
+ This Ruby gem provides FFI bindings to YARA-X (Rust-based YARA implementation) for malware/pattern detection.
4
+
5
+ ## Quick Development Guide
6
+
7
+ **Start Here for New Features:**
8
+ 1. Run `script/test` (if Docker image missing, run `script/bootstrap` first)
9
+ 2. Follow **Red-Green-Refactor** cycle with small semantic commits after each cycle
10
+ 3. Scanner lifecycle: `add_rule()` → `compile()` → `scan()` → `close()`
11
+ 4. Always use resource-safe patterns: `Scanner.open { |s| ... }` or manual `close()`
12
+ 5. Interactive testing: `docker run -it --mount type=bind,src="$(pwd)",dst=/app yara-ffi bin/console`
13
+
14
+ ## Core Components (Read These Files First)
15
+
16
+ - `lib/yara/scanner.rb`: Main API - compile-then-scan workflow, resource management
17
+ - `lib/yara/ffi.rb`: Raw FFI bindings with error codes (`YRX_SUCCESS = 0`)
18
+ - `lib/yara/scan_result.rb`: Result parsing (temporary regex-based metadata extraction)
19
+ - Tests in `test/scanner_test.rb`: Working examples of all patterns
20
+
21
+ ## Critical FFI Patterns
22
+
23
+ **Memory Management (ALWAYS Required):**
24
+ ```ruby
25
+ # Preferred - auto-cleanup
26
+ Scanner.open(rule_string) do |scanner|
27
+ scanner.compile
28
+ results = scanner.scan(data)
29
+ end
30
+
31
+ # Manual - MUST call close()
32
+ scanner = Scanner.new
33
+ # ... use scanner
34
+ scanner.close # Memory leak without this!
35
+ ```
36
+
37
+ **Error Handling - Check These First:**
38
+ ```ruby
39
+ result = Yara::FFI.yrx_compile(@rule_source, @rules_pointer)
40
+ if result != Yara::FFI::YRX_SUCCESS
41
+ error_msg = Yara::FFI.yrx_last_error
42
+ raise CompilationError, "Failed: #{error_msg}"
43
+ end
44
+ ```
45
+
46
+ **Library Loading Strategy (Multiple Fallbacks):**
47
+ ```ruby
48
+ ffi_lib "/usr/local/lib/aarch64-linux-gnu/libyara_x_capi.so" # Specific first
49
+ ffi_lib "yara_x_capi" # System library fallback
50
+ ```
51
+
52
+ ## Development Environment
53
+
54
+ **Docker-First Development:** All development happens in Docker container with YARA-X pre-built:
55
+ - `script/test` - runs tests (builds image automatically if needed)
56
+ - `script/bootstrap` - only run if `script/test` fails due to missing Docker image
57
+ - Interactive: `docker run -it --mount type=bind,src="$(pwd)",dst=/app yara-ffi bin/console`
58
+
59
+ **TDD Workflow:** Follow Red-Green-Refactor with small semantic commits:
60
+ 1. **Red**: Write failing test
61
+ 2. **Green**: Make test pass with minimal code
62
+ 3. **Refactor**: Clean up while keeping tests green
63
+ 4. **Commit**: Small semantic commit describing the feature/fix
64
+
65
+ **Testing:** Uses Minitest. Tests in `test/` directory focus on Scanner lifecycle and rule matching.
66
+
67
+ ## Common YARA Rule Patterns
68
+
69
+ **Basic Rule Template:**
70
+ ```ruby
71
+ rule = <<-RULE
72
+ rule ExampleRule
73
+ {
74
+ meta:
75
+ description = "Example rule"
76
+ author = "test"
77
+
78
+ strings:
79
+ $text = "pattern"
80
+ $regex = /regex pattern/
81
+
82
+ condition:
83
+ $text or $regex
84
+ }
85
+ RULE
86
+ ```
87
+
88
+ **Multiple Rules Pattern:**
89
+ ```ruby
90
+ scanner = Scanner.new
91
+ scanner.add_rule(rule1)
92
+ scanner.add_rule(rule2)
93
+ scanner.compile
94
+ results = scanner.scan(data) # Returns array of ScanResult objects
95
+ ```
96
+
97
+ ## Code Patterns
98
+
99
+ **Resource Management:**
100
+ ```ruby
101
+ # Preferred block pattern
102
+ Scanner.open(rule_string) do |scanner|
103
+ scanner.compile
104
+ results = scanner.scan(data)
105
+ end # Auto-cleanup
106
+
107
+ # Manual pattern - must call close()
108
+ scanner = Scanner.new
109
+ scanner.add_rule(rule)
110
+ scanner.compile
111
+ # ... use scanner
112
+ scanner.close # Required!
113
+ ```
114
+
115
+ **Error Handling:** Custom exceptions for different failure modes:
116
+ - `CompilationError` - YARA rule syntax issues
117
+ - `ScanError` - Runtime scanning failures
118
+ - `NotCompiledError` - Scanning before compilation
119
+
120
+ **Metadata Parsing:** ScanResult parses YARA rule metadata and strings via regex from rule source (temporary solution until YARA-X API improvements).
121
+
122
+ ## Adding New FFI Functions
123
+
124
+ **Pattern to Follow:**
125
+ ```ruby
126
+ # In lib/yara/ffi.rb
127
+ attach_function :yrx_new_function, [:param_types], :return_type
128
+
129
+ # In lib/yara/scanner.rb - always check return codes
130
+ result = Yara::FFI.yrx_new_function(params)
131
+ if result != Yara::FFI::YRX_SUCCESS
132
+ error_msg = Yara::FFI.yrx_last_error
133
+ raise ScanError, "Operation failed: #{error_msg}"
134
+ end
135
+ ```
136
+
137
+ **Available FFI Functions (key ones):**
138
+ - `yrx_compile(src, rules_ptr)` - Compile rules from string
139
+ - `yrx_scanner_create(rules, scanner_ptr)` - Create scanner from compiled rules
140
+ - `yrx_scanner_scan(scanner, data, len)` - Scan data
141
+ - `yrx_last_error()` - Get last error message
142
+ - Cleanup: `yrx_rules_destroy()`, `yrx_scanner_destroy()`
143
+
144
+ ## Dependencies & Constraints
145
+
146
+ **Docker Dependencies:** Container includes Rust toolchain + cargo-c for building YARA-X from source.
147
+
148
+ When adding features, maintain the resource-managed Scanner pattern and ensure proper C memory cleanup.
@@ -1,10 +1,4 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
1
+ # GitHub Actions workflow for Ruby gem testing and validation
8
2
  name: Ruby
9
3
 
10
4
  on:
@@ -13,28 +7,86 @@ on:
13
7
  pull_request:
14
8
  branches: [ main ]
15
9
 
10
+ permissions:
11
+ contents: read
12
+
16
13
  jobs:
17
14
  test:
18
-
15
+ name: Test Ruby ${{ matrix.ruby-version }}
19
16
  runs-on: ubuntu-latest
17
+
20
18
  strategy:
19
+ fail-fast: false
21
20
  matrix:
22
- ruby-version: ['2.6', '2.7', '3.0']
21
+ ruby-version: ['3.2', '3.3']
23
22
 
24
23
  steps:
25
- - uses: actions/checkout@v2
24
+ - name: Checkout code
25
+ uses: actions/checkout@v4
26
+
26
27
  - name: Set up Ruby
27
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
28
  uses: ruby/setup-ruby@v1
30
29
  with:
31
30
  ruby-version: ${{ matrix.ruby-version }}
32
31
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
- - name: Install dependencies
32
+
33
+ - name: Install system dependencies
34
34
  run: |
35
35
  sudo apt-get update -y
36
- sudo apt-get install -y libyara-dev
37
- sudo gem install bundler -v 2.2.14
38
- bundle install
36
+ sudo apt-get install -y curl git unzip build-essential
37
+
38
+ - name: Install Rust, cargo-c, and build YARA-X C API library
39
+ run: |
40
+ # Install Rust
41
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
42
+ source $HOME/.cargo/env
43
+
44
+ # Set default Rust toolchain
45
+ rustup default stable
46
+
47
+ # Install cargo-c
48
+ cargo install cargo-c
49
+
50
+ # Build and install YARA-X C API library
51
+ git clone --depth 1 --branch v1.5.0 https://github.com/VirusTotal/yara-x.git /tmp/yara-x
52
+ cd /tmp/yara-x
53
+
54
+ # Ensure rustup default is set before running cargo with sudo
55
+ source $HOME/.cargo/env
56
+ rustup default stable
57
+ sudo env "PATH=$HOME/.cargo/bin:$PATH" "RUSTUP_HOME=$HOME/.rustup" "CARGO_HOME=$HOME/.cargo" $HOME/.cargo/bin/cargo cinstall -p yara-x-capi --release
58
+ sudo ldconfig
39
59
  - name: Run tests
40
- run: bundle exec rake
60
+ run: bundle exec rake test
61
+
62
+ - name: Run RuboCop (if present)
63
+ run: |
64
+ if bundle list rubocop > /dev/null 2>&1; then
65
+ bundle exec rubocop
66
+ else
67
+ echo "RuboCop not found, skipping..."
68
+ fi
69
+ continue-on-error: true
70
+
71
+ # lint:
72
+ # name: Lint and Security Check
73
+ # runs-on: ubuntu-latest
74
+
75
+ # steps:
76
+ # - name: Checkout code
77
+ # uses: actions/checkout@v4
78
+
79
+ # - name: Set up Ruby
80
+ # uses: ruby/setup-ruby@v1
81
+ # with:
82
+ # ruby-version: '3.3'
83
+ # bundler-cache: true
84
+
85
+ # - name: Run bundle audit (if present)
86
+ # run: |
87
+ # if bundle list bundle-audit > /dev/null 2>&1; then
88
+ # bundle exec bundle-audit check --update
89
+ # else
90
+ # echo "bundle-audit not found, skipping..."
91
+ # fi
92
+ # continue-on-error: true
data/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [4.0.0] - 2025-08-19
4
+
5
+ - **BREAKING**: Migrated from legacy libyara FFI bindings to YARA-X C API (`libyara_x_capi.so`) ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
6
+ - Removed all legacy FFI struct definitions (`YrRule`, `YrMeta`, `YrString`, etc.)
7
+ - Replaced incremental rule compilation with single-step compilation via `yrx_compile`
8
+ - Eliminated dependency on `Yara.start` and `Yara.stop` lifecycle methods
9
+ - **BREAKING**: Changed `Scanner#call` to `Scanner#scan` method ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
10
+ - **BREAKING**: Require Ruby >= 3.0.0 ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
11
+ - **BREAKING**: Remove `ScanResult` return for non-matching scans ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
12
+ - Added `Yara::ScanResults` enumerable collection for managing scan results ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
13
+ - Added `Scanner.open` for block-based resource management ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
14
+ - Added streaming scan API support with block yielding ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
15
+ - Modernized CI workflow with Ruby 3.0-3.3 matrix testing and YARA-X build support ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
16
+ - Added comprehensive development documentation in `DEVELOPMENT.md` ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
17
+ - Updated Docker environment to Ruby 3.3 with YARA-X v1.5.0 ([#24](https://github.com/jonmagic/yara-ffi/pull/24))
18
+ - Improved error handling for compilation and scanning with better exception handling
19
+ - Preserved backward compatibility in `ScanResult` interface via fallback parsing
20
+ - Removed obsolete helper files: `user_data.rb`, `yr_meta.rb`, `yr_string.rb`, `yr_namespace.rb`, `yr_rule.rb`
21
+
22
+ ## [3.1.0] - 2022-04-18
23
+
24
+ - Minor documentation fix for `Scanner::call` return value ([#20](https://github.com/jonmagic/yara-ffi/pull/20))
25
+ - Fix FFI type compatibility issues on ARM64 Linux by converting integer types ([#21](https://github.com/jonmagic/yara-ffi/pull/21))
26
+
27
+ ## [3.0.0] - 2021-10-21
28
+
29
+ - **BREAKING**: Introduced new `Yara::Scanner` API for better memory management and control ([#17](https://github.com/jonmagic/yara-ffi/pull/17))
30
+ - Added proper memory cleanup with `yr_compiler_destroy` and `yr_rules_destroy` calls
31
+ - Moved core functionality to `Yara::Scanner` class
32
+
33
+ ## [2.1.1] - 2021-08-31
34
+
35
+ - Fix memory leak by calling destroy methods ([#11](https://github.com/jonmagic/yara-ffi/pull/11))
36
+
37
+ ## [2.1.0] - 2021-08-30
38
+
39
+ - Use struct hash access and `Struct.ptr` where possible ([#14](https://github.com/jonmagic/yara-ffi/pull/14))
40
+ - Improved struct member access and performance optimizations
41
+
42
+ ## [2.0.1] - 2021-08-30
43
+
44
+ - Bug fixes and improvements
45
+
46
+ ## [2.0.0] - 2021-08-24
47
+
48
+ - **BREAKING**: Changed interface to support rule metas ([#4](https://github.com/jonmagic/yara-ffi/pull/4))
49
+ - `Yara.test` now returns `Yara::ScanResult` objects instead of rule names
50
+ - Added support for accessing rule metadata as hash of name => value
51
+ - Return rule metas in scan results
52
+
53
+ ## [1.0.0] - 2021-08-16
54
+
55
+ - Wire up basic Yara functionality ([#3](https://github.com/jonmagic/yara-ffi/pull/3))
56
+ - Added `Yara.test(rules_string, string_to_scan)` functionality
57
+ - Initial FFI bindings to libyara
58
+
3
59
  ## [0.1.0] - 2021-03-11
4
60
 
5
- - Initial release
61
+ - Initial release with project structure ([#1](https://github.com/jonmagic/yara-ffi/pull/1), [#2](https://github.com/jonmagic/yara-ffi/pull/2))
62
+ - Set up GitHub Actions CI
63
+ - Configured RuboCop
data/DEVELOPMENT.md ADDED
@@ -0,0 +1,188 @@
1
+ # Development Guide
2
+
3
+ This guide covers setting up the development environment and working on the yara-ffi gem.
4
+
5
+ ## Requirements
6
+
7
+ - Docker (for containerized development environment)
8
+
9
+ ## Quick Start
10
+
11
+ After checking out the repo, run the bootstrap script to set up the development environment:
12
+
13
+ ```bash
14
+ script/bootstrap
15
+ ```
16
+
17
+ This will build a Docker image with all the necessary dependencies, including the YARA-X C API library.
18
+
19
+ ## Development Scripts
20
+
21
+ The project includes several convenience scripts in the `script/` directory:
22
+
23
+ - `script/bootstrap` - Sets up the development environment (builds Docker image)
24
+ - `script/test` - Runs the test suite in the Docker container
25
+
26
+ ## Running Tests
27
+
28
+ To run the full test suite:
29
+
30
+ ```bash
31
+ script/test
32
+ ```
33
+
34
+ This runs `bundle exec rake` inside the Docker container with all dependencies properly configured.
35
+
36
+ You can also run tests manually inside the container:
37
+
38
+ ```bash
39
+ docker run -it --mount type=bind,src="$(pwd)",dst=/app yara-ffi bundle exec rake
40
+ ```
41
+
42
+ Or run specific test files:
43
+
44
+ ```bash
45
+ docker run -it --mount type=bind,src="$(pwd)",dst=/app yara-ffi bundle exec ruby -Itest test/scanner_test.rb
46
+ ```
47
+
48
+ Alternatively, you can use rake to run specific tests:
49
+
50
+ ```bash
51
+ docker run -it --mount type=bind,src="$(pwd)",dst=/app yara-ffi bundle exec rake test TEST=test/scanner_test.rb
52
+ ```
53
+
54
+ ## Interactive Development
55
+
56
+ For an interactive development session, you can start a console in the container:
57
+
58
+ ```bash
59
+ docker run -it --mount type=bind,src="$(pwd)",dst=/app yara-ffi bin/console
60
+ ```
61
+
62
+ This gives you an IRB session with the gem loaded for experimentation.
63
+
64
+ ## Development Environment Details
65
+
66
+ The development environment uses Docker to provide a consistent setup with:
67
+
68
+ - Ruby 3.3 (latest stable)
69
+ - YARA-X C API library v1.5.0 built from source
70
+ - All necessary system dependencies
71
+ - Bundler with locked gem versions
72
+
73
+ ### Docker Image
74
+
75
+ The `Dockerfile` sets up:
76
+
77
+ 1. Base Ruby 3.3 image
78
+ 2. System dependencies (curl, git, unzip)
79
+ 3. Rust toolchain and cargo-c for building YARA-X
80
+ 4. YARA-X C API library compiled and installed
81
+ 5. Ruby gem dependencies via Bundler
82
+
83
+ ### Manual Setup (without Docker)
84
+
85
+ If you prefer not to use Docker, you'll need to manually install:
86
+
87
+ 1. Ruby 3.0+
88
+ 2. YARA-X C API library (see [Installation section in README](README.md#installing-yara-x))
89
+ 3. System dependencies for building native gems
90
+
91
+ Then run:
92
+
93
+ ```bash
94
+ bundle install
95
+ rake test
96
+ ```
97
+
98
+ ## Code Structure
99
+
100
+ The gem is organized as follows:
101
+
102
+ - `lib/yara.rb` - Main entry point and convenience methods
103
+ - `lib/yara/ffi.rb` - FFI bindings to YARA-X C API
104
+ - `lib/yara/scanner.rb` - Scanner class for rule compilation and scanning
105
+ - `lib/yara/scan_result.rb` - Individual scan result wrapper
106
+ - `lib/yara/scan_results.rb` - Collection of scan results
107
+ - `lib/yara/version.rb` - Gem version constant
108
+
109
+ ## Testing
110
+
111
+ Tests are located in the `test/` directory:
112
+
113
+ - `test/yara_test.rb` - Tests for main module convenience methods
114
+ - `test/scanner_test.rb` - Tests for Scanner class functionality
115
+ - `test/test_helper.rb` - Shared test setup and utilities
116
+
117
+ The test suite uses Minitest and includes tests for:
118
+
119
+ - Rule compilation and validation
120
+ - Data scanning with various rule types
121
+ - Memory management and resource cleanup
122
+ - Error handling and edge cases
123
+
124
+ ## Release Process
125
+
126
+ To release a new version of the gem:
127
+
128
+ 1. Update the version number in `lib/yara/version.rb`
129
+ 2. Update the `CHANGELOG.md` with release notes
130
+ 3. Commit the changes
131
+ 4. Create and push a git tag:
132
+ ```bash
133
+ git tag v<version>
134
+ git push origin v<version>
135
+ ```
136
+ 5. Build and push the gem:
137
+ ```bash
138
+ gem build yara-ffi.gemspec
139
+ gem push yara-ffi-<version>.gem
140
+ ```
141
+
142
+ ## Contributing Guidelines
143
+
144
+ 1. Fork the repository
145
+ 2. Create a feature branch (`git checkout -b my-new-feature`)
146
+ 3. Make your changes with appropriate tests
147
+ 4. Run the test suite (`script/test`) to ensure all tests pass
148
+ 5. Commit your changes (`git commit -am 'Add some feature'`)
149
+ 6. Push to the branch (`git push origin my-new-feature`)
150
+ 7. Create a Pull Request
151
+
152
+ Please ensure your code follows the existing style and includes tests for new functionality.
153
+
154
+ ## Debugging
155
+
156
+ For debugging FFI-related issues:
157
+
158
+ 1. Enable FFI debugging by setting the `RUBY_FFI_DEBUG` environment variable
159
+ 2. Use `puts` statements or `binding.pry` (if pry is available) for Ruby debugging
160
+ 3. Check YARA-X C API documentation for expected behavior
161
+ 4. Verify memory management - ensure all resources are properly freed
162
+
163
+ ## Common Issues
164
+
165
+ ### YARA-X Library Not Found
166
+
167
+ If you see errors about missing YARA-X libraries, ensure:
168
+
169
+ 1. The YARA-X C API library is properly installed
170
+ 2. The library path is in your system's library search path
171
+ 3. You're using the correct version (v1.5.0 is tested)
172
+
173
+ ### Docker Build Issues
174
+
175
+ If Docker builds fail:
176
+
177
+ 1. Ensure you have sufficient disk space
178
+ 2. Try rebuilding without cache: `docker build --no-cache . -t yara-ffi`
179
+ 3. Check internet connectivity for downloading dependencies
180
+
181
+ ### Test Failures
182
+
183
+ If tests fail:
184
+
185
+ 1. Ensure all dependencies are properly installed
186
+ 2. Check that YARA-X C API library is available
187
+ 3. Verify Ruby version compatibility (3.0+ required)
188
+ 4. Run tests individually to isolate issues
data/Dockerfile CHANGED
@@ -1,17 +1,25 @@
1
- FROM ruby:2.6.6
2
1
 
3
- RUN apt-get update -qq
4
- RUN apt-get install -y flex bison
2
+ FROM ruby:3.3
3
+
4
+ RUN apt-get update -qq \
5
+ && apt-get install -y curl git unzip
5
6
 
6
7
  WORKDIR /app
7
8
 
8
9
  COPY . ./
9
- RUN gem install bundler:2.2.15
10
- RUN bundle install
10
+ RUN gem install bundler:2.2.15 \
11
+ && bundle install
12
+
13
+ # Install Rust and cargo-c for building YARA-X C API
14
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
15
+ && . $HOME/.cargo/env \
16
+ && cargo install cargo-c
17
+
18
+ # Build and install YARA-X C API library
19
+ RUN . $HOME/.cargo/env \
20
+ && git clone --depth 1 --branch v1.5.0 https://github.com/VirusTotal/yara-x.git /tmp/yara-x \
21
+ && cd /tmp/yara-x \
22
+ && cargo cinstall -p yara-x-capi --release \
23
+ && rm -rf /tmp/yara-x
11
24
 
12
- RUN git clone --recursive --branch v4.1.1 https://github.com/VirusTotal/yara.git /tmp/yara && \
13
- cd /tmp/yara/ && \
14
- ./bootstrap.sh && \
15
- ./configure && \
16
- make && \
17
- make install
25
+ ENV PATH="/usr/local/bin:$PATH"
data/Gemfile.lock CHANGED
@@ -1,44 +1,59 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yara-ffi (3.0.0)
4
+ yara-ffi (4.0.0)
5
5
  ffi
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.2)
10
+ ast (2.4.3)
11
11
  coderay (1.1.3)
12
- ffi (1.15.5)
13
- method_source (1.0.0)
14
- minitest (5.14.4)
15
- parallel (1.20.1)
16
- parser (3.0.0.0)
12
+ ffi (1.17.2)
13
+ ffi (1.17.2-aarch64-linux-gnu)
14
+ ffi (1.17.2-arm64-darwin)
15
+ ffi (1.17.2-x86_64-darwin)
16
+ ffi (1.17.2-x86_64-linux-gnu)
17
+ json (2.13.2)
18
+ language_server-protocol (3.17.0.5)
19
+ lint_roller (1.1.0)
20
+ method_source (1.1.0)
21
+ minitest (5.25.5)
22
+ parallel (1.27.0)
23
+ parser (3.3.9.0)
17
24
  ast (~> 2.4.1)
18
- pry (0.14.0)
25
+ racc
26
+ prism (1.4.0)
27
+ pry (0.15.2)
19
28
  coderay (~> 1.1)
20
29
  method_source (~> 1.0)
21
- rainbow (3.0.0)
22
- rake (13.0.3)
23
- regexp_parser (2.1.1)
24
- rexml (3.2.4)
25
- rubocop (1.11.0)
30
+ racc (1.8.1)
31
+ rainbow (3.1.1)
32
+ rake (13.3.0)
33
+ regexp_parser (2.11.2)
34
+ rubocop (1.79.2)
35
+ json (~> 2.3)
36
+ language_server-protocol (~> 3.17.0.2)
37
+ lint_roller (~> 1.1.0)
26
38
  parallel (~> 1.10)
27
- parser (>= 3.0.0.0)
39
+ parser (>= 3.3.0.2)
28
40
  rainbow (>= 2.2.2, < 4.0)
29
- regexp_parser (>= 1.8, < 3.0)
30
- rexml
31
- rubocop-ast (>= 1.2.0, < 2.0)
41
+ regexp_parser (>= 2.9.3, < 3.0)
42
+ rubocop-ast (>= 1.46.0, < 2.0)
32
43
  ruby-progressbar (~> 1.7)
33
- unicode-display_width (>= 1.4.0, < 3.0)
34
- rubocop-ast (1.4.1)
35
- parser (>= 2.7.1.5)
36
- ruby-progressbar (1.11.0)
37
- unicode-display_width (2.0.0)
44
+ unicode-display_width (>= 2.4.0, < 4.0)
45
+ rubocop-ast (1.46.0)
46
+ parser (>= 3.3.7.2)
47
+ prism (~> 1.4)
48
+ ruby-progressbar (1.13.0)
49
+ unicode-display_width (3.1.5)
50
+ unicode-emoji (~> 4.0, >= 4.0.4)
51
+ unicode-emoji (4.0.4)
38
52
 
39
53
  PLATFORMS
40
54
  aarch64-linux
41
55
  arm64-darwin-21
56
+ ruby
42
57
  x86_64-darwin-19
43
58
  x86_64-linux
44
59
 
@@ -50,4 +65,4 @@ DEPENDENCIES
50
65
  yara-ffi!
51
66
 
52
67
  BUNDLED WITH
53
- 2.2.32
68
+ 2.7.1