#define _CRT_SECURE_NO_WARNINGS #include "stdio.h" #include "string.h" #define MAX_HEXDUMP 512 char *hexdump(unsigned char *Buffer, int len) { static char sHexBuffer[3*MAX_HEXDUMP+12]; char *s; int iMaxI; if(!Buffer) return "(NULL)"; s=sHexBuffer; iMaxI = len; if(iMaxI > MAX_HEXDUMP) iMaxI = MAX_HEXDUMP; for (int i=0; i iMaxI) strcpy(s, ",..."); return sHexBuffer; }