mirror of
https://github.com/mandiant/capa.git
synced 2025-12-23 15:37:37 -08:00
Merge pull request #99 from fireeye/capa-explorer-bug-fix-93
capa explorer: bug fix for #93
This commit is contained in:
@@ -1,18 +1,5 @@
|
||||
import abc
|
||||
|
||||
try:
|
||||
import ida
|
||||
except (ImportError, SyntaxError):
|
||||
pass
|
||||
|
||||
try:
|
||||
import viv
|
||||
except (ImportError, SyntaxError):
|
||||
pass
|
||||
|
||||
__all__ = ["ida", "viv"]
|
||||
|
||||
|
||||
class FeatureExtractor(object):
|
||||
"""
|
||||
FeatureExtractor defines the interface for fetching features from a sample.
|
||||
|
||||
@@ -5,9 +5,9 @@ import idaapi
|
||||
|
||||
import capa.features.extractors.ida.file
|
||||
import capa.features.extractors.ida.insn
|
||||
import capa.features.extractors.ida.helpers
|
||||
import capa.features.extractors.ida.function
|
||||
import capa.features.extractors.ida.basicblock
|
||||
|
||||
from capa.features.extractors import FeatureExtractor
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@ class IdaFeatureExtractor(FeatureExtractor):
|
||||
yield feature, va
|
||||
|
||||
def get_functions(self):
|
||||
for f in capa.features.extractors.ida.helpers.get_functions(ignore_thunks=True, ignore_libs=True):
|
||||
import capa.features.extractors.ida.helpers as ida_helpers
|
||||
for f in ida_helpers.get_functions(ignore_thunks=True, ignore_libs=True):
|
||||
yield add_va_int_cast(f)
|
||||
|
||||
def extract_function_features(self, f):
|
||||
@@ -67,7 +68,8 @@ class IdaFeatureExtractor(FeatureExtractor):
|
||||
yield feature, va
|
||||
|
||||
def get_instructions(self, f, bb):
|
||||
for insn in capa.features.extractors.ida.helpers.get_instructions_in_range(bb.start_ea, bb.end_ea):
|
||||
import capa.features.extractors.ida.helpers as ida_helpers
|
||||
for insn in ida_helpers.get_instructions_in_range(bb.start_ea, bb.end_ea):
|
||||
yield add_va_int_cast(insn)
|
||||
|
||||
def extract_insn_features(self, f, bb, insn):
|
||||
|
||||
Reference in New Issue
Block a user