# xmodern54/zapret-bf architecture

> Architecture diagram of the GitHub repository xmodern54/zapret-bf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xmodern54/zapret-bf
- Repository: https://github.com/xmodern54/zapret-bf

## Overview

#### Purpose and Platform
Zapret-BF is a Windows distribution of packet-filtering launch profiles for restoring Battlefield 6 matchmaking connectivity when ISP DPI filtering interferes with game-server handshakes. It is a fork-oriented bundle, not an application with source modules: strategy scripts invoke a bundled packet-processing executable and driver.

#### User and Service Entry Points
Users launch one of the root strategy batch files, beginning with the recommended profiles:
- `General-BF (SIMPLE FAKE).bat`
- `General-BF (ALT8).bat`
- `General-BF.bat`

A selected working strategy can be installed for persistent execution through `service.bat`. The batch files are therefore the primary control plane and encapsulate differing interception/desynchronization parameters.

#### Packet Interception Runtime
The operational boundary is the bundled Windows-native runtime:
- `bin/winws.exe`
- `bin/WinDivert64.sys`
- `bin/game_filter.enabled`

`winws.exe` applies filtering and packet modification rules; the signed WinDivert driver provides kernel-level traffic capture/diversion on 64-bit Windows. This requires elevated permissions and may be flagged by endpoint security products. After the connection setup phase, traffic is intended to proceed directly rather than through a proxy or tunnel.

#### Handshake Manipulation Inputs
Strategies alter signatures of early packets for match connections so DPI permits session establishment. Reusable binary payloads support protocol-specific fake/modified handshakes:
- `bin/tls_clienthello_www_google_com.bin`
- `bin/quic_initial_www_google_com.bin`

The architecture is selective: it targets connection-establishment traffic, especially TCP/TLS/QUIC/UDP variants, rather than routing all Battlefield traffic through an intermediary.

#### Targeting Data and Strategy Matrix
Static lists scope the destinations and ports affected:
- `lists/ipset-all.txt`
- `lists/list-general.txt`
- `lists/port-bf.txt`

Root profiles provide broadly usable fake-TLS and alternate strategies. The `Debug` tree is a structured experimental matrix for Battlefield 6, separating packet filters from launcher profiles:
- `Debug/filters/wf-bf6-443.txt`
- `Debug/filters/wf-bf6-hybrid.txt`
- `Debug/profiles/General-BF (BF6 B TCP+QUIC443).bat`

This enables testing combinations of transport selection, port ranges, local/wide UDP scope, and protocol-specific handshake methods without changing the core runtime.

#### Diagnostics and Validation
Developer-oriented utilities support inspecting connectivity and validating candidate strategies:
- `Debug/net.py`
- `Debug/tools/run_handshake.py`
- `Debug/profiles-test/README.txt`

These form a separate experimentation boundary from release-ready root profiles. `build.py` likely assembles the distributable bundle, while release artifacts depend on upstream Zapret WinWS/WinDivert binaries rather than locally implemented packet-processing code.

#### External Dependencies and Boundaries
The package relies on Windows networking/kernel driver facilities and upstream binaries from `bol-van/zapret-win-bundle`. It interacts with ISP DPI behavior and Battlefield infrastructure hosted on AWS, but does not expose a web service, proxy endpoint, or game API integration. Strategy effectiveness is explicitly provider- and region-dependent.

