Merge remote-tracking branch 'origin/master'

This commit is contained in:
Victor M. Alvarez
2022-05-28 19:30:34 +02:00
3 changed files with 24 additions and 3 deletions
+5
View File
@@ -159,6 +159,11 @@ The saved rules can be loaded from the memory buffer:
The result of ``load`` is also an instance of the class :py:class:`yara.Rules`.
Starting with YARA 4.3.0, ``Rules`` have a warning member which contains a list
of warnings generated by the compiler. This allows you to know if the compiler
generated warnings without them being hard errors using the `error_on_warning`
argument.
Instances of ``Rules`` also have a ``match`` method, which allows you to apply
the rules to a file:
+3 -3
View File
@@ -3548,14 +3548,14 @@ begin_declarations
end_struct_array("functions");
end_struct_array("import_details");
begin_struct_array("delay_import_details")
begin_struct_array("delayed_import_details")
declare_string("library_name");
declare_integer("number_of_function");
declare_integer("number_of_functions");
begin_struct_array("functions")
declare_string("name");
declare_integer("ordinal");
end_struct_array("functions");
end_struct_array("delay_import_details");
end_struct_array("delayed_import_details");
declare_integer("resource_timestamp");
+16
View File
@@ -596,6 +596,22 @@ int main(int argc, char** argv)
"tests/data/"
"079a472d22290a94ebb212aa8015cdc8dd28a968c6b4d3b88acdd58ce2d3b885");
assert_true_rule_file(
"import \"pe\" \
\
rule import_delayed_import_details \
{\
condition:\
for any import_detail in pe.delayed_import_details : (\
import_detail.number_of_functions == 2 and\
import_detail.library_name == \"USER32.dll\" and\
for any function in import_detail.functions : (\
function.name == \"MessageBoxA\"\
)\
)\
}",
"tests/data/pe_imports");
assert_true_rule_file(
"import \"pe\" \
\