Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e7863eaa
Commit
e7863eaa
authored
Mar 21, 2019
by
Derek Lesho
Committed by
Alexandre Julliard
Mar 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Add emulation of rdmsr for MSR_LSTAR control register.
Signed-off-by:
Derek Lesho
<
dereklesho52@Gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9a2ff844
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
instr.c
dlls/ntoskrnl.exe/instr.c
+26
-0
No files found.
dlls/ntoskrnl.exe/instr.c
View file @
e7863eaa
...
...
@@ -473,6 +473,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(int);
#define REX_R 4
#define REX_W 8
#define MSR_LSTAR 0xc0000082
#define REGMODRM_MOD( regmodrm, rex ) ((regmodrm) >> 6)
#define REGMODRM_REG( regmodrm, rex ) (((regmodrm) >> 3) & 7) | (((rex) & REX_R) ? 8 : 0)
#define REGMODRM_RM( regmodrm, rex ) (((regmodrm) & 7) | (((rex) & REX_B) ? 8 : 0))
...
...
@@ -586,6 +588,12 @@ static BYTE *INSTR_GetOperandAddr( CONTEXT *context, BYTE *instr,
}
static
void
fake_syscall_function
(
void
)
{
TRACE
(
"() stub
\n
"
);
}
/***********************************************************************
* emulate_instruction
*
...
...
@@ -757,6 +765,24 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
context
->
Rip
+=
prefixlen
+
3
;
return
ExceptionContinueExecution
;
}
case
0x32
:
/* rdmsr */
{
ULONG
reg
=
context
->
Rcx
;
TRACE
(
"rdmsr CR 0x%08x
\n
"
,
reg
);
switch
(
reg
)
{
case
MSR_LSTAR
:
{
ULONG_PTR
syscall_address
=
(
ULONG_PTR
)
fake_syscall_function
;
context
->
Rdx
=
(
ULONG
)(
syscall_address
>>
32
);
context
->
Rax
=
(
ULONG
)
syscall_address
;
break
;
}
default:
return
ExceptionContinueSearch
;
}
context
->
Rip
+=
prefixlen
+
2
;
return
ExceptionContinueExecution
;
}
case
0xb6
:
/* movzx Eb, Gv */
case
0xb7
:
/* movzx Ew, Gv */
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment