Index: /trunk/include/iprt/string.h
===================================================================
--- /trunk/include/iprt/string.h	(revision 80564)
+++ /trunk/include/iprt/string.h	(revision 80565)
@@ -1471,4 +1471,13 @@
  *                            Use the precision to specify the length. Default length is 16 bytes.
  *                            The width, if specified, is ignored.
+ *      - \%RhXd            - Same as \%Rhxd, but takes an additional uint64_t
+ *                            value with the memory start address/offset after
+ *                            the memory pointer.
+ *      - \%RhXD            - Same as \%RhxD, but takes an additional uint64_t
+ *                            value with the memory start address/offset after
+ *                            the memory pointer.
+ *      - \%RhXs            - Same as \%Rhxs, but takes an additional uint64_t
+ *                            value with the memory start address/offset after
+ *                            the memory pointer.
  *
  *      - \%Rhcb            - Human readable byte size formatting, using
Index: /trunk/src/VBox/Runtime/common/string/strformatrt.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/string/strformatrt.cpp	(revision 80564)
+++ /trunk/src/VBox/Runtime/common/string/strformatrt.cpp	(revision 80565)
@@ -832,8 +832,24 @@
                      */
                     case 'x':
+                    case 'X':
                     {
                         uint8_t *pu8 = va_arg(*pArgs, uint8_t *);
+                        uint64_t uMemAddr;
+                        int      cchMemAddrWidth;
+
                         if (cchPrecision < 0)
                             cchPrecision = 16;
+
+                        if (ch == 'x')
+                        {
+                            uMemAddr = (uintptr_t)pu8;
+                            cchMemAddrWidth = sizeof(pu8) * 2;
+                        }
+                        else
+                        {
+                            uMemAddr = va_arg(*pArgs, uint64_t);
+                            cchMemAddrWidth = uMemAddr > UINT32_MAX || uMemAddr + cchPrecision > UINT32_MAX ? 16 : 8;
+                        }
+
                         if (pu8)
                         {
@@ -854,6 +870,6 @@
                                     {
                                         int i;
-                                        cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
-                                                           "%s%0*p %04x:", off ? "\n" : "", sizeof(pu8) * 2, (uintptr_t)pu8, off);
+                                        cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s%0*llx/%04x:",
+                                                           off ? "\n" : "", cchMemAddrWidth, uMemAddr + off, off);
                                         for (i = 0; i < cchWidth && off + i < cchPrecision ; i++)
                                             cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
@@ -904,12 +920,11 @@
                                             if (cDuplicates > 0)
                                             {
-                                                cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
-                                                                   "\n%.*s ****  <ditto x %u>",
-                                                                   sizeof(pu8) * 2, "****************", cDuplicates);
+                                                cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "\n%.*s ****  <ditto x %u>",
+                                                                   cchMemAddrWidth, "****************", cDuplicates);
                                                 cDuplicates = 0;
                                             }
 
-                                            cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
-                                                               "%s%0*p %04x:", off ? "\n" : "", sizeof(pu8) * 2, (uintptr_t)pu8, off);
+                                            cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s%0*llx/%04x:",
+                                                               off ? "\n" : "", cchMemAddrWidth, uMemAddr + off, off);
                                             for (i = 0; i < cchWidth && off + i < cchPrecision ; i++)
                                                 cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
@@ -945,5 +960,9 @@
                                     if (cchPrecision-- > 0)
                                     {
-                                        cch = RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%02x", *pu8++);
+                                        if (ch == 'x')
+                                            cch = RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%02x", *pu8++);
+                                        else
+                                            cch = RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%0*llx: %02x",
+                                                              cchMemAddrWidth, uMemAddr, *pu8++);
                                         for (; cchPrecision > 0; cchPrecision--, pu8++)
                                             cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, " %02x", *pu8);
Index: /trunk/src/VBox/Runtime/testcase/tstRTStrFormat.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstRTStrFormat.cpp	(revision 80564)
+++ /trunk/src/VBox/Runtime/testcase/tstRTStrFormat.cpp	(revision 80565)
@@ -732,9 +732,13 @@
     cch = RTStrPrintf(pszBuf, BUF_SIZE, "%256.*Rhxs", sizeof(s_abHex1), s_abHex1);
     CHECKSTR("00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14");
+    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%256.*RhXs", sizeof(s_abHex1), s_abHex1, (uint64_t)0x1234);
+    CHECKSTR("00001234: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14");
+    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%256.*RhXs", sizeof(s_abHex1), s_abHex1, (uint64_t)0x987654321abcdef);
+    CHECKSTR("0987654321abcdef: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14");
 
     cch = RTStrPrintf(pszBuf, BUF_SIZE, "%4.8Rhxd", s_abHex1);
     RTStrPrintf(pszBuf2, BUF_SIZE,
-                "%p 0000: 00 01 02 03 ....\n"
-                "%p 0004: 04 05 06 07 ....",
+                "%p/0000: 00 01 02 03 ....\n"
+                "%p/0004: 04 05 06 07 ....",
                 &s_abHex1[0], &s_abHex1[4]);
     CHECKSTR(pszBuf2);
@@ -742,6 +746,6 @@
     cch = RTStrPrintf(pszBuf, BUF_SIZE, "%4.6Rhxd", s_abHex1);
     RTStrPrintf(pszBuf2, BUF_SIZE,
-                "%p 0000: 00 01 02 03 ....\n"
-                "%p 0004: 04 05       ..",
+                "%p/0000: 00 01 02 03 ....\n"
+                "%p/0004: 04 05       ..",
                 &s_abHex1[0], &s_abHex1[4]);
     CHECKSTR(pszBuf2);
@@ -749,8 +753,20 @@
     cch = RTStrPrintf(pszBuf, BUF_SIZE, "%.*Rhxd", sizeof(s_abHex1), s_abHex1);
     RTStrPrintf(pszBuf2, BUF_SIZE,
-                "%p 0000: 00 01 02 03 04 05 06 07-08 09 0a 0b 0c 0d 0e 0f ................\n"
-                "%p 0010: 10 11 12 13 14                                  ....."
+                "%p/0000: 00 01 02 03 04 05 06 07-08 09 0a 0b 0c 0d 0e 0f ................\n"
+                "%p/0010: 10 11 12 13 14                                  ....."
                 ,
                 &s_abHex1[0], &s_abHex1[0x10]);
+    CHECKSTR(pszBuf2);
+
+    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%.*RhXd", sizeof(s_abHex1), s_abHex1, (uint64_t)0xf304);
+    RTStrPrintf(pszBuf2, BUF_SIZE,
+                "0000f304/0000: 00 01 02 03 04 05 06 07-08 09 0a 0b 0c 0d 0e 0f ................\n"
+                "0000f314/0010: 10 11 12 13 14                                  .....");
+    CHECKSTR(pszBuf2);
+
+    cch = RTStrPrintf(pszBuf, BUF_SIZE, "%.*RhXd", sizeof(s_abHex1), s_abHex1, (uint64_t)0x123456789abcdef);
+    RTStrPrintf(pszBuf2, BUF_SIZE,
+                "0123456789abcdef/0000: 00 01 02 03 04 05 06 07-08 09 0a 0b 0c 0d 0e 0f ................\n"
+                "0123456789abcdff/0010: 10 11 12 13 14                                  .....");
     CHECKSTR(pszBuf2);
 
