fix codestyle issues

This commit is contained in:
Yacine Elhamer
2023-06-05 12:01:39 +01:00
parent 7dff76b122
commit e971bc4044
2 changed files with 6 additions and 3 deletions

View File

@@ -106,7 +106,6 @@ class Shdr:
)
class ELF:
def __init__(self, f: BinaryIO):
self.f = f
@@ -720,7 +719,9 @@ class SymTab:
if section.sh_info & SHT_SYMTAB:
strtab_section = ElfBinary.sections[section.sh_link]
sh_symtab = Shdr.from_viv(section, ElfBinary.readAtOffset(section.sh_offset, section.sh_size))
sh_strtab = Shdr.from_viv(strtab_section, ElfBinary.readAtOffset(strtab_section.sh_offset, strtab_section.sh_size))
sh_strtab = Shdr.from_viv(
strtab_section, ElfBinary.readAtOffset(strtab_section.sh_offset, strtab_section.sh_size)
)
try:
return cls(endian, bitness, sh_symtab, sh_strtab)

View File

@@ -51,7 +51,9 @@ class VivisectFeatureExtractor(FeatureExtractor):
def get_functions(self) -> Iterator[FunctionHandle]:
cache = {}
for va in sorted(self.vw.getFunctions()):
yield FunctionHandle(address=AbsoluteVirtualAddress(va), inner=viv_utils.Function(self.vw, va), ctx={"cache":cache})
yield FunctionHandle(
address=AbsoluteVirtualAddress(va), inner=viv_utils.Function(self.vw, va), ctx={"cache": cache}
)
def extract_function_features(self, fh: FunctionHandle) -> Iterator[Tuple[Feature, Address]]:
yield from capa.features.extractors.viv.function.extract_features(fh)