├── installer
├── res
│ ├── sys.txt
│ ├── user.txt
│ ├── except.txt
│ ├── segmdl2.ttf
│ └── adfilter.vshost.exe.manifest
├── installer.vcxproj.filters
├── readme.md
├── readme.txt
└── installer.vcxproj
├── exe
├── adfilter
│ ├── Properties
│ │ ├── Resources.zh-CN.Designer.cs
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources1.Designer.cs
│ │ ├── Resources.zh-CN.resx
│ │ └── Resources.resx
│ ├── segmdl2.ttf
│ ├── res
│ │ └── segmdl2.ttf
│ ├── packages.config
│ ├── Model
│ │ ├── HostList.cs
│ │ ├── Msg.cs
│ │ └── BaseCommand.cs
│ ├── View
│ │ ├── About.xaml
│ │ ├── Host.xaml.cs
│ │ ├── About.xaml.cs
│ │ ├── Driver.xaml.cs
│ │ ├── Driver.xaml
│ │ ├── Host.xaml
│ │ ├── HostEdit.xaml
│ │ ├── HamburgerMenu.xaml
│ │ ├── HostEdit.xaml.cs
│ │ └── WindowStyle.xaml
│ ├── App.xaml.cs
│ ├── App.config
│ ├── MainWindow.xaml.cs
│ ├── App.xaml
│ ├── ViewModel
│ │ ├── DriverViewModel.cs
│ │ └── HostViewModel.cs
│ ├── Adf.cs
│ ├── app.manifest
│ └── MainWindow.xaml
└── adfcon
│ ├── remove.bat
│ ├── install.bat
│ ├── adfcon.vcxproj.filters
│ ├── app.c
│ ├── adf.c
│ ├── adf.h
│ └── adfcon.vcxproj
├── img
└── regexp.png
├── note
├── driver.vsdx
└── read file.JPG
├── sys
├── tdi_fw
│ ├── src
│ │ ├── packet.h
│ │ ├── pid_pname.h
│ │ ├── sids.h
│ │ ├── sock.c
│ │ ├── dispatch.h
│ │ ├── filter.h
│ │ ├── memtrack.h
│ │ ├── events.c
│ │ ├── conn_state.h
│ │ ├── dispatch.c
│ │ ├── events.h
│ │ ├── net.h
│ │ ├── tdi_fw_lib.h
│ │ ├── sock.h
│ │ ├── obj_tbl.h
│ │ ├── disp_sr.c
│ │ ├── tdi_fw.h
│ │ ├── ndis_hk_ioctl.h
│ │ ├── memtrack.c
│ │ ├── ev_dg.c
│ │ ├── disp_ev.c
│ │ ├── ipc.c
│ │ ├── sids.c
│ │ ├── ipc.h
│ │ └── pid_pname.c
│ ├── tdi_fw.inf
│ ├── readme.md
│ └── tdi_fw.vcxproj.filters
├── adfilter
│ ├── readme.md
│ ├── adfilter.vcxproj.filters
│ ├── driver.c
│ ├── list.c
│ ├── adfilter.h
│ ├── filter.c
│ ├── dispatch.c
│ ├── adfilter.c
│ └── adfilter.vcxproj
└── slre
│ ├── README.md
│ └── slre.h
├── .gitattributes
├── readme.md
└── .gitignore
/installer/res/sys.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/installer/res/user.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/installer/res/except.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/exe/adfilter/Properties/Resources.zh-CN.Designer.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/img/regexp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xue-blood/adfilter/HEAD/img/regexp.png
--------------------------------------------------------------------------------
/note/driver.vsdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xue-blood/adfilter/HEAD/note/driver.vsdx
--------------------------------------------------------------------------------
/note/read file.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xue-blood/adfilter/HEAD/note/read file.JPG
--------------------------------------------------------------------------------
/exe/adfilter/segmdl2.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xue-blood/adfilter/HEAD/exe/adfilter/segmdl2.ttf
--------------------------------------------------------------------------------
/exe/adfcon/remove.bat:
--------------------------------------------------------------------------------
1 | echo off
2 | del /F C:\Windows\System32\Drivers\adfilter.sys
3 | sc delete adfilter
--------------------------------------------------------------------------------
/installer/res/segmdl2.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xue-blood/adfilter/HEAD/installer/res/segmdl2.ttf
--------------------------------------------------------------------------------
/exe/adfilter/res/segmdl2.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xue-blood/adfilter/HEAD/exe/adfilter/res/segmdl2.ttf
--------------------------------------------------------------------------------
/exe/adfilter/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/sys/tdi_fw/src/packet.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil -*- (for GNU Emacs)
2 | //
3 | // $Id: packet.h,v 1.1 2009/04/28 12:53:28 tanwen Exp $
4 |
5 | #ifndef _packet_h_
6 | #define _packet_h_
7 |
8 | NTSTATUS init_packet(void);
9 | void free_packet(void);
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/exe/adfilter/Model/HostList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace adfilter.Model
8 | {
9 | class HostList
10 | {
11 | public string Host { get; set; }
12 |
13 | public HostList(string host)
14 | {
15 | Host = host;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/exe/adfilter/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | blue
7 |
8 |
9 |
--------------------------------------------------------------------------------
/sys/tdi_fw/tdi_fw.inf:
--------------------------------------------------------------------------------
1 | ;
2 | ; tdi_fw.inf
3 | ;
4 |
5 | [Version]
6 | Signature="$WINDOWS NT$"
7 | Class=
8 | ClassGuid=
9 | Provider=
10 | DriverVer=
11 | CatalogFile=
12 |
13 | [DestinationDirs]
14 | DefaultDestDir = 12
15 |
16 |
17 | [SourceDisksNames]
18 | 1 = %DiskName%,,,""
19 |
20 | [SourceDisksFiles]
21 |
22 |
23 | [Manufacturer]
24 | %ManufacturerName%=Standard,NT$ARCH$
25 |
26 | [Standard.NT$ARCH$]
27 |
28 |
29 | [Strings]
30 | ManufacturerName=""
31 | ClassName=""
32 | DiskName="tdi_fw Source Disk"
33 |
--------------------------------------------------------------------------------
/installer/installer.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sys/tdi_fw/readme.md:
--------------------------------------------------------------------------------
1 | # build config setting
2 | * first change the `General -> Project Defaults -> Configuration Type` to `Static library (.lib)`
3 | `Target Extension` to `.lib`
4 | * change `C/C++ -> Treat Warnings As Erros` to `NO(/WX)`
5 | * **Add** a new Macro `USE_PACKET_ENGINE` in `C/C++ -> PreProcessor -> Preprocessor Definitions`
6 |
7 |
8 | ## option
9 | * the driver default can't unload dynamic, if you want to enable it Add a new Macro `CAN_UNLOAD` in `C/C++ -> PreProcessor -> Preprocessor Definitions`,but **it's not stable and not recommented**
--------------------------------------------------------------------------------
/exe/adfilter/View/About.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sys/tdi_fw/src/pid_pname.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil -*- (for GNU Emacs)
2 | //
3 | // $Id: pid_pname.h,v 1.1 2009/04/28 12:53:28 tanwen Exp $
4 |
5 | #ifndef _pid_pname_h_
6 | #define _pid_pname_h_
7 |
8 | void pid_pname_init(void);
9 | void pid_pname_free(void);
10 |
11 | BOOLEAN pid_pname_resolve(ULONG pid, char *buf, int buf_size);
12 |
13 | NTSTATUS pid_pname_set_event(ULONG pid, KEVENT *event);
14 |
15 | NTSTATUS pid_pname_set(ULONG pid, const char *pname, int context);
16 | int pid_pname_get_context(ULONG pid);
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/exe/adfilter/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace adfilter
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | App()
17 | {
18 | //System.Threading.Thread.CurrentThread.CurrentUICulture =
19 | //new System.Globalization.CultureInfo("zh-CN");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/exe/adfcon/install.bat:
--------------------------------------------------------------------------------
1 | echo off
2 | copy /Y adfilter.sys C:\Windows\System32\Drivers\adfilter.sys
3 |
4 | sc create adfilter binpath= system32\drivers\adfilter.sys start= auto type= kernel
5 |
6 | reg add HKLM\SYSTEM\CurrentControlSet\services\adfilter /v Pause /t REG_DWORD /d 0 /f
7 | reg add HKLM\SYSTEM\CurrentControlSet\services\adfilter /v SysFilePath /t REG_SZ /d %~dp0sys.txt /f
8 | reg add HKLM\SYSTEM\CurrentControlSet\services\adfilter /v UserFilePath /t REG_SZ /d %~dp0user.txt /f
9 | reg add HKLM\SYSTEM\CurrentControlSet\services\adfilter /v ExceptFilePath /t REG_SZ /d %~dp0except.txt /f
10 |
11 |
12 | net start adfilter
--------------------------------------------------------------------------------
/sys/adfilter/readme.md:
--------------------------------------------------------------------------------
1 | # build config setting
2 | * To build this driver, you need build the **tdi_fw** lib first.
3 | * change `C/C++ -> Treat Warnings As Erros` to `NO(/WX)`
4 |
5 | * if build for x64 pc, change the `General -> Target Name` to `adfilter64`
6 |
7 | * add **header path** `$(SolutionDir)sys/tdi_fw/src;$(IncludePath)` in `VC++ Directories -> Include Directories`
8 | * add **lib path** `$(SolutionDir)sys/tdi_fw/src;$(IncludePath)` in `VC++ Directories -> Include Directories`
9 |
10 | * in `Linker -> Input ` add the `tdi.lib` and `tdi_fw.lib`
11 |
12 | * for installer add a post script `copy "$(TargetPath)" "$(SolutionDir)installer\res\$(TargetFileName)" /Y` to `Build Events -> Post Build Event -> Command Line`
13 |
14 |
--------------------------------------------------------------------------------
/exe/adfilter/View/Host.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace adfilter.View
17 | {
18 | ///
19 | /// Interaction logic for Host.xaml
20 | ///
21 | public partial class Host : UserControl
22 | {
23 | public Host()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/exe/adfilter/View/About.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace adfilter.View
17 | {
18 | ///
19 | /// Interaction logic for About.xaml
20 | ///
21 | public partial class About : UserControl
22 | {
23 | public About()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/exe/adfilter/View/Driver.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 |
17 | namespace adfilter.View
18 | {
19 | ///
20 | /// Interaction logic for Driver.xaml
21 | ///
22 | public partial class Driver : UserControl
23 | {
24 | public Driver()
25 | {
26 | InitializeComponent();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/installer/readme.md:
--------------------------------------------------------------------------------
1 | editor
2 | ======
3 | * [visual studio code](https://code.visualstudio.com) + NSIS(externsion)
4 | * [Unicode NSIS](http://www.scratchpaper.com)
5 |
6 | build
7 | =====
8 | * add `copy "$(TargetPath)" "$(SolutionDir)installer\res\$(TargetFileName)" /Y`
9 | to *vs project setting* -- *post build event*
10 |
11 | * build project in visual code,
12 | * open adfilter.nsi in vs code build the installer.
13 | * or use `makensis adfilter.nsi` command line tool
14 | * this file should in res directory:
15 |
`adf.dll`
16 |
`adfilter.exe`
17 |
`adfilter.sys`
18 |
`adfilter64.exe`
19 |
`dotnetfx45_full_setup.exe`
20 |
`except.txt`
21 |
`MahApps.Metro.dll`
22 |
`segmdl2.ttf`
23 |
`sys.txt`
24 |
`System.Windows.Interactivity.dll`
25 |
`user.txt`
--------------------------------------------------------------------------------
/exe/adfilter/Model/Msg.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Controls;
7 | using System.Windows.Media.Animation;
8 |
9 | namespace adfilter.Model
10 | {
11 | class Msg
12 | {
13 |
14 | private static Msg instance;
15 | public static Msg Instance
16 | {
17 | get { return instance ?? (instance = new Msg()); }
18 | }
19 |
20 | public TextBlock MsgHost { get; set; }
21 | public void Show(string msg,bool warring = false)
22 | {
23 | MsgHost.Text = msg;
24 | string key = warring ? "Msg_Animate_Warring" : "Msg_Animate";
25 | Storyboard sb = MsgHost.Resources[key] as Storyboard;
26 | if (sb != null)
27 | MsgHost.BeginStoryboard(sb);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/exe/adfilter/Model/BaseCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 |
8 | namespace adfilter.Model
9 | {
10 | class BaseCommand : ICommand
11 | {
12 | public Action