Skip to content

Update over PyDivert to work with latest WinDivert version.

License

Notifications You must be signed in to change notification settings

xshiraori/PyDivert2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyDivert2

This isn't some shiny new project. It's more like a slightly polished version of the original PyDivert because the original author seems to have other priorities right now and the project is not up-to-date with the current version of WinDivert.

You can visit the original PyDivert repository and learn about its usage here: https://github.com/ffalcinelli/pydivert

Also, there is great documentation available: https://pythonhosted.org/pydivert/

Changes

Not much has changed in terms of usage. It's mostly the same old stuff, but I added access to the socket and flow layers, plus their data structures like events, constants, some fixes over parameters etc.

The WinDivert binaries are also updated to their latest version (2.2.2).

If you run into any issues or want to contribute, feel free to do so. Apparently, some of the features are not working, and it might take some time for me to implement all of them.

Installation and example

You can either

  • Clone this repo and directly import from it.
  • Install the original repo with pip install pydivert then change the pydivert folder with the one in this repo.

Example.py

from pydivert import WinDivert
from pydivert.consts import *

with WinDivert("true", Layer.SOCKET, 0, Flag.SNIFF | Flag.RECV_ONLY) as w:
    w.set_param(Param.QUEUE_LEN, Constants.PARAM_QUEUE_LENGTH_MAX)
    w.set_param(Param.QUEUE_SIZE, Constants.PARAM_QUEUE_SIZE_MAX)
    w.set_param(Param.QUEUE_TIME, Constants.PARAM_QUEUE_TIME_MAX)

    for packet in w:
        print(packet)

About

Update over PyDivert to work with latest WinDivert version.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages