This commit is contained in:
William Ballenthin
2021-03-04 18:06:06 -07:00
parent 004ddb3e66
commit d3caecc551
5 changed files with 14 additions and 11 deletions

View File

@@ -1,9 +1,8 @@
import pytest
from fixtures import get_function, pma16_01_extractor, extract_function_features
import capa.features.insn
from fixtures import pma16_01_extractor, get_function, extract_function_features
def test_function_id_simple_match(pma16_01_extractor):
assert pma16_01_extractor.is_library_function(0x407490) == True
@@ -18,7 +17,7 @@ def test_function_id_gz_pat(pma16_01_extractor):
@pytest.mark.xfail
def test_function_id_complex_match(pma16_01_extractor):
# 0x405714 is __spawnlp which requires recursive match of __spawnvp at 0x407FAB
# 0x405714 is __spawnlp which requires recursive match of __spawnvp at 0x407FAB
# (and __spawnvpe at 0x409DE8)
assert pma16_01_extractor.is_library_function(0x405714) == True
assert pma16_01_extractor.get_function_name(0x405714) == "__spawnlp"
@@ -27,4 +26,4 @@ def test_function_id_complex_match(pma16_01_extractor):
def test_function_id_api_feature(pma16_01_extractor):
f = get_function(pma16_01_extractor, 0x404548)
features = extract_function_features(pma16_01_extractor, f)
assert capa.features.insn.API("__aulldiv") in features
assert capa.features.insn.API("__aulldiv") in features