mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
x86_64 isrs: set ss to correct value somewhere else in the code
This commit is contained in:
+11
-13
@@ -43,12 +43,6 @@ section .text
|
|||||||
mov rax, gs
|
mov rax, gs
|
||||||
push rax
|
push rax
|
||||||
|
|
||||||
; now use kernel segments for data
|
|
||||||
|
|
||||||
;mov rax, 0x38
|
|
||||||
;mov ds, rax
|
|
||||||
;mov es, rax
|
|
||||||
;mov ss, rax
|
|
||||||
mov rdi,cr2
|
mov rdi,cr2
|
||||||
push rdi
|
push rdi
|
||||||
|
|
||||||
@@ -78,13 +72,6 @@ section .text
|
|||||||
pop rdi
|
pop rdi
|
||||||
pop rsi
|
pop rsi
|
||||||
|
|
||||||
; check and patch ss if it is invalid because of the syscall instruction
|
|
||||||
cmp qword [rsp+48], 0x33
|
|
||||||
jne .nofix
|
|
||||||
mov qword [rsp+48], 0x43
|
|
||||||
.nofix:
|
|
||||||
|
|
||||||
|
|
||||||
pop rbp
|
pop rbp
|
||||||
add rsp,8 ; remove error code
|
add rsp,8 ; remove error code
|
||||||
|
|
||||||
@@ -115,6 +102,11 @@ section .text
|
|||||||
|
|
||||||
popregs
|
popregs
|
||||||
|
|
||||||
|
cmp qword [rsp+8], 0x3b
|
||||||
|
jne .ok
|
||||||
|
mov qword [rsp+32], 0x43
|
||||||
|
.ok:
|
||||||
|
|
||||||
iretq
|
iretq
|
||||||
|
|
||||||
|
|
||||||
@@ -133,6 +125,7 @@ section .text
|
|||||||
mov rdi,rsp
|
mov rdi,rsp
|
||||||
mov rsi,%3
|
mov rsi,%3
|
||||||
|
|
||||||
|
|
||||||
cld
|
cld
|
||||||
sti
|
sti
|
||||||
extern %2
|
extern %2
|
||||||
@@ -141,6 +134,11 @@ section .text
|
|||||||
|
|
||||||
popregs
|
popregs
|
||||||
|
|
||||||
|
cmp qword [rsp+8], 0x3b
|
||||||
|
jne .ok
|
||||||
|
mov qword [rsp+32], 0x43
|
||||||
|
.ok:
|
||||||
|
|
||||||
iretq
|
iretq
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user