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
44fbc018
Commit
44fbc018
authored
Feb 12, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Feb 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Do not access memory below ESP when restoring thread contexts.
Based on a patch by John Reiser.
parent
6bec132c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
16 deletions
+33
-16
relay.c
tools/winebuild/relay.c
+33
-16
No files found.
tools/winebuild/relay.c
View file @
44fbc018
...
...
@@ -852,31 +852,48 @@ static void build_call_from_regs_x86(void)
/* Restore the context structure */
output
(
"2:
\t
pushl 0x94(%%ecx)
\n
"
);
/* SegEs */
output
(
"2:
\n
"
);
/* As soon as we have switched stacks the context structure could
* be invalid (when signal handlers are executed for example). Copy
* values on the target stack before changing ESP. */
output
(
"
\t
pushl 0xc8(%%ecx)
\n
"
);
/* SegSs */
output
(
"
\t
popl %%es
\n
"
);
output
(
"
\t
movl 0xc4(%%ecx),%%eax
\n
"
);
/* Esp */
output
(
"
\t
leal -4*4(%%eax),%%eax
\n
"
);
output
(
"
\t
movl 0xc0(%%ecx),%%edx
\n
"
);
/* EFlags */
output
(
"
\t
.byte 0x26
\n\t
movl %%edx,3*4(%%eax)
\n
"
);
output
(
"
\t
movl 0xbc(%%ecx),%%edx
\n
"
);
/* SegCs */
output
(
"
\t
.byte 0x26
\n\t
movl %%edx,2*4(%%eax)
\n
"
);
output
(
"
\t
movl 0xb8(%%ecx),%%edx
\n
"
);
/* Eip */
output
(
"
\t
.byte 0x26
\n\t
movl %%edx,1*4(%%eax)
\n
"
);
output
(
"
\t
movl 0xb0(%%ecx),%%edx
\n
"
);
/* Eax */
output
(
"
\t
.byte 0x26
\n\t
movl %%edx,0*4(%%eax)
\n
"
);
output
(
"
\t
pushl %%es
\n
"
);
output
(
"
\t
pushl 0x98(%%ecx)
\n
"
);
/* SegDs */
output
(
"
\t
pushl 0x94(%%ecx)
\n
"
);
/* SegEs */
output
(
"
\t
popl %%es
\n
"
);
output
(
"
\t
pushl 0x90(%%ecx)
\n
"
);
/* SegFs */
output
(
"
\t
popl %%fs
\n
"
);
output
(
"
\t
pushl 0x8c(%%ecx)
\n
"
);
/* SegGs */
output
(
"
\t
popl %%gs
\n
"
);
output
(
"
\t
movl 0x9c(%%ecx),%%edi
\n
"
);
/* Edi */
output
(
"
\t
movl 0xa0(%%ecx),%%esi
\n
"
);
/* Esi */
output
(
"
\t
movl 0xa
8(%%ecx),%%edx
\n
"
);
/* Ed
x */
output
(
"
\t
movl 0xa
4(%%ecx),%%ebx
\n
"
);
/* Eb
x */
output
(
"
\t
movl 0xb
0(%%ecx),%%eax
\n
"
);
/* Eax
*/
output
(
"
\t
movl 0x
b4(%%ecx),%%ebp
\n
"
);
/* Ebp
*/
output
(
"
\t
movl 0x9c(%%ecx),%%edi
\n
"
);
/* Edi */
output
(
"
\t
movl 0xa0(%%ecx),%%esi
\n
"
);
/* Esi */
output
(
"
\t
movl 0xa
4(%%ecx),%%ebx
\n
"
);
/* Eb
x */
output
(
"
\t
movl 0xa
8(%%ecx),%%edx
\n
"
);
/* Ed
x */
output
(
"
\t
movl 0xb
4(%%ecx),%%ebp
\n
"
);
/* Ebp
*/
output
(
"
\t
movl 0x
ac(%%ecx),%%ecx
\n
"
);
/* Ecx
*/
output
(
"
\t
p
ushl 0xc8(%%ecx)
\n
"
);
/* SegSs */
output
(
"
\t
p
opl %%ds
\n
"
);
output
(
"
\t
popl %%ss
\n
"
);
output
(
"
\t
movl
0xc4(%%ecx),%%esp
\n
"
);
/* Esp */
output
(
"
\t
movl
%%eax,%%esp
\n
"
);
output
(
"
\t
pushl 0xc0(%%ecx)
\n
"
);
/* EFlags */
output
(
"
\t
pushl 0xbc(%%ecx)
\n
"
);
/* SegCs */
output
(
"
\t
pushl 0xb8(%%ecx)
\n
"
);
/* Eip */
output
(
"
\t
pushl 0x98(%%ecx)
\n
"
);
/* SegDs */
output
(
"
\t
movl 0xac(%%ecx),%%ecx
\n
"
);
/* Ecx */
output
(
"
\t
popl %%ds
\n
"
);
output
(
"
\t
popl %%eax
\n
"
);
output
(
"
\t
iret
\n
"
);
output_cfi
(
".cfi_endproc"
);
output_function_size
(
"__wine_call_from_regs"
);
...
...
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