├── .gitattributes ├── .gitignore ├── KWall.sln ├── KWall ├── KWall.cpp ├── KWall.h ├── KWall.ico ├── KWall.rc ├── KWall.vcxproj ├── KWall.vcxproj.filters ├── KWallCore.cpp ├── KWallCore.h ├── ReadMe.txt ├── resource.h ├── simple_parser.cpp ├── stdafx.cpp ├── stdafx.h ├── targetver.h └── windivert.h ├── LICENSE ├── README.md ├── binaries └── KWall-0.1.0.0.zip ├── configs ├── BladeAndSoul.kcf └── BlankTemplate.kcf ├── fonts ├── DejaVuSansMono.ttf └── LICENSE └── redist ├── readme.md ├── vcredist_x64.exe └── vcredist_x86.exe /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | # DNX 42 | project.lock.json 43 | artifacts/ 44 | 45 | *_i.c 46 | *_p.c 47 | *_i.h 48 | *.ilk 49 | *.meta 50 | *.obj 51 | *.pch 52 | *.pdb 53 | *.pgc 54 | *.pgd 55 | *.rsp 56 | *.sbr 57 | *.tlb 58 | *.tli 59 | *.tlh 60 | *.tmp 61 | *.tmp_proj 62 | *.log 63 | *.vspscc 64 | *.vssscc 65 | .builds 66 | *.pidb 67 | *.svclog 68 | *.scc 69 | 70 | # Chutzpah Test files 71 | _Chutzpah* 72 | 73 | # Visual C++ cache files 74 | ipch/ 75 | *.aps 76 | *.ncb 77 | *.opensdf 78 | *.sdf 79 | *.cachefile 80 | 81 | # Visual Studio profiler 82 | *.psess 83 | *.vsp 84 | *.vspx 85 | 86 | # TFS 2012 Local Workspace 87 | $tf/ 88 | 89 | # Guidance Automation Toolkit 90 | *.gpState 91 | 92 | # ReSharper is a .NET coding add-in 93 | _ReSharper*/ 94 | *.[Rr]e[Ss]harper 95 | *.DotSettings.user 96 | 97 | # JustCode is a .NET coding add-in 98 | .JustCode 99 | 100 | # TeamCity is a build add-in 101 | _TeamCity* 102 | 103 | # DotCover is a Code Coverage Tool 104 | *.dotCover 105 | 106 | # NCrunch 107 | _NCrunch_* 108 | .*crunch*.local.xml 109 | 110 | # MightyMoose 111 | *.mm.* 112 | AutoTest.Net/ 113 | 114 | # Web workbench (sass) 115 | .sass-cache/ 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.[Pp]ublish.xml 135 | *.azurePubxml 136 | ## TODO: Comment the next line if you want to checkin your 137 | ## web deploy settings but do note that will include unencrypted 138 | ## passwords 139 | #*.pubxml 140 | 141 | *.publishproj 142 | 143 | # NuGet Packages 144 | *.nupkg 145 | # The packages folder can be ignored because of Package Restore 146 | **/packages/* 147 | # except build/, which is used as an MSBuild target. 148 | !**/packages/build/ 149 | # Uncomment if necessary however generally it will be regenerated when needed 150 | #!**/packages/repositories.config 151 | 152 | # Windows Azure Build Output 153 | csx/ 154 | *.build.csdef 155 | 156 | # Windows Store app package directory 157 | AppPackages/ 158 | 159 | # Visual Studio cache files 160 | # files ending in .cache can be ignored 161 | *.[Cc]ache 162 | # but keep track of directories ending in .cache 163 | !*.[Cc]ache/ 164 | 165 | # Others 166 | ClientBin/ 167 | [Ss]tyle[Cc]op.* 168 | ~$* 169 | *~ 170 | *.dbmdl 171 | *.dbproj.schemaview 172 | *.pfx 173 | *.publishsettings 174 | node_modules/ 175 | orleans.codegen.cs 176 | 177 | # RIA/Silverlight projects 178 | Generated_Code/ 179 | 180 | # Backup & report files from converting an old project file 181 | # to a newer Visual Studio version. Backup files are not needed, 182 | # because we have git ;-) 183 | _UpgradeReport_Files/ 184 | Backup*/ 185 | UpgradeLog*.XML 186 | UpgradeLog*.htm 187 | 188 | # SQL Server files 189 | *.mdf 190 | *.ldf 191 | 192 | # Business Intelligence projects 193 | *.rdl.data 194 | *.bim.layout 195 | *.bim_*.settings 196 | 197 | # Microsoft Fakes 198 | FakesAssemblies/ 199 | 200 | # Node.js Tools for Visual Studio 201 | .ntvs_analysis.dat 202 | 203 | # Visual Studio 6 build log 204 | *.plg 205 | 206 | # Visual Studio 6 workspace options file 207 | *.opt 208 | 209 | # LightSwitch generated files 210 | GeneratedArtifacts/ 211 | _Pvt_Extensions/ 212 | ModelManifest.xml 213 | -------------------------------------------------------------------------------- /KWall.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KWall", "KWall\KWall.vcxproj", "{EA3F4E5C-4A22-4F92-9676-90E703C101DA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | ReleaseWithDebugInfo|x64 = ReleaseWithDebugInfo|x64 15 | ReleaseWithDebugInfo|x86 = ReleaseWithDebugInfo|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Debug|x64.ActiveCfg = Debug|x64 19 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Debug|x64.Build.0 = Debug|x64 20 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Debug|x86.ActiveCfg = Debug|Win32 21 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Debug|x86.Build.0 = Debug|Win32 22 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Release|x64.ActiveCfg = Release|x64 23 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Release|x64.Build.0 = Release|x64 24 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Release|x86.ActiveCfg = Release|Win32 25 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.Release|x86.Build.0 = Release|Win32 26 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.ReleaseWithDebugInfo|x64.ActiveCfg = Release|x64 27 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.ReleaseWithDebugInfo|x64.Build.0 = Release|x64 28 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.ReleaseWithDebugInfo|x86.ActiveCfg = Release|Win32 29 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA}.ReleaseWithDebugInfo|x86.Build.0 = Release|Win32 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /KWall/KWall.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/KWall/KWall.cpp -------------------------------------------------------------------------------- /KWall/KWall.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | K*Wall, the open-source anti-RMT-spam firewall 4 | by ActiumPraetor, et al 5 | Master branch, 0.1 alpha 6 | 7 | Released under the terms of the GNU LESSER GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 8 | See the K*Wall git repository for a copy of the license if it wasn't included with this code: 9 | https://github.com/ActiumPraetor/K-Wall 10 | 11 | 12 | Please be aware of the following if you'd like to help with the development end of this project: 13 | 14 | 1. My philosophy for coding is a combination of two ideals: 15 | 1: First make it WORK, THEN make it pretty. 16 | 2: Test and optimize as you go, not after you finish. 17 | The original source will likely reflect this. Expect the occasional kludge if it solved a 18 | problem. (Or, if it looks dumb, but it -works-...) 19 | 20 | 2. I usually use Allman-style indenting instead of K&R ("One True Brace") style, since I spent 21 | a lot of time developing in Pascal. OTB fans will just have to deal. 22 | 23 | 3. We're not "using namespace"-ing. Anything involving a namespace needs to indicate that namespace 24 | everywhere it's used. This should save a lot of headaches later on. 25 | 26 | 4. I like to use "CamelCase" convention for procedure names and "lowercase_words_and_underscores" 27 | convention for variable names, so that they can be distinguished at a glance. 28 | 29 | */ 30 | #pragma once 31 | 32 | 33 | 34 | #ifndef __BASE_INCLUDED__ 35 | #define __BASE_INCLUDED__ 36 | 37 | 38 | 39 | #include "resource.h" 40 | #include 41 | 42 | 43 | 44 | #define MAXBUF 0xFFFF 45 | #define MAX_LOADSTRING 100 46 | 47 | 48 | 49 | // ZOMG, global variables! Oh, the huge manatee! (This is where they get defined for everything - all other 50 | // code units will refer to these via "extern.") 51 | HINSTANCE hInst; // Our current instance 52 | HWND kwall; // Our main window handle 53 | HINSTANCE riched; // Our richedit control 54 | HWND hRichEd; // Our richedit control's hWnd 55 | std::string logfilename; // Logging FTW! 56 | WCHAR szTitle[MAX_LOADSTRING]; // The title bar text 57 | WCHAR szWindowClass[MAX_LOADSTRING]; // The main window class name 58 | BOOL waiting_for_shutdown; // Are we waiting for things to unload and close? 59 | 60 | 61 | 62 | // Forward declarations 63 | void UpdateRichEdit(wchar_t* txt, BOOL bold, BOOL ital, UINT32 color /*as RGB()*/, wchar_t* font_name, INT font_size /*in points*/); 64 | int APIENTRY wWinMain(_In_ HINSTANCE hInstance, 65 | _In_opt_ HINSTANCE hPrevInstance, 66 | _In_ LPWSTR lpCmdLine, 67 | _In_ int nCmdShow); 68 | ATOM MyRegisterClass(HINSTANCE hInstance); 69 | BOOL InitInstance(HINSTANCE, int); 70 | void CloseApp(); 71 | LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); 72 | INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); 73 | 74 | 75 | 76 | #endif // __BASE_INCLUDED__ -------------------------------------------------------------------------------- /KWall/KWall.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/KWall/KWall.ico -------------------------------------------------------------------------------- /KWall/KWall.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/KWall/KWall.rc -------------------------------------------------------------------------------- /KWall/KWall.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {EA3F4E5C-4A22-4F92-9676-90E703C101DA} 23 | Win32Proj 24 | KWall 25 | 8.1 26 | 27 | 28 | 29 | Application 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | $(VC_SourcePath)\include\zlib;$(VC_SourcePath)\include\deflate;D:\Development\icu\include;$(IncludePath) 75 | D:\Development\icu\lib;$(VC_SourcePath)\lib\Debug;$(LibraryPath) 76 | D:\Development\Development Tools\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset 77 | false 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | $(VC_SourcePath)\include\zlib;$(VC_SourcePath)\include\deflate;D:\Development\icu\include;$(IncludePath) 85 | $(VC_SourcePath)\lib\Release;D:\Development\icu\lib;$(LibraryPath) 86 | 87 | 88 | false 89 | 90 | 91 | 92 | Use 93 | Level3 94 | Disabled 95 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) 96 | true 97 | $(VC_SourcePath)\include\zlib;$(VC_SourcePath)\include\deflate;D:\Development\icu\include;%(AdditionalIncludeDirectories) 98 | false 99 | false 100 | 101 | 102 | Windows 103 | true 104 | WinDivert.lib;zlibd.lib;icudt.lib;icudtd.lib;icuin.lib;icuind.lib;icuio.lib;icuiod.lib;icule.lib;iculed.lib;iculx.lib;iculxd.lib;icutest.lib;icutestd.lib;icutu.lib;icutud.lib;icuuc.lib;icuucd.lib;%(AdditionalDependencies) 105 | $(VC_SourcePath)\lib\Debug;%(AdditionalLibraryDirectories) 106 | NotSet 107 | false 108 | 109 | 110 | true 111 | 112 | 113 | 114 | 115 | Use 116 | Level3 117 | Disabled 118 | _DEBUG;_WINDOWS;%(PreprocessorDefinitions) 119 | true 120 | 121 | 122 | Windows 123 | true 124 | 125 | 126 | 127 | 128 | Level3 129 | Use 130 | MaxSpeed 131 | true 132 | true 133 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 134 | true 135 | true 136 | $(VC_SourcePath)\include\zlib;$(VC_SourcePath)\include\deflate;D:\Development\icu\include;%(AdditionalIncludeDirectories) 137 | 138 | 139 | Windows 140 | true 141 | true 142 | true 143 | WinDivert.lib;zlibd.lib;icudt.lib;icudtd.lib;icuin.lib;icuind.lib;icuio.lib;icuiod.lib;icule.lib;iculed.lib;iculx.lib;iculxd.lib;icutest.lib;icutestd.lib;icutu.lib;icutud.lib;icuuc.lib;icuucd.lib;%(AdditionalDependencies) 144 | $(VC_SourcePath)\lib\Release;%(AdditionalLibraryDirectories) 145 | 146 | 147 | 148 | 149 | Level3 150 | Use 151 | MaxSpeed 152 | true 153 | true 154 | NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 155 | true 156 | 157 | 158 | Windows 159 | true 160 | true 161 | true 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | Create 180 | Create 181 | Create 182 | Create 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /KWall/KWall.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | 52 | 53 | Resource Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | Resource Files 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /KWall/KWallCore.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | K*Wall, the open-source anti-RMT-spam firewall 4 | by ActiumPraetor, et al 5 | Master branch, 0.1 alpha 6 | 7 | Released under the terms of the GNU LESSER GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 8 | See the K*Wall git repository for a copy of the license if it wasn't included with this code: 9 | https://github.com/ActiumPraetor/K-Wall 10 | 11 | 12 | Please be aware of the following if you'd like to help with the development end of this project: 13 | 14 | 1. My philosophy for coding is a combination of two ideals: 15 | 1: First make it WORK, THEN make it pretty. 16 | 2: Test and optimize as you go, not after you finish. 17 | The original source will likely reflect this. Expect the occasional kludge if it solved a 18 | problem. (Or, if it looks dumb, but it -works-...) 19 | 20 | 2. I usually use Allman-style indenting instead of K&R ("One True Brace") style, since I spent 21 | a lot of time developing in Pascal. OTB fans will just have to deal. 22 | 23 | 3. We're not "using namespace"-ing. Anything involving a namespace needs to indicate that namespace 24 | everywhere it's used. This should save a lot of headaches later on. 25 | 26 | 4. I like to use "CamelCase" convention for procedure names and "lowercase_words_and_underscores" 27 | convention for variable names, so that they can be distinguished at a glance. 28 | 29 | */ 30 | #pragma once 31 | 32 | 33 | 34 | #ifndef __CORE_INCLUDED__ 35 | #define __CORE_INCLUDED__ 36 | 37 | 38 | 39 | #include 40 | 41 | 42 | 43 | #define MAXBUF 0xFFFF 44 | #define MAX_LOADSTRING 100 45 | 46 | // ZOMG, global variables! Oh, the huge manatee! No, wait, these are all externs... 47 | extern HINSTANCE hInst; // Our current instance 48 | extern HWND kwall; // Our main window handle 49 | extern HINSTANCE riched; // Our richedit control 50 | extern HWND hRichEd; // Our richedit control's hWnd 51 | extern WCHAR szTitle[MAX_LOADSTRING]; // The title bar text 52 | extern WCHAR szWindowClass[MAX_LOADSTRING]; // The main window class name 53 | extern BOOL waiting_for_shutdown; // Are we waiting for things to unload and close? 54 | extern std::string logfilename; // Logging FTW! 55 | 56 | extern void UpdateRichEdit(wchar_t* txt, BOOL bold, BOOL ital, UINT32 color /*as RGB()*/, wchar_t* font_name, INT font_size /*in points*/); 57 | 58 | 59 | 60 | #endif // __CORE_INCLUDED__ -------------------------------------------------------------------------------- /KWall/ReadMe.txt: -------------------------------------------------------------------------------- 1 | K*Wall, the Open-Source Anti-RMT-Spam Firewall 2 | ==================================================================================================== 3 | 4 | What is this? 5 | 6 | This is an application firewall designed to do one thing: filter chat traffic for online games, 7 | specifically RMT spam. K*Wall watches for incoming chat packets, and then processes and filters 8 | them using powerful deobfuscation tools and regex filtering. 9 | 10 | K*Wall is open-source! Grab the source from Github: 11 | https://github.com/ActiumPraetor/K-Wall 12 | -------------------------------------------------------------------------------- /KWall/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/KWall/resource.h -------------------------------------------------------------------------------- /KWall/simple_parser.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Simple Configuration File Parser 3 | Written by "sarmanu" and posted at dreamincode.net 4 | 5 | Full article: 6 | "Create A Simple Configuration File Parser." 7 | http://www.dreamincode.net/forums/topic/183191-create-a-simple-configuration-file-parser/ 8 | 9 | PLEASE NOTE that while a usage license has not been provided by "sarmanu," he or she is still 10 | considered the owner of Copyright to this sourcecode. 11 | 12 | Updated by ActiumPraetor to add widestring support for K*Wall 13 | */ 14 | 15 | #include "stdafx.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | class Convert 26 | { 27 | public: 28 | template 29 | static std::string T_to_wstring(T const &val) 30 | { 31 | std::ostringstream ostr; 32 | ostr << val; 33 | 34 | return ostr.str(); 35 | } 36 | 37 | template 38 | static T wstring_to_T(std::wstring const &val) 39 | { 40 | std::istringstream istr(val); 41 | T returnVal; 42 | if (!(istr >> returnVal)) 43 | exitWithError("CFG: Not a valid " + (std::string)typeid(T).name() + " received!\n"); 44 | 45 | return returnVal; 46 | } 47 | 48 | template <> 49 | static std::wstring wstring_to_T(std::wstring const &val) 50 | { 51 | return val; 52 | } 53 | 54 | void ThrowError(const std::string &error) 55 | { 56 | throw std::invalid_argument(error); 57 | } 58 | }; 59 | 60 | //void ThrowError(const std::string &error) 61 | //{ 62 | //std::cout << error; 63 | //std::cin.ignore(); 64 | //std::cin.get(); 65 | 66 | //exit(EXIT_FAILURE); 67 | //throw std::invalid_argument(error); 68 | //} 69 | 70 | class ConfigFile 71 | { 72 | private: 73 | std::map contents; 74 | std::wstring fName; 75 | 76 | void removeComment(std::wstring &line) const 77 | { 78 | if (line.find(L';') != line.npos) 79 | line.erase(line.find(L';')); 80 | } 81 | 82 | bool onlyWhitespace(const std::wstring &line) const 83 | { 84 | return (line.find_first_not_of(' ') == line.npos); 85 | } 86 | bool validLine(const std::wstring &line) const 87 | { 88 | std::wstring temp = line; 89 | temp.erase(0, temp.find_first_not_of(L"\t ")); 90 | if (temp[0] == '=') 91 | return false; 92 | 93 | for (size_t i = temp.find('=') + 1; i < temp.length(); i++) 94 | if (temp[i] != ' ') 95 | return true; 96 | 97 | return false; 98 | } 99 | 100 | void extractKey(std::wstring &key, size_t const &sepPos, const std::wstring &line) const 101 | { 102 | key = line.substr(0, sepPos); 103 | if (key.find('\t') != line.npos || key.find(' ') != line.npos) 104 | key.erase(key.find_first_of(L"\t ")); 105 | } 106 | void extractValue(std::wstring &value, size_t const &sepPos, const std::wstring &line) const 107 | { 108 | value = line.substr(sepPos + 1); 109 | value.erase(0, value.find_first_not_of(L"\t ")); 110 | value.erase(value.find_last_not_of(L"\t ") + 1); 111 | } 112 | 113 | void extractContents(const std::wstring &line) 114 | { 115 | std::wstring temp = line; 116 | temp.erase(0, temp.find_first_not_of(L"\t ")); 117 | size_t sepPos = temp.find(L'='); 118 | 119 | std::wstring key, value; 120 | extractKey(key, sepPos, temp); 121 | extractValue(value, sepPos, temp); 122 | 123 | if (!keyExists(key)) 124 | contents.insert(std::pair(key, value)); 125 | else 126 | ThrowError("CFG: Can only have unique key names!\n"); 127 | } 128 | 129 | void parseLine(const std::wstring &line, size_t const lineNo) 130 | { 131 | // Only parse lines that have a "key=value" pair and appear to be valid. 132 | if ((line.find('=') != line.npos) && (validLine(line))) 133 | extractContents(line); 134 | } 135 | 136 | void ExtractKeys() 137 | { 138 | std::wifstream file; 139 | std::wstring line; 140 | size_t lineNo = 0; 141 | wchar_t churr; 142 | std::wstring temp; 143 | 144 | // Open for binary read 145 | file.open(fName.c_str(), 0x01 | _IOSbinary); 146 | if (!file) 147 | ThrowError("CFG: File not found!\n"); 148 | 149 | while (file.read(&churr, 1)) 150 | { 151 | // Kludge that replaces std::getline with something not confused by Unicode. 152 | line.clear(); 153 | while ((file.read(&churr, 1)) && (churr != 13)) 154 | { 155 | if ((churr > 0) && (churr != 10)) // Skip Windows' CR before the LF, and ignore nulls. 156 | line = line + churr; 157 | } 158 | 159 | lineNo++; 160 | temp = line; 161 | 162 | if (temp.empty()) 163 | continue; 164 | 165 | removeComment(temp); 166 | if (onlyWhitespace(temp)) 167 | continue; 168 | 169 | parseLine(temp, lineNo); 170 | } 171 | 172 | file.close(); 173 | } 174 | 175 | void ThrowError(const std::string &error) 176 | { 177 | throw std::invalid_argument(error); 178 | } 179 | public: 180 | ConfigFile(const std::wstring &fName) 181 | { 182 | this->fName = fName; 183 | ExtractKeys(); 184 | } 185 | 186 | bool keyExists(const std::wstring &key) const 187 | { 188 | return contents.find(key) != contents.end(); 189 | } 190 | 191 | template 192 | ValueType getValueOfKey(const std::wstring &key, ValueType const &defaultValue = ValueType()) const 193 | { 194 | if (!keyExists(key)) 195 | return defaultValue; 196 | 197 | return Convert::wstring_to_T(contents.find(key)->second); 198 | } 199 | }; 200 | /* 201 | int main() 202 | { 203 | ConfigFile cfg("config.cfg"); 204 | 205 | bool exists = cfg.keyExists("car"); 206 | std::cout << "car key: " << std::boolalpha << exists << "\n"; 207 | exists = cfg.keyExists("fruits"); 208 | std::cout << "fruits key: " << exists << "\n"; 209 | 210 | std::string someValue = cfg.getValueOfKey("mykey", "Unknown"); 211 | std::cout << "value of key mykey: " << someValue << "\n"; 212 | std::string carValue = cfg.getValueOfKey("car"); 213 | std::cout << "value of key car: " << carValue << "\n"; 214 | double doubleVal = cfg.getValueOfKey("double"); 215 | std::cout << "value of key double: " << doubleVal << "\n\n"; 216 | 217 | std::cin.get(); 218 | return 0; 219 | } 220 | */ -------------------------------------------------------------------------------- /KWall/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // KWall.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /KWall/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | // C RunTime Header Files 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | 21 | // TODO: reference additional headers your program requires here 22 | -------------------------------------------------------------------------------- /KWall/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /KWall/windivert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * windivert.h 3 | * (C) 2015, all rights reserved, 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef __WINDIVERT_H 20 | #define __WINDIVERT_H 21 | 22 | #ifndef WINDIVERT_KERNEL 23 | #include 24 | #endif /* WINDIVERT_KERNEL */ 25 | 26 | #ifndef WINDIVERTEXPORT 27 | #define WINDIVERTEXPORT __declspec(dllimport) 28 | #endif /* WINDIVERTEXPORT */ 29 | 30 | #ifdef __MINGW32__ 31 | #define __in 32 | #define __out 33 | #define __out_opt 34 | #define __inout 35 | #define __inout_opt 36 | #include 37 | #define INT8 int8_t 38 | #define UINT8 uint8_t 39 | #define INT16 int16_t 40 | #define UINT16 uint16_t 41 | #define INT32 int32_t 42 | #define UINT32 uint32_t 43 | #define INT64 int64_t 44 | #define UINT64 uint64_t 45 | #endif /* __MINGW32__ */ 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | /****************************************************************************/ 52 | /* WINDIVERT API */ 53 | /****************************************************************************/ 54 | 55 | /* 56 | * Divert address. 57 | */ 58 | typedef struct 59 | { 60 | UINT32 IfIdx; /* Packet's interface index. */ 61 | UINT32 SubIfIdx; /* Packet's sub-interface index. */ 62 | UINT8 Direction; /* Packet's direction. */ 63 | } WINDIVERT_ADDRESS, *PWINDIVERT_ADDRESS; 64 | 65 | #define WINDIVERT_DIRECTION_OUTBOUND 0 66 | #define WINDIVERT_DIRECTION_INBOUND 1 67 | 68 | /* 69 | * Divert layers. 70 | */ 71 | typedef enum 72 | { 73 | WINDIVERT_LAYER_NETWORK = 0, /* Network layer. */ 74 | WINDIVERT_LAYER_NETWORK_FORWARD = 1 /* Network layer (forwarded packets) */ 75 | } WINDIVERT_LAYER, *PWINDIVERT_LAYER; 76 | 77 | /* 78 | * Divert flags. 79 | */ 80 | #define WINDIVERT_FLAG_SNIFF 1 81 | #define WINDIVERT_FLAG_DROP 2 82 | 83 | /* 84 | * Divert parameters. 85 | */ 86 | typedef enum 87 | { 88 | WINDIVERT_PARAM_QUEUE_LEN = 0, /* Packet queue length. */ 89 | WINDIVERT_PARAM_QUEUE_TIME = 1 /* Packet queue time. */ 90 | } WINDIVERT_PARAM, *PWINDIVERT_PARAM; 91 | #define WINDIVERT_PARAM_MAX WINDIVERT_PARAM_QUEUE_TIME 92 | 93 | #ifndef WINDIVERT_KERNEL 94 | 95 | /* 96 | * Open a WinDivert handle. 97 | */ 98 | extern WINDIVERTEXPORT HANDLE WinDivertOpen( 99 | __in const char *filter, 100 | __in WINDIVERT_LAYER layer, 101 | __in INT16 priority, 102 | __in UINT64 flags); 103 | 104 | /* 105 | * Receive (read) a packet from a WinDivert handle. 106 | */ 107 | extern WINDIVERTEXPORT BOOL WinDivertRecv( 108 | __in HANDLE handle, 109 | __out PVOID pPacket, 110 | __in UINT packetLen, 111 | __out_opt PWINDIVERT_ADDRESS pAddr, 112 | __out_opt UINT *readLen); 113 | 114 | /* 115 | * Receive (read) a packet from a WinDivert handle. 116 | */ 117 | extern WINDIVERTEXPORT BOOL WinDivertRecvEx( 118 | __in HANDLE handle, 119 | __out PVOID pPacket, 120 | __in UINT packetLen, 121 | __in UINT64 flags, 122 | __out_opt PWINDIVERT_ADDRESS pAddr, 123 | __out_opt UINT *readLen, 124 | __inout_opt LPOVERLAPPED lpOverlapped); 125 | 126 | /* 127 | * Send (write/inject) a packet to a WinDivert handle. 128 | */ 129 | extern WINDIVERTEXPORT BOOL WinDivertSend( 130 | __in HANDLE handle, 131 | __in PVOID pPacket, 132 | __in UINT packetLen, 133 | __in PWINDIVERT_ADDRESS pAddr, 134 | __out_opt UINT *writeLen); 135 | 136 | /* 137 | * Send (write/inject) a packet to a WinDivert handle. 138 | */ 139 | extern WINDIVERTEXPORT BOOL WinDivertSendEx( 140 | __in HANDLE handle, 141 | __in PVOID pPacket, 142 | __in UINT packetLen, 143 | __in UINT64 flags, 144 | __in PWINDIVERT_ADDRESS pAddr, 145 | __out_opt UINT *writeLen, 146 | __inout_opt LPOVERLAPPED lpOverlapped); 147 | 148 | /* 149 | * Close a WinDivert handle. 150 | */ 151 | extern WINDIVERTEXPORT BOOL WinDivertClose( 152 | __in HANDLE handle); 153 | 154 | /* 155 | * Set a WinDivert handle parameter. 156 | */ 157 | extern WINDIVERTEXPORT BOOL WinDivertSetParam( 158 | __in HANDLE handle, 159 | __in WINDIVERT_PARAM param, 160 | __in UINT64 value); 161 | 162 | /* 163 | * Get a WinDivert handle parameter. 164 | */ 165 | extern WINDIVERTEXPORT BOOL WinDivertGetParam( 166 | __in HANDLE handle, 167 | __in WINDIVERT_PARAM param, 168 | __out UINT64 *pValue); 169 | 170 | /****************************************************************************/ 171 | /* WINDIVERT HELPER API */ 172 | /****************************************************************************/ 173 | 174 | /* 175 | * IPv4/IPv6/ICMP/ICMPv6/TCP/UDP header definitions. 176 | */ 177 | typedef struct 178 | { 179 | UINT8 HdrLength:4; 180 | UINT8 Version:4; 181 | UINT8 TOS; 182 | UINT16 Length; 183 | UINT16 Id; 184 | UINT16 FragOff0; 185 | UINT8 TTL; 186 | UINT8 Protocol; 187 | UINT16 Checksum; 188 | UINT32 SrcAddr; 189 | UINT32 DstAddr; 190 | } WINDIVERT_IPHDR, *PWINDIVERT_IPHDR; 191 | 192 | #define WINDIVERT_IPHDR_GET_FRAGOFF(hdr) \ 193 | (((hdr)->FragOff0) & 0xFF1F) 194 | #define WINDIVERT_IPHDR_GET_MF(hdr) \ 195 | ((((hdr)->FragOff0) & 0x0020) != 0) 196 | #define WINDIVERT_IPHDR_GET_DF(hdr) \ 197 | ((((hdr)->FragOff0) & 0x0040) != 0) 198 | #define WINDIVERT_IPHDR_GET_RESERVED(hdr) \ 199 | ((((hdr)->FragOff0) & 0x0080) != 0) 200 | 201 | #define WINDIVERT_IPHDR_SET_FRAGOFF(hdr, val) \ 202 | do \ 203 | { \ 204 | (hdr)->FragOff0 = (((hdr)->FragOff0) & 0x00E0) | \ 205 | ((val) & 0xFF1F); \ 206 | } \ 207 | while (FALSE) 208 | #define WINDIVERT_IPHDR_SET_MF(hdr, val) \ 209 | do \ 210 | { \ 211 | (hdr)->FragOff0 = (((hdr)->FragOff0) & 0xFFDF) | \ 212 | (((val) & 0x0001) << 5); \ 213 | } \ 214 | while (FALSE) 215 | #define WINDIVERT_IPHDR_SET_DF(hdr, val) \ 216 | do \ 217 | { \ 218 | (hdr)->FragOff0 = (((hdr)->FragOff0) & 0xFFBF) | \ 219 | (((val) & 0x0001) << 6); \ 220 | } \ 221 | while (FALSE) 222 | #define WINDIVERT_IPHDR_SET_RESERVED(hdr, val) \ 223 | do \ 224 | { \ 225 | (hdr)->FragOff0 = (((hdr)->FragOff0) & 0xFF7F) | \ 226 | (((val) & 0x0001) << 7); \ 227 | } \ 228 | while (FALSE) 229 | 230 | typedef struct 231 | { 232 | UINT8 TrafficClass0:4; 233 | UINT8 Version:4; 234 | UINT8 FlowLabel0:4; 235 | UINT8 TrafficClass1:4; 236 | UINT16 FlowLabel1; 237 | UINT16 Length; 238 | UINT8 NextHdr; 239 | UINT8 HopLimit; 240 | UINT32 SrcAddr[4]; 241 | UINT32 DstAddr[4]; 242 | } WINDIVERT_IPV6HDR, *PWINDIVERT_IPV6HDR; 243 | 244 | #define WINDIVERT_IPV6HDR_GET_TRAFFICCLASS(hdr) \ 245 | ((((hdr)->TrafficClass0) << 4) | ((hdr)->TrafficClass1)) 246 | #define WINDIVERT_IPV6HDR_GET_FLOWLABEL(hdr) \ 247 | ((((UINT32)(hdr)->FlowLabel0) << 16) | ((UINT32)(hdr)->FlowLabel1)) 248 | 249 | #define WINDIVERT_IPV6HDR_SET_TRAFFICCLASS(hdr, val) \ 250 | do \ 251 | { \ 252 | (hdr)->TrafficClass0 = ((UINT8)(val) >> 4); \ 253 | (hdr)->TrafficClass1 = (UINT8)(val); \ 254 | } \ 255 | while (FALSE) 256 | #define WINDIVERT_IPV6HDR_SET_FLOWLABEL(hdr, val) \ 257 | do \ 258 | { \ 259 | (hdr)->FlowLabel0 = (UINT8)((val) >> 16); \ 260 | (hdr)->FlowLabel1 = (UINT16)(val); \ 261 | } \ 262 | while (FALSE) 263 | 264 | typedef struct 265 | { 266 | UINT8 Type; 267 | UINT8 Code; 268 | UINT16 Checksum; 269 | UINT32 Body; 270 | } WINDIVERT_ICMPHDR, *PWINDIVERT_ICMPHDR; 271 | 272 | typedef struct 273 | { 274 | UINT8 Type; 275 | UINT8 Code; 276 | UINT16 Checksum; 277 | UINT32 Body; 278 | } WINDIVERT_ICMPV6HDR, *PWINDIVERT_ICMPV6HDR; 279 | 280 | typedef struct 281 | { 282 | UINT16 SrcPort; 283 | UINT16 DstPort; 284 | UINT32 SeqNum; 285 | UINT32 AckNum; 286 | UINT16 Reserved1:4; 287 | UINT16 HdrLength:4; 288 | UINT16 Fin:1; 289 | UINT16 Syn:1; 290 | UINT16 Rst:1; 291 | UINT16 Psh:1; 292 | UINT16 Ack:1; 293 | UINT16 Urg:1; 294 | UINT16 Reserved2:2; 295 | UINT16 Window; 296 | UINT16 Checksum; 297 | UINT16 UrgPtr; 298 | } WINDIVERT_TCPHDR, *PWINDIVERT_TCPHDR; 299 | 300 | typedef struct 301 | { 302 | UINT16 SrcPort; 303 | UINT16 DstPort; 304 | UINT16 Length; 305 | UINT16 Checksum; 306 | } WINDIVERT_UDPHDR, *PWINDIVERT_UDPHDR; 307 | 308 | /* 309 | * Flags for WinDivertHelperCalcChecksums() 310 | */ 311 | #define WINDIVERT_HELPER_NO_IP_CHECKSUM 1 312 | #define WINDIVERT_HELPER_NO_ICMP_CHECKSUM 2 313 | #define WINDIVERT_HELPER_NO_ICMPV6_CHECKSUM 4 314 | #define WINDIVERT_HELPER_NO_TCP_CHECKSUM 8 315 | #define WINDIVERT_HELPER_NO_UDP_CHECKSUM 16 316 | #define WINDIVERT_HELPER_NO_REPLACE 2048 317 | 318 | /* 319 | * Parse IPv4/IPv6/ICMP/ICMPv6/TCP/UDP headers from a raw packet. 320 | */ 321 | extern WINDIVERTEXPORT BOOL WinDivertHelperParsePacket( 322 | __in PVOID pPacket, 323 | __in UINT packetLen, 324 | __out_opt PWINDIVERT_IPHDR *ppIpHdr, 325 | __out_opt PWINDIVERT_IPV6HDR *ppIpv6Hdr, 326 | __out_opt PWINDIVERT_ICMPHDR *ppIcmpHdr, 327 | __out_opt PWINDIVERT_ICMPV6HDR *ppIcmpv6Hdr, 328 | __out_opt PWINDIVERT_TCPHDR *ppTcpHdr, 329 | __out_opt PWINDIVERT_UDPHDR *ppUdpHdr, 330 | __out_opt PVOID *ppData, 331 | __out_opt UINT *pDataLen); 332 | 333 | /* 334 | * Parse an IPv4 address. 335 | */ 336 | extern WINDIVERTEXPORT BOOL WinDivertHelperParseIPv4Address( 337 | __in const char *addrStr, 338 | __out_opt UINT32 *pAddr); 339 | 340 | /* 341 | * Parse an IPv6 address. 342 | */ 343 | extern WINDIVERTEXPORT BOOL WinDivertHelperParseIPv6Address( 344 | __in const char *addrStr, 345 | __out_opt UINT32 *pAddr); 346 | 347 | /* 348 | * Calculate IPv4/IPv6/ICMP/ICMPv6/TCP/UDP checksums. 349 | */ 350 | extern WINDIVERTEXPORT UINT WinDivertHelperCalcChecksums( 351 | __inout PVOID pPacket, 352 | __in UINT packetLen, 353 | __in UINT64 flags); 354 | 355 | /* 356 | * Check the given filter string. 357 | */ 358 | extern WINDIVERTEXPORT BOOL WinDivertHelperCheckFilter( 359 | __in const char *filter, 360 | __in WINDIVERT_LAYER layer, 361 | __out_opt const char **errorStr, 362 | __out_opt UINT *errorPos); 363 | 364 | /* 365 | * Evaluate the given filter string. 366 | */ 367 | extern WINDIVERTEXPORT BOOL WinDivertHelperEvalFilter( 368 | __in const char *filter, 369 | __in WINDIVERT_LAYER layer, 370 | __in PVOID pPacket, 371 | __in UINT packetLen, 372 | __in PWINDIVERT_ADDRESS pAddr); 373 | 374 | /****************************************************************************/ 375 | /* WINDIVERT LEGACY API */ 376 | /****************************************************************************/ 377 | 378 | /* 379 | * Deprecated API: 380 | */ 381 | #define WINDIVERT_FLAG_NO_CHECKSUM 0 382 | 383 | #endif /* WINDIVERT_KERNEL */ 384 | 385 | #ifdef __cplusplus 386 | } 387 | #endif 388 | 389 | #endif /* __WINDIVERT_H */ 390 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # K-Wall 2 | ### Open-Source Anti-RMT-Spam Firewall 3 | 4 | Welcome! 5 | 6 | If you'd like to obtain ready-to-run precompiled binaries of K-Wall, please click the "binaries" folder above. That's where they live. 7 | 8 |   9 | 10 | ### What Is K-Wall? 11 | 12 | K-Wall is a specific type of firewall built for a specific purpose, which in a nutshell is this: adding comprehensive spam detection and filtration capabilities based on regular expressions to games that have integrated text-based "chat" functionality. K-Wall adds powerful filtration tools to any game that passes chat traffic "in the clear" (read: uncompressed/unencrypted). (Trivia: The "K" in K-Wall stands for Kleene, in honor of Stephen Cole Kleene, the inventor of regular expressions.) 13 | 14 | Tell K-Wall what IP address(es) and port(s) to listen to (up to eight total), and any incoming packet traffic on that IP/port (or set of them) is procesed and scanned. Traffic that trips enough filters is logged and dropped, and everything else is passed on unmodified to the game client. The game never sees K-Wall, and never receives any spam chat that K-Wall drops. 15 | 16 |   17 | 18 | ### System Requirements 19 | 20 | K-Wall supports Windows Vista and later, both 32- and 64-bit. Please note that K-Wall uses a network filter driver that requires elevated privileges, and thus MUST be run as an administrator. 21 | 22 |   23 | 24 | ### K-Wall Features 25 | 26 | » K-Wall does not violate the ToS/AUP of any game, as it is NOT a "third-party tool" or a cheat program; it's literally a customized, purpose-specific network firewall. K-Wall does not hook to any game process, but instead hooks to Windows' integrated packet filtering service. 27 | 28 | » K-Wall is ignored by "anti-cheat" software often used with F2P MMOs (e.g., GameGuardian), again since it is a network firewall and doesn't intrude upon the game itself in any way. 29 | 30 | » Full Unicode 8.0 support, including built-in decode capability for UTF-8, UTF-16LE, UTF-16BE, and UTF32 text, thanks to the International Components for Unicode libraries. 31 | 32 | » Game-agnostic design. K-Wall can process any chat text it can "see," regardless of the game. (Hint: This may have other uses outside game chats...) 33 | 34 | » Per-game configuration, for maximum flexibility and customization. 35 | 36 | » Multi-step deobfuscation converts or removes characters spammers like to use in order to bypass filters. Convert lookalike characters (e.g., "ø" becomes "o") and even multiple-character sequences (e.g., "|\/|" becomes "m"), strip out punctuation and whitespace (to catch gapped-out characters), casefold, normalize Unicode confusables (based on the Unicode Consortium's suggested method), and more. 37 | 38 | » Comprehensive, fully-Unicode-aware RegExp engine via ICU'd RegEx libraries, which can detect any valid character across the entire Unicode codepage space, including other planes outside the BMP. 39 | 40 | » Multi-threaded application, coded in C++ for excellent performance without requiring .NET. 41 | 42 | » Full source code is available for both K-Wall and for all of its prerequisite libraries. 43 | -------------------------------------------------------------------------------- /binaries/KWall-0.1.0.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/binaries/KWall-0.1.0.0.zip -------------------------------------------------------------------------------- /configs/BladeAndSoul.kcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/configs/BladeAndSoul.kcf -------------------------------------------------------------------------------- /configs/BlankTemplate.kcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/configs/BlankTemplate.kcf -------------------------------------------------------------------------------- /fonts/DejaVuSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/fonts/DejaVuSansMono.ttf -------------------------------------------------------------------------------- /fonts/LICENSE: -------------------------------------------------------------------------------- 1 | Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. 2 | Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) 3 | 4 | Bitstream Vera Fonts Copyright 5 | ------------------------------ 6 | 7 | Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is 8 | a trademark of Bitstream, Inc. 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of the fonts accompanying this license ("Fonts") and associated 12 | documentation files (the "Font Software"), to reproduce and distribute the 13 | Font Software, including without limitation the rights to use, copy, merge, 14 | publish, distribute, and/or sell copies of the Font Software, and to permit 15 | persons to whom the Font Software is furnished to do so, subject to the 16 | following conditions: 17 | 18 | The above copyright and trademark notices and this permission notice shall 19 | be included in all copies of one or more of the Font Software typefaces. 20 | 21 | The Font Software may be modified, altered, or added to, and in particular 22 | the designs of glyphs or characters in the Fonts may be modified and 23 | additional glyphs or characters may be added to the Fonts, only if the fonts 24 | are renamed to names not containing either the words "Bitstream" or the word 25 | "Vera". 26 | 27 | This License becomes null and void to the extent applicable to Fonts or Font 28 | Software that has been modified and is distributed under the "Bitstream 29 | Vera" names. 30 | 31 | The Font Software may be sold as part of a larger software package but no 32 | copy of one or more of the Font Software typefaces may be sold by itself. 33 | 34 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 35 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, 36 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, 37 | TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME 38 | FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING 39 | ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, 40 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 41 | THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE 42 | FONT SOFTWARE. 43 | 44 | Except as contained in this notice, the names of Gnome, the Gnome 45 | Foundation, and Bitstream Inc., shall not be used in advertising or 46 | otherwise to promote the sale, use or other dealings in this Font Software 47 | without prior written authorization from the Gnome Foundation or Bitstream 48 | Inc., respectively. For further information, contact: fonts at gnome dot 49 | org. 50 | 51 | Arev Fonts Copyright 52 | ------------------------------ 53 | 54 | Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. 55 | 56 | Permission is hereby granted, free of charge, to any person obtaining 57 | a copy of the fonts accompanying this license ("Fonts") and 58 | associated documentation files (the "Font Software"), to reproduce 59 | and distribute the modifications to the Bitstream Vera Font Software, 60 | including without limitation the rights to use, copy, merge, publish, 61 | distribute, and/or sell copies of the Font Software, and to permit 62 | persons to whom the Font Software is furnished to do so, subject to 63 | the following conditions: 64 | 65 | The above copyright and trademark notices and this permission notice 66 | shall be included in all copies of one or more of the Font Software 67 | typefaces. 68 | 69 | The Font Software may be modified, altered, or added to, and in 70 | particular the designs of glyphs or characters in the Fonts may be 71 | modified and additional glyphs or characters may be added to the 72 | Fonts, only if the fonts are renamed to names not containing either 73 | the words "Tavmjong Bah" or the word "Arev". 74 | 75 | This License becomes null and void to the extent applicable to Fonts 76 | or Font Software that has been modified and is distributed under the 77 | "Tavmjong Bah Arev" names. 78 | 79 | The Font Software may be sold as part of a larger software package but 80 | no copy of one or more of the Font Software typefaces may be sold by 81 | itself. 82 | 83 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 84 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 85 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 86 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL 87 | TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 88 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 89 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 90 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 91 | OTHER DEALINGS IN THE FONT SOFTWARE. 92 | 93 | Except as contained in this notice, the name of Tavmjong Bah shall not 94 | be used in advertising or otherwise to promote the sale, use or other 95 | dealings in this Font Software without prior written authorization 96 | from Tavmjong Bah. For further information, contact: tavmjong @ free 97 | . fr. 98 | 99 | $Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ 100 | -------------------------------------------------------------------------------- /redist/readme.md: -------------------------------------------------------------------------------- 1 | Visual Studio 2016 Redistributables 2 | -------------------------------------------------------------------------------- /redist/vcredist_x64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/redist/vcredist_x64.exe -------------------------------------------------------------------------------- /redist/vcredist_x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActiumPraetor/K-Wall/bd5f4cc9adb37400d419c8e5c8bdbf16ff2355a8/redist/vcredist_x86.exe --------------------------------------------------------------------------------