Skip to content

Commit 4eae8ef

Browse files
authored
Merge pull request #2 from lallouslab/fix32
fixed crashes on a 32bits target
2 parents 089f025 + 3600f75 commit 4eae8ef

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

pyclassinformer/mc_tree.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def process_data(self):
9898
self.dirtree.mkdir(dirtree_path)
9999

100100
bc_path = self.base_class_paths[vftable_ea]
101+
if not bc_path:
102+
continue
101103
actual_class_name = bc_path[-1].name
102104

103105
# for vftable folder

pyclassinformer/method_classifier.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def change_dir_of_ctors_dtors(paths, data, dirtree):
3232
# move virtual functions to its class folder
3333
for vftable_ea in paths:
3434
path = paths[vftable_ea]
35+
if not path:
36+
continue
3537

3638
# get the class name that owns the vftable, which is the last entry of the path.
3739
class_name = path[-1].name
@@ -62,6 +64,8 @@ def change_dir_of_vfuncs(paths, data, dirtree):
6264
# move virtual functions to its class folder
6365
for vftable_ea in paths:
6466
path = paths[vftable_ea]
67+
if not path:
68+
continue
6569

6670
# get the class name that owns the vftable, which is the last entry of the path.
6771
class_name = path[-1].name
@@ -136,6 +140,8 @@ def rename_func(ea, prefix="", fn="", is_lib=False):
136140
def rename_vftable_ref_funcs(paths, data):
137141
for vftable_ea in paths:
138142
path = paths[vftable_ea]
143+
if not path:
144+
continue
139145
col = data[vftable_ea]
140146

141147
# get the class name that owns the vftable, which is the last entry of the path.
@@ -163,6 +169,8 @@ def rename_funcs(func_eas, prefix="", is_lib=False):
163169
def rename_vfuncs(paths, data):
164170
for vftable_ea in paths:
165171
path = paths[vftable_ea]
172+
if not path:
173+
continue
166174
col = data[vftable_ea]
167175

168176
# get the class name that owns the vftable, which is the last entry of the path.

pyclassinformer/pci_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ def get_mdisp_bases(col, vftables):
198198
col_offs = utils.get_col_offs(col, vftables)
199199

200200
bases = []
201-
for path in col.chd.bca.paths[col.offset]:
201+
paths = col.chd.bca.paths.get(col.offset, [])
202+
for path in paths:
202203
append = False
203204
for bcd in path:
204205
# for SI and MI but there is only a vftable

0 commit comments

Comments
 (0)