Skip to content

Commit e56d57c

Browse files
committed
Sorta fix for #78
1 parent 1dea37e commit e56d57c

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

dwex/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .treedlg import TreeDlg
2020

2121
# Sync with version in setup.py
22-
version = (4, 55)
22+
version = (4, 56)
2323
the_app = None
2424

2525
# TODO:

dwex/dwarfutil.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ def top_die_file_name(die, Default = 'N/A'):
141141
if val > 0:
142142
if die.cu._lineprogram is None:
143143
die.cu._lineprogram = die.dwarfinfo.line_program_for_CU(die.cu)
144-
delta = 1 if die.cu.version < 5 else 0
145-
return strip_path(die.cu._lineprogram.header.file_entry[val-delta].name.decode('utf-8', errors='ignore'))
144+
if die.cu._lineprogram: # No lineprogram is effectively corruption
145+
delta = 1 if die.cu.header.version < 5 else 0
146+
return strip_path(die.cu._lineprogram.header.file_entry[val-delta].name.decode('utf-8', errors='ignore'))
147+
else:
148+
return "(unknown)"
146149
return Default
147150

148151
# See #1742

dwex/patch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ def iter_DIE_children(self, die):
181181
cur_offset = child._terminator.offset + child._terminator.size
182182
elftools.dwarf.compileunit.CompileUnit.iter_DIE_children = iter_DIE_children
183183

184+
# Fix for DW_FORM_strx
185+
orig_create_structs = elftools.dwarf.dwarfinfo.DWARFStructs._create_structs
186+
def _create_structs(self):
187+
orig_create_structs(self)
188+
self.Dwarf_dw_form['DW_FORM_strx'] = self.the_Dwarf_uleb128
189+
elftools.dwarf.dwarfinfo.DWARFStructs._create_structs = _create_structs
190+
184191
# Short out import directory parsing for now
185192
filebytes.pe.PE._parseDataDirectory = lambda self,a,b,c: None
186193

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def run(self):
123123

124124
setup(
125125
name='dwex',
126-
version='4.55', # Sync with version in __main__
126+
version='4.56', # Sync with version in __main__
127127
packages=['dwex'],
128128
url="https://github.com/sevaa/dwex/",
129129
entry_points={"gui_scripts": ["dwex = dwex.__main__:main"]},

0 commit comments

Comments
 (0)