├── assets
├── tray.png
├── modesets.png
└── settings.png
├── GDPIControl
├── Resources
│ ├── GDPI.png
│ ├── icon.ico
│ ├── GDPI_green.png
│ ├── GDPI_red.png
│ ├── icon_green.ico
│ ├── icon_red.ico
│ └── Icons8
│ │ ├── Ok16.png
│ │ ├── Cancel16.png
│ │ ├── info16.png
│ │ ├── Replace16.png
│ │ ├── settings16.png
│ │ ├── shutdown16.png
│ │ └── CopyToClipboard16.png
├── GDPI
│ ├── x86
│ │ ├── WinDivert.dll
│ │ ├── WinDivert32.sys
│ │ ├── WinDivert64.sys
│ │ └── goodbyedpi.exe
│ ├── x86_64
│ │ ├── WinDivert.dll
│ │ ├── goodbyedpi.exe
│ │ └── WinDivert64.sys
│ └── licenses
│ │ ├── LICENSE-uthash.txt
│ │ ├── LICENSE-getline.txt
│ │ └── LICENSE-goodbyedpi.txt
├── Model
│ ├── Modeset.cs
│ ├── ControlSettings.cs
│ └── GDPISettings.cs
├── Properties
│ ├── DataSources
│ │ ├── GDPISettings.datasource
│ │ ├── GDPIControl.Model.GDPISettings.datasource
│ │ └── GDPIControl.Model.ControlSettings.datasource
│ ├── Settings.settings
│ ├── PublishProfiles
│ │ ├── net472.pubxml
│ │ └── net6.pubxml
│ ├── Settings.Designer.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── app.manifest
├── App.config
├── Program.cs
├── Forms
│ ├── FormAbout.cs
│ ├── FormSettings.cs
│ ├── FormBlacklist.cs
│ ├── FormGDPISettings.cs
│ ├── FormAbout.resx
│ ├── FormBlacklist.resx
│ ├── FormSettings.resx
│ ├── FormGDPISettings.resx
│ ├── FormSettings.Designer.cs
│ ├── FormAbout.Designer.cs
│ └── FormBlacklist.Designer.cs
├── Constants.cs
├── ControlTask.cs
├── Extensions
│ ├── FormExtensions.cs
│ ├── ModesetExtensions.cs
│ └── IOExtensions.cs
├── Config.cs
├── GDPIProcess.cs
├── GDPIControl.csproj
├── icons8.Designer.cs
├── FormMain.cs
├── icons8.resx
└── packages.lock.json
├── .github
├── scripts
│ └── version.ps1
└── workflows
│ ├── publish-artifact.yml
│ └── build-artifact.yml
├── README.md
├── LICENSE
├── GDPIControl.sln
└── .gitignore
/assets/tray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/assets/tray.png
--------------------------------------------------------------------------------
/assets/modesets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/assets/modesets.png
--------------------------------------------------------------------------------
/assets/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/assets/settings.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/GDPI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/GDPI.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/icon.ico
--------------------------------------------------------------------------------
/GDPIControl/GDPI/x86/WinDivert.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/GDPI/x86/WinDivert.dll
--------------------------------------------------------------------------------
/GDPIControl/GDPI/x86/WinDivert32.sys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/GDPI/x86/WinDivert32.sys
--------------------------------------------------------------------------------
/GDPIControl/GDPI/x86/WinDivert64.sys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/GDPI/x86/WinDivert64.sys
--------------------------------------------------------------------------------
/GDPIControl/GDPI/x86/goodbyedpi.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/GDPI/x86/goodbyedpi.exe
--------------------------------------------------------------------------------
/GDPIControl/Resources/GDPI_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/GDPI_green.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/GDPI_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/GDPI_red.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/icon_green.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/icon_green.ico
--------------------------------------------------------------------------------
/GDPIControl/Resources/icon_red.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/icon_red.ico
--------------------------------------------------------------------------------
/GDPIControl/GDPI/x86_64/WinDivert.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/GDPI/x86_64/WinDivert.dll
--------------------------------------------------------------------------------
/GDPIControl/GDPI/x86_64/goodbyedpi.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/GDPI/x86_64/goodbyedpi.exe
--------------------------------------------------------------------------------
/GDPIControl/Resources/Icons8/Ok16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/Icons8/Ok16.png
--------------------------------------------------------------------------------
/GDPIControl/GDPI/x86_64/WinDivert64.sys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/GDPI/x86_64/WinDivert64.sys
--------------------------------------------------------------------------------
/GDPIControl/Resources/Icons8/Cancel16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/Icons8/Cancel16.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/Icons8/info16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/Icons8/info16.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/Icons8/Replace16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/Icons8/Replace16.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/Icons8/settings16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/Icons8/settings16.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/Icons8/shutdown16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/Icons8/shutdown16.png
--------------------------------------------------------------------------------
/GDPIControl/Resources/Icons8/CopyToClipboard16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Virenbar/GDPIControl/HEAD/GDPIControl/Resources/Icons8/CopyToClipboard16.png
--------------------------------------------------------------------------------
/.github/scripts/version.ps1:
--------------------------------------------------------------------------------
1 | dotnet tool install --global minver-cli --version 4.2.0
2 | $version = minver -t v -d preview
3 | $number = $version.Split('-')[0]
4 | Write-Output "VERSION=$version"
5 | Write-Output "V=$number"
6 | "VERSION=$version" >> $env:GITHUB_ENV
7 | "V=$number" >> $env:GITHUB_ENV
8 | Write-Output "{version}={$version}" >> $GITHUB_OUTPUT
--------------------------------------------------------------------------------
/GDPIControl/Model/Modeset.cs:
--------------------------------------------------------------------------------
1 | namespace GDPIControl.Model
2 | {
3 | public enum Modeset
4 | {
5 | M1,
6 | M2,
7 | M3,
8 | M4,
9 | M5,
10 | M6,
11 | M7,
12 | M8,
13 | M9,
14 | Custom,
15 | Custom1,
16 | Custom2,
17 | Custom3
18 | }
19 | }
--------------------------------------------------------------------------------
/GDPIControl/Properties/DataSources/GDPISettings.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | GDPIControl.CS.GDPISettings, GDPIControl.CS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GDPIControl - GUI for [GoodbyeDPI](https://github.com/ValdikSS/GoodbyeDPI/)
2 |
3 | Small GUI application for controlling GoodbyeDPI
4 |
5 | ## Features
6 |
7 | - Enable/disable Goodbye DPI from the tray
8 | - Custom settings (up to 3)
9 | - Updating the blacklist
10 | - Autorun at login
11 |
12 | ## Screenshots
13 |
14 | Tray menu
15 | 
16 |
17 | Main window
18 | 
19 |
20 | Custom settings
21 | 
22 |
23 | ## Links
24 |
25 | - **[GoodbyeDPI](https://github.com/ValdikSS/GoodbyeDPI/)** by @ValdikSS
26 | - **[WinDivert](https://github.com/basil00/Divert)** by @basil00
27 |
--------------------------------------------------------------------------------
/GDPIControl/Properties/DataSources/GDPIControl.Model.GDPISettings.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | GDPIControl.Model.GDPISettings, GDPIControl.CS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/GDPIControl/Properties/DataSources/GDPIControl.Model.ControlSettings.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | GDPIControl.Model.ControlSettings, GDPIControl.CS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/GDPIControl/Model/ControlSettings.cs:
--------------------------------------------------------------------------------
1 | namespace GDPIControl.Model
2 | {
3 | public class ControlSettings
4 | {
5 | public string Arguments { get; set; }
6 | public bool AutostartGDPI { get; set; }
7 | public GDPISettings CustomSettings1 { get; set; }
8 | public GDPISettings CustomSettings2 { get; set; }
9 | public GDPISettings CustomSettings3 { get; set; }
10 | public GDPISettings GDPISettings { get; set; }
11 | public bool LaunchMinimazed { get; set; }
12 | public Modeset Modeset { get; set; }
13 | public bool StopDriver { get; set; }
14 | public bool UseBlacklist { get; set; }
15 | public bool UseUserlist { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/GDPIControl/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 250, 250, 250
7 |
8 |
9 | Black
10 |
11 |
12 | Segoe UI, 9pt
13 |
14 |
15 |
--------------------------------------------------------------------------------
/GDPIControl/Properties/PublishProfiles/net472.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | win-x86
6 | FileSystem
7 | Release
8 | Any CPU
9 |
10 |
11 |
12 | net472
13 | publish\net472\
14 | false
15 | false
16 | false
17 |
18 |
19 |
20 | False
21 | None
22 |
23 |
--------------------------------------------------------------------------------
/GDPIControl/Properties/PublishProfiles/net6.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | win-x86
6 | FileSystem
7 | Release
8 | Any CPU
9 |
10 |
11 |
12 | net6.0-windows
13 | publish\net6.0-windows\
14 | true
15 | false
16 | false
17 |
18 |
19 |
20 | False
21 | None
22 |
23 |
--------------------------------------------------------------------------------
/.github/workflows/publish-artifact.yml:
--------------------------------------------------------------------------------
1 | name: Publish Artifact
2 | on:
3 | workflow_dispatch:
4 | jobs:
5 | build:
6 | name: Build
7 | uses: ./.github/workflows/build-artifact.yml
8 |
9 | release:
10 | name: Publish
11 | runs-on: ubuntu-latest
12 | permissions:
13 | contents: write
14 | needs: build
15 | steps:
16 | - name: Version
17 | run: echo "Version builded ${{ needs.build.outputs.version }}"
18 |
19 | - name: Download artifacts
20 | uses: actions/download-artifact@v4
21 |
22 | - name: List files
23 | run: ls -R
24 |
25 | - name: Archive artifacts
26 | run: |
27 | zip -r "GDPIControl.zip" "GDPIControl(net6.0-windows)"
28 | zip -r "GDPIControl-4.7.2.zip" "GDPIControl(net472)"
29 |
30 | - name: Create Release
31 | uses: softprops/action-gh-release@v2
32 | with:
33 | files: |
34 | GDPIControl.zip
35 | GDPIControl-4.7.2.zip
--------------------------------------------------------------------------------
/GDPIControl/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | -
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/GDPIControl/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 250, 250, 250
12 |
13 |
14 | Black
15 |
16 |
17 | Segoe UI, 9pt
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Artyom
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/GDPIControl/GDPI/licenses/LICENSE-uthash.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2005-2014, Troy D. Hanson http://troydhanson.github.com/uthash/
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 |
10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
11 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
12 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
13 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
14 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
15 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
17 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
18 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
20 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 |
22 |
--------------------------------------------------------------------------------
/GDPIControl/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Windows.Forms;
4 |
5 | namespace GDPIControl
6 | {
7 | internal static class Program
8 | {
9 | ///
10 | /// The main entry point for the application.
11 | ///
12 | [STAThread]
13 | private static void Main()
14 | {
15 | using Mutex mutex = new(true, "GDPIControl", out var created);
16 | #if NET6_0_OR_GREATER
17 | Application.SetHighDpiMode(HighDpiMode.SystemAware);
18 | #endif
19 | Application.EnableVisualStyles();
20 | Application.SetCompatibleTextRenderingDefault(false);
21 | if (!created)
22 | {
23 | MessageBox.Show($"Another instance of {Application.ProductName} is already running.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
24 | return;
25 | }
26 |
27 | Config.Load();
28 | var Form = new FormMain();
29 | if (!Config.Current.LaunchMinimazed) { Form.Show(); }
30 |
31 | Application.ApplicationExit += Application_ApplicationExit;
32 | Application.Run();
33 | }
34 |
35 | private static void Application_ApplicationExit(object sender, EventArgs e)
36 | {
37 | Config.Save();
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormAbout.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Extensions;
2 | using System.Diagnostics;
3 | using System.Windows.Forms;
4 |
5 | namespace GDPIControl
6 | {
7 | public partial class FormAbout : Form
8 | {
9 | public FormAbout()
10 | {
11 | InitializeComponent();
12 | this.BindSettings();
13 | L_Version.Text = $"v{Application.ProductVersion}";
14 | }
15 |
16 | private static void OpenURL(string url) => Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
17 |
18 | private void LL_Control_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
19 | {
20 | LL_Control.LinkVisited = true;
21 | OpenURL("https://github.com/Virenbar/GDPIControl");
22 | }
23 |
24 | private void LL_GDPI_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
25 | {
26 | LL_GDPI.LinkVisited = true;
27 | OpenURL("https://github.com/ValdikSS/GoodbyeDPI/");
28 | }
29 |
30 | private void LL_Icons_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
31 | {
32 | LL_Icons.LinkVisited = true;
33 | OpenURL("https://icons8.com");
34 | }
35 |
36 | private void LL_WinDivert_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
37 | {
38 | LL_WinDivert.LinkVisited = true;
39 | OpenURL("https://github.com/basil00/Divert");
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/GDPIControl/Constants.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Windows.Forms;
4 |
5 | namespace GDPIControl
6 | {
7 | internal static class Constants
8 | {
9 | private const string BlacklistName = "Blacklist.txt";
10 | private const string BlacklistTempName = "Blacklist.temp.txt";
11 | private const string ConfigName = "Config.xml";
12 | private const string UserlistName = "Userlist.txt";
13 | private const string x86 = @"GDPI\x86\goodbyedpi.exe";
14 | private const string x86_64 = @"GDPI\x86_64\goodbyedpi.exe";
15 | public static string BlacklistPath => Path.Combine(StartupPath, BlacklistName);
16 | public static string BlacklistTempPath => Path.Combine(StartupPath, BlacklistTempName);
17 | public static string ConfigPath => Path.Combine(StartupPath, ConfigName);
18 | public static string GDPIPath => Path.Combine(StartupPath, Environment.Is64BitOperatingSystem ? x86_64 : x86);
19 | public static string UserlistPath => Path.Combine(StartupPath, UserlistName);
20 |
21 | #region StartupPath
22 | /*
23 | .NET 6 uses TEMP directory for GDPIControl
24 | Application.StartupPath - Real executable path
25 | Environment.ProcessPath - Packed executable path
26 | */
27 |
28 | #if NET6_0_OR_GREATER
29 | public static string StartupPath => Path.GetDirectoryName(Environment.ProcessPath);
30 | #else
31 | public static string StartupPath => Application.StartupPath;
32 | #endif
33 | #endregion StartupPath
34 | }
35 | }
--------------------------------------------------------------------------------
/GDPIControl/ControlTask.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32.TaskScheduler;
2 | using System;
3 | using System.Security.Principal;
4 | using System.Windows.Forms;
5 |
6 | namespace GDPIControl
7 | {
8 | internal static class ControlTask
9 | {
10 | private const string TaskName = "GDPIControl";
11 | private static readonly string TaskPath;
12 | private static readonly string UserName;
13 |
14 | static ControlTask()
15 | {
16 | UserName = WindowsIdentity.GetCurrent().Name.Split('\\')[1];
17 | TaskPath = $@"{TaskName}\Autorun for {UserName}";
18 | }
19 |
20 | public static bool IsRegistered => TaskService.Instance.GetTask(TaskPath) != null;
21 |
22 | public static void Delete()
23 | {
24 | if (!IsRegistered) { return; }
25 | TaskService.Instance.RootFolder.DeleteTask(TaskPath);
26 | }
27 |
28 | public static void Register()
29 | {
30 | var TS = TaskService.Instance;
31 |
32 | var TD = TS.NewTask();
33 | TD.Actions.Add(Application.ExecutablePath);
34 | TD.Principal.RunLevel = TaskRunLevel.Highest;
35 | var S = TD.Settings;
36 | S.DisallowStartIfOnBatteries = false;
37 | S.ExecutionTimeLimit = TimeSpan.Zero;
38 | S.StopIfGoingOnBatteries = false;
39 |
40 | var LT = new LogonTrigger { UserId = UserName };
41 | TD.Triggers.Add(LT);
42 |
43 | TS.RootFolder.RegisterTaskDefinition(TaskPath, TD);
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/GDPIControl.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.1.31911.260
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GDPIControl", "GDPIControl\GDPIControl.csproj", "{E0198301-A932-4072-A44C-23624C46C1D6}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x86 = Debug|x86
12 | Release|Any CPU = Release|Any CPU
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {E0198301-A932-4072-A44C-23624C46C1D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {E0198301-A932-4072-A44C-23624C46C1D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {E0198301-A932-4072-A44C-23624C46C1D6}.Debug|x86.ActiveCfg = Debug|Any CPU
19 | {E0198301-A932-4072-A44C-23624C46C1D6}.Debug|x86.Build.0 = Debug|Any CPU
20 | {E0198301-A932-4072-A44C-23624C46C1D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {E0198301-A932-4072-A44C-23624C46C1D6}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {E0198301-A932-4072-A44C-23624C46C1D6}.Release|x86.ActiveCfg = Release|Any CPU
23 | {E0198301-A932-4072-A44C-23624C46C1D6}.Release|x86.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {D5D67241-FA42-4A4C-83E7-BEB334F6B003}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/GDPIControl/GDPI/licenses/LICENSE-getline.txt:
--------------------------------------------------------------------------------
1 | /*-
2 | * Copyright (c) 2011 The NetBSD Foundation, Inc.
3 | * All rights reserved.
4 | *
5 | * This code is derived from software contributed to The NetBSD Foundation
6 | * by Christos Zoulas.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | * 1. Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * 2. Redistributions in binary form must reproduce the above copyright
14 | * notice, this list of conditions and the following disclaimer in the
15 | * documentation and/or other materials provided with the distribution.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
--------------------------------------------------------------------------------
/GDPIControl/Extensions/FormExtensions.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Properties;
2 | using System;
3 | using System.Windows.Forms;
4 |
5 | namespace GDPIControl.Extensions
6 | {
7 | internal static class FormExtensions
8 | {
9 | public static void BindSettings(this Form form)
10 | {
11 | form.DataBindings.Add(new Binding("Font", Settings.Default, "Font", true, DataSourceUpdateMode.OnPropertyChanged));
12 | form.DataBindings.Add(new Binding("ForeColor", Settings.Default, "ForeColor", true, DataSourceUpdateMode.OnPropertyChanged));
13 | form.DataBindings.Add(new Binding("BackColor", Settings.Default, "BackColor", true, DataSourceUpdateMode.OnPropertyChanged));
14 | }
15 |
16 | public static DialogResult ShowError(this Form form, Exception exception)
17 | {
18 | return MessageBox.Show(form, exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
19 | }
20 |
21 | public static DialogResult ShowError(this Form form, Exception exception, string caption)
22 | {
23 | return MessageBox.Show(form, exception.Message, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
24 | }
25 |
26 | public static DialogResult ShowInfo(this Form form, string text)
27 | {
28 | return MessageBox.Show(form, text, "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
29 | }
30 |
31 | public static DialogResult ShowInfo(this Form form, string text, string caption)
32 | {
33 | return MessageBox.Show(form, text, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormSettings.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Extensions;
2 | using GDPIControl.Model;
3 | using System;
4 | using System.Windows.Forms;
5 |
6 | namespace GDPIControl.Forms
7 | {
8 | public partial class FormSettings : Form
9 | {
10 | private readonly ControlSettings Settings = Config.Current;
11 |
12 | public FormSettings()
13 | {
14 | InitializeComponent();
15 | this.BindSettings();
16 | CB_Minimized.Checked = Settings.LaunchMinimazed;
17 | CB_AutostartGDPIControl.Checked = ControlTask.IsRegistered;
18 |
19 | CB_AutostartGDPI.Checked = Settings.AutostartGDPI;
20 | CB_StopDriver.Checked = Settings.StopDriver;
21 | }
22 |
23 | private void B_Cancel_Click(object sender, EventArgs e)
24 | {
25 | Close();
26 | }
27 |
28 | private void B_OK_Click(object sender, EventArgs e)
29 | {
30 | Settings.LaunchMinimazed = CB_Minimized.Checked;
31 | Settings.AutostartGDPI = CB_AutostartGDPI.Checked;
32 | Settings.StopDriver = CB_StopDriver.Checked;
33 |
34 | try
35 | {
36 | if (CB_AutostartGDPIControl.Checked && !ControlTask.IsRegistered)
37 | {
38 | ControlTask.Register();
39 | }
40 | else if (!CB_AutostartGDPIControl.Checked && ControlTask.IsRegistered)
41 | {
42 | ControlTask.Delete();
43 | }
44 | }
45 | catch (Exception ex)
46 | {
47 | this.ShowError(ex);
48 | }
49 | Close();
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/GDPIControl/Config.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Model;
2 | using System;
3 | using System.IO;
4 | using System.Xml.Serialization;
5 |
6 | namespace GDPIControl
7 | {
8 | internal static class Config
9 | {
10 | public static ControlSettings Current { get; set; }
11 |
12 | private static ControlSettings Default => new()
13 | {
14 | Modeset = Modeset.M9,
15 | CustomSettings1 = new GDPISettings(),
16 | CustomSettings2 = new GDPISettings(),
17 | CustomSettings3 = new GDPISettings(),
18 | StopDriver = true
19 | };
20 |
21 | public static void Load()
22 | {
23 | if (File.Exists(Constants.ConfigPath))
24 | {
25 | try
26 | {
27 | var XS = new XmlSerializer(typeof(ControlSettings));
28 | using var SR = new StreamReader(Constants.ConfigPath);
29 | Current = (ControlSettings)XS.Deserialize(SR);
30 |
31 | var def = Default;
32 | if (Current.Modeset == Modeset.Custom) { Current.Modeset = Modeset.Custom1; }
33 | Current.CustomSettings1 ??= Current.GDPISettings ?? def.CustomSettings1;
34 | Current.CustomSettings2 ??= def.CustomSettings2;
35 | Current.CustomSettings3 ??= def.CustomSettings3;
36 | }
37 | catch (Exception)
38 | {
39 | Current = Default;
40 | }
41 | }
42 | else
43 | {
44 | Current = Default;
45 | }
46 | }
47 |
48 | public static void Save()
49 | {
50 | var XS = new XmlSerializer(typeof(ControlSettings));
51 | using var SW = new StreamWriter(Constants.ConfigPath);
52 | XS.Serialize(SW, Current);
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/GDPIControl/GDPIProcess.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Linq;
3 | using System.ServiceProcess;
4 | using System.Threading.Tasks;
5 |
6 | namespace GDPIControl
7 | {
8 | internal static class GDPIProcess
9 | {
10 | private static Process GDPIP;
11 |
12 | public static bool IsRunning => GDPIP != null;
13 |
14 | public static async Task Restart()
15 | {
16 | Stop();
17 | await Task.Delay(5 * 1000);
18 | Start();
19 | }
20 |
21 | public static void Start()
22 | {
23 | if (IsRunning) { return; }
24 | var StartInfo = new ProcessStartInfo
25 | {
26 | FileName = Constants.GDPIPath,
27 | Arguments = Config.Current.Arguments,
28 | RedirectStandardOutput = true,
29 | RedirectStandardError = true,
30 | UseShellExecute = false,
31 | CreateNoWindow = true
32 | };
33 | GDPIP = new Process { StartInfo = StartInfo };
34 | GDPIP.EnableRaisingEvents = true;
35 | GDPIP.OutputDataReceived += GDPIP_OutputDataReceived;
36 | GDPIP.ErrorDataReceived += GDPIP_ErrorDataReceived;
37 | GDPIP.Start();
38 | GDPIP.BeginOutputReadLine();
39 | GDPIP.BeginErrorReadLine();
40 | }
41 |
42 | public static void Stop()
43 | {
44 | if (!IsRunning) { return; }
45 | GDPIP.Kill();
46 | GDPIP = null;
47 | }
48 |
49 | public static void StopDriver()
50 | {
51 | var devices = ServiceController.GetDevices();
52 | var driver = devices.FirstOrDefault(S => S.ServiceName.Contains("WinDivert"));
53 | driver?.Stop();
54 | }
55 |
56 | private static void GDPIP_ErrorDataReceived(object sender, DataReceivedEventArgs e)
57 | {
58 | Debug.WriteLine(e.Data);
59 | }
60 |
61 | private static void GDPIP_OutputDataReceived(object sender, DataReceivedEventArgs e)
62 | {
63 | Debug.WriteLine(e.Data);
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/.github/workflows/build-artifact.yml:
--------------------------------------------------------------------------------
1 | name: Build Artifact
2 | on:
3 | push:
4 | branches: [ master ]
5 | paths-ignore:
6 | - "**.md"
7 | - ".github/**"
8 | - "assets/**"
9 | pull_request:
10 | branches: [ master ]
11 | workflow_call:
12 | outputs:
13 | version:
14 | description: "Version builded"
15 | value: ${{ jobs.build.outputs.version }}
16 | jobs:
17 | build:
18 | name: Build
19 | strategy:
20 | matrix:
21 | include:
22 | - framework: "net6.0-windows"
23 | profile: "net6"
24 | - framework: "net472"
25 | profile: "net472"
26 | runs-on: windows-latest
27 | env:
28 | DOTNET_NOLOGO: true
29 | FRAMEWORK: ${{ matrix.framework }}
30 | PROFILE: ${{ matrix.profile }}
31 | outputs:
32 | version: ${{steps.version.outputs.version}}
33 | steps:
34 | - name: Checkout
35 | uses: actions/checkout@v4
36 | with:
37 | fetch-depth: 0
38 |
39 | - name: Install .NET
40 | uses: actions/setup-dotnet@v4
41 | with:
42 | dotnet-version: 6.x
43 |
44 | - name: Set VERSION
45 | id: version
46 | run: .\.github\scripts\version.ps1
47 |
48 | - name: Restore cache
49 | uses: actions/cache@v4
50 | with:
51 | path: ~\.nuget\packages
52 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
53 | restore-keys: |
54 | ${{ runner.os }}-nuget-
55 |
56 | - name: Build solution
57 | run: |
58 | dotnet restore --locked-mode
59 | dotnet build -c Release
60 |
61 | - name: Build artifact
62 | run: dotnet publish -c Release -p:PublishProfile=$env:PROFILE -f $env:FRAMEWORK /property:Version=$env:VERSION
63 |
64 | - name: Upload artifact
65 | uses: actions/upload-artifact@v4
66 | with:
67 | name: GDPIControl(${{ matrix.framework }})
68 | path: |
69 | GDPIControl\publish\${{ matrix.framework }}\*.exe
70 | GDPIControl\publish\${{ matrix.framework }}\*.dll
71 | GDPIControl\publish\${{ matrix.framework }}\GDPI\**\*
72 | GDPIControl\publish\${{ matrix.framework }}\GDPIControl.runtimeconfig.json
73 | GDPIControl\publish\${{ matrix.framework }}\GDPIControl.exe.config
74 | if-no-files-found: error
75 |
--------------------------------------------------------------------------------
/GDPIControl/Extensions/ModesetExtensions.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Model;
2 |
3 | namespace GDPIControl.Extensions
4 | {
5 | public static class ModesetExtensions
6 | {
7 | public static string ToArgument(this Modeset modeset)
8 | {
9 | return modeset switch
10 | {
11 | Modeset.M1 => "-1",
12 | Modeset.M2 => "-2",
13 | Modeset.M3 => "-3",
14 | Modeset.M4 => "-4",
15 | Modeset.M5 => "-5",
16 | Modeset.M6 => "-6",
17 | Modeset.M7 => "-7",
18 | Modeset.M8 => "-8",
19 | Modeset.M9 => "-9",
20 | Modeset.Custom1 => GetArguments(Config.Current.CustomSettings1),
21 | Modeset.Custom2 => GetArguments(Config.Current.CustomSettings2),
22 | Modeset.Custom3 => GetArguments(Config.Current.CustomSettings3),
23 | _ => "-9",
24 | };
25 | }
26 |
27 | public static GDPISettings ToSettings(this Modeset modeset)
28 | {
29 | return modeset switch
30 | {
31 | Modeset.M1 => new GDPISettings { P = true, R = true, S = true, F = true, F_V = 2, K = true, K_V = 2, N = true, E = true, E_V = 2 },
32 | Modeset.M2 => new GDPISettings { P = true, R = true, S = true, F = true, F_V = 2, K = true, K_V = 2, N = true, E = true, E_V = 40 },
33 | Modeset.M3 => new GDPISettings { P = true, R = true, S = true, E = true, E_V = 2 },
34 | Modeset.M4 => new GDPISettings { P = true, R = true, S = true },
35 | Modeset.M5 => new GDPISettings { F = true, F_V = 2, E = true, E_V = 2, ATTL = true, RFrag = true, MP = true, MP_V = 1200 },
36 | Modeset.M6 => new GDPISettings { F = true, F_V = 2, E = true, E_V = 2, Seq = true, RFrag = true, MP = true, MP_V = 1200 },
37 | Modeset.M7 => new GDPISettings { F = true, F_V = 2, E = true, E_V = 2, ChkSum = true, RFrag = true, MP = true, MP_V = 1200 },
38 | Modeset.M8 => new GDPISettings { F = true, F_V = 2, E = true, E_V = 2, Seq = true, ChkSum = true, RFrag = true, MP = true, MP_V = 1200 },
39 | Modeset.M9 => new GDPISettings { F = true, F_V = 2, E = true, E_V = 2, Seq = true, ChkSum = true, RFrag = true, MP = true, MP_V = 1200, Q = true },
40 | _ => new GDPISettings(),
41 | };
42 | }
43 |
44 | private static string GetArguments(GDPISettings settings) => settings.Arguments ?? settings.ToArguments();
45 | }
46 | }
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormBlacklist.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Extensions;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Net.Http;
7 | using System.Threading;
8 | using System.Windows.Forms;
9 |
10 | namespace GDPIControl
11 | {
12 | public partial class FormBlacklist : Form
13 | {
14 | private readonly HttpClient Client = new();
15 | private readonly Dictionary RBtoURI = new();
16 | private CancellationTokenSource CTS;
17 |
18 | public FormBlacklist()
19 | {
20 | InitializeComponent();
21 | this.BindSettings();
22 | RBtoURI.Add(RB_AZ, @"https://antizapret.prostovpn.org/domains-export.txt");
23 | RBtoURI.Add(RB_AZ1, @"https://p.thenewone.lol/domains-export.txt");
24 | RBtoURI.Add(RB_AZ2, @"https://mirror.thetahex.ru/?key=blacklist-gdpi");
25 | RBtoURI.Add(RB_AF, @"https://antifilter.download/list/domains.lst");
26 |
27 | Client.DefaultRequestHeaders.Add("Origin", "GDPIControl");
28 | }
29 |
30 | #region UI Events
31 |
32 | private async void B_Download_Click(object sender, EventArgs e)
33 | {
34 | B_Download.Enabled = false;
35 | CTS = new CancellationTokenSource();
36 | try
37 | {
38 | var uri = RBtoURI.First(KV => KV.Key.Checked).Value;
39 | if (File.Exists(Constants.BlacklistTempPath)) { File.Delete(Constants.BlacklistTempPath); }
40 |
41 | var progress = new Progress(p => PB.Value = (int)(p * 100));
42 | using (var FS = new FileStream(Constants.BlacklistTempPath, FileMode.Create))
43 | {
44 | await Client.DownloadAsync(uri, FS, progress, CTS.Token);
45 | }
46 | if (File.Exists(Constants.BlacklistPath)) { File.Delete(Constants.BlacklistPath); }
47 | File.Move(Constants.BlacklistTempPath, Constants.BlacklistPath);
48 | this.ShowInfo("Blacklist download done");
49 | }
50 | catch (Exception E)
51 | {
52 | this.ShowError(E, "Download Error");
53 | }
54 | finally
55 | {
56 | CTS.Dispose();
57 | CTS = null;
58 | B_Download.Enabled = true;
59 | }
60 | }
61 |
62 | private void FormBlacklist_FormClosed(object sender, FormClosedEventArgs e)
63 | {
64 | CTS?.Cancel();
65 | Client.Dispose();
66 | }
67 |
68 | #endregion UI Events
69 | }
70 | }
--------------------------------------------------------------------------------
/GDPIControl/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Этот код создан программой.
4 | // Исполняемая версия:4.0.30319.42000
5 | //
6 | // Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
7 | // повторной генерации кода.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GDPIControl.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("250, 250, 250")]
29 | public global::System.Drawing.Color BackColor {
30 | get {
31 | return ((global::System.Drawing.Color)(this["BackColor"]));
32 | }
33 | set {
34 | this["BackColor"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("Black")]
41 | public global::System.Drawing.Color ForeColor {
42 | get {
43 | return ((global::System.Drawing.Color)(this["ForeColor"]));
44 | }
45 | set {
46 | this["ForeColor"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("Segoe UI, 9pt")]
53 | public global::System.Drawing.Font Font {
54 | get {
55 | return ((global::System.Drawing.Font)(this["Font"]));
56 | }
57 | set {
58 | this["Font"] = value;
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/GDPIControl/GDPIControl.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows;net472
6 | embedded
7 | disable
8 | 10.0
9 | Resources\icon.ico
10 | win-x86;win-x64
11 | true
12 | true
13 | git
14 | https://github.com/Virenbar/RRTools
15 | app.manifest
16 |
17 |
18 |
19 | true
20 | true
21 | true
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | true
38 |
39 |
40 |
41 |
42 |
43 | True
44 | True
45 | icons8.resx
46 |
47 |
48 | True
49 | True
50 | Resources.resx
51 |
52 |
53 | True
54 | True
55 | Settings.settings
56 |
57 |
58 |
59 |
60 |
61 | ResXFileCodeGenerator
62 | icons8.Designer.cs
63 |
64 |
65 | ResXFileCodeGenerator
66 | Resources.Designer.cs
67 |
68 |
69 |
70 |
71 |
72 | SettingsSingleFileGenerator
73 | Settings.Designer.cs
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormGDPISettings.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Extensions;
2 | using GDPIControl.Model;
3 | using System;
4 | using System.Windows.Forms;
5 |
6 | namespace GDPIControl.Forms
7 | {
8 | public partial class FormGDPISettings : Form
9 | {
10 | private readonly ControlSettings Settings;
11 | private GDPISettings GDPISettings;
12 |
13 | public FormGDPISettings(ControlSettings settings)
14 | {
15 | InitializeComponent();
16 | this.BindSettings();
17 | Settings = settings;
18 | GDPISettings = (GDPISettings)(Settings.Modeset switch
19 | {
20 | Modeset.Custom1 => settings.CustomSettings1,
21 | Modeset.Custom2 => settings.CustomSettings2,
22 | Modeset.Custom3 => settings.CustomSettings3,
23 | _ => default
24 | }).Clone();
25 | BS_GDPISettings.CurrentItemChanged += BS_GDPISettings_CurrentItemChanged;
26 | BS_GDPISettings.DataSource = GDPISettings;
27 | Text = $"GDPI Settings {Settings.Modeset.ToString()[6..]}";
28 | }
29 |
30 | private void SetFromModeset(Modeset modeset)
31 | {
32 | GDPISettings = modeset.ToSettings();
33 | BS_GDPISettings.DataSource = GDPISettings;
34 | }
35 |
36 | #region UIEvents
37 |
38 | private void B_Cancel_Click(object sender, EventArgs e)
39 | {
40 | DialogResult = DialogResult.Cancel;
41 | Close();
42 | }
43 |
44 | private void B_OK_Click(object sender, EventArgs e)
45 | {
46 | switch (Settings.Modeset)
47 | {
48 | case Modeset.Custom1:
49 | Settings.CustomSettings1 = GDPISettings;
50 | break;
51 |
52 | case Modeset.Custom2:
53 | Settings.CustomSettings2 = GDPISettings;
54 | break;
55 |
56 | case Modeset.Custom3:
57 | Settings.CustomSettings3 = GDPISettings;
58 | break;
59 |
60 | default:
61 | throw new InvalidOperationException();
62 | }
63 | DialogResult = DialogResult.OK;
64 | Close();
65 | }
66 |
67 | private void BS_GDPISettings_CurrentItemChanged(object sender, EventArgs e)
68 | {
69 | if (GDPISettings.Manual) { return; }
70 | GDPISettings.Arguments = GDPISettings.ToArguments();
71 | }
72 |
73 | private void CB_Manual_CheckedChanged(object sender, EventArgs e)
74 | {
75 | TB_Arguments.ReadOnly = !CB_Manual.Checked;
76 | }
77 |
78 | private void FormGDPISettings_Load(object sender, EventArgs e)
79 | {
80 | Icon = Owner.Icon;
81 | }
82 |
83 | private void MI_M1_Click(object sender, EventArgs e)
84 | {
85 | SetFromModeset(Modeset.M1);
86 | }
87 |
88 | private void MI_M2_Click(object sender, EventArgs e)
89 | {
90 | SetFromModeset(Modeset.M2);
91 | }
92 |
93 | private void MI_M3_Click(object sender, EventArgs e)
94 | {
95 | SetFromModeset(Modeset.M3);
96 | }
97 |
98 | private void MI_M4_Click(object sender, EventArgs e)
99 | {
100 | SetFromModeset(Modeset.M4);
101 | }
102 |
103 | private void MI_M5_Click(object sender, EventArgs e)
104 | {
105 | SetFromModeset(Modeset.M5);
106 | }
107 |
108 | private void MI_M6_Click(object sender, EventArgs e)
109 | {
110 | SetFromModeset(Modeset.M6);
111 | }
112 |
113 | private void MI_M7_Click(object sender, EventArgs e)
114 | {
115 | SetFromModeset(Modeset.M7);
116 | }
117 |
118 | private void MI_M8_Click(object sender, EventArgs e)
119 | {
120 | SetFromModeset(Modeset.M8);
121 | }
122 |
123 | private void MI_M9_Click(object sender, EventArgs e)
124 | {
125 | SetFromModeset(Modeset.M9);
126 | }
127 |
128 | #endregion UIEvents
129 | }
130 | }
--------------------------------------------------------------------------------
/GDPIControl/Extensions/IOExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Net.Http;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 |
7 | namespace GDPIControl.Extensions
8 | {
9 | internal static class IOExtensions
10 | {
11 | public static Task CopyToAsync(this Stream source, Stream destination, int bufferSize) => CopyToAsync(source, destination, bufferSize, default, default);
12 |
13 | public static Task CopyToAsync(this Stream source, Stream destination, int bufferSize, IProgress progress) => CopyToAsync(source, destination, bufferSize, progress, default);
14 |
15 | ///
16 | /// https://stackoverflow.com/a/46497896
17 | ///
18 | public static async Task CopyToAsync(this Stream source, Stream destination, int bufferSize, IProgress progress, CancellationToken cancellationToken)
19 | {
20 | if (source is null) { throw new ArgumentNullException(nameof(source)); }
21 | if (!source.CanRead) { throw new ArgumentException("Has to be readable", nameof(source)); }
22 | if (destination is null) { throw new ArgumentNullException(nameof(destination)); }
23 | if (!destination.CanWrite) { throw new ArgumentException("Has to be writable", nameof(destination)); }
24 | if (bufferSize < 0) { throw new ArgumentOutOfRangeException(nameof(bufferSize)); }
25 |
26 | var buffer = new byte[bufferSize];
27 | long totalBytesRead = 0;
28 | int bytesRead;
29 | while ((bytesRead = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0)
30 | {
31 | await destination.WriteAsync(buffer, 0, bytesRead, cancellationToken).ConfigureAwait(false);
32 | totalBytesRead += bytesRead;
33 | progress?.Report(totalBytesRead);
34 | }
35 | }
36 |
37 | ///
38 | /// Асинхронно скачать файл
39 | ///
40 | public static Task DownloadAsync(this HttpClient client, string requestUri, Stream destination) => DownloadAsync(client, requestUri, destination, default(CancellationToken));
41 |
42 | ///
43 | /// Асинхронно скачать файл
44 | ///
45 | public static async Task DownloadAsync(this HttpClient client, string requestUri, Stream destination, CancellationToken cancellationToken)
46 | {
47 | // Считать только заголовок
48 | using var response = await client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
49 | response.EnsureSuccessStatusCode();
50 | // А содержимое записать прямо в файл
51 | using var download = await response.Content.ReadAsStreamAsync();
52 | await download.CopyToAsync(destination);
53 | }
54 |
55 | ///
56 | /// Асинхронно скачать файл с отчётом о прогрессе
57 | ///
58 | public static Task DownloadAsync(this HttpClient client, string requestUri, Stream destination, IProgress progress) => DownloadAsync(client, requestUri, destination, progress, default);
59 |
60 | ///
61 | /// Асинхронно скачать файл с отчётом о прогрессе
62 | ///
63 | public static async Task DownloadAsync(this HttpClient client, string requestUri, Stream destination, IProgress progress, CancellationToken cancellationToken)
64 | {
65 | // Get the http headers first to examine the content length
66 | using var response = await client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
67 | response.EnsureSuccessStatusCode();
68 | var contentLength = response.Content.Headers.ContentLength;
69 | using var download = await response.Content.ReadAsStreamAsync();
70 | // Ignore progress reporting when no progress reporter was
71 | // passed or when the content length is unknown
72 | if (!contentLength.HasValue)
73 | {
74 | await download.CopyToAsync(destination);
75 | progress.Report(1);
76 | return;
77 | }
78 |
79 | // Convert absolute progress (bytes downloaded) into relative progress (0% - 100%)
80 | var relativeProgress = new Progress(totalBytes => progress.Report((float)totalBytes / contentLength.Value));
81 | // Use extension method to report progress while downloading
82 | await download.CopyToAsync(destination, 81920, relativeProgress, cancellationToken);
83 | progress.Report(1);
84 | }
85 | }
86 | }
--------------------------------------------------------------------------------
/GDPIControl/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GDPIControl.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GDPIControl.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap GDPI {
67 | get {
68 | object obj = ResourceManager.GetObject("GDPI", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap GDPI_green {
77 | get {
78 | object obj = ResourceManager.GetObject("GDPI_green", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized resource of type System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap GDPI_red {
87 | get {
88 | object obj = ResourceManager.GetObject("GDPI_red", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
95 | ///
96 | internal static System.Drawing.Icon icon {
97 | get {
98 | object obj = ResourceManager.GetObject("icon", resourceCulture);
99 | return ((System.Drawing.Icon)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
105 | ///
106 | internal static System.Drawing.Icon icon_green {
107 | get {
108 | object obj = ResourceManager.GetObject("icon_green", resourceCulture);
109 | return ((System.Drawing.Icon)(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
115 | ///
116 | internal static System.Drawing.Icon icon_red {
117 | get {
118 | object obj = ResourceManager.GetObject("icon_red", resourceCulture);
119 | return ((System.Drawing.Icon)(obj));
120 | }
121 | }
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/GDPIControl/icons8.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Этот код создан программой.
4 | // Исполняемая версия:4.0.30319.42000
5 | //
6 | // Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
7 | // повторной генерации кода.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GDPIControl {
12 | using System;
13 |
14 |
15 | ///
16 | /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
17 | ///
18 | // Этот класс создан автоматически классом StronglyTypedResourceBuilder
19 | // с помощью такого средства, как ResGen или Visual Studio.
20 | // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
21 | // с параметром /str или перестройте свой проект VS.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class icons8 {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal icons8() {
33 | }
34 |
35 | ///
36 | /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GDPIControl.icons8", typeof(icons8).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Перезаписывает свойство CurrentUICulture текущего потока для всех
51 | /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap Cancel16 {
67 | get {
68 | object obj = ResourceManager.GetObject("Cancel16", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap CopyToClipboard16 {
77 | get {
78 | object obj = ResourceManager.GetObject("CopyToClipboard16", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap Info16 {
87 | get {
88 | object obj = ResourceManager.GetObject("Info16", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
95 | ///
96 | internal static System.Drawing.Bitmap Ok16 {
97 | get {
98 | object obj = ResourceManager.GetObject("Ok16", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
105 | ///
106 | internal static System.Drawing.Bitmap Replace16 {
107 | get {
108 | object obj = ResourceManager.GetObject("Replace16", resourceCulture);
109 | return ((System.Drawing.Bitmap)(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
115 | ///
116 | internal static System.Drawing.Bitmap Settings16 {
117 | get {
118 | object obj = ResourceManager.GetObject("Settings16", resourceCulture);
119 | return ((System.Drawing.Bitmap)(obj));
120 | }
121 | }
122 |
123 | ///
124 | /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
125 | ///
126 | internal static System.Drawing.Bitmap Shutdown16 {
127 | get {
128 | object obj = ResourceManager.GetObject("Shutdown16", resourceCulture);
129 | return ((System.Drawing.Bitmap)(obj));
130 | }
131 | }
132 | }
133 | }
134 |
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormAbout.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormBlacklist.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormSettings.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormGDPISettings.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | Fragment (split) the packets just as --native-frag, but send them in the reversed order. Works with the websites which could not handle segmented HTTPS TLS ClientHello (because they receive the TCP flow "combined")
125 |
126 |
127 | 157, 17
128 |
129 |
--------------------------------------------------------------------------------
/GDPIControl/FormMain.cs:
--------------------------------------------------------------------------------
1 | using GDPIControl.Extensions;
2 | using GDPIControl.Forms;
3 | using GDPIControl.Model;
4 | using GDPIControl.Properties;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Diagnostics;
8 | using System.IO;
9 | using System.Linq;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 |
13 | namespace GDPIControl
14 | {
15 | public partial class FormMain : Form
16 | {
17 | private readonly HashSet CustomModesets;
18 | private readonly List<(RadioButton Button, Modeset Modeset)> RBModesets;
19 | private readonly ControlSettings Settings = Config.Current;
20 |
21 | public FormMain()
22 | {
23 | InitializeComponent();
24 | this.BindSettings();
25 | CustomModesets = new() {
26 | Modeset.Custom1,
27 | Modeset.Custom2,
28 | Modeset.Custom3
29 | };
30 | RBModesets = new List<(RadioButton Button, Modeset Modeset)>
31 | {
32 | (RB_M1,Modeset.M1),
33 | (RB_M2,Modeset.M2),
34 | (RB_M3,Modeset.M3),
35 | (RB_M4,Modeset.M4),
36 | (RB_M5,Modeset.M5),
37 | (RB_M6,Modeset.M6),
38 | (RB_M7,Modeset.M7),
39 | (RB_M8,Modeset.M8),
40 | (RB_M9,Modeset.M9),
41 | (RB_Custom_1,Modeset.Custom1),
42 | (RB_Custom_2,Modeset.Custom2),
43 | (RB_Custom_3,Modeset.Custom3)
44 | };
45 | RBModesets.First(X => X.Modeset == Settings.Modeset).Button.Checked = true;
46 | BS_ControlSettings.DataSource = Settings;
47 |
48 | RefreshUI();
49 | RefreshArguments();
50 | if (Settings.AutostartGDPI) { StartGDPI(); } else { StopGDPI(); }
51 | }
52 |
53 | private void CloseGDPIControl()
54 | {
55 | GDPIProcess.Stop();
56 | TrayControl.Icon = null;
57 | TrayControl.Visible = false;
58 | TrayControl.Dispose();
59 | RefreshArguments();
60 | if (Settings.StopDriver)
61 | {
62 | GDPIProcess.StopDriver();
63 | }
64 | Application.Exit();
65 | }
66 |
67 | private void RefreshArguments()
68 | {
69 | Settings.Modeset = RBModesets.First(X => X.Button.Checked).Modeset;
70 | var Arguments = Settings.Modeset.ToArgument();
71 | if (Settings.UseBlacklist) { Arguments += $@" --blacklist ""{Constants.BlacklistPath}"""; }
72 | if (Settings.UseUserlist) { Arguments += $@" --blacklist ""{Constants.UserlistPath}"""; }
73 | Settings.Arguments = Arguments;
74 | }
75 |
76 | private void RefreshUI()
77 | {
78 | B_Edit.Enabled = CustomModesets.Contains(Settings.Modeset);
79 | B_Restart.Enabled = GDPIProcess.IsRunning;
80 | }
81 |
82 | private void ShowGDPIControl()
83 | {
84 | Show();
85 | Activate();
86 | }
87 |
88 | private void StartGDPI()
89 | {
90 | B_Start.Text = "Stop GDPI";
91 | B_Start.Image = Resources.GDPI_red;
92 | MI_Start.Enabled = false;
93 | MI_Stop.Enabled = true;
94 | TrayControl.Icon = Resources.icon_green;
95 | Icon = Resources.icon_green;
96 | RefreshArguments();
97 | GDPIProcess.Start();
98 | RefreshUI();
99 | }
100 |
101 | private void StopGDPI()
102 | {
103 | B_Start.Text = "Start GDPI";
104 | B_Start.Image = Resources.GDPI_green;
105 | MI_Start.Enabled = true;
106 | MI_Stop.Enabled = false;
107 | TrayControl.Icon = Resources.icon_red;
108 | Icon = Resources.icon_red;
109 | RefreshArguments();
110 | GDPIProcess.Stop();
111 | RefreshUI();
112 | }
113 |
114 | private void UIState(bool state)
115 | {
116 | B_Restart.Enabled = state;
117 | B_Start.Enabled = state;
118 | B_Close.Enabled = state;
119 | }
120 |
121 | #region UIEvents
122 |
123 | private void B_Close_Click(object sender, EventArgs e) => CloseGDPIControl();
124 |
125 | private void B_Edit_Click(object sender, EventArgs e)
126 | {
127 | using var form = new FormGDPISettings(Settings);
128 | if (form.ShowDialog(this) == DialogResult.OK)
129 | {
130 | RefreshArguments();
131 | }
132 | }
133 |
134 | private async void B_Restart_Click(object sender, EventArgs e)
135 | {
136 | UIState(false);
137 | StopGDPI();
138 | await Task.Delay(500);
139 | StartGDPI();
140 | UIState(true);
141 | }
142 |
143 | private void B_Start_Click(object sender, EventArgs e)
144 | {
145 | UIState(false);
146 | if (GDPIProcess.IsRunning) { StopGDPI(); } else { StartGDPI(); }
147 | UIState(true);
148 | }
149 |
150 | private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
151 | {
152 | if (e.CloseReason == CloseReason.ApplicationExitCall) { return; }
153 | e.Cancel = true;
154 | Visible = false;
155 | }
156 |
157 | private void MI_About_Click(object sender, EventArgs e)
158 | {
159 | var F = new FormAbout();
160 | F.ShowDialog(this);
161 | }
162 |
163 | private void MI_Settings_Click(object sender, EventArgs e)
164 | {
165 | using var F = new FormSettings();
166 | F.ShowDialog(this);
167 | }
168 |
169 | private void RB_CheckedChanged(object sender, EventArgs e)
170 | {
171 | var RB = (RadioButton)sender;
172 | if (!RB.Checked) { return; }
173 | foreach (var entry in RBModesets)
174 | {
175 | if (entry.Button == RB) { continue; }
176 | entry.Button.Checked = false;
177 | }
178 | RefreshArguments();
179 | RefreshUI();
180 | }
181 |
182 | #region Lists
183 |
184 | private void MI_Blacklist_Click(object sender, EventArgs e)
185 | {
186 | var F = new FormBlacklist();
187 | F.ShowDialog(this);
188 | }
189 |
190 | private void MI_Userlist_Click(object sender, EventArgs e)
191 | {
192 | if (!File.Exists(Constants.UserlistPath))
193 | {
194 | File.WriteAllText(Constants.UserlistPath, "");
195 | }
196 | Process.Start(new ProcessStartInfo(Constants.UserlistPath) { UseShellExecute = true });
197 | }
198 |
199 | #endregion Lists
200 |
201 | #region Tray
202 |
203 | private void MI_Close_Click(object sender, EventArgs e) => CloseGDPIControl();
204 |
205 | private void MI_Show_Click(object sender, EventArgs e) => ShowGDPIControl();
206 |
207 | private void MI_Start_Click(object sender, EventArgs e) => StartGDPI();
208 |
209 | private void MI_Stop_Click(object sender, EventArgs e) => StopGDPI();
210 |
211 | private void TrayControl_MouseClick(object sender, MouseEventArgs e)
212 | {
213 | if (e.Button == MouseButtons.Left) { ShowGDPIControl(); }
214 | }
215 |
216 | #endregion Tray
217 |
218 | #endregion UIEvents
219 | }
220 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | #x86/ NO, i need that
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | #*.pubxml
178 | #*.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
--------------------------------------------------------------------------------
/GDPIControl/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\GDPI.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\GDPI_green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\GDPI_red.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | ..\Resources\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | ..\Resources\icon_green.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
137 | ..\Resources\icon_red.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
138 |
139 |
--------------------------------------------------------------------------------
/GDPIControl/icons8.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | Resources\Icons8\Cancel16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | Resources\Icons8\CopyToClipboard16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | Resources\Icons8\Info16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | Resources\Icons8\Ok16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | Resources\Icons8\Replace16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
137 | Resources\Icons8\Settings16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
138 |
139 |
140 | Resources\Icons8\Shutdown16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
141 |
142 |
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormSettings.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace GDPIControl.Forms
2 | {
3 | partial class FormSettings
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | CB_Minimized = new System.Windows.Forms.CheckBox();
32 | flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
33 | CB_AutostartGDPIControl = new System.Windows.Forms.CheckBox();
34 | CB_AutostartGDPI = new System.Windows.Forms.CheckBox();
35 | CB_StopDriver = new System.Windows.Forms.CheckBox();
36 | tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
37 | flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
38 | B_OK = new System.Windows.Forms.Button();
39 | B_Cancel = new System.Windows.Forms.Button();
40 | flowLayoutPanel3.SuspendLayout();
41 | tableLayoutPanel1.SuspendLayout();
42 | flowLayoutPanel1.SuspendLayout();
43 | SuspendLayout();
44 | //
45 | // CB_Minimized
46 | //
47 | CB_Minimized.AutoSize = true;
48 | CB_Minimized.Location = new System.Drawing.Point(3, 28);
49 | CB_Minimized.Name = "CB_Minimized";
50 | CB_Minimized.Size = new System.Drawing.Size(109, 19);
51 | CB_Minimized.TabIndex = 7;
52 | CB_Minimized.Text = "Start minimized";
53 | //
54 | // flowLayoutPanel3
55 | //
56 | flowLayoutPanel3.AutoSize = true;
57 | flowLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
58 | flowLayoutPanel3.Controls.Add(CB_AutostartGDPIControl);
59 | flowLayoutPanel3.Controls.Add(CB_Minimized);
60 | flowLayoutPanel3.Controls.Add(CB_AutostartGDPI);
61 | flowLayoutPanel3.Controls.Add(CB_StopDriver);
62 | flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Top;
63 | flowLayoutPanel3.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
64 | flowLayoutPanel3.Location = new System.Drawing.Point(0, 0);
65 | flowLayoutPanel3.Name = "flowLayoutPanel3";
66 | flowLayoutPanel3.Size = new System.Drawing.Size(284, 100);
67 | flowLayoutPanel3.TabIndex = 8;
68 | flowLayoutPanel3.WrapContents = false;
69 | //
70 | // CB_AutostartGDPIControl
71 | //
72 | CB_AutostartGDPIControl.AutoSize = true;
73 | CB_AutostartGDPIControl.Location = new System.Drawing.Point(3, 3);
74 | CB_AutostartGDPIControl.Name = "CB_AutostartGDPIControl";
75 | CB_AutostartGDPIControl.Size = new System.Drawing.Size(144, 19);
76 | CB_AutostartGDPIControl.TabIndex = 7;
77 | CB_AutostartGDPIControl.Text = "Autostart GDPIControl";
78 | //
79 | // CB_AutostartGDPI
80 | //
81 | CB_AutostartGDPI.AutoSize = true;
82 | CB_AutostartGDPI.Location = new System.Drawing.Point(3, 53);
83 | CB_AutostartGDPI.Name = "CB_AutostartGDPI";
84 | CB_AutostartGDPI.Size = new System.Drawing.Size(267, 19);
85 | CB_AutostartGDPI.TabIndex = 7;
86 | CB_AutostartGDPI.Text = "Start GoodbyeDPI when GDPControl is started";
87 | //
88 | // CB_StopDriver
89 | //
90 | CB_StopDriver.AutoSize = true;
91 | CB_StopDriver.Location = new System.Drawing.Point(3, 78);
92 | CB_StopDriver.Name = "CB_StopDriver";
93 | CB_StopDriver.Size = new System.Drawing.Size(213, 19);
94 | CB_StopDriver.TabIndex = 7;
95 | CB_StopDriver.Text = "Stop WinDivert on GDPIControl exit";
96 | //
97 | // tableLayoutPanel1
98 | //
99 | tableLayoutPanel1.AutoSize = true;
100 | tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
101 | tableLayoutPanel1.ColumnCount = 2;
102 | tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
103 | tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
104 | tableLayoutPanel1.Controls.Add(flowLayoutPanel1, 1, 0);
105 | tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
106 | tableLayoutPanel1.Location = new System.Drawing.Point(0, 108);
107 | tableLayoutPanel1.Name = "tableLayoutPanel1";
108 | tableLayoutPanel1.RowCount = 1;
109 | tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
110 | tableLayoutPanel1.Size = new System.Drawing.Size(284, 33);
111 | tableLayoutPanel1.TabIndex = 9;
112 | //
113 | // flowLayoutPanel1
114 | //
115 | flowLayoutPanel1.Anchor = System.Windows.Forms.AnchorStyles.Right;
116 | flowLayoutPanel1.AutoSize = true;
117 | flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
118 | flowLayoutPanel1.Controls.Add(B_OK);
119 | flowLayoutPanel1.Controls.Add(B_Cancel);
120 | flowLayoutPanel1.Location = new System.Drawing.Point(150, 0);
121 | flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
122 | flowLayoutPanel1.Name = "flowLayoutPanel1";
123 | flowLayoutPanel1.Size = new System.Drawing.Size(134, 33);
124 | flowLayoutPanel1.TabIndex = 9;
125 | flowLayoutPanel1.WrapContents = false;
126 | //
127 | // B_OK
128 | //
129 | B_OK.Anchor = System.Windows.Forms.AnchorStyles.None;
130 | B_OK.AutoSize = true;
131 | B_OK.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
132 | B_OK.Image = icons8.Ok16;
133 | B_OK.Location = new System.Drawing.Point(3, 3);
134 | B_OK.Name = "B_OK";
135 | B_OK.Padding = new System.Windows.Forms.Padding(1);
136 | B_OK.Size = new System.Drawing.Size(51, 27);
137 | B_OK.TabIndex = 1;
138 | B_OK.Text = "OK";
139 | B_OK.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
140 | B_OK.UseVisualStyleBackColor = true;
141 | B_OK.Click += B_OK_Click;
142 | //
143 | // B_Cancel
144 | //
145 | B_Cancel.AutoSize = true;
146 | B_Cancel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
147 | B_Cancel.Image = icons8.Cancel16;
148 | B_Cancel.Location = new System.Drawing.Point(60, 3);
149 | B_Cancel.Name = "B_Cancel";
150 | B_Cancel.Padding = new System.Windows.Forms.Padding(1);
151 | B_Cancel.Size = new System.Drawing.Size(71, 27);
152 | B_Cancel.TabIndex = 5;
153 | B_Cancel.Text = "Cancel";
154 | B_Cancel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
155 | B_Cancel.UseVisualStyleBackColor = true;
156 | B_Cancel.Click += B_Cancel_Click;
157 | //
158 | // FormSettings
159 | //
160 | AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
161 | AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
162 | BackColor = System.Drawing.Color.FromArgb(250, 250, 250);
163 | ClientSize = new System.Drawing.Size(284, 141);
164 | ControlBox = false;
165 | Controls.Add(tableLayoutPanel1);
166 | Controls.Add(flowLayoutPanel3);
167 | MaximumSize = new System.Drawing.Size(400, 200);
168 | MinimumSize = new System.Drawing.Size(300, 180);
169 | Name = "FormSettings";
170 | ShowInTaskbar = false;
171 | StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
172 | Text = "Settings";
173 | flowLayoutPanel3.ResumeLayout(false);
174 | flowLayoutPanel3.PerformLayout();
175 | tableLayoutPanel1.ResumeLayout(false);
176 | tableLayoutPanel1.PerformLayout();
177 | flowLayoutPanel1.ResumeLayout(false);
178 | flowLayoutPanel1.PerformLayout();
179 | ResumeLayout(false);
180 | PerformLayout();
181 | }
182 |
183 | #endregion
184 |
185 | private System.Windows.Forms.CheckBox CB_Minimized;
186 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3;
187 | private System.Windows.Forms.CheckBox CB_AutostartGDPIControl;
188 | private System.Windows.Forms.CheckBox CB_AutostartGDPI;
189 | private System.Windows.Forms.CheckBox CB_StopDriver;
190 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
191 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
192 | private System.Windows.Forms.Button B_OK;
193 | private System.Windows.Forms.Button B_Cancel;
194 | }
195 | }
--------------------------------------------------------------------------------
/GDPIControl/packages.lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "dependencies": {
4 | ".NETFramework,Version=v4.7.2": {
5 | "PolySharp": {
6 | "type": "Direct",
7 | "requested": "[1.14.1, )",
8 | "resolved": "1.14.1",
9 | "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ=="
10 | },
11 | "System.Resources.Extensions": {
12 | "type": "Direct",
13 | "requested": "[8.0.0, )",
14 | "resolved": "8.0.0",
15 | "contentHash": "psnQ6GRQOvt+evda5C4nD5EuV49mz2Tv0DD2JDVDEbE/TKoMukxSkGJcsBJ0pajpPuFRr67syFYlkJ4Wj6A5Zw==",
16 | "dependencies": {
17 | "System.Memory": "4.5.5"
18 | }
19 | },
20 | "System.ServiceProcess.ServiceController": {
21 | "type": "Direct",
22 | "requested": "[8.0.0, )",
23 | "resolved": "8.0.0",
24 | "contentHash": "jtYVG3bpw2n/NvNnP2g/JLri0D4UtfusTvLeH6cZPNAEjJXJVGspS3wLgVvjNbm+wjaYkFgsXejMTocV1T5DIQ==",
25 | "dependencies": {
26 | "System.Diagnostics.EventLog": "8.0.0"
27 | }
28 | },
29 | "TaskScheduler": {
30 | "type": "Direct",
31 | "requested": "[2.11.0, )",
32 | "resolved": "2.11.0",
33 | "contentHash": "p9wH58XSNIyUtO7PIFAEldaKUzpYmlj+YWAfnUqBKnGxIZRY51I9BrsBGJijUVwlxrgmLLPUigRIv2ZTD4uPJA=="
34 | },
35 | "System.Buffers": {
36 | "type": "Transitive",
37 | "resolved": "4.5.1",
38 | "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg=="
39 | },
40 | "System.Diagnostics.EventLog": {
41 | "type": "Transitive",
42 | "resolved": "8.0.0",
43 | "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==",
44 | "dependencies": {
45 | "System.Security.Principal.Windows": "5.0.0"
46 | }
47 | },
48 | "System.Memory": {
49 | "type": "Transitive",
50 | "resolved": "4.5.5",
51 | "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==",
52 | "dependencies": {
53 | "System.Buffers": "4.5.1",
54 | "System.Numerics.Vectors": "4.5.0",
55 | "System.Runtime.CompilerServices.Unsafe": "4.5.3"
56 | }
57 | },
58 | "System.Numerics.Vectors": {
59 | "type": "Transitive",
60 | "resolved": "4.5.0",
61 | "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ=="
62 | },
63 | "System.Runtime.CompilerServices.Unsafe": {
64 | "type": "Transitive",
65 | "resolved": "4.5.3",
66 | "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw=="
67 | },
68 | "System.Security.Principal.Windows": {
69 | "type": "Transitive",
70 | "resolved": "5.0.0",
71 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
72 | }
73 | },
74 | ".NETFramework,Version=v4.7.2/win-x64": {
75 | "System.Security.Principal.Windows": {
76 | "type": "Transitive",
77 | "resolved": "5.0.0",
78 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
79 | }
80 | },
81 | ".NETFramework,Version=v4.7.2/win-x86": {
82 | "System.Security.Principal.Windows": {
83 | "type": "Transitive",
84 | "resolved": "5.0.0",
85 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
86 | }
87 | },
88 | ".NETFramework,Version=v4.7.2/win7-x86": {
89 | "System.Security.Principal.Windows": {
90 | "type": "Transitive",
91 | "resolved": "5.0.0",
92 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
93 | }
94 | },
95 | "net6.0-windows7.0": {
96 | "System.Resources.Extensions": {
97 | "type": "Direct",
98 | "requested": "[8.0.0, )",
99 | "resolved": "8.0.0",
100 | "contentHash": "psnQ6GRQOvt+evda5C4nD5EuV49mz2Tv0DD2JDVDEbE/TKoMukxSkGJcsBJ0pajpPuFRr67syFYlkJ4Wj6A5Zw=="
101 | },
102 | "System.ServiceProcess.ServiceController": {
103 | "type": "Direct",
104 | "requested": "[8.0.0, )",
105 | "resolved": "8.0.0",
106 | "contentHash": "jtYVG3bpw2n/NvNnP2g/JLri0D4UtfusTvLeH6cZPNAEjJXJVGspS3wLgVvjNbm+wjaYkFgsXejMTocV1T5DIQ==",
107 | "dependencies": {
108 | "System.Diagnostics.EventLog": "8.0.0"
109 | }
110 | },
111 | "TaskScheduler": {
112 | "type": "Direct",
113 | "requested": "[2.11.0, )",
114 | "resolved": "2.11.0",
115 | "contentHash": "p9wH58XSNIyUtO7PIFAEldaKUzpYmlj+YWAfnUqBKnGxIZRY51I9BrsBGJijUVwlxrgmLLPUigRIv2ZTD4uPJA==",
116 | "dependencies": {
117 | "Microsoft.Win32.Registry": "5.0.0",
118 | "System.Diagnostics.EventLog": "8.0.0",
119 | "System.Security.AccessControl": "6.0.1"
120 | }
121 | },
122 | "Microsoft.Win32.Registry": {
123 | "type": "Transitive",
124 | "resolved": "5.0.0",
125 | "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
126 | "dependencies": {
127 | "System.Security.AccessControl": "5.0.0",
128 | "System.Security.Principal.Windows": "5.0.0"
129 | }
130 | },
131 | "System.Diagnostics.EventLog": {
132 | "type": "Transitive",
133 | "resolved": "8.0.0",
134 | "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
135 | },
136 | "System.Security.AccessControl": {
137 | "type": "Transitive",
138 | "resolved": "6.0.1",
139 | "contentHash": "IQ4NXP/B3Ayzvw0rDQzVTYsCKyy0Jp9KI6aYcK7UnGVlR9+Awz++TIPCQtPYfLJfOpm8ajowMR09V7quD3sEHw=="
140 | },
141 | "System.Security.Principal.Windows": {
142 | "type": "Transitive",
143 | "resolved": "5.0.0",
144 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
145 | }
146 | },
147 | "net6.0-windows7.0/win-x64": {
148 | "System.ServiceProcess.ServiceController": {
149 | "type": "Direct",
150 | "requested": "[8.0.0, )",
151 | "resolved": "8.0.0",
152 | "contentHash": "jtYVG3bpw2n/NvNnP2g/JLri0D4UtfusTvLeH6cZPNAEjJXJVGspS3wLgVvjNbm+wjaYkFgsXejMTocV1T5DIQ==",
153 | "dependencies": {
154 | "System.Diagnostics.EventLog": "8.0.0"
155 | }
156 | },
157 | "Microsoft.Win32.Registry": {
158 | "type": "Transitive",
159 | "resolved": "5.0.0",
160 | "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
161 | "dependencies": {
162 | "System.Security.AccessControl": "5.0.0",
163 | "System.Security.Principal.Windows": "5.0.0"
164 | }
165 | },
166 | "System.Diagnostics.EventLog": {
167 | "type": "Transitive",
168 | "resolved": "8.0.0",
169 | "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
170 | },
171 | "System.Security.AccessControl": {
172 | "type": "Transitive",
173 | "resolved": "6.0.1",
174 | "contentHash": "IQ4NXP/B3Ayzvw0rDQzVTYsCKyy0Jp9KI6aYcK7UnGVlR9+Awz++TIPCQtPYfLJfOpm8ajowMR09V7quD3sEHw=="
175 | },
176 | "System.Security.Principal.Windows": {
177 | "type": "Transitive",
178 | "resolved": "5.0.0",
179 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
180 | }
181 | },
182 | "net6.0-windows7.0/win-x86": {
183 | "System.ServiceProcess.ServiceController": {
184 | "type": "Direct",
185 | "requested": "[8.0.0, )",
186 | "resolved": "8.0.0",
187 | "contentHash": "jtYVG3bpw2n/NvNnP2g/JLri0D4UtfusTvLeH6cZPNAEjJXJVGspS3wLgVvjNbm+wjaYkFgsXejMTocV1T5DIQ==",
188 | "dependencies": {
189 | "System.Diagnostics.EventLog": "8.0.0"
190 | }
191 | },
192 | "Microsoft.Win32.Registry": {
193 | "type": "Transitive",
194 | "resolved": "5.0.0",
195 | "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
196 | "dependencies": {
197 | "System.Security.AccessControl": "5.0.0",
198 | "System.Security.Principal.Windows": "5.0.0"
199 | }
200 | },
201 | "System.Diagnostics.EventLog": {
202 | "type": "Transitive",
203 | "resolved": "8.0.0",
204 | "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
205 | },
206 | "System.Security.AccessControl": {
207 | "type": "Transitive",
208 | "resolved": "6.0.1",
209 | "contentHash": "IQ4NXP/B3Ayzvw0rDQzVTYsCKyy0Jp9KI6aYcK7UnGVlR9+Awz++TIPCQtPYfLJfOpm8ajowMR09V7quD3sEHw=="
210 | },
211 | "System.Security.Principal.Windows": {
212 | "type": "Transitive",
213 | "resolved": "5.0.0",
214 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
215 | }
216 | },
217 | "net6.0-windows7.0/win7-x86": {
218 | "System.ServiceProcess.ServiceController": {
219 | "type": "Direct",
220 | "requested": "[8.0.0, )",
221 | "resolved": "8.0.0",
222 | "contentHash": "jtYVG3bpw2n/NvNnP2g/JLri0D4UtfusTvLeH6cZPNAEjJXJVGspS3wLgVvjNbm+wjaYkFgsXejMTocV1T5DIQ==",
223 | "dependencies": {
224 | "System.Diagnostics.EventLog": "8.0.0"
225 | }
226 | },
227 | "Microsoft.Win32.Registry": {
228 | "type": "Transitive",
229 | "resolved": "5.0.0",
230 | "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
231 | "dependencies": {
232 | "System.Security.AccessControl": "5.0.0",
233 | "System.Security.Principal.Windows": "5.0.0"
234 | }
235 | },
236 | "System.Diagnostics.EventLog": {
237 | "type": "Transitive",
238 | "resolved": "8.0.0",
239 | "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
240 | },
241 | "System.Security.AccessControl": {
242 | "type": "Transitive",
243 | "resolved": "6.0.1",
244 | "contentHash": "IQ4NXP/B3Ayzvw0rDQzVTYsCKyy0Jp9KI6aYcK7UnGVlR9+Awz++TIPCQtPYfLJfOpm8ajowMR09V7quD3sEHw=="
245 | },
246 | "System.Security.Principal.Windows": {
247 | "type": "Transitive",
248 | "resolved": "5.0.0",
249 | "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
250 | }
251 | }
252 | }
253 | }
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormAbout.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace GDPIControl
2 | {
3 | partial class FormAbout
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
32 | flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
33 | LL_GDPI = new System.Windows.Forms.LinkLabel();
34 | LL_WinDivert = new System.Windows.Forms.LinkLabel();
35 | flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
36 | LL_Control = new System.Windows.Forms.LinkLabel();
37 | label1 = new System.Windows.Forms.Label();
38 | L_Version = new System.Windows.Forms.Label();
39 | LL_Icons = new System.Windows.Forms.LinkLabel();
40 | pictureBox1 = new System.Windows.Forms.PictureBox();
41 | tableLayoutPanel1.SuspendLayout();
42 | flowLayoutPanel2.SuspendLayout();
43 | flowLayoutPanel1.SuspendLayout();
44 | ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
45 | SuspendLayout();
46 | //
47 | // tableLayoutPanel1
48 | //
49 | tableLayoutPanel1.AutoSize = true;
50 | tableLayoutPanel1.ColumnCount = 2;
51 | tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
52 | tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
53 | tableLayoutPanel1.Controls.Add(flowLayoutPanel2, 1, 1);
54 | tableLayoutPanel1.Controls.Add(flowLayoutPanel1, 1, 0);
55 | tableLayoutPanel1.Controls.Add(pictureBox1, 0, 0);
56 | tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
57 | tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
58 | tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
59 | tableLayoutPanel1.Name = "tableLayoutPanel1";
60 | tableLayoutPanel1.RowCount = 2;
61 | tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
62 | tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
63 | tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
64 | tableLayoutPanel1.Size = new System.Drawing.Size(384, 126);
65 | tableLayoutPanel1.TabIndex = 0;
66 | //
67 | // flowLayoutPanel2
68 | //
69 | flowLayoutPanel2.AutoSize = true;
70 | flowLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
71 | flowLayoutPanel2.Controls.Add(LL_GDPI);
72 | flowLayoutPanel2.Controls.Add(LL_WinDivert);
73 | flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
74 | flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
75 | flowLayoutPanel2.Location = new System.Drawing.Point(64, 81);
76 | flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
77 | flowLayoutPanel2.Name = "flowLayoutPanel2";
78 | flowLayoutPanel2.Size = new System.Drawing.Size(316, 42);
79 | flowLayoutPanel2.TabIndex = 1;
80 | flowLayoutPanel2.WrapContents = false;
81 | //
82 | // LL_GDPI
83 | //
84 | LL_GDPI.AutoSize = true;
85 | LL_GDPI.LinkArea = new System.Windows.Forms.LinkArea(0, 10);
86 | LL_GDPI.Location = new System.Drawing.Point(4, 0);
87 | LL_GDPI.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
88 | LL_GDPI.Name = "LL_GDPI";
89 | LL_GDPI.Size = new System.Drawing.Size(139, 21);
90 | LL_GDPI.TabIndex = 3;
91 | LL_GDPI.TabStop = true;
92 | LL_GDPI.Text = "GoodbyeDPI by ValdikSS";
93 | LL_GDPI.UseCompatibleTextRendering = true;
94 | LL_GDPI.LinkClicked += LL_GDPI_LinkClicked;
95 | //
96 | // LL_WinDivert
97 | //
98 | LL_WinDivert.AutoSize = true;
99 | LL_WinDivert.LinkArea = new System.Windows.Forms.LinkArea(0, 9);
100 | LL_WinDivert.Location = new System.Drawing.Point(4, 21);
101 | LL_WinDivert.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
102 | LL_WinDivert.Name = "LL_WinDivert";
103 | LL_WinDivert.Size = new System.Drawing.Size(117, 21);
104 | LL_WinDivert.TabIndex = 3;
105 | LL_WinDivert.TabStop = true;
106 | LL_WinDivert.Text = "WinDivert by basil00";
107 | LL_WinDivert.UseCompatibleTextRendering = true;
108 | LL_WinDivert.LinkClicked += LL_WinDivert_LinkClicked;
109 | //
110 | // flowLayoutPanel1
111 | //
112 | flowLayoutPanel1.AutoSize = true;
113 | flowLayoutPanel1.Controls.Add(LL_Control);
114 | flowLayoutPanel1.Controls.Add(label1);
115 | flowLayoutPanel1.Controls.Add(L_Version);
116 | flowLayoutPanel1.Controls.Add(LL_Icons);
117 | flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
118 | flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
119 | flowLayoutPanel1.Location = new System.Drawing.Point(64, 3);
120 | flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
121 | flowLayoutPanel1.Name = "flowLayoutPanel1";
122 | flowLayoutPanel1.Size = new System.Drawing.Size(316, 72);
123 | flowLayoutPanel1.TabIndex = 1;
124 | flowLayoutPanel1.WrapContents = false;
125 | //
126 | // LL_Control
127 | //
128 | LL_Control.AutoSize = true;
129 | LL_Control.LinkArea = new System.Windows.Forms.LinkArea(0, 11);
130 | LL_Control.Location = new System.Drawing.Point(4, 0);
131 | LL_Control.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
132 | LL_Control.Name = "LL_Control";
133 | LL_Control.Size = new System.Drawing.Size(139, 21);
134 | LL_Control.TabIndex = 3;
135 | LL_Control.TabStop = true;
136 | LL_Control.Text = "GDPIControl by Virenbar";
137 | LL_Control.UseCompatibleTextRendering = true;
138 | LL_Control.LinkClicked += LL_Control_LinkClicked;
139 | //
140 | // label1
141 | //
142 | label1.AutoSize = true;
143 | label1.Location = new System.Drawing.Point(4, 21);
144 | label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
145 | label1.Name = "label1";
146 | label1.Size = new System.Drawing.Size(269, 15);
147 | label1.TabIndex = 2;
148 | label1.Text = "Small tray application for controlling GoodbyeDPI";
149 | //
150 | // L_Version
151 | //
152 | L_Version.AutoSize = true;
153 | L_Version.Location = new System.Drawing.Point(4, 36);
154 | L_Version.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
155 | L_Version.Name = "L_Version";
156 | L_Version.Size = new System.Drawing.Size(14, 15);
157 | L_Version.TabIndex = 3;
158 | L_Version.Text = "V";
159 | //
160 | // LL_Icons
161 | //
162 | LL_Icons.AutoSize = true;
163 | LL_Icons.LinkArea = new System.Windows.Forms.LinkArea(9, 6);
164 | LL_Icons.Location = new System.Drawing.Point(4, 51);
165 | LL_Icons.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
166 | LL_Icons.Name = "LL_Icons";
167 | LL_Icons.Size = new System.Drawing.Size(88, 21);
168 | LL_Icons.TabIndex = 4;
169 | LL_Icons.TabStop = true;
170 | LL_Icons.Text = "Icons by Icons8";
171 | LL_Icons.UseCompatibleTextRendering = true;
172 | LL_Icons.LinkClicked += LL_Icons_LinkClicked;
173 | //
174 | // pictureBox1
175 | //
176 | pictureBox1.Image = Properties.Resources.GDPI;
177 | pictureBox1.Location = new System.Drawing.Point(4, 3);
178 | pictureBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
179 | pictureBox1.Name = "pictureBox1";
180 | pictureBox1.Padding = new System.Windows.Forms.Padding(10, 10, 10, 10);
181 | pictureBox1.Size = new System.Drawing.Size(52, 52);
182 | pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
183 | pictureBox1.TabIndex = 1;
184 | pictureBox1.TabStop = false;
185 | //
186 | // FormAbout
187 | //
188 | AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
189 | AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
190 | BackColor = System.Drawing.Color.FromArgb(250, 250, 250);
191 | ClientSize = new System.Drawing.Size(384, 211);
192 | Controls.Add(tableLayoutPanel1);
193 | Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
194 | MaximizeBox = false;
195 | MaximumSize = new System.Drawing.Size(400, 250);
196 | MinimizeBox = false;
197 | MinimumSize = new System.Drawing.Size(300, 201);
198 | Name = "FormAbout";
199 | ShowIcon = false;
200 | ShowInTaskbar = false;
201 | StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
202 | Text = "About GDPIControl";
203 | tableLayoutPanel1.ResumeLayout(false);
204 | tableLayoutPanel1.PerformLayout();
205 | flowLayoutPanel2.ResumeLayout(false);
206 | flowLayoutPanel2.PerformLayout();
207 | flowLayoutPanel1.ResumeLayout(false);
208 | flowLayoutPanel1.PerformLayout();
209 | ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
210 | ResumeLayout(false);
211 | PerformLayout();
212 | }
213 |
214 | #endregion
215 |
216 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
217 | private System.Windows.Forms.PictureBox pictureBox1;
218 | private System.Windows.Forms.Label label1;
219 | private System.Windows.Forms.Label L_Version;
220 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
221 | private System.Windows.Forms.LinkLabel LL_GDPI;
222 | private System.Windows.Forms.LinkLabel LL_WinDivert;
223 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
224 | private System.Windows.Forms.LinkLabel LL_Control;
225 | private System.Windows.Forms.LinkLabel LL_Icons;
226 | }
227 | }
--------------------------------------------------------------------------------
/GDPIControl/GDPI/licenses/LICENSE-goodbyedpi.txt:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/GDPIControl/Forms/FormBlacklist.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace GDPIControl
2 | {
3 | partial class FormBlacklist
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
32 | PB = new System.Windows.Forms.ProgressBar();
33 | L_Done = new System.Windows.Forms.Label();
34 | L_Size = new System.Windows.Forms.Label();
35 | RB_AZ = new System.Windows.Forms.RadioButton();
36 | flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
37 | label2 = new System.Windows.Forms.Label();
38 | RB_AZ1 = new System.Windows.Forms.RadioButton();
39 | RB_AZ2 = new System.Windows.Forms.RadioButton();
40 | label3 = new System.Windows.Forms.Label();
41 | RB_AF = new System.Windows.Forms.RadioButton();
42 | B_Download = new System.Windows.Forms.Button();
43 | label1 = new System.Windows.Forms.Label();
44 | flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
45 | tableLayoutPanel1.SuspendLayout();
46 | flowLayoutPanel1.SuspendLayout();
47 | flowLayoutPanel2.SuspendLayout();
48 | SuspendLayout();
49 | //
50 | // tableLayoutPanel1
51 | //
52 | tableLayoutPanel1.AutoSize = true;
53 | tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
54 | tableLayoutPanel1.ColumnCount = 2;
55 | tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
56 | tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
57 | tableLayoutPanel1.Controls.Add(PB, 0, 0);
58 | tableLayoutPanel1.Controls.Add(L_Done, 0, 1);
59 | tableLayoutPanel1.Controls.Add(L_Size, 1, 1);
60 | tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
61 | tableLayoutPanel1.Location = new System.Drawing.Point(0, 97);
62 | tableLayoutPanel1.Name = "tableLayoutPanel1";
63 | tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(5);
64 | tableLayoutPanel1.RowCount = 2;
65 | tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
66 | tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
67 | tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 23F));
68 | tableLayoutPanel1.Size = new System.Drawing.Size(384, 54);
69 | tableLayoutPanel1.TabIndex = 0;
70 | //
71 | // PB
72 | //
73 | tableLayoutPanel1.SetColumnSpan(PB, 2);
74 | PB.Dock = System.Windows.Forms.DockStyle.Top;
75 | PB.Location = new System.Drawing.Point(8, 8);
76 | PB.Name = "PB";
77 | PB.Size = new System.Drawing.Size(368, 23);
78 | PB.TabIndex = 0;
79 | //
80 | // L_Done
81 | //
82 | L_Done.AutoSize = true;
83 | L_Done.Location = new System.Drawing.Point(8, 34);
84 | L_Done.Name = "L_Done";
85 | L_Done.Size = new System.Drawing.Size(12, 15);
86 | L_Done.TabIndex = 1;
87 | L_Done.Text = "_";
88 | //
89 | // L_Size
90 | //
91 | L_Size.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
92 | L_Size.AutoSize = true;
93 | L_Size.Location = new System.Drawing.Point(364, 34);
94 | L_Size.Name = "L_Size";
95 | L_Size.Size = new System.Drawing.Size(12, 15);
96 | L_Size.TabIndex = 1;
97 | L_Size.Text = "_";
98 | //
99 | // RB_AZ
100 | //
101 | RB_AZ.AutoSize = true;
102 | RB_AZ.Checked = true;
103 | RB_AZ.Location = new System.Drawing.Point(72, 3);
104 | RB_AZ.Name = "RB_AZ";
105 | RB_AZ.Size = new System.Drawing.Size(67, 19);
106 | RB_AZ.TabIndex = 1;
107 | RB_AZ.TabStop = true;
108 | RB_AZ.Text = "Original";
109 | RB_AZ.UseVisualStyleBackColor = true;
110 | //
111 | // flowLayoutPanel1
112 | //
113 | flowLayoutPanel1.AutoSize = true;
114 | flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
115 | flowLayoutPanel1.Controls.Add(label2);
116 | flowLayoutPanel1.Controls.Add(RB_AZ);
117 | flowLayoutPanel1.Controls.Add(RB_AZ1);
118 | flowLayoutPanel1.Controls.Add(RB_AZ2);
119 | flowLayoutPanel1.Controls.Add(label3);
120 | flowLayoutPanel1.Controls.Add(RB_AF);
121 | flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
122 | flowLayoutPanel1.Location = new System.Drawing.Point(0, 15);
123 | flowLayoutPanel1.Name = "flowLayoutPanel1";
124 | flowLayoutPanel1.Size = new System.Drawing.Size(384, 50);
125 | flowLayoutPanel1.TabIndex = 2;
126 | //
127 | // label2
128 | //
129 | label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
130 | label2.AutoSize = true;
131 | label2.Location = new System.Drawing.Point(3, 5);
132 | label2.Name = "label2";
133 | label2.Size = new System.Drawing.Size(63, 15);
134 | label2.TabIndex = 2;
135 | label2.Text = "AntiZapret";
136 | //
137 | // RB_AZ1
138 | //
139 | RB_AZ1.AutoSize = true;
140 | RB_AZ1.Location = new System.Drawing.Point(145, 3);
141 | RB_AZ1.Name = "RB_AZ1";
142 | RB_AZ1.Size = new System.Drawing.Size(67, 19);
143 | RB_AZ1.TabIndex = 1;
144 | RB_AZ1.TabStop = true;
145 | RB_AZ1.Text = "Mirror 1";
146 | RB_AZ1.UseVisualStyleBackColor = true;
147 | //
148 | // RB_AZ2
149 | //
150 | RB_AZ2.AutoSize = true;
151 | flowLayoutPanel1.SetFlowBreak(RB_AZ2, true);
152 | RB_AZ2.Location = new System.Drawing.Point(218, 3);
153 | RB_AZ2.Name = "RB_AZ2";
154 | RB_AZ2.Size = new System.Drawing.Size(67, 19);
155 | RB_AZ2.TabIndex = 1;
156 | RB_AZ2.TabStop = true;
157 | RB_AZ2.Text = "Mirror 2";
158 | RB_AZ2.UseVisualStyleBackColor = true;
159 | //
160 | // label3
161 | //
162 | label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
163 | label3.AutoSize = true;
164 | label3.Location = new System.Drawing.Point(3, 30);
165 | label3.Name = "label3";
166 | label3.Size = new System.Drawing.Size(51, 15);
167 | label3.TabIndex = 2;
168 | label3.Text = "antifilter";
169 | //
170 | // RB_AF
171 | //
172 | RB_AF.AutoSize = true;
173 | RB_AF.Location = new System.Drawing.Point(60, 28);
174 | RB_AF.Name = "RB_AF";
175 | RB_AF.Size = new System.Drawing.Size(67, 19);
176 | RB_AF.TabIndex = 1;
177 | RB_AF.TabStop = true;
178 | RB_AF.Text = "Original";
179 | RB_AF.UseVisualStyleBackColor = true;
180 | //
181 | // B_Download
182 | //
183 | B_Download.AutoSize = true;
184 | B_Download.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
185 | B_Download.Location = new System.Drawing.Point(308, 3);
186 | B_Download.Name = "B_Download";
187 | B_Download.Padding = new System.Windows.Forms.Padding(1);
188 | B_Download.Size = new System.Drawing.Size(73, 27);
189 | B_Download.TabIndex = 3;
190 | B_Download.Text = "Download";
191 | B_Download.UseVisualStyleBackColor = true;
192 | B_Download.Click += B_Download_Click;
193 | //
194 | // label1
195 | //
196 | label1.AutoSize = true;
197 | label1.Dock = System.Windows.Forms.DockStyle.Top;
198 | label1.Location = new System.Drawing.Point(0, 0);
199 | label1.Name = "label1";
200 | label1.Size = new System.Drawing.Size(92, 15);
201 | label1.TabIndex = 4;
202 | label1.Text = "Blacklist Source:";
203 | //
204 | // flowLayoutPanel2
205 | //
206 | flowLayoutPanel2.AutoSize = true;
207 | flowLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
208 | flowLayoutPanel2.Controls.Add(B_Download);
209 | flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
210 | flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
211 | flowLayoutPanel2.Location = new System.Drawing.Point(0, 64);
212 | flowLayoutPanel2.Name = "flowLayoutPanel2";
213 | flowLayoutPanel2.Size = new System.Drawing.Size(384, 33);
214 | flowLayoutPanel2.TabIndex = 2;
215 | //
216 | // FormBlacklist
217 | //
218 | AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
219 | AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
220 | BackColor = System.Drawing.Color.FromArgb(250, 250, 250);
221 | ClientSize = new System.Drawing.Size(384, 151);
222 | Controls.Add(flowLayoutPanel1);
223 | Controls.Add(label1);
224 | Controls.Add(flowLayoutPanel2);
225 | Controls.Add(tableLayoutPanel1);
226 | ForeColor = System.Drawing.Color.Black;
227 | Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
228 | MaximizeBox = false;
229 | MaximumSize = new System.Drawing.Size(639, 202);
230 | MinimizeBox = false;
231 | MinimumSize = new System.Drawing.Size(400, 190);
232 | Name = "FormBlacklist";
233 | ShowIcon = false;
234 | ShowInTaskbar = false;
235 | StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
236 | Text = "Blacklist Download";
237 | FormClosed += FormBlacklist_FormClosed;
238 | tableLayoutPanel1.ResumeLayout(false);
239 | tableLayoutPanel1.PerformLayout();
240 | flowLayoutPanel1.ResumeLayout(false);
241 | flowLayoutPanel1.PerformLayout();
242 | flowLayoutPanel2.ResumeLayout(false);
243 | flowLayoutPanel2.PerformLayout();
244 | ResumeLayout(false);
245 | PerformLayout();
246 | }
247 |
248 | #endregion
249 |
250 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
251 | private System.Windows.Forms.ProgressBar PB;
252 | private System.Windows.Forms.Label L_Done;
253 | private System.Windows.Forms.Label L_Size;
254 | private System.Windows.Forms.RadioButton RB_AZ;
255 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
256 | private System.Windows.Forms.RadioButton RB_AF;
257 | private System.Windows.Forms.Button B_Download;
258 | private System.Windows.Forms.Label label1;
259 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
260 | private System.Windows.Forms.RadioButton RB_AZ1;
261 | private System.Windows.Forms.RadioButton RB_AZ2;
262 | private System.Windows.Forms.Label label2;
263 | private System.Windows.Forms.Label label3;
264 | }
265 | }
--------------------------------------------------------------------------------
/GDPIControl/Model/GDPISettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Net.Sockets;
4 | using System.Runtime.CompilerServices;
5 | using System.Text;
6 |
7 | namespace GDPIControl.Model
8 | {
9 | public class GDPISettings : INotifyPropertyChanged, ICloneable
10 | {
11 | public GDPISettings()
12 | {
13 | DNS_Port = "53";
14 | DNS6_Port = "53";
15 | FakeResend_V = 1;
16 | MP_V = 1200;
17 | }
18 |
19 | #region P
20 | private bool _P;
21 |
22 | public bool P
23 | {
24 | get => _P;
25 | set
26 | {
27 | if (_P == value) { return; }
28 | _P = value;
29 | NotifyPropertyChanged();
30 | }
31 | }
32 |
33 | #endregion P
34 |
35 | #region Q
36 | private bool _Q;
37 |
38 | public bool Q
39 | {
40 | get => _Q;
41 | set
42 | {
43 | if (_Q == value) { return; }
44 | _Q = value;
45 | NotifyPropertyChanged();
46 | }
47 | }
48 |
49 | #endregion Q
50 |
51 | #region R
52 | private bool _R;
53 |
54 | public bool R
55 | {
56 | get => _R;
57 | set
58 | {
59 | if (_R == value) { return; }
60 | _R = value;
61 | NotifyPropertyChanged();
62 | }
63 | }
64 |
65 | #endregion R
66 |
67 | #region S
68 | private bool _S;
69 |
70 | public bool S
71 | {
72 | get => _S;
73 | set
74 | {
75 | if (_S == value) { return; }
76 | _S = value;
77 | NotifyPropertyChanged();
78 | }
79 | }
80 |
81 | #endregion S
82 |
83 | #region M
84 | private bool _M;
85 |
86 | public bool M
87 | {
88 | get => _M;
89 | set
90 | {
91 | if (_M == value) { return; }
92 | _M = value;
93 | NotifyPropertyChanged();
94 | }
95 | }
96 |
97 | #endregion M
98 |
99 | #region F
100 | private bool _F;
101 | private int _F_V;
102 |
103 | public bool F
104 | {
105 | get => _F;
106 | set
107 | {
108 | if (_F == value) { return; }
109 | _F = value;
110 | NotifyPropertyChanged();
111 | }
112 | }
113 |
114 | public int F_V
115 | {
116 | get => _F_V;
117 | set
118 | {
119 | if (_F_V == value) { return; }
120 | _F_V = value;
121 | NotifyPropertyChanged();
122 | }
123 | }
124 |
125 | #endregion F
126 |
127 | #region K
128 | private bool _K;
129 | private int _K_V;
130 |
131 | public bool K
132 | {
133 | get => _K;
134 | set
135 | {
136 | if (_K == value) { return; }
137 | _K = value;
138 | NotifyPropertyChanged();
139 | }
140 | }
141 |
142 | public int K_V
143 | {
144 | get => _K_V;
145 | set
146 | {
147 | if (_K_V == value) { return; }
148 | _K_V = value;
149 | NotifyPropertyChanged();
150 | }
151 | }
152 |
153 | #endregion K
154 |
155 | #region N
156 | private bool _N;
157 |
158 | public bool N
159 | {
160 | get => _N;
161 | set
162 | {
163 | if (_N == value) { return; }
164 | _N = value;
165 | NotifyPropertyChanged();
166 | }
167 | }
168 |
169 | #endregion N
170 |
171 | #region E
172 | private bool _E;
173 | private int _E_V;
174 |
175 | public bool E
176 | {
177 | get => _E;
178 | set
179 | {
180 | if (_E == value) { return; }
181 | _E = value;
182 | NotifyPropertyChanged();
183 | }
184 | }
185 |
186 | public int E_V
187 | {
188 | get => _E_V;
189 | set
190 | {
191 | if (_E_V == value) { return; }
192 | _E_V = value;
193 | NotifyPropertyChanged();
194 | }
195 | }
196 |
197 | #endregion E
198 |
199 | #region A
200 | private bool _A;
201 |
202 | public bool A
203 | {
204 | get => _A;
205 | set
206 | {
207 | if (_A == value) { return; }
208 | _A = value;
209 | NotifyPropertyChanged();
210 | }
211 | }
212 |
213 | #endregion A
214 |
215 | #region W
216 | private bool _W;
217 |
218 | public bool W
219 | {
220 | get => _W;
221 | set
222 | {
223 | if (_W == value) { return; }
224 | _W = value;
225 | NotifyPropertyChanged();
226 | }
227 | }
228 |
229 | #endregion W
230 |
231 | #region DNS
232 | private bool _DNS_State;
233 | private string _DNS_Addr;
234 | private string _DNS_Port;
235 |
236 | public bool DNS_State
237 | {
238 | get => _DNS_State;
239 | set
240 | {
241 | if (_DNS_State == value) { return; }
242 | _DNS_State = value;
243 | NotifyPropertyChanged();
244 | }
245 | }
246 |
247 | public string DNS_Addr
248 | {
249 | get => _DNS_Addr; set
250 | {
251 | if (_DNS_Addr == value) { return; }
252 | _DNS_Addr = value;
253 | NotifyPropertyChanged();
254 | }
255 | }
256 |
257 | public string DNS_Port
258 | {
259 | get => _DNS_Port; set
260 | {
261 | if (_DNS_Port == value) { return; }
262 | _DNS_Port = value;
263 | NotifyPropertyChanged();
264 | }
265 | }
266 |
267 | #endregion DNS
268 |
269 | #region DNS6
270 | private bool _DNS6_State;
271 | private string _DNS6_Addr;
272 | private string _DNS6_Port;
273 |
274 | public bool DNS6_State
275 | {
276 | get => _DNS6_State;
277 | set
278 | {
279 | if (_DNS6_State == value) { return; }
280 | _DNS6_State = value;
281 | NotifyPropertyChanged();
282 | }
283 | }
284 |
285 | public string DNS6_Addr
286 | {
287 | get => _DNS6_Addr; set
288 | {
289 | if (_DNS6_Addr == value) { return; }
290 | _DNS6_Addr = value;
291 | NotifyPropertyChanged();
292 | }
293 | }
294 |
295 | public string DNS6_Port
296 | {
297 | get => _DNS6_Port; set
298 | {
299 | if (_DNS6_Port == value) { return; }
300 | _DNS6_Port = value;
301 | NotifyPropertyChanged();
302 | }
303 | }
304 |
305 | #endregion DNS6
306 |
307 | #region AllowNoSNI
308 | private bool _SNI;
309 |
310 | public bool SNI
311 | {
312 | get => _SNI;
313 | set
314 | {
315 | if (_SNI == value) { return; }
316 | _SNI = value;
317 | NotifyPropertyChanged();
318 | }
319 | }
320 |
321 | #endregion AllowNoSNI
322 |
323 | #region SetTTL
324 | private bool _STTL;
325 | private int _STTL_V;
326 |
327 | public bool STTL
328 | {
329 | get => _STTL;
330 | set
331 | {
332 | if (_STTL == value) { return; }
333 | _STTL = value;
334 | NotifyPropertyChanged();
335 | }
336 | }
337 |
338 | public int STTL_V
339 | {
340 | get => _STTL_V; set
341 | {
342 | if (_STTL_V == value) { return; }
343 | _STTL_V = value;
344 | NotifyPropertyChanged();
345 | }
346 | }
347 |
348 | #endregion SetTTL
349 |
350 | #region AutoTTL
351 | private bool _ATTL;
352 |
353 | public bool ATTL
354 | {
355 | get => _ATTL;
356 | set
357 | {
358 | if (_ATTL == value) { return; }
359 | _ATTL = value;
360 | NotifyPropertyChanged();
361 | }
362 | }
363 |
364 | #endregion AutoTTL
365 |
366 | #region MinTTL
367 | private bool _MTTL;
368 | private int _MTTL_V;
369 |
370 | public bool MTTL
371 | {
372 | get => _MTTL;
373 | set
374 | {
375 | if (_MTTL == value) { return; }
376 | _MTTL = value;
377 | NotifyPropertyChanged();
378 | }
379 | }
380 |
381 | public int MTTL_V
382 | {
383 | get => _MTTL_V;
384 | set
385 | {
386 | if (_MTTL_V == value) { return; }
387 | _MTTL_V = value;
388 | NotifyPropertyChanged();
389 | }
390 | }
391 |
392 | #endregion MinTTL
393 |
394 | #region WrongCheckSum
395 | private bool _ChkSum;
396 |
397 | public bool ChkSum
398 | {
399 | get => _ChkSum;
400 | set
401 | {
402 | if (_ChkSum == value) { return; }
403 | _ChkSum = value;
404 | NotifyPropertyChanged();
405 | }
406 | }
407 |
408 | #endregion WrongCheckSum
409 |
410 | #region WrongSeq
411 | private bool _Seq;
412 |
413 | public bool Seq
414 | {
415 | get => _Seq;
416 | set
417 | {
418 | if (_Seq == value) { return; }
419 | _Seq = value;
420 | NotifyPropertyChanged();
421 | }
422 | }
423 |
424 | #endregion WrongSeq
425 |
426 | #region NativeFrag
427 | private bool _NFrag;
428 |
429 | public bool NFrag
430 | {
431 | get => _NFrag;
432 | set
433 | {
434 | if (_NFrag == value) { return; }
435 | _NFrag = value;
436 | NotifyPropertyChanged();
437 | }
438 | }
439 |
440 | #endregion NativeFrag
441 |
442 | #region ReverseFrag
443 | private bool _RFrag;
444 |
445 | public bool RFrag
446 | {
447 | get => _RFrag;
448 | set
449 | {
450 | if (_RFrag == value) { return; }
451 | _RFrag = value;
452 | NotifyPropertyChanged();
453 | }
454 | }
455 |
456 | #endregion ReverseFrag
457 |
458 | #region FakeFromHex
459 | private bool _FFH;
460 | private string _FFH_V;
461 |
462 | public bool FakeHex
463 | {
464 | get => _FFH;
465 | set
466 | {
467 | if (_FFH == value) { return; }
468 | _FFH = value;
469 | NotifyPropertyChanged();
470 | }
471 | }
472 |
473 | public string FakeHex_V
474 | {
475 | get => _FFH_V;
476 | set
477 | {
478 | if (_FFH_V == value) { return; }
479 | _FFH_V = value;
480 | NotifyPropertyChanged();
481 | }
482 | }
483 |
484 | #endregion FakeFromHex
485 |
486 | #region FakeGen
487 | private bool _FG;
488 | private int _FG_V;
489 |
490 | public bool FakeGen
491 | {
492 | get => _FG;
493 | set
494 | {
495 | if (_FG == value) { return; }
496 | _FG = value;
497 | NotifyPropertyChanged();
498 | }
499 | }
500 |
501 | public int FakeGen_V
502 | {
503 | get => _FG_V;
504 | set
505 | {
506 | if (_FG_V == value) { return; }
507 | _FG_V = value;
508 | NotifyPropertyChanged();
509 | }
510 | }
511 |
512 | #endregion FakeGen
513 |
514 | #region FakeResend
515 | private bool _FR;
516 | private int _FR_V;
517 |
518 | public bool FakeResend
519 | {
520 | get => _FR;
521 | set
522 | {
523 | if (_FR == value) { return; }
524 | _FR = value;
525 | NotifyPropertyChanged();
526 | }
527 | }
528 |
529 | public int FakeResend_V
530 | {
531 | get => _FR_V;
532 | set
533 | {
534 | if (_FR_V == value) { return; }
535 | _FR_V = value;
536 | NotifyPropertyChanged();
537 | }
538 | }
539 |
540 | #endregion FakeResend
541 |
542 | #region MaxPayload
543 | private bool _MP;
544 | private int _MP_V;
545 |
546 | public bool MP
547 | {
548 | get => _MP;
549 | set
550 | {
551 | if (_MP == value) { return; }
552 | _MP = value;
553 | NotifyPropertyChanged();
554 | }
555 | }
556 |
557 | public int MP_V
558 | {
559 | get => _MP_V;
560 | set
561 | {
562 | if (_MP_V == value) { return; }
563 | _MP_V = value;
564 | NotifyPropertyChanged();
565 | }
566 | }
567 |
568 | #endregion MaxPayload
569 |
570 | // -p block passive DPI
571 | // -q block QUIC/HTTP3
572 | // -r replace Host with hoSt
573 | // -s remove space between host header and its value
574 | // -m mix Host header case (test.com -> tEsT.cOm)
575 | // -f set HTTP fragmentation to value
576 | // -k enable HTTP persistent (keep-alive) fragmentation and set it to value
577 | // -n do not wait for first segment ACK when -k is enabled
578 | // -e set HTTPS fragmentation to value
579 | // -a additional space between Method and Request-URI (enables -s, may break sites)
580 | // -w try to find and parse HTTP traffic on all processed ports (not only on port 80)
581 |
582 | // --dns-addr redirect UDP DNS requests to the supplied IP address (experimental)
583 | // --dns-port redirect UDP DNS requests to the supplied port (53 by default)
584 | // --dnsv6-addr redirect UDPv6 DNS requests to the supplied IPv6 address (experimental)
585 | // --dnsv6-port redirect UDPv6 DNS requests to the supplied port (53 by default)
586 | // --dns-verb print verbose DNS redirection messages
587 |
588 | // --allow-no-sni perform circumvention if TLS SNI can't be detected with --blacklist enabled.
589 | // --set-ttl activate Fake Request Mode and send it with supplied TTL value.
590 | // DANGEROUS! May break websites in unexpected ways. Use with care.
591 | // --auto-ttl [a1-a2-m] activate Fake Request Mode, automatically detect TTL and decrease
592 | // it based on a distance. If the distance is shorter than a2, TTL is decreased
593 | // by a2. If it's longer, (a1; a2) scale is used with the distance as a weight.
594 | // If the resulting TTL is more than m(ax), set it to m.
595 | // Default (if set): --auto-ttl 1-4-10. Also sets --min-ttl 3.
596 | // --min-ttl minimum TTL distance (128/64 - TTL) for which to send Fake Request
597 | // in --set-ttl and --auto-ttl modes.
598 | // --wrong-chksum activate Fake Request Mode and send it with incorrect TCP checksum.
599 | // May not work in a VM or with some routers, but is safer than set-ttl.
600 | // --wrong-seq activate Fake Request Mode and send it with TCP SEQ/ACK in the past.
601 | // --native-frag fragment (split) the packets by sending them in smaller packets, without
602 | // shrinking the Window Size. Works faster (does not slow down the connection)
603 | // and better.
604 | // --reverse-frag fragment (split) the packets just as --native-frag, but send them in the
605 | // reversed order. Works with the websites which could not handle segmented
606 | // HTTPS TLS ClientHello (because they receive the TCP flow "combined").
607 | // --fake-from-hex Load fake packets for Fake Request Mode from HEX values(like 1234abcDEF).
608 | // This option can be supplied multiple times, in this case each fake packet
609 | // would be sent on every request in the command line argument order.
610 | // --fake-gen Generate random-filled fake packets for Fake Request Mode, value of them
611 | // (up to 30).
612 | // --fake-resend Send each fake packet value number of times.
613 | // Default: 1 (send each packet once).
614 | // --max-payload [value] packets with TCP payload data more than [value] won't be processed.
615 | // Use this option to reduce CPU usage by skipping huge amount of data
616 | // (like file transfers) in already established sessions.
617 | // May skip some huge HTTP requests from being processed.
618 | // Note: combination of --wrong-seq and --wrong-chksum generates two different fake packets.
619 |
620 | #region Properties
621 | private bool _manual;
622 | private string _arguments;
623 |
624 | public bool Manual
625 | {
626 | get => _manual;
627 | set
628 | {
629 | _manual = value;
630 | NotifyPropertyChanged();
631 | }
632 | }
633 |
634 | public string Arguments
635 | {
636 | get => _arguments;
637 | set
638 | {
639 | _arguments = value;
640 | NotifyPropertyChanged();
641 | }
642 | }
643 |
644 | #endregion Properties
645 |
646 | public object Clone() => MemberwiseClone();
647 |
648 | public string ToArguments()
649 | {
650 | var SB = new StringBuilder();
651 | if (P) { SB.Append(" -p"); }
652 | if (Q) { SB.Append(" -q"); }
653 | if (R) { SB.Append(" -r"); }
654 | if (S) { SB.Append(" -s"); }
655 | if (M) { SB.Append(" -m"); }
656 | if (F) { SB.Append($" -f {F_V}"); }
657 | if (K) { SB.Append($" -k {K_V}"); }
658 | if (N) { SB.Append(" -n"); }
659 | if (E) { SB.Append($" -e {E_V}"); }
660 | if (A) { SB.Append(" -a"); }
661 | if (W) { SB.Append(" -w"); }
662 |
663 | if (DNS_State) { SB.Append($" --dns-addr {DNS_Addr} --dns-port {DNS_Port}"); }
664 | if (DNS6_State) { SB.Append($" --dns-addr {DNS6_Addr} --dns-port {DNS6_Port}"); }
665 | if (SNI) { SB.Append(" --allow-no-sni"); }
666 | if (STTL) { SB.Append($" --set-ttl {STTL_V}"); }
667 | if (ATTL) { SB.Append(" --auto-ttl"); }
668 | if (MTTL) { SB.Append($" --min-ttl {MTTL_V}"); }
669 | if (ChkSum) { SB.Append(" --wrong-chksum"); }
670 | if (Seq) { SB.Append(" --wrong-seq"); }
671 | if (NFrag) { SB.Append(" --native-frag "); }
672 | if (RFrag) { SB.Append(" --reverse-frag "); }
673 |
674 | if (FakeHex) { SB.Append($" --fake-from-hex {FakeHex_V}"); }
675 | if (FakeGen) { SB.Append($" --fake-gen {FakeGen_V}"); }
676 | if (FakeResend) { SB.Append($" --fake-resend {FakeResend_V}"); }
677 |
678 | if (MP) { SB.Append($" --max-payload {MP_V}"); }
679 | return SB.ToString().Trim();
680 | }
681 |
682 | #region INotify
683 |
684 | protected void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
685 | {
686 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
687 | }
688 |
689 | public event PropertyChangedEventHandler PropertyChanged;
690 |
691 | #endregion INotify
692 | }
693 | }
--------------------------------------------------------------------------------