[Forensics-changes] [yara] 06/135: Add test case for nested loops

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:27:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.1.0
in repository yara.

commit 9cae43b0111b5b294400eba6d15690d60e9e82d6
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Thu Mar 13 08:52:47 2014 +0100

    Add test case for nested loops
---
 yara-python/tests.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/yara-python/tests.py b/yara-python/tests.py
index da003ff..fe42605 100644
--- a/yara-python/tests.py
+++ b/yara-python/tests.py
@@ -447,6 +447,18 @@ class TestYara(unittest.TestCase):
             'rule test { strings: $a1 = "dummy1" $b1 = "dummy1" $b2 = "ssi" condition: any of ($a*, $b*) }',
         ], 'mississipi')
 
+        self.assertTrueRules(["""
+            rule test
+            {
+              strings:
+                $ = /abc/
+                $ = /def/
+                $ = /ghi/
+              condition:
+                for any of ($*) : ( for any i in (1..#): (uint8(@[i] - 1) == 0x00) )
+            }"""
+        ], 'abc\x00def\x00ghi')
+
         self.assertFalseRules([
             'rule test { strings: $a = "ssi" $b = "mis" $c = "oops" condition: all of them }'
         ], 'mississipi')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list