Exemple #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"]
Exemple #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"
Exemple #3
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"
Exemple #4
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"]