Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
common_helper_yara
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
common_helper_yara
Commits
05a15b53
Commit
05a15b53
authored
7 years ago
by
Peter Weidenbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoding added
parent
d2428d28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
yara_interpretation.py
common_helper_yara/yara_interpretation.py
+1
-2
test_interpretation.py
tests/test_interpretation.py
+1
-1
No files found.
common_helper_yara/yara_interpretation.py
View file @
05a15b53
...
@@ -14,7 +14,6 @@ def get_all_matched_strings(yara_result_dict):
...
@@ -14,7 +14,6 @@ def get_all_matched_strings(yara_result_dict):
def
_get_matched_strings_of_single_rule
(
yara_match
):
def
_get_matched_strings_of_single_rule
(
yara_match
):
matched_strings
=
set
()
matched_strings
=
set
()
print
(
yara_match
[
'strings'
])
for
string_item
in
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
return
matched_strings
This diff is collapsed.
Click to expand it.
tests/test_interpretation.py
View file @
05a15b53
...
@@ -10,4 +10,4 @@ class TestYaraInterpretation(unittest.TestCase):
...
@@ -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
},
'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
)
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"
)
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment