コード例 #1
0
 def test_multiple(self):
     ym = YaraMatch({
         "name":
         "foo",
         "meta": {},
         "offsets": {
             "a": [
                 (1, 0),
                 (2, 2),
             ],
             "b": [
                 (3, 1),
             ],
         },
         "strings": [
             "bar".encode("base64"),
             "baz".encode("base64"),
             "foo".encode("base64"),
         ],
     })
     assert ym.string("a", 0) == "bar"
     assert ym.string("a", 1) == "foo"
     assert ym.string("b", 0) == "baz"
     assert ym.strings("a") == ["bar", "foo"]
     assert ym.strings("b") == ["baz"]
コード例 #2
0
 def test_basics(self):
     ym = YaraMatch({
         "name": "foo",
         "meta": {},
         "offsets": {
             "a": [
                 (1, 0),
             ],
         },
         "strings": [
             "bar".encode("base64"),
         ],
     })
     assert ym.string("a", 0) == "bar"
     assert ym.string("a") == "bar"
コード例 #3
0
ファイル: test_objects.py プロジェクト: consen/cuckoo
 def test_basics(self):
     ym = YaraMatch({
         "name": "foo",
         "meta": {},
         "offsets": {
             "a": [
                 (1, 0),
             ],
         },
         "strings": [
             "bar".encode("base64"),
         ],
     })
     assert ym.string("a", 0) == "bar"
     assert ym.string("a") == "bar"
コード例 #4
0
ファイル: test_objects.py プロジェクト: consen/cuckoo
 def test_multiple(self):
     ym = YaraMatch({
         "name": "foo",
         "meta": {},
         "offsets": {
             "a": [
                 (1, 0),
                 (2, 2),
             ],
             "b": [
                 (3, 1),
             ],
         },
         "strings": [
             "bar".encode("base64"),
             "baz".encode("base64"),
             "foo".encode("base64"),
         ],
     })
     assert ym.string("a", 0) == "bar"
     assert ym.string("a", 1) == "foo"
     assert ym.string("b", 0) == "baz"
     assert ym.strings("a") == ["bar", "foo"]
     assert ym.strings("b") == ["baz"]