#include "stdafx.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <Windows.h>
#include "log.h"
void dump(unsigned char * buff,int len)
{
char szTmp[4] = {0};
char szLog[1024] = {0};
for (int i=0;i<len;i++)
{
ZeroMemory(szTmp,4);
sprintf_s(szTmp,4,"%02X",buff[i]);
strcat_s(szLog,1024,szTmp);
strcat_s(szLog,1024," ");
}
strcat_s(szLog,1024,"\n");
printf(szLog);
}
int _tmain(int argc, _TCHAR* argv[])
{
char szLog[64] = {0};
//strcpy_s(szLog,64,"ABCDEF");
strcpy_s(szLog,64,"abcdef");
dump((unsigned char*)szLog,6);
return 0;
}
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <Windows.h>
#include "log.h"
void dump(unsigned char * buff,int len)
{
char szTmp[4] = {0};
char szLog[1024] = {0};
for (int i=0;i<len;i++)
{
ZeroMemory(szTmp,4);
sprintf_s(szTmp,4,"%02X",buff[i]);
strcat_s(szLog,1024,szTmp);
strcat_s(szLog,1024," ");
}
strcat_s(szLog,1024,"\n");
printf(szLog);
}
int _tmain(int argc, _TCHAR* argv[])
{
char szLog[64] = {0};
//strcpy_s(szLog,64,"ABCDEF");
strcpy_s(szLog,64,"abcdef");
dump((unsigned char*)szLog,6);
return 0;
}