#include <stdio.h> #include <stdint.h> #include <stdlib.h> void hexDump(void *ptr, char *buf) { static char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; *buf++ = '0'; *buf++ = 'x'; // unsigned __int64 ip = (unsigned __int64)ptr;
uintptr_t ip = (uintptr_t)ptr;
for (int nibble = (2 * sizeof(ptr) - 1); nibble >= 0; --nibble) *buf++ = hex[(ip >> (4 * nibble)) & 0xf]; *buf = '