Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdint.h>
- #include <stdlib.h>
- #include <stdio.h>
- struct pair
- {
- uint32_t instruction;
- uint8_t prefix_length;
- };
- typedef struct
- {
- uint8_t *start;
- uint8_t buffer[4096];
- struct pair table[1];
- } branch;
- static char text[] = "boiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
- int main()
- {
- branch *crc[2][2] =
- {
- {
- malloc(sizeof(branch) + sizeof(struct pair) * 2),
- malloc(sizeof(branch) + sizeof(struct pair) * 2)
- },
- {
- malloc(sizeof(branch) + sizeof(struct pair) * 2),
- malloc(sizeof(branch) + sizeof(struct pair) * 2)
- },
- };
- for (uint16_t i = 0; i < sizeof crc[0][0]->buffer; i++)
- crc[0][0]->buffer[i] = text[i];
- crc[0][0]->table[0].instruction = 13333337;
- crc[0][0]->table[0].prefix_length = 1;
- crc[0][0]->table[1].instruction = 13333337;
- crc[0][0]->table[1].prefix_length = 1;
- crc[0][0]->start = (uint8_t *)text;
- printf("%08x:%s\n%08x:%s\n", crc[0][0]->start, crc[0][0]->start, crc[0][0]->buffer, crc[0][0]->buffer);
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement