https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9161985e1bd8edd107a517598f687e035b3b6e5

commit e9161985e1bd8edd107a517598f687e035b3b6e5
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 14:31:20 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:35:35 2020 +0200

    [WINESYNC] dbghelp: Correctly determine the dyld image info address.
    
    Signed-off-by: Zebediah Figura <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id b7defd2946e625351111c36ff0f521b8aa9e6487 by Zebediah Figura 
<[email protected]>
---
 dll/win32/dbghelp/macho_module.c | 18 ++++++++++++++----
 sdk/tools/winesync/dbghelp.cfg   |  2 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index 05130b7de8d..a3f838f88ff 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -1360,18 +1360,28 @@ static ULONG_PTR get_dyld_image_info_address(struct 
process* pcs)
     NTSTATUS status;
     PROCESS_BASIC_INFORMATION pbi;
     ULONG_PTR dyld_image_info_address = 0;
+    BOOL ret;
 
     /* Get address of PEB */
     status = NtQueryInformationProcess(pcs->handle, ProcessBasicInformation, 
&pbi, sizeof(pbi), NULL);
     if (status == STATUS_SUCCESS)
     {
         /* Read dyld image info address from PEB */
-        if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0],
-                              &dyld_image_info_address, 
sizeof(dyld_image_info_address), NULL))
+        if (!pcs->is_64bit)
+            ret = ReadProcessMemory(pcs->handle, 
&pbi.PebBaseAddress->Reserved[0],
+                &dyld_image_info_address, sizeof(dyld_image_info_address), 
NULL);
+        else
         {
-            TRACE("got dyld_image_info_address 0x%08lx from PEB %p 
MacDyldImageInfo %p\n",
-                  (unsigned long)dyld_image_info_address, pbi.PebBaseAddress, 
&pbi.PebBaseAddress->Reserved);
+            PEB32 *peb32 = (PEB32 *)pbi.PebBaseAddress;
+            ULONG addr32;
+            ret = ReadProcessMemory(pcs->handle, &peb32->Reserved[0], &addr32,
+                sizeof(addr32), NULL);
+            dyld_image_info_address = addr32;
         }
+
+        if (ret)
+            TRACE("got dyld_image_info_address %#lx from PEB %p\n",
+                dyld_image_info_address, pbi.PebBaseAddress);
     }
 
 #ifndef __LP64__ /* No reading the symtab with nlist(3) in LP64 */
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index 20322ecc88c..77b08e5ad01 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -3,4 +3,4 @@ directories:
 files:
   include/dbghelp.h: sdk/include/psdk/dbghelp.h
 tags:
-  wine: 42745c068f80b696e7402680a61c2006b68b01d0
+  wine: b7defd2946e625351111c36ff0f521b8aa9e6487

Reply via email to