You can use WinDivert filters to drop or intercept payloads directly in kernel mode, which significantly reduces CPU usage by preventing entire streams from being redirected to winws.
To use these filters, invoke winws with the --wf-raw-part=@filename flag. You can specify multiple partial filters by repeating this flag. These partial filters can be combined with --wf-tcp and --wf-udp flags.
Limitations:
- The WinDivert filter language does not support bit fields, shifts, or bitwise logic operations.
- Because of these limitations, filters are 'relaxed' and may allow incorrect payloads to pass through.
winws performs the final, finer-grained filtering on any payloads that pass the initial kernel-mode filter.
winws --wf-raw-part=@windivert_part.discord_media.txt --wf-raw-part=@windivert_part.stun.txt --filter-l7=stun,discord --dpi-desync=fake