Update capa2yara.py

This commit is contained in:
Arnim Rupp
2021-05-21 17:04:16 +02:00
parent 73f121cf03
commit 7759d2dd79

View File

@@ -295,7 +295,7 @@ def convert_rule(rule, rulename, cround, depth):
# change begining of line to null byte, e.g. /^open => /\x00open (not word boundary because we're not looking for the begining of a word in a text but usually a function name if there's ^ in a capa rule) # change begining of line to null byte, e.g. /^open => /\x00open (not word boundary because we're not looking for the begining of a word in a text but usually a function name if there's ^ in a capa rule)
regex = re.sub(r"^\^", r"\\x00", regex) regex = re.sub(r"^\^", r"\\x00", regex)
#regex = re.sub(r"^\^", r"\\b", regex) # regex = re.sub(r"^\^", r"\\b", regex)
regex = "/" + regex + "/" regex = "/" + regex + "/"
if count: if count: