File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import ntpath
3232import os
3333import warnings
34+ import pytest
35+
36+
37+ def is_sdk_dbghelp_available ():
38+ """Check if Microsoft SDK version of dbghelp.dll is available."""
39+ try :
40+ from winappdbg import win32
41+ from winappdbg .system import System
42+
43+ with warnings .catch_warnings ():
44+ warnings .simplefilter ("ignore" )
45+ dbghelp = System .load_dbghelp ()
46+
47+ if dbghelp is None :
48+ return False
49+
50+ pathname = win32 .GetModuleFileNameEx (- 1 , dbghelp ._handle )
51+ sysroot = os .getenv ("SystemRoot" ) or os .getenv ("SYSTEMROOT" )
52+ if not sysroot :
53+ return False
54+
55+ system = ntpath .join (sysroot , "System32" )
56+ syswow = ntpath .join (sysroot , "SysWoW64" )
57+
58+ # If it's in System32/SysWoW64, it's the system version, not SDK
59+ if pathname .lower ().startswith (system .lower ()) or pathname .lower ().startswith (syswow .lower ()):
60+ return False
61+
62+ return True
63+ except Exception :
64+ return False
3465
3566
3667def test_module_load ():
@@ -52,6 +83,10 @@ def test_db_load():
5283 from winappdbg import db # noqa
5384
5485
86+ @pytest .mark .skipif (
87+ not is_sdk_dbghelp_available (),
88+ reason = "Microsoft SDK (Debugging Tools for Windows) is not installed. Only system dbghelp.dll is available."
89+ )
5590def test_windbg_version ():
5691 from winappdbg import win32
5792 from winappdbg .system import System
Original file line number Diff line number Diff line change 55"""
66
77import sys
8+ import pytest
89
910
11+ def is_miasm_available ():
12+ """Check if Miasm is available for import."""
13+ try :
14+ import miasm .analysis .binary
15+ import miasm .analysis .machine
16+ import miasm .core .locationdb
17+ return True
18+ except ImportError :
19+ return False
20+
21+
22+ @pytest .mark .skipif (
23+ not is_miasm_available (),
24+ reason = "Miasm is not installed. Install from: https://github.com/cea-sec/miasm"
25+ )
1026def test_miasm_engine_integration ():
1127 """Test that MiasmEngine integrates properly with WinAppDbg"""
1228
You can’t perform that action at this time.
0 commit comments