VirusTotal / yara-python

The Python interface for YARA
http://virustotal.github.io/yara/
Apache License 2.0
648 stars 179 forks source link

yara-python only reports last compile error, making debugging rules more difficult #126

Closed wesinator closed 1 year ago

wesinator commented 4 years ago

rule that has the following errors: test_invalid_nonascii_chars_error.yara.txt

$ yarac test_invalid_nonascii_chars_error.yara /dev/null 
test_invalid_nonascii_chars_error.yara(3): error: non-ascii character
test_invalid_nonascii_chars_error.yara(3): error: syntax error, unexpected end of file, expecting identifier

yara-python output only gave the last error, making it harder to debug yara.SyntaxError: test_invalid_nonascii_chars_error.yara(3): syntax error, unexpected end of file, expecting identifier

This is based on a real issue I encountered in a badly formatted rule

wxsBSD commented 4 years ago

I actually had a branch which switched yara-python to using the scanner API, but I lost it when my laptop turned into a brick last week. I'll see if I can get another version of it up for review.

wesinator commented 4 years ago

I actually had a branch which switched yara-python to using the scanner API, but I lost it when my laptop turned into a brick last week. I'll see if I can get another version of it up for review.

damn, I'm sorry to hear that. did you lose anything else more important ?

Thanks !