Index: /trunk/src/VBox/Runtime/common/ldr/ldrMachO.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/ldr/ldrMachO.cpp	(revision 74675)
+++ /trunk/src/VBox/Runtime/common/ldr/ldrMachO.cpp	(revision 74676)
@@ -1748,7 +1748,8 @@
     {
         /* simplify validation. */
-        if (cchStrings <= cchSymbol)
+        /** @todo figure out a better way to deal with underscore prefixes. sigh. */
+        if (cchStrings <= cchSymbol + 1)
             return VERR_SYMBOL_NOT_FOUND;
-        cchStrings -= cchSymbol;
+        cchStrings -= cchSymbol + 1;
 
         /* external symbols are usually at the end, so search the other way. */
@@ -1773,7 +1774,8 @@
                 continue;
             psz = &pchStrings[paSyms[iSymbol].n_un.n_strx];
-            if (psz[cchSymbol])
+            if (psz[cchSymbol + 1])
                 continue;
-            if (memcmp(psz, pchSymbol, cchSymbol))
+            /** @todo figure out a better way to deal with underscore prefixes. sigh. */
+            if (*psz != '_' || memcmp(psz + 1, pchSymbol, cchSymbol))
                 continue;
 
@@ -1876,7 +1878,8 @@
     {
         /* simplify validation. */
-        if (cchStrings <= cchSymbol)
+        /** @todo figure out a better way to deal with underscore prefixes. sigh. */
+        if (cchStrings <= cchSymbol + 1)
             return VERR_SYMBOL_NOT_FOUND;
-        cchStrings -= cchSymbol;
+        cchStrings -= cchSymbol + 1;
 
         /* external symbols are usually at the end, so search the other way. */
@@ -1901,7 +1904,7 @@
                 continue;
             psz = &pchStrings[paSyms[iSymbol].n_un.n_strx];
-            if (psz[cchSymbol])
+            if (psz[cchSymbol + 1])
                 continue;
-            if (memcmp(psz, pchSymbol, cchSymbol))
+            if (*psz != '_' || memcmp(psz + 1, pchSymbol, cchSymbol))
                 continue;
 
@@ -2128,4 +2131,7 @@
          * Do callback.
          */
+        /** @todo figure out a better way to deal with underscore prefixes. sigh. */
+        if (cch > 1 && *psz == '_')
+            psz++;
         rc = pfnCallback(&pThis->Core, psz, iSym, uValue/*, fKind*/, pvUser);
         if (rc != VINF_SUCCESS)
@@ -2240,4 +2246,7 @@
          * Do callback.
          */
+        /** @todo figure out a better way to deal with underscore prefixes. sigh. */
+        if (cch > 1 && *psz == '_')
+            psz++;
         rc = pfnCallback(&pThis->Core, psz, iSym, uValue/*, fKind*/, pvUser);
         if (rc != VINF_SUCCESS)
@@ -2609,6 +2618,8 @@
 
                 /* Ask the user for an address to the symbol. */
+                /** @todo figure out a better way to deal with underscore prefixes. sigh. */
                 if (RT_FAILURE_NP(rc))
-                    rc = pfnGetImport(&pThis->Core, NULL /*pszModule*/, pszSymbol, iSym, &Value/*, &fKind*/, pvUser);
+                    rc = pfnGetImport(&pThis->Core, NULL /*pszModule*/, pszSymbol + (pszSymbol[0] == '_'),
+                                      UINT32_MAX, &Value/*, &fKind*/, pvUser);
                 if (RT_FAILURE(rc))
                 {
@@ -2668,6 +2679,8 @@
 
                 /* Ask the user for an address to the symbol. */
+                /** @todo figure out a better way to deal with underscore prefixes. sigh. */
                 if (RT_FAILURE_NP(rc))
-                    rc = pfnGetImport(&pThis->Core, NULL, pszSymbol, iSym, &Value, /*&fKind,*/ pvUser);
+                    rc = pfnGetImport(&pThis->Core, NULL, pszSymbol + (*pszSymbol == '_'),
+                                      UINT32_MAX, &Value, /*&fKind,*/ pvUser);
                 if (RT_FAILURE(rc))
                 {
