Code: Select all
exception_0_stub:
cli
push 0
push 0
pusha
push ds
push es
push fs
push gs
mov ax,$08
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov eax,esp
push eax
mov eax,ExceptionHandlers
call [eax]
pop eax
pop gs
pop fs
pop es
pop ds
popa
add esp,8
iret
Code: Select all
type
TExceptionSavedRegisters = packed record
ds,es,fs,gs: longword;
edi,esi,ebp,esp,ebx,edx,ecx,eax: longword;
lwISRIndex,lwErrorCode: longword;
eip,cs,eflags,useresp,ss: longword;
end;
PExceptionSavedRegisters = ^TExceptionSavedRegisters;
The problem is that for any exception I get the eip is always 0x52A112. This has happened with a naturally ocurring exception I was working on and with a contrived Divide by Zero exception I set up. Anyone know what is going wrong here, I seem to be accessing something from the register data, but not the right thing.