d
git-svn-id: https://spexeah.com:8443/svn/Asuro@199 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
@ -28,22 +28,29 @@ var
|
||||
|
||||
procedure Main(); interrupt;
|
||||
var
|
||||
i : integer;
|
||||
ec : uint32;
|
||||
i : uint32;
|
||||
Regs : PRegisters;
|
||||
|
||||
begin
|
||||
asm
|
||||
MOV EAX, [ESP-4]
|
||||
MOV ec, EAX
|
||||
end;
|
||||
CLI;
|
||||
asm
|
||||
MOV EAX, EBP
|
||||
MOV Regs, EAX
|
||||
end;
|
||||
for i:=0 to MAX_HOOKS-1 do begin
|
||||
if uint32(Hooks[i]) <> 0 then Hooks[i](void(13));
|
||||
end;
|
||||
console.writestring('General Protection Fault. [');
|
||||
console.writehex(ec);
|
||||
console.writestringln(']');
|
||||
util.halt_and_catch_fire;
|
||||
console.writestringln('General Protection Fault.');
|
||||
console.writestring('Flags: ');
|
||||
console.writehexln(Regs^.EFlags);
|
||||
console.writestring('EIP: ');
|
||||
console.writehexln(Regs^.EIP);
|
||||
console.writestring('CS: ');
|
||||
console.writehexln(Regs^.CS);
|
||||
console.writestring('Error Code: ');
|
||||
console.writehexln(Regs^.ErrorCode);
|
||||
Regs^.EIP:= Regs^.EIP - 2;
|
||||
//util.halt_and_catch_fire;
|
||||
end;
|
||||
|
||||
procedure register();
|
||||
|
@ -15,10 +15,12 @@ const
|
||||
MAX_HOOKS = 16;
|
||||
|
||||
type
|
||||
ISR_REGS = record
|
||||
ip, cs, flags, sp, ss : uint16;
|
||||
PRegisters = ^TRegisters;
|
||||
TRegisters = record
|
||||
edi,esi,ebp,esp,ebx,edx,ecx,eax: uint32;
|
||||
ErrorCode : uint32;
|
||||
eip,cs,eflags,UserESP,ss: uint32;
|
||||
end;
|
||||
PISR_REGS = ^ISR_REGS;
|
||||
|
||||
pp_hook_method = procedure(data : void);
|
||||
pp_void = pp_hook_method;
|
||||
|
Reference in New Issue
Block a user