-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from TommYDeeee/full_language_support
Full ruleset support
- Loading branch information
Showing
112 changed files
with
6,810 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import "macho" | ||
include "test" | ||
//Global comment | ||
|
||
//Rule comment | ||
rule test | ||
rule test : bla test | ||
{ | ||
//Rule block comment | ||
|
||
meta: | ||
author = "Author" | ||
description = 20 | ||
//String comment | ||
strings: | ||
$a = "foo" | ||
$b = "bar" | ||
$b = "bar" ascii | ||
condition: | ||
$b and not true or false | ||
$b and not true or true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use std::fs; | ||
use yara_parser::{AstNode, SourceFile}; | ||
|
||
fn main() { | ||
let filename = std::env::args().nth(1).expect("No arguments provided"); | ||
let file_content = | ||
fs::read_to_string(filename).expect("Something went wrong while reading the file"); | ||
let ast = SourceFile::parse(&file_content); | ||
println!("AST:\n\n{:#?}", ast.tree().syntax()); | ||
println!("Errors: {:?}", ast.errors()); | ||
} |
Oops, something went wrong.