Created
March 14, 2020 16:56
-
-
Save koriwi/366edbf5af987dcd9fb7ef31087ff5c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| char hex[] = "00020000000000020000000000000000\ | |
| 000000000000017dfa00000000000000\ | |
| 0000000000000ed52ac0000000000000\ | |
| 00000000000035a88534000000000000\ | |
| 000000000000ee465048000000000000\ | |
| 000000000001b1554405000000000000\ | |
| 0000000003f7cd55528297c000000000\ | |
| 0000000002deaaaaa820454000000000\ | |
| 0000000002da55548510228000000000\ | |
| 00000000023d55525084104000000000\ | |
| 0000000002e955552a21048000000000\ | |
| 0000000000b2aaa94488020000000000\ | |
| 0000000003c45554a820008000000000\ | |
| 00000000015295524500020000000000\ | |
| 00000000078842aaa040804000000000\ | |
| 000000000527fcaa14bfc00000000000\ | |
| 000000000640b0aaa25e00a000000000\ | |
| 000000000a2b4a541024800000000000\ | |
| 000000001d41a1554854002000000000\ | |
| 0000000014a96a528452821000000000\ | |
| 000000001911d4a92058000800000000\ | |
| 0000000028a4e425086a002000000000\ | |
| 00000000324ab29180a9040800000000\ | |
| 000000002920d44a8474000800000000\ | |
| 000000005494f52350aa000400000000\ | |
| 0000000052a2551280f2200a00000000\ | |
| 000000005554f54320a8048400000000\ | |
| 0000000042a25a1544f6000a00000000\ | |
| 000000006a946b46a0d0100400000000\ | |
| 0000000044aa3a86916c020500000000\ | |
| 000000002aa4aa86c1e4002400000000\ | |
| 00000000a2523d145174080400000000\ | |
| 0000000049092b8751d4008500000000\ | |
| 0000000044a43d4cd1a8000400000000\ | |
| 000000005251158d52e8000a00000000\ | |
| 0000000045141ecae9a8000500000000\ | |
| 0000000020a1154d5368000a00000000\ | |
| 0000000055141edaaad0000a00000000\ | |
| 0000000000a28b557750000a00000000\ | |
| 0000000055100dba55d0001400000000\ | |
| 00000000208a8eaa6aa8001400000000\ | |
| 000000001240057535a0001400000000\ | |
| 00000000082a8b542d90002800000000\ | |
| 000000001100055a36d0002800000000\ | |
| 00000000045486aa2b40003000000000\ | |
| 000000000800056a3aa0005800000000\ | |
| 00000000022207282d9000a000000000\ | |
| 00000000000882b4168000d000000000\ | |
| 00000000050007543aa0016000000000\ | |
| 00000000000205541940028000000000\ | |
| 000000000140048a2428038000000000\ | |
| 00000000000009201280068000000000\ | |
| 0000000000a0000000001b4000000000\ | |
| 000000000208000000001c8000000000\ | |
| 000000000120000000006d4000000000\ | |
| 00000000028a00000000b28000000000\ | |
| 0000000002c10000000377c000000000\ | |
| 000000000364a000000acd4000000000\ | |
| 0000000000011000002f000000000000\ | |
| 000000000000550001d5000000000000\ | |
| 000000000000156a56b8000000000000\ | |
| 0000000000000295aac0000000000000\ | |
| 00000000000000555a00000000000000\ | |
| 00000000000000008000000000000000"; | |
| unsigned int toInt(char c) | |
| { | |
| if (c >= '0' && c <= '9') return c - '0'; | |
| if (c >= 'A' && c <= 'F') return 10 + c - 'A'; | |
| if (c >= 'a' && c <= 'f') return 10 + c - 'a'; | |
| return -1; | |
| } | |
| u_int8_t stringtToInt(char *input) { | |
| if(input == NULL) return -1; | |
| u_int8_t output = 16 * toInt(input[0]) + toInt(input[1]); | |
| return output; | |
| } | |
| u_int8_t* hexStringToMonoBitmap(char *string) { | |
| u_int8_t parts[strlen(string)/2]; | |
| int i = 0; | |
| while(string[i*2+1]){ | |
| char buffer[2]; | |
| memcpy(buffer, &hex[i*2], 2); | |
| u_int8_t number = stringtToInt(buffer); | |
| printf("%d %d\n", number, i); | |
| i++; | |
| } | |
| return parts; | |
| } | |
| int main() { | |
| u_int8_t* bitmap = hexStringToMonoBitmap(hex); | |
| printf("LEL\n"); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment