{"id":30067783,"url":"https://github.com/definetlynotai/pyctools","last_synced_at":"2025-08-08T09:10:12.753Z","repository":{"id":308734670,"uuid":"1033884389","full_name":"DefinetlyNotAI/PyCTools","owner":"DefinetlyNotAI","description":"This project provides a cross-language toolkit for Windows process inspection and hardware random number generation, with both Python and C components.","archived":false,"fork":false,"pushed_at":"2025-08-07T14:21:15.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-07T16:22:51.969Z","etag":null,"topics":["c","dll","hrng","proccess-dump","process-info","process-snapshot","python","python-dll","python-lib","rng","tools"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DefinetlyNotAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-07T13:50:42.000Z","updated_at":"2025-08-07T14:21:19.000Z","dependencies_parsed_at":"2025-08-07T16:24:25.006Z","dependency_job_id":null,"html_url":"https://github.com/DefinetlyNotAI/PyCTools","commit_stats":null,"previous_names":["definetlynotai/pyctools"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DefinetlyNotAI/PyCTools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefinetlyNotAI%2FPyCTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefinetlyNotAI%2FPyCTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefinetlyNotAI%2FPyCTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefinetlyNotAI%2FPyCTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DefinetlyNotAI","download_url":"https://codeload.github.com/DefinetlyNotAI/PyCTools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefinetlyNotAI%2FPyCTools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269394669,"owners_count":24409799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","dll","hrng","proccess-dump","process-info","process-snapshot","python","python-dll","python-lib","rng","tools"],"created_at":"2025-08-08T09:10:07.884Z","updated_at":"2025-08-08T09:10:12.740Z","avatar_url":"https://github.com/DefinetlyNotAI.png","language":"C","readme":"# Project Overview\r\n\r\nThis project provides a cross-language toolkit for Windows process inspection and hardware random number generation, with both Python and C components. It includes:\r\n\r\n- **Python library (`pyCTools`)**: Easy-to-use wrappers for native DLLs to access process metrics and hardware RNG.\r\n- **C source files**: Implement the DLLs for process inspection and hardware RNG.\r\n- **Example Python scripts**: Demonstrate usage of the library.\r\n- **PowerShell build helper**: Automates DLL compilation for x86/x64.\r\n\r\n\u003e [!IMPORTANT]\r\n\u003e To get the `dist` binary folder, choose **one** of the following options:\r\n\u003e\r\n\u003e | Method                       | Description                                                                                      | Requirements                                                   |\r\n\u003e |-----------------------------|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------|\r\n\u003e | Manual Build                | Compile the binaries yourself using `cl.exe` or similar toolchains                               | Microsoft Visual Studio with MSVC installed                    |\r\n\u003e | Auto Build Script           | Run the [`tool/compilerHelper.ps1`](https://github.com/DefinetlyNotAI/PyCTools/blob/main/tool/compilerHelper.ps1) PowerShell script | Visual Studio Build Tools + PowerShell                         |\r\n\u003e | Prebuilt Release Archive    | Download precompiled binaries from the [releases page](https://github.com/DefinetlyNotAI/PyCTools/releases/tag/v1.0.0)              | None (just extract archive)                                    |\r\n\u003e\r\n\u003e No matter what you decide, do still read the important notice about the `dist` from the [release](https://github.com/DefinetlyNotAI/PyCTools/releases/tag/v1.0.0) OR check the [Wiki](https://github.com/DefinetlyNotAI/PyCTools/wiki/DLL-Discovery) page about the DLL discovery explanation.\r\n\r\n## Directory Structure\r\n\r\n\u003cdetails\u003e\r\n  \u003csummary\u003e📁 Project Structure (click to expand)\u003c/summary\u003e\r\n\r\n    example/\r\n      pyCTools/\r\n        hwrng.py           # Python wrapper for hardware RNG DLL\r\n        processInspect.py  # Python wrapper for process inspection DLL\r\n      hwrng_example.py     # Example: hardware RNG usage\r\n      process_inspect_example.py # Example: process metrics usage\r\n    src/\r\n      hRng.c               # C source for hardware RNG DLL\r\n      processInspect.c     # C source for process inspection DLL\r\n    tool/\r\n      compilerHelper.ps1   # PowerShell script to build DLLs for x86/x64\r\n    dist/\r\n      x64/                 # Compiled DLLs for 64-bit\r\n      x86/                 # Compiled DLLs for 32-bit\r\n\r\n\u003c/details\u003e\r\n\r\n## Building the DLLs\r\n\r\n1. Open PowerShell and run `tool/compilerHelper.ps1`.\r\n2. Select which `.c` files to compile.\r\n3. The script will build both x86 and x64 DLLs and place them in `dist/x86` and `dist/x64`.\r\n\r\n## Using the Python Library\r\n\r\n- Place the `dist/` folder as a sibling to your Python scripts or as described in the wrappers.\r\n- Import and use `pyCTools.hwrng` or `pyCTools.processInspect` as shown in the examples.\r\n\r\n## Example Usage\r\n\r\n**Hardware RNG:**\r\n```python\r\nfrom pyCTools.hwrng import get_hardware_random_bytes\r\nrb = get_hardware_random_bytes(16)\r\nprint(rb.hex())\r\n```\r\n\r\n**Process Inspection:**\r\n```python\r\nfrom pyCTools.processInspect import ProcessMetrics\r\nmetrics = ProcessMetrics()\r\npid = 1234  # Target PID\r\nflags = ProcessMetrics.METRIC_WORKING_SET | ProcessMetrics.METRIC_CPU_USAGE\r\nsnapshot = metrics.get_snapshot(pid, flags)\r\nprint(snapshot)\r\n```\r\n\r\n## DLL Discovery\r\n\r\nThe Python wrappers automatically search for the correct DLL in:\r\n- `./dist/{arch}/\u003cdll\u003e`\r\n- `../dist/{arch}/\u003cdll\u003e`\r\n- `../../dist/{arch}/\u003cdll\u003e`\r\n\r\nwhere `{arch}` is `x64` or `x86` depending on your Python interpreter.\r\n\r\n## Extra resources\r\n\r\n\u003e [!TIP]\r\n\u003e Want to dive deeper into how everything works? Head over to the [PyCTools Wiki](https://github.com/DefinetlyNotAI/PyCTools/wiki) for detailed breakdowns of the key parts:\r\n\u003e\r\n\u003e • **DLL explanations**: learn how the DLLs are structured, discovered, and loaded \r\n\u003e • **Python examples, wrappers, and usage**: practical code snippets and usage patterns in Python \r\n\u003e • **C code explanation**: understand the underlying native implementation\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefinetlynotai%2Fpyctools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefinetlynotai%2Fpyctools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefinetlynotai%2Fpyctools/lists"}