Python 2.7 Simple Extension in C++
Available commands are:
- arch.time() - prints simplified datetime
- arch.time("%Y") - prints strftime format datetime (https://www.cplusplus.com/reference/ctime/strftime/)
- arch.udp_send('80.211.XXX.XXX', 7000, 'ls') - sends commands to UDP Socket at specified IP & Port
Instalation Guide
- Install choco (PACKAGE MANAGER FOR WINDOWS)
- Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- Install Visual C++ 2008 Service Pack 1 Redistributable Package
- choco install vcredist2008
- Install .NET Framework 3.5
- choco install dotnet3.5
- Install Visual C++ Compiler Package for Python 2.7 (vcpython27) (microsoft link deprecated & deleted) (using community uploaded binary)
- Install Extension (it will build the extension and put into Python folder)
- python setup.py install
...or compile manually
- g++ -c arch.cpp udp.cpp -IC:/Python27/include -D MS_WIN64
- g++ -shared -o arch.pyd arch.o -LC:/Python27/libs -lPython27 -D MS_WIN64
Server not included, write your own. This just an example.