Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YARA language #3877

Merged
merged 5 commits into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,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
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,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
Expand Down
8 changes: 8 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5109,6 +5109,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:
Expand Down
23 changes: 23 additions & 0 deletions samples/YARA/OfExample.yar
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions samples/YARA/example.yara
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions samples/YARA/true.yar
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rule test { condition: true }
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,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)
1 change: 1 addition & 0 deletions vendor/grammars/language-yara
Submodule language-yara added at f08eec
26 changes: 26 additions & 0 deletions vendor/licenses/grammar/language-yara.txt
Original file line number Diff line number Diff line change
@@ -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.