diff --git a/README.md b/README.md index 4f449514..5dbc432a 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ Usage: goodbyedpi.exe [OPTION...] would be sent on every request in the command line argument order. --fake-gen Generate random-filled fake packets for Fake Request Mode, value of them (up to 30). + --fake-resend Send each fake packet value number of times. + Default: 1 (send each packet once). --max-payload [value] packets with TCP payload data more than [value] won't be processed. Use this option to reduce CPU usage by skipping huge amount of data (like file transfers) in already established sessions. diff --git a/src/fakepackets.c b/src/fakepackets.c index e13c271a..c5043452 100644 --- a/src/fakepackets.c +++ b/src/fakepackets.c @@ -16,6 +16,7 @@ struct fake_t { static struct fake_t *fakes[30] = {0}; int fakes_count = 0; +int fakes_resend = 1; static const unsigned char fake_http_request[] = "GET / HTTP/1.1\r\nHost: www.w3.org\r\n" "User-Agent: curl/7.65.3\r\nAccept: */*\r\n" @@ -198,7 +199,8 @@ int send_fake_http_request(const HANDLE w_filter, ) { int ret = 0; for (int i=0; i 100) + puts("WARNING: fake-resend value is a little too high, don't you think?"); + break; case 'x': // --debug-exit debug_exit = true; break; @@ -1005,6 +1015,8 @@ int main(int argc, char *argv[]) { " would be sent on every request in the command line argument order.\n" " --fake-gen Generate random-filled fake packets for Fake Request Mode, value of them\n" " (up to 30).\n" + " --fake-resend Send each fake packet value number of times.\n" + " Default: 1 (send each packet once).\n" " --max-payload [value] packets with TCP payload data more than [value] won't be processed.\n" " Use this option to reduce CPU usage by skipping huge amount of data\n" " (like file transfers) in already established sessions.\n" @@ -1065,7 +1077,8 @@ int main(int argc, char *argv[]) { "Fake requests, wrong checksum: %d\n" /* 18 */ "Fake requests, wrong SEQ/ACK: %d\n" /* 19 */ "Fake requests, custom payloads: %d\n" /* 20 */ - "Max payload size: %hu\n", /* 21 */ + "Fake requests, resend: %d\n" /* 21 */ + "Max payload size: %hu\n", /* 22 */ do_passivedpi, do_block_quic, /* 1 */ (do_fragment_http ? http_fragment_size : 0), /* 2 */ (do_fragment_http_persistent ? http_fragment_size : 0),/* 3 */ @@ -1087,8 +1100,9 @@ int main(int argc, char *argv[]) { do_auto_ttl ? auto_ttl_max : 0, ttl_min_nhops, do_wrong_chksum, /* 18 */ do_wrong_seq, /* 19 */ - fakes_count, /* 20 */ - max_payload_size /* 21 */ + fakes_count, /* 20 */ + fakes_resend, /* 21 */ + max_payload_size /* 22 */ ); if (do_fragment_http && http_fragment_size > 2 && !do_native_frag) {