Skip to content

Repository files navigation

kiero


Universal graphical hook for a D3D9-D3D12, OpenGL and Vulkan based games

Requirement

Windows SDK (For D3D9/D3D10/D3D11/OpenGL hook)

DirectX SDK (For D3D9/D3D10/D3D11 hook)

Vulkan SDK (For Vulkan hook)

MinHook (For kiero::bind function)

Example

To start, go to the kiero.h and select the desired hooks

// Example for D3D9 hook
#defineKIERO_INCLUDE_D3D91// 1 if you need D3D9 hook
#defineKIERO_INCLUDE_D3D100// 1 if you need D3D10 hook
#defineKIERO_INCLUDE_D3D110// 1 if you need D3D11 hook
#defineKIERO_INCLUDE_D3D120// 1 if you need D3D12 hook
#defineKIERO_INCLUDE_OPENGL0// 1 if you need OpenGL hook
#defineKIERO_INCLUDE_VULKAN0// 1 if you need Vulkan hook

Then proceed to the main work

// Example for D3D9 hook// Include required libraries
#include"kiero.h"
#include<d3d9.h>
#include<Windows.h>// Create the type of function that we will hooktypedeflong(__stdcall* EndScene)(LPDIRECT3DDEVICE9);
static EndScene oEndScene = NULL;
// Declare the detour functionlong __stdcall hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
// ... Your magic here ...// static bool init = false;// if (!init)// {// MessageBox(0, "Boom! It's works!", "Kiero", MB_OK);// init = true;// }returnoEndScene(pDevice);
}
intkieroExampleThread()
{
if (kiero::init(kiero::RenderType::D3D9) == kiero::Status::Success)
// orif (kiero::init(kiero::RenderType::Auto) == kiero::Status::Success)
{
// define KIERO_USE_MINHOOK must be 1// the index of the required function can be found in the METHODSTABLE.txtkiero::bind(42, (void**)&oEndScene, hkEndScene);
// If you just need to get the function address you can use the kiero::getMethodsTable function
oEndScene = (EndScene)kiero::getMethodsTable()[42];
}
return0;
}
BOOLWINAPIDllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID)
{
DisableThreadLibraryCalls(hInstance);
switch (fdwReason)
{
caseDLL_PROCESS_ATTACH:
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)kieroExampleThread, NULL, 0, NULL);
break;
}
returnTRUE;
}

License

MIT License
Copyright (c) 2014-2021 Rebzzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Universal graphical hook for a D3D9-D3D12, OpenGL and Vulkan based games.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages