Dmitry Timoshkov : kernel32: On process entry store PEB address in %ebx.

Alexandre Julliard julliard at winehq.org
Fri Aug 7 10:42:29 CDT 2020


Module: wine
Branch: stable
Commit: cf297b1fb6a0408ee8c832f6c1c18c6251d677c3
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cf297b1fb6a0408ee8c832f6c1c18c6251d677c3

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed May  6 15:15:58 2020 +0800

kernel32: On process entry store PEB address in %ebx.

8k demo custom PE loader depends on this.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42125
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 360820fb5830750b23543dc34188970aa9431835)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/kernel32/process.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 7875f3469a..58bbbac522 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -94,12 +94,18 @@ __ASM_GLOBAL_FUNC( call_process_entry,
                     __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
                     "movl %esp,%ebp\n\t"
                     __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
-                    "pushl 4(%ebp)\n\t"  /* deliberately mis-align the stack by 8, Doom 3 needs this */
+                    "pushl %ebx\n\t"
+                    __ASM_CFI(".cfi_rel_offset %ebx,-4\n\t")
+                    "movl 8(%ebp),%ebx\n\t"
+                    /* deliberately mis-align the stack by 8, Doom 3 needs this */
                     "pushl 4(%ebp)\n\t"  /* Driller expects readable address at this offset */
                     "pushl 4(%ebp)\n\t"
-                    "pushl 8(%ebp)\n\t"
+                    "pushl %ebx\n\t"
                     "call *12(%ebp)\n\t"
-                    "leave\n\t"
+                    "leal -4(%ebp),%esp\n\t"
+                    "popl %ebx\n\t"
+                    __ASM_CFI(".cfi_same_value %ebx\n\t")
+                    "popl %ebp\n\t"
                     __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
                     __ASM_CFI(".cfi_same_value %ebp\n\t")
                     "ret" )




More information about the wine-cvs mailing list