This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
2016-12-19 19:20:27 +01:00
|
|
|
#include "utils.h"
|
|
|
|
|
2018-10-04 01:54:12 +02:00
|
|
|
void print_hexa (const char *prefix, unsigned char *payload, size_t size)
|
2016-12-19 19:20:27 +01:00
|
|
|
{
|
2018-10-04 01:54:12 +02:00
|
|
|
if (! payload)
|
2016-12-19 19:20:27 +01:00
|
|
|
return ;
|
|
|
|
|
|
|
|
size_t i;
|
|
|
|
for(i = 0; i < size; i++)
|
|
|
|
{
|
|
|
|
if(! (i % 4))
|
|
|
|
printf("\n%s (%ld) ", prefix, size);
|
2018-10-04 01:54:12 +02:00
|
|
|
printf("%2x ", payload[i]);
|
2016-12-19 19:20:27 +01:00
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void mprint_hexa (char *prefix, unsigned char *buf, size_t length)
|
|
|
|
{
|
|
|
|
print_hexa (prefix, buf, length);
|
|
|
|
}
|