|
25 | 25 |
|
26 | 26 | import capa.rules |
27 | 27 | import capa.engine as ceng |
28 | | -import capa.loader |
29 | 28 | import capa.render.result_document |
30 | 29 | from capa.features.common import OS_AUTO, FORMAT_AUTO, Feature |
31 | 30 | from capa.features.address import Address |
@@ -647,29 +646,6 @@ def parametrize(params, values, **kwargs): |
647 | 646 | return pytest.mark.parametrize(params, values, ids=ids, **kwargs) |
648 | 647 |
|
649 | 648 |
|
650 | | -FEATURE_COUNT_TESTS_BE2_INTEL = [ |
651 | | - ( |
652 | | - "mimikatz", |
653 | | - "function=0x40105d,bb=0x401125,insn=0x401125", |
654 | | - capa.features.insn.Offset(0), |
655 | | - 1, |
656 | | - ), |
657 | | - ( |
658 | | - "mimikatz", |
659 | | - "function=0x40105d,bb=0x401125,insn=0x401125", |
660 | | - capa.features.insn.OperandOffset(1, 0), |
661 | | - 1, |
662 | | - ), |
663 | | -] |
664 | | - |
665 | | - |
666 | | -def do_test_feature_count(get_extractor, sample, scope, feature, expected): |
667 | | - extractor = get_extractor(sample) |
668 | | - features = scope(extractor) |
669 | | - assert features.get(feature, set()) != set(), f"{feature} should be found in {scope.__name__}" |
670 | | - assert len(features[feature]) == expected, f"{feature} should be found {expected} times in {scope.__name__}" |
671 | | - |
672 | | - |
673 | 649 | def get_result_doc(path: Path): |
674 | 650 | return capa.render.result_document.ResultDocument.from_file(path) |
675 | 651 |
|
@@ -727,7 +703,7 @@ def dynamic_a0000a6_rd(): |
727 | 703 | # as well as some fixtures below |
728 | 704 | @functools.lru_cache(maxsize=1) |
729 | 705 | def get_viv_extractor(path: Path): |
730 | | - import capa.main |
| 706 | + import capa.loader |
731 | 707 | import capa.features.extractors.viv.extractor |
732 | 708 |
|
733 | 709 | sigpaths = [ |
@@ -856,6 +832,7 @@ def get_ghidra_extractor(path: Path): |
856 | 832 | if not pyghidra.started(): |
857 | 833 | pyghidra.start() |
858 | 834 |
|
| 835 | + import capa.loader |
859 | 836 | import capa.features.extractors.ghidra.context |
860 | 837 |
|
861 | 838 | if path in GHIDRA_CACHE: |
|
0 commit comments