Skip to content

Commit de87fd0

Browse files
ilay122ikelos
authored andcommitted
fix pdb mz parsing
1 parent 374542d commit de87fd0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

volatility3/framework/symbols/windows/pdbutil.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,14 @@ def get_guid_from_mz(cls, context: interfaces.context.ContextInterface, layer_na
131131
# Check it is actually the MZ header
132132
if mz_sig != b"MZ":
133133
return None
134-
135-
nt_header_start = ord(layer.read(offset + 0x3C, 1))
134+
135+
nt_header_start = struct.unpack("<I", layer.read(offset + 0x3C, 4))[0]
136+
pe_sig = layer.read(offset + nt_header_start, 2)
137+
138+
# Check it is actually the Nt Headers
139+
if pe_sig != b"PE":
140+
return None
141+
136142
optional_header_size = struct.unpack('<H', layer.read(offset + nt_header_start + 0x14, 2))[0]
137143
# Just enough to tell us the max size
138144
pe_header = layer.read(offset, nt_header_start + 0x16 + optional_header_size)

0 commit comments

Comments
 (0)