Skip to content

Commit

Permalink
Merge pull request #38 from iPower/fix-exception-parsing
Browse files Browse the repository at this point in the history
fix: MINIDUMP_EXCEPTION parsing
  • Loading branch information
skelsec authored Dec 18, 2023
2 parents 67901cd + c6ea262 commit 04113f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion minidump/streams/ExceptionStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class ExceptionCode(enum.Enum):

#https://msdn.microsoft.com/en-us/library/windows/desktop/ms680367(v=vs.85).aspx
class MINIDUMP_EXCEPTION:
EXCEPTION_MAXIMUM_PARAMETERS = 15

def __init__(self):
self.ExceptionCode = None
self.ExceptionFlags = None
Expand All @@ -134,9 +136,10 @@ def parse(buff):
me.ExceptionAddress = int.from_bytes(buff.read(8), byteorder = 'little', signed = False)
me.NumberParameters = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
me.__unusedAlignment = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
for _ in range(me.NumberParameters):
for _ in range(self.EXCEPTION_MAXIMUM_PARAMETERS):
me.ExceptionInformation.append(int.from_bytes(buff.read(8), byteorder = 'little', signed = False))

me.ExceptionInformation = me.ExceptionInformation[:me.NumberParameters]
return me

def __str__(self):
Expand Down

0 comments on commit 04113f5

Please sign in to comment.