Merged code in the issue #157 does not work
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the issue with the two-rule YARA ruleset and the Python call yara.compile('bad_rule.yar', error_on_warning=True). Trace how the Python interface handles warnings from compilation and compare it with the command-line output. Done means error_on_warning reports both warnings instead of only the final warning.
Written by the indexing model from the issue text.
Description
Summary: the Issue #157 was about printing all the warnings with "error_on_warning" enabled. But at the example below we can see that it does not work at the newest version of yara-python.
Yara ruleset:
rule bad_rule1
{
meta:
author = "Rakovskij Stanislav / disasm.me"
date = "01.03.2021"
description = "Rule that uses bad wilecards to raise yara warning"
strings:
$ = {00 [32] 00}
condition:
any of them
}
rule bad_rule2
{
meta:
author = "Rakovskij Stanislav / disasm.me"
date = "01.03.2021"
description = "Rule that uses bad wilecards to raise yara warning"
strings:
$ = {00 [32] 00}
condition:
any of them
}
Output:
/m/d/test_yara_speed> ./yara64.exe bad_rule.yar random_100Mb.bin
bad_rule.yar(8): warning in rule "bad_rule1": $ is slowing down scanning
bad_rule.yar(20): warning in rule "bad_rule2": $ is slowing down scanning
bad_rule1 random_100Mb.bin
bad_rule2 random_100Mb.bin
/m/d/test_yara_speed> python3 -c "import yara; yara.compile('bad_rule.yar', error_on_warning=True)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
yara.WarningError: bad_rule.yar(20): $ is slowing down scanning // <- expected two warnings - on lines 8 and 20, got only the last one.
/m/d/test_yara_speed [1]> ./yara64.exe -v
4.0.5
/m/d/test_yara_speed> python3 -m pip install yara-python
Requirement already satisfied: yara-python in /home/user/.local/lib/python3.8/site-packages (4.0.5)
- Dominant language
- C
- Stars
- 754
- Forks
- 190
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VirusTotal/yara-python
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
VirusTotal/yara-python#263 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 28/100
VirusTotal/yara-python#234 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
VirusTotal/yara-python#218 · 3 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
VirusTotal/yara-python#216 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
VirusTotal/yara-python#212 · 11 comments ·
All issues in VirusTotal/yara-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
libretro/libretro-common#233 ·
-
area:lint-tooling bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
InauguralSystems/EigenScript#1340 ·
Maintainers usually reply within 1 day
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#19047 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100