1 #pragma once
2 #ifndef __MTX_H
3 #define __MTX_H
4 
5 #pragma pack(push, 1)
6 
7 typedef struct {
8     unsigned version  : 8;
9     unsigned distance : 24;
10     unsigned dataoffset : 24;
11     unsigned codeoffset : 24;
12 } mtx_header_t;
13 
14 #pragma pack(pop)
15 
16 typedef struct {
17     mtx_header_t head;
18     uint8_t *rest;
19     uint8_t *data;
20     uint8_t *code;
21     size_t restsize;
22     size_t datasize;
23     size_t codesize;
24     size_t totalsize;
25 } mtx_t;
26 
27 bool mtx_init(mtx_t **state, const uint8_t *data, size_t size);
28 bool mtx_dump(mtx_t *state);
29 bool mtx_getCTF(mtx_t *state, uint8_t **data, size_t *size);
30 bool mtx_fini(mtx_t *state);
31 
32 #else
33 # warning mtx.h included twice
34 #endif
35