Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created February 11, 2013 21:38
Show Gist options
  • Select an option

  • Save KristianLyng/4757845 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/4757845 to your computer and use it in GitHub Desktop.
kristian@luke:~$ cat foo.c; gcc foo.c; ./a.out
#include <stdio.h>
main() {
char a[] = { 0x00, 0x30, 0x01, 0x01, 0x5f, 0x2b, 0x00, 0, 0, 0, 0, 0xd9, 0xfe, 0x53, 0x4d, 0x42, 0x40, 0 };
int len = sizeof(a);
int i;
for (i = 0; i < len; i++) {
if (isprint(a[i]))
printf("%X %c\n", a[i], a[i]);
else
printf("%X\n", a[i]);
}
}
0
30 0
1
1
5F _
2B +
0
0
0
0
0
FFFFFFD9
FFFFFFFE
53 S
4D M
42 B
40 @
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment