mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
@@ -17,7 +17,7 @@ import capa.features.common
|
||||
from capa.features.common import Feature
|
||||
|
||||
|
||||
class Statement(object):
|
||||
class Statement:
|
||||
"""
|
||||
superclass for structural nodes, such as and/or/not.
|
||||
this exists to provide a default impl for `__str__` and `__repr__`,
|
||||
@@ -69,7 +69,7 @@ class Statement(object):
|
||||
self.children[i] = new
|
||||
|
||||
|
||||
class Result(object):
|
||||
class Result:
|
||||
"""
|
||||
represents the results of an evaluation of statements against features.
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ def escape_string(s: str) -> str:
|
||||
return s
|
||||
|
||||
|
||||
class Feature(object):
|
||||
class Feature:
|
||||
def __init__(self, value: Union[str, int, bytes], arch=None, description=None):
|
||||
"""
|
||||
Args:
|
||||
@@ -228,7 +228,7 @@ class _MatchedRegex(Regex):
|
||||
)
|
||||
|
||||
|
||||
class StringFactory(object):
|
||||
class StringFactory:
|
||||
def __new__(cls, value: str, description=None):
|
||||
if value.startswith("/") and (value.endswith("/") or value.endswith("/i")):
|
||||
return Regex(value, description=description)
|
||||
|
||||
@@ -26,7 +26,7 @@ BBHandle = SupportsInt
|
||||
InsnHandle = SupportsInt
|
||||
|
||||
|
||||
class FeatureExtractor(object):
|
||||
class FeatureExtractor:
|
||||
"""
|
||||
FeatureExtractor defines the interface for fetching features from a sample.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ def location_to_hex(location):
|
||||
return "%08X" % location
|
||||
|
||||
|
||||
class CapaExplorerDataItem(object):
|
||||
class CapaExplorerDataItem:
|
||||
"""store data for CapaExplorerDataModel"""
|
||||
|
||||
def __init__(self, parent, data, can_check=True):
|
||||
|
||||
@@ -429,7 +429,7 @@ def second(s: List[Any]) -> Any:
|
||||
return s[1]
|
||||
|
||||
|
||||
class Rule(object):
|
||||
class Rule:
|
||||
def __init__(self, name, scope, statement, meta, definition=""):
|
||||
super(Rule, self).__init__()
|
||||
self.name = name
|
||||
@@ -863,7 +863,7 @@ def topologically_order_rules(rules: List[Rule]) -> List[Rule]:
|
||||
return ret
|
||||
|
||||
|
||||
class RuleSet(object):
|
||||
class RuleSet:
|
||||
"""
|
||||
a ruleset is initialized with a collection of rules, which it verifies and sorts into scopes.
|
||||
each set of scoped rules is sorted topologically, which enables rules to match on past rule matches.
|
||||
|
||||
@@ -49,7 +49,7 @@ def green(s):
|
||||
return termcolor.colored(s, "green")
|
||||
|
||||
|
||||
class Lint(object):
|
||||
class Lint:
|
||||
WARN = orange("WARN")
|
||||
FAIL = red("FAIL")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user