Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaXser committed Aug 13, 2024
1 parent 40758a8 commit e705b33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
29 changes: 15 additions & 14 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ endif

WINDIVERTHEADERS = ../../../include
WINDIVERTLIBS = ../../binary
MINGWLIB = /usr/$(CPREFIX)/lib/
MINGWINCLUDE = /usr/$(CPREFIX)/include/
MINGWLIB = /usr/x86_64-w64-mingw32/lib/

TARGET = goodbyedpi.exe
LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32
CC = clang --target=$(CPREFIX) --sysroot=/usr/$(CPREFIX)

CC = $(CPREFIX)clang

CCWINDRES = $(CPREFIX)windres
ifeq (, $(shell which $(CPREFIX)windres))
CCWINDRES = windres
CCWINDRES = llvm-windres --target=$(CPREFIX)
ifeq (, $(shell which $(CPREFIX)llvm-windres))
CCWINDRES = llvm-windres
endif

CFLAGS = --target=$(CPREFIX) --sysroot=$(MINGWLIB) -std=c99 -fPIE -pipe \
-I$(WINDIVERTHEADERS) -I$(MINGWINCLUDE) -L$(WINDIVERTLIBS) \
CFLAGS = -std=c99 -I$(WINDIVERTHEADERS) \
-O3 -march=x86-64-v3 -D_FORTIFY_SOURCE=2 -fstack-protector \
-Wall -Wextra -Wpedantic -Wformat=2 -Wshadow -Wstrict-aliasing=1 \
-Wnull-dereference -Wcast-align -Wsign-conversion
-Wall -Wextra -Wpedantic \
-Wformat-security -Wno-format-nonliteral -Wshadow \
-Wstrict-aliasing=1 -Wnull-dereference \
-Wimplicit-fallthrough=3 -Wstringop-overflow=4 \
-Wformat-signedness -Wstrict-overflow=2 \
-Wcast-align -Wsign-conversion

LDFLAGS = -fstack-protector -Wl,-O3,-pie,--dynamicbase,--nxcompat,--sort-common,--as-needed \
-Wl,--disable-auto-image-base
LDFLAGS = -fstack-protector -Wl,-O1,--dynamicbase,--nxcompat,--sort-common,--as-needed \
-Wl,--disable-auto-image-base

ifdef BIT64
LDFLAGS += -Wl,--high-entropy-va -Wl,--pic-executable,-e,mainCRTStartup
Expand All @@ -50,7 +51,7 @@ goodbyedpi-rc.o:
.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -s -o $@
$(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@

clean:
-rm -f *.o utils/*.o
Expand Down
7 changes: 4 additions & 3 deletions src/goodbyedpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,17 +974,18 @@ int main(int argc, char *argv[]) {

if (optarg) {
char *autottl_copy = strdup(optarg);
char *autottl_save;
if (strchr(autottl_copy, '-')) {
// token "-" found, start X-Y parser
char *autottl_current = strtok(autottl_copy, "-");
char *autottl_current = strtok_r(autottl_copy, "-", &autottl_save);
auto_ttl_1 = atoub(autottl_current, "Set Auto TTL parameter error!");
autottl_current = strtok(NULL, "-");
autottl_current = strtok_r(NULL, "-", &autottl_save);
if (!autottl_current) {
puts("Set Auto TTL parameter error!");
exit(ERROR_AUTOTTL);
}
auto_ttl_2 = atoub(autottl_current, "Set Auto TTL parameter error!");
autottl_current = strtok(NULL, "-");
autottl_current = strtok_r(NULL, "-", &autottl_save);
if (!autottl_current) {
puts("Set Auto TTL parameter error!");
exit(ERROR_AUTOTTL);
Expand Down

0 comments on commit e705b33

Please sign in to comment.