A lightweight C++ library that hooks locates graphics API methods
at runtime.
Important
You bring your own hooking library. kiero just finds the addresses.
Check MIGRATION_GUIDE.md for more details.
- DirectX 9 (kiero_d3d9.hpp)
- DirectX 10 (kiero_d3d10.hpp)
- DirectX 11 (kiero_d3d11.hpp)
- DirectX 12 (kiero_d3d12.hpp)
- OpenGL (kiero_opengl.hpp)
- Windows
- Linux
- MacOS
- Vulkan (kiero_vulkan.hpp)
- Windows
- Linux
- MacOS
- C++17
- Windows SDK (for DirectX backends)
- DirectX SDK (for DirectX backends)
- Vulkan SDK (for Vulkan backends)
#include "kiero.hpp"
#include "kiero_d3d9.hpp" // order is important!
// kiero.hpp must be included before any backend header
// also order changes implementation indices
// for example if you include kiero_d3d11.hpp before
// kiero_d3d9.hpp, then kiero::Implementation_D3D9
// will be 2 instead of 1
kiero::D3D9Output d3d9;
auto err = kiero::locate<kiero::Implementation_D3D9>(
nullptr, &d3d9
);
if (err != kiero::Error_Nil) {
// handle error
}
// d3d9.device_methods[42] is the address of
// IDirect3DDevice9::EndScene — hook it however you likeEach backend do some magic inside (check each backend cpp file for details), and results
stores in a typed output structs. The temporary
resources are released before locate returns.
The single entry point is a function template:
template<int Impl>
kiero::Error kiero::locate(void* in, void* out);Each backend provides a full specialization. Include only the headers you need — unused backends add zero overhead.
locate returns kiero::Error. Shared codes:
| Code | Meaning |
|---|---|
Error_Nil |
Success |
Error_ModuleNotFound |
Required DLL not loaded |
Error_MethodNotFound |
Export not found in DLL |
Each backend defines additional codes. Check the corresponding header for the full list.
-
Create
kiero_myapi.hpp:- Define
Implementation_MyAPI = KIERO_IMPL_FREE_SLOT - Define backend-specific errors from
Error_BaseIndex - Define your
MyAPIOutputstruct #undefand#define KIERO_IMPL_CURR_SLOT
- Define
-
Create
kiero_myapi.cpp:- Include
kiero.hpp, your header,kiero_intern.hpp - Provide
template<> kiero::locate<...>(...)
- Include
kiero v2 is licensed under the MIT License. See LICENSE for details.