2023-06-12 04:00:33 +00:00
|
|
|
#include <stdio.h>
|
2024-03-08 00:37:02 +00:00
|
|
|
#include <mpool.h>
|
2024-02-18 20:20:52 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <ws2tcpip.h>
|
|
|
|
#else
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#endif
|
2023-06-12 04:00:33 +00:00
|
|
|
|
2024-03-05 20:22:12 +00:00
|
|
|
#define OFFSET_SNI 1
|
|
|
|
#define OFFSET_HOST 2
|
|
|
|
|
2023-06-03 19:52:10 +00:00
|
|
|
enum demode {
|
|
|
|
DESYNC_NONE,
|
|
|
|
DESYNC_SPLIT,
|
|
|
|
DESYNC_DISORDER,
|
2024-02-29 17:07:59 +00:00
|
|
|
DESYNC_OOB,
|
2023-06-03 19:52:10 +00:00
|
|
|
DESYNC_FAKE
|
|
|
|
};
|
|
|
|
|
2024-03-04 01:49:08 +00:00
|
|
|
struct part {
|
|
|
|
int m;
|
2024-03-05 20:22:12 +00:00
|
|
|
int flag;
|
2024-03-04 01:49:08 +00:00
|
|
|
long pos;
|
|
|
|
};
|
|
|
|
|
2024-03-08 00:37:02 +00:00
|
|
|
struct desync_params {
|
2023-06-03 19:52:10 +00:00
|
|
|
int ttl;
|
2024-03-05 20:22:12 +00:00
|
|
|
int parts_n;
|
2024-03-04 01:49:08 +00:00
|
|
|
struct part *parts;
|
2023-06-03 19:52:10 +00:00
|
|
|
int mod_http;
|
2024-03-05 20:22:12 +00:00
|
|
|
int tlsrec_n;
|
2024-03-04 12:30:23 +00:00
|
|
|
struct part *tlsrec;
|
2024-03-08 00:37:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct params {
|
|
|
|
char de_known;
|
|
|
|
int dp_count;
|
|
|
|
struct desync_params *dp;
|
|
|
|
long sfdelay;
|
|
|
|
int def_ttl;
|
|
|
|
char custom_ttl;
|
2023-06-03 19:52:10 +00:00
|
|
|
|
2024-03-08 18:33:25 +00:00
|
|
|
long cache_ttl;
|
2023-06-03 19:52:10 +00:00
|
|
|
char ipv6;
|
|
|
|
char resolve;
|
|
|
|
int max_open;
|
|
|
|
int debug;
|
|
|
|
size_t bfsize;
|
2023-10-08 11:43:34 +00:00
|
|
|
struct sockaddr_in6 baddr;
|
2024-03-08 00:37:02 +00:00
|
|
|
struct mphdr *mempool;
|
2023-06-03 19:52:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct params params;
|
|
|
|
|
|
|
|
struct packet {
|
2023-10-08 11:43:34 +00:00
|
|
|
ssize_t size;
|
|
|
|
char *data;
|
2023-06-03 19:52:10 +00:00
|
|
|
};
|
|
|
|
extern struct packet fake_tls;
|
|
|
|
extern struct packet fake_http;
|
2024-02-29 17:07:59 +00:00
|
|
|
extern struct packet oob_data;
|