{"id":13608515,"url":"https://github.com/bruhmoment21/UniversalHookX","last_synced_at":"2025-04-12T17:31:48.414Z","repository":{"id":40542506,"uuid":"503782667","full_name":"bruhmoment21/UniversalHookX","owner":"bruhmoment21","description":"Universal graphical hook for Windows apps.","archived":false,"fork":false,"pushed_at":"2024-07-31T18:26:38.000Z","size":1085,"stargazers_count":191,"open_issues_count":11,"forks_count":42,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-07T14:39:50.752Z","etag":null,"topics":["directx","graphics","hook","hooking","imgui","opengl","runtime-hooking","vulkan"],"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/bruhmoment21.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}},"created_at":"2022-06-15T13:42:42.000Z","updated_at":"2024-10-29T17:39:31.000Z","dependencies_parsed_at":"2024-11-07T14:33:56.301Z","dependency_job_id":"beb66ad1-7ec6-4e6d-ba7d-99cc836aabee","html_url":"https://github.com/bruhmoment21/UniversalHookX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruhmoment21%2FUniversalHookX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruhmoment21%2FUniversalHookX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruhmoment21%2FUniversalHookX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruhmoment21%2FUniversalHookX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bruhmoment21","download_url":"https://codeload.github.com/bruhmoment21/UniversalHookX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248605130,"owners_count":21132117,"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":["directx","graphics","hook","hooking","imgui","opengl","runtime-hooking","vulkan"],"created_at":"2024-08-01T19:01:27.866Z","updated_at":"2025-04-12T17:31:44.780Z","avatar_url":"https://github.com/bruhmoment21.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# UniversalHookX ![C++](https://img.shields.io/badge/language-C%2B%2B-%23f34b7d.svg) ![Windows](https://img.shields.io/badge/platform-Windows-0078d7.svg)\nUniversal graphical hook for Windows apps, although it should work on [Linux](https://user-images.githubusercontent.com/53657322/176435063-c1511ee4-462c-47f2-9f3a-1cc983c73310.png) too if you implement it correctly, that will display an [ImGui Demo Window](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/menu/menu.cpp#L24) as an example.\n\n## Usage\nCall `Utils::SetRenderingBackend(eRenderingBackend)` in DllMain as shown [here](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/dllmain.cpp#L19).\nYou must do this or the DLL won't know what to hook or how to hook. [What is eRenderingBackend?](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/utils/utils.hpp#L3). To enable or disable a specific backend comment backends in [backend.hpp](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/backend.hpp)\n\n## Purpose\nThe purpose of this library is to show how to hook different backends to display ImGui, the code should be easy to understand as I tried to make everything seem almost the same, see [backends folder](https://github.com/bruhmoment21/UniversalHookX/tree/main/UniversalHookX/src/hooks/backend).\n\n## Supported Backends\n- [x] DirectX9 + DirectX9Ex\n- [x] DirectX10\n- [x] DirectX11\n- [x] DirectX12\n- [x] OpenGL\n- [x] Vulkan\n\n# How it works\n## DirectX\nWe create a 'dummy device' and a 'dummy swapchain' (for DirectX10 and higher) with a handle to the [console window](https://docs.microsoft.com/en-us/windows/console/getconsolewindow). See the `CreateDeviceD3DX` function in every DirectX backend. [See DX12 example 'CreateDeviceD3D12'](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/hooks/backend/dx12/hook_directx12.cpp#L43-L72). The point is to get a pointer to the vTable to get the required functions addresses. We release it right after getting the pointers because we won't use our 'dummy device' and 'dummy swapchain' for drawing. [See code used in DX12 backend hook.](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/hooks/backend/dx12/hook_directx12.cpp#L195-L259)\n## OpenGL\nWe hook wglSwapBuffers which is an exported function in opengl32.dll. [See code used in OpenGL backend hook.](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/hooks/backend/opengl/hook_opengl.cpp#L39-L56)\n## Vulkan\nWe create a 'dummy device' to get the required functions addresses. The point is to hook into [vkQueuePresentKHR](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueuePresentKHR.html) where we will submit the queue with our data from our command pool and our command buffer. [See code used in Vulkan backend hook.](https://github.com/bruhmoment21/UniversalHookX/blob/main/UniversalHookX/src/hooks/backend/vulkan/hook_vulkan.cpp#L314-L349)\n\n# Media\n## DirectX9 32bit\n![image](https://user-images.githubusercontent.com/53657322/173915161-0c683d0f-7a50-4272-ad4d-3b4e1aaa7939.png)\n![image](https://user-images.githubusercontent.com/53657322/173915463-4d19c09c-ab47-443c-9efa-2af49decd3aa.png)\n## DirectX10 32bit\n![image](https://user-images.githubusercontent.com/53657322/173996412-d842d04c-6ed9-4cd8-87b3-e83fca8dfabe.png)\n## DirectX11 64bit\n![image](https://user-images.githubusercontent.com/53657322/173915680-598f9a9c-9f63-457d-a9dd-ee5b04da1f31.png)\n## DirectX12 64bit\n![image](https://user-images.githubusercontent.com/53657322/173922887-f56629da-58bd-4ce6-b818-211c74cad6ab.png)\n## OpenGL 32bit + 64bit\n![image](https://user-images.githubusercontent.com/53657322/174028360-a59d71e8-de1a-4e79-8df4-8dd40b10775e.png)\n![image](https://user-images.githubusercontent.com/53657322/174029463-a7e24813-850b-4261-86b7-4c26fb18a34b.png)\n## Vulkan 32bit + 64bit\n![image](https://user-images.githubusercontent.com/53657322/175804247-681dd228-5d18-462a-82e4-bd9eab90bdcb.png)\n![image](https://user-images.githubusercontent.com/53657322/176169557-d278097a-2e1e-40a1-ac07-2d87865ab363.png)\n\n# Other\nFeel free to open an issue if something isn't working. Input handling is left for the user because there is no general solution.\n\n## Known issues\nTip: Try pressing the \"Home\" key, that will rehook graphics, and see if anything changed.\n- **[!] Conflicts with other overlays such as MSI Afterburner and will probably crash.**\n- [Vulkan] Games or apps that present from a queue that doesn't support GRAPHICS_BIT may have issues such as artifacts and menu jittering. (Example: DOOM Eternal)\n- ~~[Vulkan] Portal 2 will crash if injected while Valve intro is playing.~~\n- [OpenGL] [Minecraft (tested on 1.19) - ui textures glitched sometimes.](https://user-images.githubusercontent.com/53657322/174030423-aa92e780-057e-451d-9d60-ddd20f668d03.png)\n\n## Dependencies\n[MinHook](https://github.com/TsudaKageyu/minhook) - TsudaKageyu - Used for hooking (trampoline method).  \n[ImGui](https://github.com/ocornut/imgui) - ocornut - self-explanatory.  \n[Vulkan SDK](https://vulkan.lunarg.com/) - for the Vulkan API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruhmoment21%2FUniversalHookX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbruhmoment21%2FUniversalHookX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruhmoment21%2FUniversalHookX/lists"}