windows 7 x86 32 bit machine
winkey + r -> windbg calc
bp ntdll!KiUserExceptionDispatcher
f5
divide 0/0 in calculator to raise an exception
(ac8.c8c): C++ EH exception - code e06d7363 (first chance)
Breakpoint 0 hit
eax=0023e1ec ebx=02b12fd0 ecx=00000003 edx=00000000 esi=02b13178 edi=00000001
eip=76e77048 esp=0023dee0 ebp=0023e23c iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
ntdll!KiUserExceptionDispatcher:
76e77048 fc cld
your post shows the return address to be + 0xf so lets see whats upto that point
0:000> u . .+f
ntdll!KiUserExceptionDispatcher:
76e77048 fc cld
76e77049 8b4c2404 mov ecx,dword ptr [esp+4]
76e7704d 8b1c24 mov ebx,dword ptr [esp]
76e77050 51 push ecx
76e77051 53 push ebx
76e77052 e85d88fdff call ntdll!RtlDispatchException (76e4f8b4)
76e77057 0ac0 or al,al
so it appears you have broken after entering RtlDispatchException from your call stack
breaking to enter the call
0:000> tc
eax=0023e1ec ebx=0023dee8 ecx=0023df08 edx=00000000 esi=02b13178 edi=00000001
eip=76e77052 esp=0023ded8 ebp=0023e23c iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
ntdll!KiUserExceptionDispatcher+0xa:
76e77052 e85d88fdff call ntdll!RtlDispatchException (76e4f8b4)
0:000> t
eax=0023e1ec ebx=0023dee8 ecx=0023df08 edx=00000000 esi=02b13178 edi=00000001
eip=76e4f8b4 esp=0023ded4 ebp=0023e23c iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
ntdll!RtlDispatchException:
76e4f8b4 8bff mov edi,edi
looking at stack if you ask windbg to be verbose it will even decipher the context for you
0:000> kb 3
# ChildEBP RetAddr Args to Child
00 0023ded0 76e77057 0023dee8 0023df08 0023dee8 ntdll!RtlDispatchException
01 0023ded0 7521b760 0023dee8 0023df08 0023dee8 ntdll!KiUserExceptionDispatcher+0xf
02 0023e23c 7579359c e06d7363 00000001 00000003 KERNELBASE!RaiseException+0x58
0:000> kv 3
# ChildEBP RetAddr Args to Child
00 0023ded0 76e77057 0023dee8 0023df08 0023dee8 ntdll!RtlDispatchException (FPO: [Non-Fpo])
01 0023ded0 7521b760 0023dee8 0023df08 0023dee8 ntdll!KiUserExceptionDispatcher+0xf (FPO: [2,0,0]) (CONTEXT @ 0023df08)
02 0023e23c 7579359c e06d7363 00000001 00000003 KERNELBASE!RaiseException+0x58 (FPO: [Non-Fpo])
exr output
0:000> .exr poi(@esp+4)
ExceptionAddress: 7521b760 (KERNELBASE!RaiseException+0x00000058)
ExceptionCode: e06d7363 (C++ EH exception)
ExceptionFlags: 00000001
NumberParameters: 3
Parameter[0]: 19930520
Parameter[1]: 0023e294
Parameter[2]: 007c15b4
unable to find C-Runtime symbols, even with unqualified search
context record output
0:000> dt ntdll!_CONTEXT poi(@esp+8)
+0x000 ContextFlags : 0x1003f
+0x004 Dr0 : 0
+0x008 Dr1 : 0
+0x00c Dr2 : 0
+0x010 Dr3 : 0
+0x014 Dr6 : 0
+0x018 Dr7 : 0
+0x01c FloatSave : _FLOATING_SAVE_AREA
+0x08c SegGs : 0
+0x090 SegFs : 0x3b
+0x094 SegEs : 0x23
+0x098 SegDs : 0x23
+0x09c Edi : 1
+0x0a0 Esi : 0x2b13178
+0x0a4 Ebx : 0x2b12fd0
+0x0a8 Edx : 0
+0x0ac Ecx : 3
+0x0b0 Eax : 0x23e1ec
+0x0b4 Ebp : 0x23e23c
+0x0b8 Eip : 0x7521b760
+0x0bc SegCs : 0x1b
+0x0c0 EFlags : 0x202
+0x0c4 Esp : 0x23e1ec
+0x0c8 SegSs : 0x23
+0x0cc ExtendedRegisters : [512] "???"
you can even get both by use .extptr (note you may need to reset context to default scope using .cxr after using this command)
0:000> .exptr (@esp+4)
----- Exception record at 0023dee8:
ExceptionAddress: 7521b760 (KERNELBASE!RaiseException+0x00000058)
ExceptionCode: e06d7363 (C++ EH exception)
ExceptionFlags: 00000001
NumberParameters: 3
Parameter[0]: 19930520
Parameter[1]: 0023e294
Parameter[2]: 007c15b4
unable to find C-Runtime symbols, even with unqualified search
----- Context record at 0023df08:
eax=0023e1ec ebx=02b12fd0 ecx=00000003 edx=00000000 esi=02b13178 edi=00000001
eip=7521b760 esp=0023e1ec ebp=0023e23c iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
KERNELBASE!RaiseException+0x58:
7521b760 c9 leave
0:000> kb 3
# ChildEBP RetAddr Args to Child
00 0023e23c 7579359c e06d7363 00000001 00000003 KERNELBASE!RaiseException+0x58
01 0023e274 0079eee0 0023e294 007c15b4 02b13178 msvcrt!_CxxThrowException+0x48
02 0023e288 0079146e 02b13178 80000002 c87a3f02 calc!divrat+0x69
0:000> .cxr
Resetting default scope
0:000> kb 3
# ChildEBP RetAddr Args to Child
00 0023ded0 76e77057 0023dee8 0023df08 0023dee8 ntdll!RtlDispatchException
01 0023ded0 7521b760 0023dee8 0023df08 0023dee8 ntdll!KiUserExceptionDispatcher+0xf
02 0023e23c 7579359c e06d7363 00000001 00000003 KERNELBASE!RaiseException+0x58
hope this suffices to research on your own for your specific situation for which you cant divulge the actual windbg stack trace
KiUserExceptionDispatcherthat you linked is correct. I believe it is actuallyVOID KiUserExceptionDispatcher(PEXCEPTION_RECORD ExceptionRecord, PCONTEXT Context). In that case01111111is the exception record and04444444is the context record.kbcommand shows much more. Are you sure it's not a copy/paste issue? I also wonder about the+0xfoffset. Ain't that too near the beginning of the method?