add a Mutex feature

This commit is contained in:
Yacine Elhamer
2023-06-12 00:06:53 +01:00
parent 632b3ff07c
commit 5a10b612a1
2 changed files with 14 additions and 0 deletions

View File

@@ -296,6 +296,18 @@ class Filename(String):
return False
class Mutex(String):
# todo: add a way to tell whether this mutex was created or used
def __init__(self, value: str, description=None):
super().__init__(value, description)
def __eq__(self, other):
# Mutex instance is in a ruleset
if isinstance(other, Mutex):
return super().__eq__(other)
return False
class Regex(String):
def __init__(self, value: str, description=None):
super().__init__(value, description=description)

View File

@@ -265,6 +265,8 @@ def parse_feature(key: str):
return capa.features.common.Registry
elif key == "filename":
return capa.features.common.Filename
elif key == "mutex":
return capa.features.common.Mutex
elif key == "bytes":
return capa.features.common.Bytes
elif key == "number":