Add YARA language (#3877)

* Add YARA language grammars

* Add YARA to languages.yml

* Add YARA samples

* Add YARA to README
This commit is contained in:
wesdawg
2017-11-15 20:16:33 -05:00
committed by Ashe Connor
parent 9dceffce2f
commit 8c516655bc
9 changed files with 78 additions and 0 deletions

3
.gitmodules vendored
View File

@@ -868,6 +868,9 @@
[submodule "vendor/grammars/language-ballerina"]
path = vendor/grammars/language-ballerina
url = https://github.com/ballerinalang/plugin-vscode
[submodule "vendor/grammars/language-yara"]
path = vendor/grammars/language-yara
url = https://github.com/blacktop/language-yara
[submodule "vendor/grammars/language-ruby"]
path = vendor/grammars/language-ruby
url = https://github.com/atom/language-ruby

View File

@@ -503,6 +503,8 @@ vendor/grammars/language-yaml:
- source.yaml
vendor/grammars/language-yang:
- source.yang
vendor/grammars/language-yara:
- source.yara
vendor/grammars/latex.tmbundle:
- text.bibtex
- text.log.latex

View File

@@ -5133,6 +5133,14 @@ YANG:
tm_scope: source.yang
ace_mode: text
language_id: 408
YARA:
type: data
ace_mode: text
extensions:
- ".yar"
- ".yara"
tm_scope: source.yara
language_id: 805122868
Yacc:
type: programming
extensions:

View File

@@ -0,0 +1,23 @@
rule OfExample2
{
strings:
$foo1 = "foo1"
$foo2 = "foo2"
$foo3 = "foo3"
condition:
2 of ($foo*) // equivalent to 2 of ($foo1,$foo2,$foo3)
}
rule OfExample3
{
strings:
$foo1 = "foo1"
$foo2 = "foo2"
$bar1 = "bar1"
$bar2 = "bar2"
condition:
3 of ($foo*,$bar1,$bar2)
}

13
samples/YARA/example.yara Normal file
View File

@@ -0,0 +1,13 @@
rule silent_banker : banker
{
meta:
description = "This is just an example"
thread_level = 3
in_the_wild = true
strings:
$a = {6A 40 68 00 30 00 00 6A 14 8D 91}
$b = {8D 4D B0 2B C1 83 C0 27 99 6A 4E 59 F7 F9}
$c = "UVODFRYSIHLNWPEJXQZAKCBGMT"
condition:
$a or $b or $c
}

1
samples/YARA/true.yar Normal file
View File

@@ -0,0 +1 @@
rule test { condition: true }

1
vendor/README.md vendored
View File

@@ -406,4 +406,5 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **Yacc:** [textmate/bison.tmbundle](https://github.com/textmate/bison.tmbundle)
- **YAML:** [atom/language-yaml](https://github.com/atom/language-yaml)
- **YANG:** [DzonyKalafut/language-yang](https://github.com/DzonyKalafut/language-yang)
- **YARA:** [blacktop/language-yara](https://github.com/blacktop/language-yara)
- **Zephir:** [phalcon/zephir-sublime](https://github.com/phalcon/zephir-sublime)

View File

@@ -0,0 +1,26 @@
---
type: grammar
name: language-yara
license: mit
---
The MIT License (MIT)
Copyright (c) 2014-2016 Blacktop
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.