Commit 05a15b53 by Peter Weidenbach

decoding added

parent d2428d28
......@@ -14,7 +14,6 @@ def get_all_matched_strings(yara_result_dict):
def _get_matched_strings_of_single_rule(yara_match):
matched_strings = set()
print(yara_match['strings'])
for string_item in yara_match['strings']:
matched_strings.add(string_item[2])
matched_strings.add(string_item[2].decode('utf-8', 'replace'))
return matched_strings
......@@ -10,4 +10,4 @@ class TestYaraInterpretation(unittest.TestCase):
'test_rule2': {'rule': 'test_rule2', 'meta': {}, 'strings': [(0, '$a', b'test_1'), (10, '$b', b'test_3')], 'matches': True},
}
result = get_all_matched_strings(test_data)
self.assertEqual(result, set([b'test_1', b'test_2', b'test_3']), "resulting strings not correct")
self.assertEqual(result, set(['test_1', 'test_2', 'test_3']), "resulting strings not correct")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment