| 1 | #include <stdio.h> |
| 2 | |
| 3 | void DumpHex(const void* data, size_t size) { |
| 4 | char ascii[17]; |
| 5 | size_t i, j; |
| 6 | ascii[16] = '\0'; |
| 7 | for (i = 0; i < size; ++i) { |
| 8 | printf("%02X ", ((unsigned char*)data)[i]); |
| 9 | if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') { |
| 10 | ascii[i % 16] = ((unsigned char*)data)[i]; |
| 11 | } |
| 12 | else { |
| 13 | ascii[i % 16] = '.'; |
| 14 | } |
| 15 | if ((i + 1) % 8 == 0 || i + 1 == size) { |
| 16 | printf(" "); |
| 17 | if ((i + 1) % 16 == 0) { |
| 18 | printf("| %s \n", ascii); |
| 19 | } |
| 20 | else if (i + 1 == size) { |
| 21 | ascii[(i + 1) % 16] = '\0'; |
| 22 | if ((i + 1) % 16 <= 8) { |
| 23 | printf(" "); |
| 24 | } |
| 25 | for (j = (i + 1) % 16; j < 16; ++j) { |
| 26 | printf(" "); |
| 27 | } |
| 28 | printf("| %s \n", ascii); |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | int findNTLMBytes(char* bytes, int len) { |
| 34 | |
| 35 | char pattern[7] = { 0x4E, 0x54, 0x4C, 0x4D, 0x53, 0x53, 0x50 }; |