Skip to content

Instantly share code, notes, and snippets.

@ahappyforest
Created July 25, 2014 06:39
Show Gist options
  • Save ahappyforest/e44e657dfe33da327236 to your computer and use it in GitHub Desktop.
Save ahappyforest/e44e657dfe33da327236 to your computer and use it in GitHub Desktop.
int i;
for (i = 0;i < connection->msg.len * 2;i++) {
unsigned char c = (unsigned char *)connection->msg.data[(i & 0xf) | ((i & 0xffffffe0)>>1)];
if ((i & 15) == 0) printf("\n");
if ((i & 31) < 16) {
printf("%02x ", c);
} else {
if (c < 0x20) {
printf(".");
} else {
printf("%c", c);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment