Update goodbyedpi.c

This commit is contained in:
SashaXser 2023-11-14 12:21:21 +04:00 committed by GitHub
parent b7d3bf4abe
commit c808eb0077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -213,7 +213,7 @@ static void add_maxpayloadsize_str(unsigned short maxpayload) {
const char *maxpayloadsize_str = "and (tcp.PayloadLength ? tcp.PayloadLength < %hu or tcp.Payload32[0] == 0x47455420 or tcp.Payload32[0] == 0x504F5354 : true)";
char *addfilter;
asprintf(&addfilter, "%s", maxpayloadsize_str, maxpayload);
asprintf(&addfilter, maxpayloadsize_str, maxpayload);
char *newstr = repl_str(filter_string, MAXPAYLOADSIZE_TEMPLATE, addfilter);
free(filter_string);
@ -222,7 +222,6 @@ static void add_maxpayloadsize_str(unsigned short maxpayload) {
}
static void finalize_filter_strings() {
char *newstr = repl_str(filter_string, IPID_TEMPLATE, "");
free(filter_string);
@ -391,7 +390,7 @@ static int extract_sni(const char *pktdata, unsigned int pktlen,
while (ptr + 8 < pktlen) {
if (d[ptr] == '\0' && d[ptr+1] == '\0' && d[ptr+2] == '\0' &&
d[ptr+4] == '\0' && d[ptr+6] == '\0' && d[ptr+7] == '\0' &&
(d[ptr+3] ^ d[ptr+5]) == 2 && (d[ptr+5] ^ d[ptr+8]) == 3)
d[ptr+3] - d[ptr+5] == 2 && d[ptr+5] - d[ptr+8] == 3)
{
hnaddr = &d[ptr+9];
hnlen = d[ptr+8];
@ -420,7 +419,6 @@ static int extract_sni(const char *pktdata, unsigned int pktlen,
}
static inline void change_window_size(const PWINDIVERT_TCPHDR ppTcpHdr, unsigned int size) {
if (size >= 1 && size <= 0xFFFFu) {
ppTcpHdr->Window = htons((u_short)size);