From 64ef2c8a65bddb1c625f730f90f6e54f7e5b86a9 Mon Sep 17 00:00:00 2001 From: Yacine Elhamer Date: Thu, 1 Jun 2023 01:50:06 +0100 Subject: [PATCH] add tests for vivisect's usage of debug symbols --- tests/fixtures.py | 8 ++++++++ tests/test_viv_features.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 04c9c53b..b339c994 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -761,6 +761,14 @@ FEATURE_PRESENCE_TESTS = sorted( key=lambda t: (t[0], t[1]), ) +# this list should be merged into the one above (FEATURE_PRESENSE_TESTS) +# once the debug symbol functionality has been added to all backends +FEATURE_SYMTAB_FUNC_TESTS = [ + ("2bf18d", "function=0x4027b3,bb=0x402861,insn=0x40286d", capa.features.insn.API("__GI_connect"), True), + ("2bf18d", "function=0x4027b3,bb=0x402861,insn=0x40286d", capa.features.insn.API("connect"), True), + ("2bf18d", "function=0x4027b3,bb=0x402861,insn=0x40286d", capa.features.insn.API("__libc_connect"), True), +] + FEATURE_PRESENCE_TESTS_DOTNET = sorted( [ ("b9f5b", "file", Arch(ARCH_I386), True), diff --git a/tests/test_viv_features.py b/tests/test_viv_features.py index fcf49c84..58ce5ace 100644 --- a/tests/test_viv_features.py +++ b/tests/test_viv_features.py @@ -11,7 +11,7 @@ from fixtures import * @fixtures.parametrize( "sample,scope,feature,expected", - fixtures.FEATURE_PRESENCE_TESTS, + fixtures.FEATURE_PRESENCE_TESTS + fixtures.FEATURE_SYMTAB_FUNC_TESTS, indirect=["sample", "scope"], ) def test_viv_features(sample, scope, feature, expected):