mirror of
https://github.com/mandiant/capa.git
synced 2026-02-04 19:12:01 -08:00
add a Mutex feature
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user