Skip to content

Commit 302598c

Browse files
committed
🚑 Fix relative paths for examples (2)
1 parent 5843537 commit 302598c

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

examples/create_vmt_struct.py renamed to examples/create_vmt_structs.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
#!/usr/bin/env python
2+
from binaryninja import BinaryView, BinaryViewType
3+
24
import importlib
35
import sys
46
from os import path
57

8+
# from delphi_ninja.delphi_analyser import ClassFinder, DelphiVMT
9+
# from delphi_ninja.bnlogger import BNLogger
10+
# from delphi_ninja.bnhelpers import BNHelpers
11+
612
module_dir = path.dirname(path.dirname(path.abspath(__file__)))
713
module_name = path.basename(module_dir)
814
module_parent = path.dirname(module_dir)
915
sys.path.insert(0, module_parent)
1016
delphi_ninja = importlib.import_module(module_name)
11-
12-
from binaryninja import BinaryView, BinaryViewType
13-
14-
from delphi_ninja.delphi_analyser import ClassFinder, DelphiVMT
15-
from delphi_ninja.bnlogger import BNLogger
16-
from delphi_ninja.bnhelpers import BNHelpers
17+
ClassFinder = delphi_ninja.delphi_analyser.ClassFinder
18+
DelphiVMT = delphi_ninja.delphi_analyser.DelphiVMT
19+
BNLogger = delphi_ninja.bnlogger.BNLogger
20+
BNHelpers = delphi_ninja.bnhelpers.BNHelpers
1721

1822

1923
def analyze_callback(vmt: DelphiVMT, bv: BinaryView):

examples/list_class.py renamed to examples/list_vmts.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
#!/usr/bin/env python
2+
from binaryninja import BinaryViewType
3+
24
import importlib
35
import sys
46
from os import path
57

8+
# from delphi_ninja.bnlogger import BNLogger
9+
# from delphi_ninja.delphi_analyser import ClassFinder
10+
611
module_dir = path.dirname(path.dirname(path.abspath(__file__)))
712
module_name = path.basename(module_dir)
813
module_parent = path.dirname(module_dir)
914
sys.path.insert(0, module_parent)
1015
delphi_ninja = importlib.import_module(module_name)
11-
12-
from binaryninja import BinaryViewType
13-
14-
from delphi_ninja.bnlogger import BNLogger
15-
from delphi_ninja.delphi_analyser import ClassFinder
16+
BNLogger = delphi_ninja.bnlogger.BNLogger
17+
ClassFinder = delphi_ninja.delphi_analyser.ClassFinder
1618

1719

1820
def main(target: str, delphi_version: int):

examples/vmt_visualize.py renamed to examples/vmt_visualizer.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
#!/usr/bin/env python
2+
from binaryninja import BinaryViewType, LogLevel
3+
from graphviz import Digraph
4+
from typing import Dict
5+
26
import importlib
37
import sys
48
from os import path
59

10+
# from delphi_ninja.bnlogger import BNLogger
11+
# from delphi_ninja.delphi_analyser import ClassFinder, DelphiVMT
12+
613
module_dir = path.dirname(path.dirname(path.abspath(__file__)))
714
module_name = path.basename(module_dir)
815
module_parent = path.dirname(module_dir)
916
sys.path.insert(0, module_parent)
1017
delphi_ninja = importlib.import_module(module_name)
1118

12-
from binaryninja import BinaryViewType, LogLevel
13-
from graphviz import Digraph
14-
from typing import Dict
15-
16-
from delphi_ninja.bnlogger import BNLogger
17-
from delphi_ninja.delphi_analyser import ClassFinder, DelphiVMT
19+
BNLogger = delphi_ninja.bnlogger.BNLogger
20+
ClassFinder = delphi_ninja.delphi_analyser.ClassFinder
21+
DelphiVMT = delphi_ninja.delphi_analyser.DelphiVMT
1822

1923

2024
def create_graph(vmt_map: Dict[int, DelphiVMT]):

0 commit comments

Comments
 (0)