Note
There are multiple ways to install the pyCTools library!
- 
Manual installation: - Clone the repository and build the DLLs yourself.
- Update the VERSIONvariable inpyCTools/__init__.pyto match your desired version for the build.
- Run the following to create the wheel file:
pip install build cd tool python setupHelper.py # Do not run `setup.py` directly, use this script instead as it handles many important things 
- The setup script will show you how to install the package locally with pip and how to create a virtual environment for testing.
 
- 
Automatic installation: Go to the releases page and select the version you wish to install, and click on it, then copy the top pipcommand that will allow you to install it [Auto installation support from v0.2.0-beta and above]
This project provides a cross-language toolkit for Windows process inspection and hardware random number generation, with both Python and C components. It includes:
- Python library (pyCTools): Easy-to-use wrappers for native DLLs to access process metrics and hardware RNG.
- C source files: Implement the DLLs for process inspection and hardware RNG.
- Example Python scripts: Demonstrate usage of the library.
- PowerShell build helper: Automates DLL compilation for x86/x64.
Important
To get the dist binary folder, choose one of the following options:
| Method | Description | Requirements | 
|---|---|---|
| Manual Build | Compile the binaries yourself using cl.exeor similar toolchains | Microsoft Visual Studio with MSVC installed | 
| Auto Build Script | Run the tool/compilerHelper.ps1PowerShell script | Visual Studio Build Tools + PowerShell | 
| Prebuilt Release Archive | Download precompiled binaries from the releases page | None, make sure to use the latest available version | 
No matter what you decide, do still read the important notice about the dist from the release OR check the Wiki page about the DLL discovery explanation.
π Project Structure (click to expand)
root/
βββ dist/                              # Release artifacts for distribution
β   βββ rawBinaryZipped/               # Prebuilt binaries files (generated by `distributionHelper.ps1`)
β   β   βββ bin.zip                    # Zipped prebuilt binaries
β   β   βββ bin.zip.sha256             # SHA256 checksum for `bin.zip`
β   βββ libraryWheel/                  # Library wheel files (generated by `setup.py`)
β       βββ *.whl                      # Python wheel files for library distribution via pip
β
βββ pyCTools/                          # Python package (library code)
β   βββ bin/                           # Auto-generated folder containing compiled DLL binaries
β   β   βββ x86/                       # 32-bit DLL builds
β   β   βββ x64/                       # 64-bit DLL builds
β   βββ __init__.py                    # Package initializer
β   βββ hwrng.py                       # Hardware RNG DLL wrapper
β   βββ processInspect.py              # Process inspection DLL wrapper
β   βββ _loadDLL.py                    # DLL loading logic used by wrappers
β   βββ setup.py                       # Setup script for building and installing the package
β
βββ tool/                              # Build and distribution tools
β   βββ compilerHelper.ps1             # Compiles C code into DLLs
β   βββ distributionHelper.ps1         # Creates `bin.zip` and SHA256 checksum
β
βββ src/                               # C source code for DLLs
β   βββ hRng.c                         # Hardware RNG implementation
β   βββ processInspect.c               # Process inspection implementation
β
βββ CMakeLists.txt                     # CMake build configuration (currently unused)
- Place the dist/folder inside thepyCToolspackage directory.
- Import and use hwrngorprocessInspectfrompyCTools.
- The library will automatically load the correct DLL based on your Python interpreter architecture (x86 or x64).
Example usages and documentation for both modules in detail can be found in the Wiki:
You can find all information in the Wiki.
Details about building the DLLs can be found in more detail here
Tip
Want to dive deeper into how everything works? Head over to the PyCTools Wiki for detailed breakdowns of the key parts:
β’ DLL explanations: learn how the DLLs are structured, discovered, and loaded
β’ Python examples, wrappers, and usage: practical code snippets and usage patterns in Python
β’ C code explanation: understand the underlying native implementation
β’ Build and distribution: how to compile, package, and distribute the libraries