1- """
2- DiffRays - Binary Diff Analysis Tool
3- Decompile, Compare, and Visualize Binary Changes
4- """
5-
6- __version__ = "0.1.0"
7- __author__ = "PwnFuzz"
8- __license__ = "MIT"
9-
10- from .cli import main
11- from .server import run_server
12-
13- # Don't import analyzer at module level
14- run_diff = None
15-
16- def _get_run_diff ():
17- """Helper to get run_diff with proper error handling"""
18- global run_diff
19- if run_diff is None :
20- try :
21- from .analyzer import run_diff as rd
22- run_diff = rd
23- except ImportError as e :
24- # Only show message when actually trying to use it
25- def run_diff_stub (* args , ** kwargs ):
26- print ("\n IDA analysis not available" )
27- print ("Required: IDA Pro with HexRays Decompiler + ida_domain package" )
28- print (f"Error: { e } " )
29- raise ImportError ("IDA analysis components not available" ) from e
30- run_diff = run_diff_stub
31- return run_diff
32-
33- # Override the run_diff name to use our lazy loader
34- def run_diff_wrapper (* args , ** kwargs ):
35- return _get_run_diff ()(* args , ** kwargs )
36-
37- # Replace the None with our wrapper
38- run_diff = run_diff_wrapper
39-
1+ """
2+ DiffRays - Binary Diff Analysis Tool
3+ Decompile, Compare, and Visualize Binary Changes
4+ """
5+
6+ __version__ = "0.1.0"
7+ __author__ = "PwnFuzz"
8+ __license__ = "MIT"
9+
10+ from .cli import main
11+ from .server import run_server
12+
13+ # Don't import analyzer at module level
14+ run_diff = None
15+
16+ def _get_run_diff ():
17+ """Helper to get run_diff with proper error handling"""
18+ global run_diff
19+ if run_diff is None :
20+ try :
21+ from .analyzer import run_diff as rd
22+ run_diff = rd
23+ except ImportError as e :
24+ # Only show message when actually trying to use it
25+ def run_diff_stub (* args , ** kwargs ):
26+ print ("\n IDA analysis not available" )
27+ print ("Required: IDA Pro with HexRays Decompiler + ida_domain package" )
28+ print (f"Error: { e } " )
29+ raise ImportError ("IDA analysis components not available" ) from e
30+ run_diff = run_diff_stub
31+ return run_diff
32+
33+ # Override the run_diff name to use our lazy loader
34+ def run_diff_wrapper (* args , ** kwargs ):
35+ return _get_run_diff ()(* args , ** kwargs )
36+
37+ # Replace the None with our wrapper
38+ run_diff = run_diff_wrapper
39+
4040__all__ = ['main' , 'run_diff' , 'run_server' ]
0 commit comments