Configuration Options for Zapret's Game Filter Mode: Complete Setup Guide

Zapret's Game Filter provides four configuration modes—Disable (0), TCP & UDP (1), TCP only (2), and UDP only (3)—that control which high-range ports (1024-65535) the WinDivert DPI bypass driver inspects, managed through the service.bat interactive menu or manual flag file editing.

The Flowseal/zapret-discord-youtube repository includes a specialized Game Filter feature that fine-tunes traffic interception for gaming and high-port services. Understanding the configuration options for Zapret's Game Filter mode allows you to optimize the bypass for specific transport protocols without affecting standard web browsing.

Available Game Filter Modes

Zapret implements the Game Filter as a lightweight toggle in service.bat that modifies the port range and protocol inspection rules passed to WinDivert. The filter supports four distinct modes:

  • Mode 0 – Disable: No game filtering is applied. The utils\game_filter.enabled flag file is removed, and Zapret operates as a standard DPI bypass without inspecting high-range ports.
  • Mode 1 – TCP & UDP: Inspects both TCP and UDP traffic on ports 1024-65535. The flag file contains the value all.
  • Mode 2 – TCP only: Filters only TCP traffic on ports 1024-65535, leaving UDP untouched. The flag file contains the value tcp.
  • Mode 3 – UDP only: Filters only UDP traffic on ports 1024-65535, leaving TCP untouched. The flag file contains the value udp.

When enabled, these modes direct the WinDivert driver to inspect traffic on the ephemeral port range (1024-65535), which covers most game servers and peer-to-peer applications.

How Configuration is Stored

The Game Filter mode persists in a simple flag file system located at utils\game_filter.enabled. According to the source code in service.bat, the configuration mechanism works as follows:

  • File existence: If utils\game_filter.enabled is missing, the filter is considered disabled.
  • Content values: The first line of the file determines the mode using the strings all, tcp, or udp.
  • Default state: When disabled, internal variables GameFilter, GameFilterTCP, and GameFilterUDP are set to a harmless placeholder value of 12 (see the :game_switch_status function in service.bat).

The :game_switch_status function (lines 107-138) reads this file to set environment variables that determine how the service constructs the final WinDivert command line.

Changing Modes via the Interactive Menu

The primary method for configuring the Game Filter uses the built-in service manager. In service.bat, the interactive menu presents the Game Filter as option 4, displaying the current status via the !GameFilterStatus! variable.

To change modes interactively:

rem Run the service manager with administrative privileges
service.bat

rem Select option 4 from the menu:

# 4. Game Filter         [!GameFilterStatus!]

This launches the :game_switch subroutine (lines 47-77), which presents the four mode choices. After selection, the script automatically creates or deletes the flag file and reminds you to restart Zapret for changes to take effect.

Manual Configuration Methods

For automation or scripting scenarios, you can modify the Game Filter mode directly without using the interactive menu.

To disable the filter completely:

del /f /q "%~dp0utils\game_filter.enabled"

To enable specific filtering modes by setting the flag file contents:

rem Enable TCP & UDP (Mode 1)
echo all > "%~dp0utils\game_filter.enabled"

rem Enable TCP only (Mode 2)
echo tcp > "%~dp0utils\game_filter.enabled"

rem Enable UDP only (Mode 3)
echo udp > "%~dp0utils\game_filter.enabled"

Important: After any manual configuration change, you must restart the Zapret service for the new settings to apply:

rem Stop the running bypass
taskkill /IM winws.exe /F

rem Restart with your chosen strategy
general.bat

Implementation Details in Source Code

The configuration flows through several key components in service.bat. The :game_switch_status function (lines 107-138) handles the initial parsing:

  1. Lines 108-116: Checks for utils\game_filter.enabled; if missing, sets filter variables to 12 (disabled state).
  2. Lines 124-138: Reads the first line (%%A) into GameFilterMode and sets status text based on whether the content is all, tcp, or udp.

Later in the script (lines 302-307), these variables substitute the placeholders %%GameFilter%%, %%GameFilterTCP%%, and %%GameFilterUDP%% in the WinDivert command line construction. This substitution determines which port ranges the driver filters, allowing fine-grained control over game traffic inspection without modifying the core DPI bypass logic.

Summary

  • Four modes control the Game Filter: Disable (0), TCP & UDP (1), TCP only (2), and UDP only (3), all targeting ports 1024-65535.
  • Flag file at utils\game_filter.enabled stores the configuration using the values all, tcp, udp, or is deleted to disable.
  • Interactive management occurs through option 4 in service.bat, utilizing the :game_switch and :game_switch_status functions.
  • Variables GameFilter, GameFilterTCP, and GameFilterUDP pass configuration to WinDivert via command-line substitution at lines 302-307.
  • Restart required after any configuration change to reload the WinDivert driver with new filtering parameters.

Frequently Asked Questions

How do I know which Game Filter mode is currently active?

Check the utils\game_filter.enabled file in your Zapret installation directory. If the file does not exist, the filter is disabled (Mode 0). If it exists, open it to see all (Mode 1), tcp (Mode 2), or udp (Mode 3). Alternatively, run service.bat and look at the status displayed next to option 4 in the main menu.

Why must I restart Zapret after changing the Game Filter mode?

The configuration values are read during service initialization and passed as arguments to the WinDivert driver. Lines 302-307 of service.bat substitute these values into the command line that launches winws.exe. Changing the flag file while the service is running does not dynamically update the driver's port filtering rules, requiring a full restart to reload the configuration.

What is the difference between TCP only and UDP only modes?

TCP only (Mode 2) configures WinDivert to inspect only TCP packets on ports 1024-65535, which is useful for games that use TCP connections for matchmaking or communication while leaving UDP-based voice chat or other services unaffected. UDP only (Mode 3) does the opposite, filtering only UDP traffic on high ports for games that use UDP networking, without touching TCP-based HTTPS or other connections.

Can I use the Game Filter with custom port ranges?

No, the Game Filter configuration in service.bat uses hardcoded port ranges (1024-65535) defined in the :game_switch_status logic. The mode selection only toggles which protocols (TCP, UDP, or both) are filtered across this entire range. To filter specific individual ports, you would need to modify the filter strings directly in your chosen strategy batch file (such as general.bat) rather than using the Game Filter mode system.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →