Skip to content

Upgrade to Python 3 and Add Wintun Support - #3

Open
boytm wants to merge 2 commits into
masterfrom
python3-wintun-upgrade-1040062784445015949
Open

boytm wants to merge 2 commits into
masterfrom
python3-wintun-upgrade-1040062784445015949

Conversation

@boytm

@boytm boytm commented Mar 11, 2026

Copy link
Copy Markdown
Owner

This submission upgrades the minivtun-win client to Python 3 and adds support for the Wintun network interface driver.

Key changes:

  • tun.py: Complete overhaul for Python 3 compatibility. Replaced _winreg with winreg, updated print statements, and ensured correct handling of binary packet data.
  • Cryptography: Replaced the abandoned M2Crypto library with pycryptodome. Implemented compatibility layers for AES, RC4, and DES-based algorithms.
  • Wintun Integration: Introduced wintun.py, a ctypes wrapper for wintun.dll. tun.py now supports using Wintun as a high-performance alternative to the legacy TAP-Windows driver.
  • Configuration: Wintun interfaces are now automatically configured using netsh for IP and routing.
  • Metadata: Updated requirements.txt and setup.py (py2exe) for the Python 3 ecosystem.
  • Documentation: Updated README.md with installation and usage instructions for Python 3 and Wintun.

PR created automatically by Jules for task 1040062784445015949 started by @boytm

- Upgraded `tun.py` to be compatible with Python 3, including syntax changes and bytes/str handling.
- Migrated cryptographic operations from `M2Crypto` to `pycryptodome`.
- Added `wintun.py` to interface with the Wintun driver using `ctypes`.
- Integrated Wintun support into `tun.py` with a new `--wintun` flag.
- Updated `requirements.txt`, `setup.py`, and `README.md` to reflect Python 3 requirements and Wintun usage.
- Fixed several bugs related to Python 3 migration, including `subprocess` usage and TAP driver configuration.

Co-authored-by: boytm <5652342+boytm@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Completed Python 3 migration with proper bytes/str handling.
- Integrated Wintun driver support via `wintun.py` wrapper.
- Modernized CLI with `argparse` replacing legacy `getopt`.
- Migrated cryptography from `M2Crypto` to `pycryptodome`.
- Rewrote `README.md` in English with updated instructions.
- Fixed critical bugs including missing imports and type mismatches.

Co-authored-by: boytm <5652342+boytm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant