Skip to content

Commit

Permalink
Update goodbyedpi.c
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaXser authored Nov 14, 2023
1 parent b7d3bf4 commit c808eb0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/goodbyedpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c808eb0

Please sign in to comment.