Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit 7b3f52b

Browse files
committed
update dwarf parsing for missing DW_AT_byte_size
1 parent 2e48f2d commit 7b3f52b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

volatility/dwarf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ def process_statement(self, kind, level, data, statement_id):
195195

196196
# If it's just a forward declaration, we want the name around,
197197
# but there won't be a size
198-
if 'DW_AT_declaration' not in data:
198+
if 'DW_AT_declaration' not in data and 'DW_AT_byte_size' in data:
199199
self.vtypes[name] = [ int(data['DW_AT_byte_size'], self.base), {} ]
200200

201201
elif kind == 'DW_TAG_union_type':
202202
name = data.get('DW_AT_name', "__unnamed_%s" % statement_id).strip('"')
203203
self.name_stack[-1][1] = name
204204
self.id_to_name[statement_id] = [name]
205-
if 'DW_AT_declaration' not in data:
205+
if 'DW_AT_declaration' not in data and 'DW_AT_byte_size' in data:
206206
self.vtypes[name] = [ int(data['DW_AT_byte_size'], self.base), {} ]
207207

208208
elif kind == 'DW_TAG_array_type':
@@ -216,7 +216,7 @@ def process_statement(self, kind, level, data, statement_id):
216216

217217
# If it's just a forward declaration, we want the name around,
218218
# but there won't be a size
219-
if 'DW_AT_declaration' not in data:
219+
if 'DW_AT_declaration' not in data and 'DW_AT_byte_size' in data:
220220
sz = int(data['DW_AT_byte_size'], self.base)
221221
self.enums[name] = [sz, {}]
222222

0 commit comments

Comments
 (0)