Skip to content

Commit

Permalink
Upgrade to the lastest WinDivert and Tor.
Browse files Browse the repository at this point in the history
  • Loading branch information
basil00 committed Feb 3, 2018
1 parent 90ee1b9 commit ed876cf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CC = i686-w64-mingw32-gcc
WINDRES = i686-w64-mingw32-windres
CFLAGS = --std=c99 -O2 -I contrib/WinDivert-1.3.0-MINGW/include/ -mwindows \
-mthreads -mno-ms-bitfields -m32 -Wall
CLIBS = -lws2_32 -lkernel32 -L contrib/WinDivert-1.3.0-MINGW/x86/ \
CFLAGS = --std=c99 -O2 -I contrib/WinDivert-1.4.0-rc-B-MINGW/include/ \
-mwindows -mthreads -mno-ms-bitfields -m32 -Wall
CLIBS = -lws2_32 -lkernel32 -L contrib/WinDivert-1.4.0-rc-B-MINGW/x86/ \
-lWinDivert -lcomctl32 -mwindows
OBJS = main.o redirect.o domain.o
PROG = tallow.exe
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ To build Tallow you need the MinGW cross-compiler for Linux.
You also need to download and place the following external dependencies and
place them in the contrib/ directory:

* [WinDivert-1.3.0-MINGW.zip](http://reqrypt.org/windivert.html).
* [tor-win32-0.3.1.9.zip](https://www.torproject.org/).
* [WinDivert-1.4.0-rc-B-MINGW.zip](http://reqrypt.org/windivert.html).
* [tor-win32-0.3.2.9.zip](https://www.torproject.org/).

Then simply run the build.sh script.

Expand Down
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# (C) 2015, all rights reserved,
# (C) 2018, all rights reserved,
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -20,8 +20,8 @@

set -e

WINDIVERT=WinDivert-1.3.0-MINGW
TOR=tor-win32-0.3.1.9
WINDIVERT=WinDivert-1.4.0-rc-B-MINGW
TOR=tor-win32-0.3.2.9
VERSION=`cat VERSION`

echo "Checking for dependencies..."
Expand Down Expand Up @@ -66,7 +66,7 @@ echo "Copying \"LICENSE\"..."
cp LICENSE install/.

for FILE in \
"$WINDIVERT/amd64/WinDivert64.sys" \
"$WINDIVERT/x86_64/WinDivert64.sys" \
"$WINDIVERT/x86/WinDivert32.sys" \
"$WINDIVERT/x86/WinDivert.dll" \
"Tor/libeay32.dll" \
Expand Down
4 changes: 2 additions & 2 deletions redirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static void send_packet(HANDLE handle, void *packet, size_t packet_len,
PWINDIVERT_ADDRESS addr)
{
addr->Direction = WINDIVERT_DIRECTION_INBOUND;
WinDivertHelperCalcChecksums(packet, packet_len, 0);
WinDivertHelperCalcChecksums(packet, packet_len, addr, 0);
if (!WinDivertSend(handle, packet, packet_len, addr, NULL))
debug("Send packet failed (err=%d)\n", (int)GetLastError());
}
Expand Down Expand Up @@ -230,7 +230,7 @@ extern void redirect_start(void)
{
// Use the default filter:
const char *default_filter =
"(ipv6 or ip.DstAddr != 127.0.0.1) and "
"!loopback and "
"(not tcp or (tcp and tcp.DstPort != 9001 and "
"tcp.SrcPort != 9001 and "
"tcp.DstPort != 9030 and "
Expand Down
2 changes: 1 addition & 1 deletion traffic.divert
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# contents of this file.
# - Traffic is diverted if and only if the filter evaluates to "true".

(ip? ip.DstAddr != 127.0.0.1: true) # Ignore localhost
!loopback # Ignore loopback
and
(tcp? tcp.DstPort != 9001 and # Ignore Tor traffic
tcp.SrcPort != 9001 and
Expand Down

0 comments on commit ed876cf

Please sign in to comment.