{"id":16606958,"url":"https://github.com/mrexodia/phnt-single-header","last_synced_at":"2025-04-04T19:08:09.997Z","repository":{"id":186092517,"uuid":"674545600","full_name":"mrexodia/phnt-single-header","owner":"mrexodia","description":"Single header version of System Informer's phnt library.","archived":false,"fork":false,"pushed_at":"2025-03-28T15:04:58.000Z","size":47,"stargazers_count":205,"open_issues_count":8,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T18:08:42.837Z","etag":null,"topics":["debugger","native","processhacker","sdk","security","systeminformer","wdk","windows","windows-internals"],"latest_commit_sha":null,"homepage":"","language":"CMake","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/mrexodia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["mrexodia"]}},"created_at":"2023-08-04T07:50:46.000Z","updated_at":"2025-03-27T21:11:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"08ab8411-1ba7-4c25-8e35-8dd9448687dd","html_url":"https://github.com/mrexodia/phnt-single-header","commit_stats":null,"previous_names":["mrexodia/phnt-single-header"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fphnt-single-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fphnt-single-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fphnt-single-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fphnt-single-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrexodia","download_url":"https://codeload.github.com/mrexodia/phnt-single-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234921,"owners_count":20905854,"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","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":["debugger","native","processhacker","sdk","security","systeminformer","wdk","windows","windows-internals"],"created_at":"2024-10-12T01:10:55.058Z","updated_at":"2025-04-04T19:08:09.958Z","avatar_url":"https://github.com/mrexodia.png","language":"CMake","funding_links":["https://github.com/sponsors/mrexodia"],"categories":[],"sub_categories":[],"readme":"# phnt-single-header\r\n\r\nThis repository automatically generates a single-header version of [System Informer](https://github.com/winsiderss/systeminformer)'s [phnt](https://github.com/winsiderss/systeminformer/tree/master/phnt) library. This repository was created because the original library is separated in many headers and can be annoying to integrate into your project.\r\n\r\n## Usage\r\n\r\nThis is a simple example of using phnt\r\n\r\n```c\r\n#define PHNT_VERSION PHNT_WIN11\r\n#include \"phnt.h\" // Instead of Windows.h\r\n\r\n// Imports for ntdll.dll\r\n#pragma comment(lib, \"ntdll.lib\")\r\n\r\nstatic char message[] = \"Hello, phnt!\\r\\n\";\r\n\r\nint main()\r\n{\r\n    IO_STATUS_BLOCK IoStatusBlock = { 0, 0 };\r\n    NtWriteFile(\r\n        NtCurrentPeb()-\u003eProcessParameters-\u003eStandardOutput,\r\n        NULL,\r\n        NULL,\r\n        NULL,\r\n        \u0026IoStatusBlock,\r\n        message,\r\n        strlen(message) - 1,\r\n        NULL,\r\n        NULL\r\n    );\r\n    return 0;\r\n}\r\n```\r\n\r\n## Download\r\n\r\n[`phnt.h`](https://github.com/mrexodia/phnt-single-header/releases/latest/download/phnt.h) (direct link to the [latest release](https://github.com/mrexodia/phnt-single-header/releases/latest)).\r\n\r\n## CMake\r\n\r\nTo quickly use this library from CMake, use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html):\r\n\r\n```cmake\r\ncmake_minimum_required(VERSION 3.24)\r\ncmake_policy(SET CMP0135 NEW)\r\nproject(phnt-example)\r\n\r\ninclude(FetchContent)\r\nset(phnt_TAG \"v1.4-ed73b907\")\r\nmessage(STATUS \"Fetching phnt (${phnt_TAG})...\")\r\nFetchContent_Declare(phnt\r\n    URL \"https://github.com/mrexodia/phnt-single-header/releases/download/${phnt_TAG}/phnt.zip\"\r\n    URL_HASH \"SHA256=a41def8d91204dc8c1d322a9d20b5fa107f99138ed0ad8bf52d6353137000dd5\"\r\n)\r\nFetchContent_MakeAvailable(phnt)\r\n\r\nadd_executable(example main.cpp)\r\ntarget_link_libraries(example PRIVATE phnt::phnt)\r\n```\r\n\r\nInstead of `FetchContent` you can also extract [`phnt.zip`](https://github.com/mrexodia/phnt-single-header/releases/latest/download/phnt.zip) to `third_party/phnt` in your project and do:\r\n\r\n```cmake\r\nadd_subdirectory(third_party/phnt)\r\n```\r\n\r\nThe target `phnt::phnt` also links to `ntdll.lib`. If you want to avoid this you can link to `phnt::headers` instead.\r\n\r\n\u003csub\u003e_Note_: The CMake project in `phnt.zip` also works as a CMake package. After configuring and installing it, you can do `find_package(phnt REQUIRED)` and everything should work out of the box.\u003c/sub\u003e\r\n\r\n## Older SDKs\r\n\r\nTo use phnt with older SDK versions, change the `PHNT_VERSION` to one of the following:\r\n\r\n```\r\n#define PHNT_VERSION PHNT_WIN2K\r\n#define PHNT_VERSION PHNT_WINXP\r\n#define PHNT_VERSION PHNT_WS03\r\n#define PHNT_VERSION PHNT_VISTA\r\n#define PHNT_VERSION PHNT_WIN7\r\n#define PHNT_VERSION PHNT_WIN8\r\n#define PHNT_VERSION PHNT_WINBLUE\r\n#define PHNT_VERSION PHNT_THRESHOLD\r\n#define PHNT_VERSION PHNT_THRESHOLD2\r\n#define PHNT_VERSION PHNT_REDSTONE\r\n#define PHNT_VERSION PHNT_REDSTONE2\r\n#define PHNT_VERSION PHNT_REDSTONE3\r\n#define PHNT_VERSION PHNT_REDSTONE4\r\n#define PHNT_VERSION PHNT_REDSTONE5\r\n#define PHNT_VERSION PHNT_19H1\r\n#define PHNT_VERSION PHNT_19H2\r\n#define PHNT_VERSION PHNT_20H1\r\n#define PHNT_VERSION PHNT_20H2\r\n#define PHNT_VERSION PHNT_21H1\r\n#define PHNT_VERSION PHNT_WIN10_21H2\r\n#define PHNT_VERSION PHNT_WIN10_22H2\r\n#define PHNT_VERSION PHNT_WIN11\r\n#define PHNT_VERSION PHNT_WIN11_22H2\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrexodia%2Fphnt-single-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrexodia%2Fphnt-single-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrexodia%2Fphnt-single-header/lists"}