\r
#define CPU_EXCEPTION_NUM 32\r
#define CPU_INTERRUPT_NUM 256\r
-#define HOOKAFTER_STUB_SIZE 16\r
+#define HOOKAFTER_STUB_SIZE 18\r
\r
//\r
// Exception Error Code of Page-Fault Exception\r
AsmIdtVectorBegin:\r
%assign Vector 0\r
%rep 256\r
- push byte %[Vector];\r
+ push strict dword %[Vector];\r
push eax\r
mov eax, ASM_PFX(CommonInterruptEntry)\r
jmp eax\r
AsmIdtVectorEnd:\r
\r
HookAfterStubBegin:\r
- db 0x6a ; push\r
+ push strict dword 0 ; 0 will be fixed\r
VectorNum:\r
- db 0 ; 0 will be fixed\r
push eax\r
mov eax, HookAfterStubHeaderEnd\r
jmp eax\r
ASM_PFX(AsmVectorNumFixup):\r
mov eax, dword [esp + 8]\r
mov ecx, [esp + 4]\r
- mov [ecx + (VectorNum - HookAfterStubBegin)], al\r
+ mov [ecx + (VectorNum - 4 - HookAfterStubBegin)], al\r
ret\r
AsmIdtVectorBegin:\r
%assign Vector 0\r
%rep 256\r
- push byte %[Vector]\r
+ push strict dword %[Vector] ; This instruction pushes sign-extended 8-byte value on stack\r
push rax\r
- mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterruptEntry)\r
+ mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterruptEntry)\r
jmp rax\r
%assign Vector Vector+1\r
%endrep\r
AsmIdtVectorEnd:\r
\r
HookAfterStubHeaderBegin:\r
- db 0x6a ; push\r
-@VectorNum:\r
- db 0 ; 0 will be fixed\r
+ push strict dword 0 ; 0 will be fixed\r
+VectorNum:\r
push rax\r
mov rax, strict qword 0 ; mov rax, HookAfterStubHeaderEnd\r
JmpAbsoluteAddress:\r
global ASM_PFX(AsmVectorNumFixup)\r
ASM_PFX(AsmVectorNumFixup):\r
mov rax, rdx\r
- mov [rcx + (@VectorNum - HookAfterStubHeaderBegin)], al\r
+ mov [rcx + (VectorNum - 4 - HookAfterStubHeaderBegin)], al\r
ret\r
\r