File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ class MemoryViolation(Enum):
47
47
ReadProtect = 4
48
48
WriteProtect = 5
49
49
ExecuteProtect = 6
50
+ ReadUnaligned = 7
51
+ WriteUnaligned = 8
52
+ ExecuteUnaligned = 9
50
53
51
54
@dataclass
52
55
class ExceptionInfo :
@@ -991,7 +994,8 @@ def handle_exception(self):
991
994
context_ex .XState .Offset = 0xF0 if self ._x64 else 0x20
992
995
context_ex .XState .Length = 0x160 if self ._x64 else 0x140
993
996
record = record_type ()
994
- if self ._exception .type == ExceptionType .Memory :
997
+ alignment_violations = [MemoryViolation .ReadUnaligned , MemoryViolation .WriteUnaligned , MemoryViolation .ExecuteUnaligned ]
998
+ if self ._exception .type == ExceptionType .Memory and self ._exception .memory_violation not in alignment_violations :
995
999
record .ExceptionCode = STATUS_ACCESS_VIOLATION
996
1000
record .ExceptionFlags = 0
997
1001
record .ExceptionAddress = self .regs .cip
@@ -1004,7 +1008,7 @@ def handle_exception(self):
1004
1008
MemoryViolation .WriteProtect : EXCEPTION_WRITE_FAULT ,
1005
1009
MemoryViolation .ExecuteProtect : EXCEPTION_EXECUTE_FAULT ,
1006
1010
}
1007
- record .ExceptionInformation [0 ] = types . get ( self ._exception .memory_violation , EXCEPTION_READ_FAULT )
1011
+ record .ExceptionInformation [0 ] = types [ self ._exception .memory_violation ]
1008
1012
record .ExceptionInformation [1 ] = self ._exception .memory_address
1009
1013
elif self ._exception .type == ExceptionType .Interrupt and self ._exception .interrupt_number == 3 :
1010
1014
if self ._x64 :
You can’t perform that action at this time.
0 commit comments