File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
yara-java/src/test/resources/yara/rules Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ Rules are generally composed of two sections: strings definition and condition.
3
+ The strings definition section can be omitted if the rule doesn't rely on any string,
4
+ but the condition section is always required. The strings definition section is where
5
+ the strings that will be part of the rule are defined. Each string has an identifier
6
+ consisting of a $ character followed by a sequence of alphanumeric characters and underscores,
7
+ these identifiers can be used in the condition section to refer to the corresponding string.
8
+ Strings can be defined in text or hexadecimal form, as shown in the following example:
9
+ */
10
+ rule ExampleRule
11
+ {
12
+ strings :
13
+ $ my_text_string = " text here "
14
+ $ my_hex_string = { E2 34 A1 C8 23 FB }
15
+
16
+ condition :
17
+ $ my_text_string or $ my_hex_string
18
+ }
19
+ /*
20
+ Text strings are enclosed in double quotes just like in the C language.
21
+ Hex strings are enclosed by curly brackets, and they are composed by a sequence of hexadecimal numbers
22
+ that can appear contiguously or separated by spaces. Decimal numbers are not allowed in hex strings.
23
+
24
+ The condition section is where the logic of the rule resides. This section must contain a boolean
25
+ expression telling under which circumstances a file or process satisfies the rule or not.
26
+ Generally, the condition will refer to previously defined strings by using their identifiers.
27
+ In this context the string identifier acts as a boolean variable which evaluate to true if the string
28
+ was found in the file or process memory, or false if otherwise.
29
+ */
You can’t perform that action at this time.
0 commit comments