This commit is contained in:
Willi Ballenthin
2023-01-09 13:01:41 +01:00
parent 58e94a35cb
commit e34fdfae1a
2 changed files with 3 additions and 0 deletions

View File

@@ -180,6 +180,7 @@ class String(Feature):
super().__init__(value, description=description)
def get_value_str(self) -> str:
assert isinstance(self.value, str)
return escape_string(self.value)
@@ -236,6 +237,7 @@ class Substring(String):
return Result(False, _MatchedSubstring(self, {}), [])
def get_value_str(self) -> str:
assert isinstance(self.value, str)
return escape_string(self.value)
def __str__(self):

View File

@@ -9,6 +9,7 @@ import pefile
import capa.features
import capa.features.extractors.elf
import capa.features.extractors.pefile
import capa.features.extractors.strings
from capa.features.common import OS, FORMAT_PE, FORMAT_ELF, OS_WINDOWS, FORMAT_FREEZE, Arch, Format, String, Feature
from capa.features.freeze import is_freeze
from capa.features.address import NO_ADDRESS, Address, FileOffsetAddress