viv: cleanup flirt changes

This commit is contained in:
William Ballenthin
2021-03-04 15:46:14 -07:00
parent c2a4629c62
commit 22c4e3b8c2
3 changed files with 3 additions and 16 deletions

View File

@@ -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

View File

@@ -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__()

View File

@@ -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)