mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
viv: cleanup flirt changes
This commit is contained in:
@@ -87,7 +87,7 @@ class FeatureExtractor(object):
|
||||
- recognize when to fetch symbol names for called (non-API) functions
|
||||
|
||||
args:
|
||||
va [int]: the virtual address of a function.
|
||||
va (int): the virtual address of a function.
|
||||
|
||||
returns:
|
||||
bool: True if the given address is the start of a library function.
|
||||
@@ -101,7 +101,7 @@ class FeatureExtractor(object):
|
||||
we accept a VA here, rather than function object, to handle addresses identified in instructions.
|
||||
|
||||
args:
|
||||
va [int]: the virtual address of a function.
|
||||
va (int): the virtual address of a function.
|
||||
|
||||
returns:
|
||||
str: the function name
|
||||
|
||||
@@ -45,19 +45,6 @@ def add_va_int_cast(o):
|
||||
return o
|
||||
|
||||
|
||||
import time
|
||||
import contextlib
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def timing(msg):
|
||||
t0 = time.time()
|
||||
yield
|
||||
t1 = time.time()
|
||||
logger.debug("perf: %s: %0.2fs", msg, t1 - t0)
|
||||
|
||||
|
||||
|
||||
class VivisectFeatureExtractor(FeatureExtractor):
|
||||
def __init__(self, vw, path):
|
||||
super(VivisectFeatureExtractor, self).__init__()
|
||||
|
||||
@@ -495,7 +495,7 @@ def extract_insn_segment_access_features(f, bb, insn):
|
||||
|
||||
def get_section(vw, va):
|
||||
for start, length, _, __ in vw.getMemoryMaps():
|
||||
if va and start <= va < start + length:
|
||||
if start <= va < start + length:
|
||||
return start
|
||||
|
||||
raise KeyError(va)
|
||||
|
||||
Reference in New Issue
Block a user