Merge branch 'mandiant:master' into Aayush-Goel-04/Issue#1451

This commit is contained in:
Aayush Goel
2023-05-17 12:09:26 +05:30
committed by GitHub
4 changed files with 14 additions and 4 deletions

View File

@@ -21,8 +21,8 @@
- symtab: fix struct.unpack() format for 64-bit ELF files @yelhamer
- symtab: safeguard against ZeroDivisionError for files containing a symtab with a null entry size @yelhamer
- improve ELF strtab and needed parsing @mr-tz
- better handle exceptional cases when parsing ELF files #1471 @Aayush-Goel-04
- better handle exceptional cases when parsing ELF files [#1458](https://github.com/mandiant/capa/issues/1458) [@Aayush-Goel-04](https://github.com/aayush-goel-04)
- Improved testing coverage for Binary Ninja Backend [#1446](https://github.com/mandiant/capa/issues/1446) [@Aayush-Goel-04](https://github.com/aayush-goel-04)
- extractor: fix binja installation path detection does not work with Python 3.11
### capa explorer IDA Pro plugin

View File

@@ -77,7 +77,7 @@ setuptools.setup(
"ruff==0.0.265",
"black==23.3.0",
"isort==5.11.4",
"mypy==1.2.0",
"mypy==1.3.0",
"psutil==5.9.2",
"stix2==3.0.1",
"requests==2.28.0",

View File

@@ -10,8 +10,11 @@ import logging
import fixtures
from fixtures import *
import capa.main
logger = logging.getLogger(__file__)
# We need to skip the binja test if we cannot import binaryninja, e.g., in GitHub CI.
binja_present: bool = False
try:
@@ -45,3 +48,10 @@ def test_binja_features(sample, scope, feature, expected):
)
def test_binja_feature_counts(sample, scope, feature, expected):
fixtures.do_test_feature_count(fixtures.get_binja_extractor, sample, scope, feature, expected)
@pytest.mark.skipif(binja_present is False, reason="Skip binja tests if the binaryninja Python API is not installed")
def test_standalone_binja_backend():
CD = os.path.dirname(__file__)
test_path = os.path.join(CD, "..", "tests", "data", "Practical Malware Analysis Lab 01-01.exe_")
assert capa.main.main([test_path, "-b", capa.main.BACKEND_BINJA]) == 0