YaraXSharp 1.0.3.160
See the version list below for details.
dotnet add package YaraXSharp --version 1.0.3.160
NuGet\Install-Package YaraXSharp -Version 1.0.3.160
<PackageReference Include="YaraXSharp" Version="1.0.3.160" />
<PackageVersion Include="YaraXSharp" Version="1.0.3.160" />
<PackageReference Include="YaraXSharp" />
paket add YaraXSharp --version 1.0.3.160
#r "nuget: YaraXSharp, 1.0.3.160"
#:package YaraXSharp@1.0.3.160
#addin nuget:?package=YaraXSharp&version=1.0.3.160
#tool nuget:?package=YaraXSharp&version=1.0.3.160
Yara-X Sharp
A simple wrapper for Yara-X around the Yara-X C/C++ API.
You can find the Nuget package here.
Requirements
As of 1.0.2, Windows x86_64 and Linux x86_64 version of Yara X CAPI is included in the Nuget package.
If you are on Apple silicon or want to bring your own yara_x_capi.dll, you can follow the compile guide here.
Usage
/*
* New Compiler instance.
* You can pass multiple params from YRX_COMPILE_FLAGS.
* E.g. new Compiler(YRX_COMPILE_FLAGS.YRX_ERROR_ON_SLOW_PATTERN)
*/
var yara = new Compiler();
yara.AddRuleFile("./eicar.yar");
var (rules, errors, warnings) = yara.Build(); // Compiled rules to be used in Scanner.
Scanner scanner = new Scanner(rules, YRX_SCANNER_FLAGS.LOAD_METADATA, YRX_SCANNER_FLAGS.LOAD_PATTERNS);
scanner.scan("./eicar.txt");
List<Match> results = scanner.Results();
foreach (Match rule in results) {
Console.WriteLine($"Pattern match count: {rule.Patterns.Count}");
Console.WriteLine(rule.Metadata["malware_family"]);
}
// Make sure to destroy.
scanner.Destroy();
yara.Destroy();
Or
using (var yara = new Compiler())
{
yara.AddRuleFile(Path.Combine(Environment.CurrentDirectory, "../../../", "eicar.yar"));
yara.AddRuleFile(Path.Combine(Environment.CurrentDirectory, "../../../", "eitwo.yar"));
var (rules, errors, warnings) = yara.Build();
Console.WriteLine($"Number of rules: {rules.Count()}");
using (Scanner scanner = new Scanner(rules, YRX_SCANNER_FLAGS.LOAD_METADATA, YRX_SCANNER_FLAGS.LOAD_PATTERNS))
{
scanner.Scan(Path.Combine(Environment.CurrentDirectory, "eicar.txt"));
List<Match> results = scanner.Results();
Console.WriteLine($"Matches: {results.Count}");
foreach (Match rule in results)
{
Console.WriteLine($"Pattern match count: {rule.Patterns.Count}");
Console.WriteLine(rule.Metadata["malware_family"]);
}
}
}
Reference
Compatibility
Any suffix after the initial x.x.x for example 1.0.3.160 signifies that it is compatible with the associated Yara-X version (in this case v1.6.0) as well as the CAPI being bundled in Nuget.
| Yara-X Release Version | Wrapper Version |
|--|--|
| 1.4.0 | 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.1.0, 1.0.0 |
| 1.5.0 | 1.0.3 |
| 1.6.0 | 1.0.3 |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.1.190 | 33 | 11/5/2025 |
| 1.1.0.181 | 170 | 10/8/2025 |
| 1.0.3.170 | 294 | 9/17/2025 |
| 1.0.3.160 | 150 | 9/5/2025 |
| 1.0.3 | 173 | 8/20/2025 |
| 1.0.2 | 170 | 8/13/2025 |
| 1.0.2-rc.2 | 180 | 8/8/2025 |
| 1.0.2-rc | 223 | 8/8/2025 |
| 1.0.1 | 106 | 8/1/2025 |
| 1.0.0 | 140 | 7/31/2025 |
| 0.1.0 | 553 | 7/22/2025 |
| 0.0.5 | 163 | 7/16/2025 |
| 0.0.4 | 168 | 7/14/2025 |
| 0.0.3 | 165 | 7/13/2025 |
| 0.0.2 | 115 | 7/13/2025 |
| 0.0.1 | 98 | 7/12/2025 |