Main entry points: [`bin/winws.exe`](https://github.com/xmodern54/zapret-bf/blob/main/bin/winws.exe) (WinWS packet processor), [`General-BF (SIMPLE FAKE).bat`](https://github.com/xmodern54/zapret-bf/blob/main/General-BF%20(SIMPLE%20FAKE).bat) (Recommended strategy profiles), [`Debug/profiles/General-BF (BF6 B TCP+QUIC443).bat`](https://github.com/xmodern54/zapret-bf/blob/main/Debug/profiles/General-BF%20(BF6%20B%20TCP%2BQUIC443).bat) (BF6 TCP+QUIC profile), [`General-BF.bat`](https://github.com/xmodern54/zapret-bf/blob/main/General-BF.bat) (General BF profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_release["Release profiles"]
  node_recommended_profiles["Recommended strategy profiles<br/>batch profiles"]
  node_general_profile["General BF profile<br/>batch profile<br/>[General-BF.bat]"]
  node_service_installer["Persistent service installer<br/>batch installer<br/>[service.bat]"]
  node_target_lists["Target IP and port lists<br/>targeting data<br/>[ipset-all.txt]"]
end

subgraph group_runtime["Packet runtime"]
  node_winws["WinWS packet processor<br/>native executable<br/>[winws.exe]"]
  node_windivert{{"WinDivert kernel driver<br/>Windows driver<br/>[WinDivert64.sys]"}}
  node_filter_switch["Game filter switch<br/>runtime flag"]
  node_tls_payload["Fake TLS ClientHello<br/>binary payload"]
  node_quic_payload["Fake QUIC Initial<br/>binary payload"]
end

subgraph group_experiment["Debug matrix"]
  node_debug_filters["BF6 packet filters<br/>filter definitions<br/>[wf-bf6-443.txt]"]
  node_debug_profile["BF6 TCP+QUIC profile<br/>experimental batch profile"]
  node_net_diagnostics["Network diagnostics<br/>Python utility<br/>[net.py]"]
  node_handshake_runner["Handshake validator<br/>Python utility<br/>[run_handshake.py]"]
  node_test_notes["Profile test notes<br/>documentation<br/>[README.txt]"]
end

node_user(("Windows user<br/>actor"))
node_dpi{{"ISP DPI filtering<br/>external network boundary"}}
node_battlefield["Battlefield infrastructure<br/>external game service"]
node_bundle_builder["Distribution builder<br/>build script<br/>[build.py]"]

node_user -->|"launches"| node_recommended_profiles
node_user -->|"launches"| node_general_profile
node_recommended_profiles -.->|"can install"| node_service_installer
node_recommended_profiles -->|"uses"| node_target_lists
node_general_profile -->|"uses"| node_target_lists
node_recommended_profiles -->|"invokes"| node_winws
node_general_profile -->|"invokes"| node_winws
node_service_installer -->|"runs persistently"| node_winws
node_winws -->|"uses for interception"| node_windivert
node_filter_switch -->|"enables game filter"| node_winws
node_tls_payload -->|"supplies fake handshake"| node_winws
node_quic_payload -->|"supplies fake handshake"| node_winws
node_winws -->|"modifies setup traffic through"| node_dpi
node_winws -->|"permits direct session traffic to"| node_battlefield
node_debug_filters -->|"parameterizes"| node_debug_profile
node_debug_profile -.->|"invokes experimentally"| node_winws
node_net_diagnostics -.->|"supports validation"| node_handshake_runner
node_handshake_runner -.->|"evaluates"| node_debug_profile
node_test_notes -.->|"documents tests for"| node_debug_profile
node_bundle_builder -->|"packages"| node_recommended_profiles
node_bundle_builder -->|"bundles upstream runtime"| node_winws

click node_recommended_profiles "https://github.com/xmodern54/zapret-bf/blob/main/General-BF%20(SIMPLE%20FAKE).bat"
click node_general_profile "https://github.com/xmodern54/zapret-bf/blob/main/General-BF.bat"
click node_service_installer "https://github.com/xmodern54/zapret-bf/blob/main/service.bat"
click node_target_lists "https://github.com/xmodern54/zapret-bf/blob/main/lists/ipset-all.txt"
click node_winws "https://github.com/xmodern54/zapret-bf/blob/main/bin/winws.exe"
click node_windivert "https://github.com/xmodern54/zapret-bf/blob/main/bin/WinDivert64.sys"
click node_filter_switch "https://github.com/xmodern54/zapret-bf/blob/main/bin/game_filter.enabled"
click node_tls_payload "https://github.com/xmodern54/zapret-bf/blob/main/bin/tls_clienthello_www_google_com.bin"
click node_quic_payload "https://github.com/xmodern54/zapret-bf/blob/main/bin/quic_initial_www_google_com.bin"
click node_debug_filters "https://github.com/xmodern54/zapret-bf/blob/main/Debug/filters/wf-bf6-443.txt"
click node_debug_profile "https://github.com/xmodern54/zapret-bf/blob/main/Debug/profiles/General-BF%20(BF6%20B%20TCP%2BQUIC443).bat"
click node_net_diagnostics "https://github.com/xmodern54/zapret-bf/blob/main/Debug/net.py"
click node_handshake_runner "https://github.com/xmodern54/zapret-bf/blob/main/Debug/tools/run_handshake.py"
click node_test_notes "https://github.com/xmodern54/zapret-bf/blob/main/Debug/profiles-test/README.txt"
click node_bundle_builder "https://github.com/xmodern54/zapret-bf/blob/main/build.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_recommended_profiles,node_general_profile,node_service_installer,node_target_lists toneBlue
class node_winws,node_windivert,node_filter_switch,node_tls_payload,node_quic_payload toneAmber
class node_debug_filters,node_debug_profile,node_net_diagnostics,node_handshake_runner,node_test_notes toneMint
class node_user,node_dpi,node_battlefield,node_bundle_builder toneNeutral
```

## Components

### Release profiles

User-facing launch and installation control plane.

- [Recommended strategy profiles](https://github.com/xmodern54/zapret-bf/blob/main/General-BF%20(SIMPLE%20FAKE).bat): batch profiles · Select fake-TLS or ALT8 packet-handling parameters. · `General-BF (SIMPLE FAKE).bat`
- [General BF profile](https://github.com/xmodern54/zapret-bf/blob/main/General-BF.bat): batch profile · `General-BF.bat`
- [Persistent service installer](https://github.com/xmodern54/zapret-bf/blob/main/service.bat): batch installer · Installs a selected strategy for persistent execution. · `service.bat`
- [Target IP and port lists](https://github.com/xmodern54/zapret-bf/blob/main/lists/ipset-all.txt): targeting data · Scopes affected Battlefield destinations and ports. · `lists/ipset-all.txt`

### Packet runtime

Native Windows interception boundary.

- [WinWS packet processor](https://github.com/xmodern54/zapret-bf/blob/main/bin/winws.exe): native executable · Applies filtering and packet-modification rules. · `bin/winws.exe`
- [WinDivert kernel driver](https://github.com/xmodern54/zapret-bf/blob/main/bin/WinDivert64.sys): Windows driver · Captures and diverts traffic on 64-bit Windows. · `bin/WinDivert64.sys`
- [Game filter switch](https://github.com/xmodern54/zapret-bf/blob/main/bin/game_filter.enabled): runtime flag · `bin/game_filter.enabled`
- [Fake TLS ClientHello](https://github.com/xmodern54/zapret-bf/blob/main/bin/tls_clienthello_www_google_com.bin): binary payload · `bin/tls_clienthello_www_google_com.bin`
- [Fake QUIC Initial](https://github.com/xmodern54/zapret-bf/blob/main/bin/quic_initial_www_google_com.bin): binary payload · `bin/quic_initial_www_google_com.bin`

### Debug matrix

Experimental filters, profiles, and validation tools.

- [BF6 packet filters](https://github.com/xmodern54/zapret-bf/blob/main/Debug/filters/wf-bf6-443.txt): filter definitions · Transport and port-selection experiments. · `Debug/filters/wf-bf6-443.txt`
- [BF6 TCP+QUIC profile](https://github.com/xmodern54/zapret-bf/blob/main/Debug/profiles/General-BF%20(BF6%20B%20TCP%2BQUIC443).bat): experimental batch profile · `Debug/profiles/General-BF (BF6 B TCP+QUIC443).bat`
- [Network diagnostics](https://github.com/xmodern54/zapret-bf/blob/main/Debug/net.py): Python utility · `Debug/net.py`
- [Handshake validator](https://github.com/xmodern54/zapret-bf/blob/main/Debug/tools/run_handshake.py): Python utility · Validates candidate handshake strategies. · `Debug/tools/run_handshake.py`
- [Profile test notes](https://github.com/xmodern54/zapret-bf/blob/main/Debug/profiles-test/README.txt): documentation · `Debug/profiles-test/README.txt`

### Other components

- **Windows user**: actor
- **ISP DPI filtering**: external network boundary · The handshake manipulation is intended to evade this filtering.
- **Battlefield infrastructure**: external game service · Receives direct traffic after connection setup.
- [Distribution builder](https://github.com/xmodern54/zapret-bf/blob/main/build.py): build script · Assembles the distributable bundle. · `build.py`

## Connections

- Windows user → Recommended strategy profiles: launches
- Windows user → General BF profile: launches
- Recommended strategy profiles → Persistent service installer: can install
- Recommended strategy profiles → Target IP and port lists: uses
- General BF profile → Target IP and port lists: uses
- Recommended strategy profiles → WinWS packet processor: invokes
- General BF profile → WinWS packet processor: invokes
- Persistent service installer → WinWS packet processor: runs persistently
- WinWS packet processor → WinDivert kernel driver: uses for interception
- Game filter switch → WinWS packet processor: enables game filter
- Fake TLS ClientHello → WinWS packet processor: supplies fake handshake
- Fake QUIC Initial → WinWS packet processor: supplies fake handshake
- WinWS packet processor → ISP DPI filtering: modifies setup traffic through
- WinWS packet processor → Battlefield infrastructure: permits direct session traffic to
- BF6 packet filters → BF6 TCP+QUIC profile: parameterizes
- BF6 TCP+QUIC profile → WinWS packet processor: invokes experimentally
- Network diagnostics → Handshake validator: supports validation
- Handshake validator → BF6 TCP+QUIC profile: evaluates
- Profile test notes → BF6 TCP+QUIC profile: documents tests for
- Distribution builder → Recommended strategy profiles: packages
- Distribution builder → WinWS packet processor: bundles upstream runtime
