From dfd4909816fc06841cffc86d1c2170e5cd68bfbd Mon Sep 17 00:00:00 2001 From: ionescu007 Date: Sat, 3 Sep 2016 08:57:31 -0700 Subject: Invert files... idiot. --- shvosx64.asm | 42 +++++++++++++++++++++++------------------- shvvmxhvx64.asm | 42 +++++++++++++++++++----------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/shvosx64.asm b/shvosx64.asm index e010e66..1e75175 100644 --- a/shvosx64.asm +++ b/shvosx64.asm @@ -4,11 +4,11 @@ ; ; Module: ; -; shvx64.asm +; shvvmxhvx64.asm ; ; Abstract: ; -; This module implements the AMD64-specific SimpleVisor VMENTRY routine. +; This module implements AMD64-specific code for NT support of SimpleVisor. ; ; Author: ; @@ -20,24 +20,28 @@ ; ;-- - .code +include ksamd64.inc - extern ShvVmxEntryHandler:proc - extern ShvOsCaptureContext:proc + LEAF_ENTRY _str, _TEXT$00 + str word ptr [rcx] ; Store TR value + ret ; Return + LEAF_END _str, _TEXT$00 - ShvVmxEntry PROC - push rcx ; save the RCX register, which we spill below - lea rcx, [rsp+8h] ; store the context in the stack, bias for - ; the return address and the push we just did. - call ShvOsCaptureContext ; save the current register state. - ; note that this is a specially written function - ; which has the following key characteristics: - ; 1) it does not taint the value of RCX - ; 2) it does not spill any registers, nor - ; expect home space to be allocated for it - jmp ShvVmxEntryHandler ; jump to the C code handler. we assume that it - ; compiled with optimizations and does not use - ; home space, which is true of release builds. - ShvVmxEntry ENDP + LEAF_ENTRY _sldt, _TEXT$00 + sldt word ptr [rcx] ; Store LDTR value + ret ; Return + LEAF_END _sldt, _TEXT$00 + + LEAF_ENTRY ShvVmxCleanup, _TEXT$00 + mov ds, cx ; set DS to parameter 1 + mov es, cx ; set ES to parameter 1 + mov fs, dx ; set FS to parameter 2 + ret ; return + LEAF_END ShvVmxCleanup, _TEXT$00 + + LEAF_ENTRY __lgdt, _TEXT$00 + lgdt fword ptr [rcx] ; load the GDTR with the value in parameter 1 + ret ; return + LEAF_END __lgdt, _TEXT$00 end diff --git a/shvvmxhvx64.asm b/shvvmxhvx64.asm index 1e75175..e010e66 100644 --- a/shvvmxhvx64.asm +++ b/shvvmxhvx64.asm @@ -4,11 +4,11 @@ ; ; Module: ; -; shvvmxhvx64.asm +; shvx64.asm ; ; Abstract: ; -; This module implements AMD64-specific code for NT support of SimpleVisor. +; This module implements the AMD64-specific SimpleVisor VMENTRY routine. ; ; Author: ; @@ -20,28 +20,24 @@ ; ;-- -include ksamd64.inc + .code - LEAF_ENTRY _str, _TEXT$00 - str word ptr [rcx] ; Store TR value - ret ; Return - LEAF_END _str, _TEXT$00 + extern ShvVmxEntryHandler:proc + extern ShvOsCaptureContext:proc - LEAF_ENTRY _sldt, _TEXT$00 - sldt word ptr [rcx] ; Store LDTR value - ret ; Return - LEAF_END _sldt, _TEXT$00 - - LEAF_ENTRY ShvVmxCleanup, _TEXT$00 - mov ds, cx ; set DS to parameter 1 - mov es, cx ; set ES to parameter 1 - mov fs, dx ; set FS to parameter 2 - ret ; return - LEAF_END ShvVmxCleanup, _TEXT$00 - - LEAF_ENTRY __lgdt, _TEXT$00 - lgdt fword ptr [rcx] ; load the GDTR with the value in parameter 1 - ret ; return - LEAF_END __lgdt, _TEXT$00 + ShvVmxEntry PROC + push rcx ; save the RCX register, which we spill below + lea rcx, [rsp+8h] ; store the context in the stack, bias for + ; the return address and the push we just did. + call ShvOsCaptureContext ; save the current register state. + ; note that this is a specially written function + ; which has the following key characteristics: + ; 1) it does not taint the value of RCX + ; 2) it does not spill any registers, nor + ; expect home space to be allocated for it + jmp ShvVmxEntryHandler ; jump to the C code handler. we assume that it + ; compiled with optimizations and does not use + ; home space, which is true of release builds. + ShvVmxEntry ENDP end -- cgit v1.2.3