Closed HydraDragonAntivirus closed 1 year ago
What code are you executing? / What is your question?
I executing my Antivirus created by me. My question is how to fix undefinied idenfier error at filename function.
Either by not using the rules that use external variables or by defining the variable.
It's a YARA feature. You can look e.g. here https://yara.readthedocs.io/en/stable/writingrules.html#external-variables
Ok I'm going to delete the problematic lines. Thanks!
Error compiling YARA rule from /home/emirhanucan/Masaüstü/Antivirus/YARA/Florian_Roth_index.yara: line 34838: undefined identifier "filename" Error compiling YARA rule from /home/emirhanucan/Masaüstü/Antivirus/YARA/FlorianRoth.yara: line 118229: undefined identifier "filename"
Function to load YARA rules from a folder
def load_yara_rules(yara_folder, filename=None): yara_rules = [] for root, dirs, files in os.walk(yara_folder): for file in files: if file.endswith(".yara"): rule_file = os.path.join(root, file) try: with open(rule_file, 'rb') as f:
Read the binary content and decode it using a suitable encoding