MIT License

项目介绍

Rebzzel/kiero 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 MIT License 许可证,目前获得 1.2k 个 Star、238 次 Fork。

仓库全名
Rebzzel/kiero
开源许可证
MIT License
Star 数
1.2k
Fork 数
238
未关闭 Issue
11

README 摘要

[!WARNING] This project is no longer maintained and will not receive any further updates. We recommend switching to the new project kiero2. 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

kiero 用什么语言开发?

主要使用 C++ 编写,采用 MIT License 许可证,目前有 1.2k 个 Star。

kiero 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 kiero 的源码?

可以直接克隆仓库:git clone https://github.com/Rebzzel/kiero.git,默认分支为 master;安装与运行步骤见仓库 README。

kiero 最近还在维护吗?

仓库最近一次更新为 5月4日,当前有 11 个未关闭 Issue;Star 数为 1.2k,可作为社区活跃度的参考。

简要分析

热度分
1717
价值分
797
活跃状态
归档

语言占比

C++

Release

README

Warning 警告

This project is no longer maintained and will not receive any further updates.

We recommend switching to the new project kiero2.

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
#define KIERO_INCLUDE_D3D9   1 // 1 if you need D3D9 hook
#define KIERO_INCLUDE_D3D10  0 // 1 if you need D3D10 hook
#define KIERO_INCLUDE_D3D11  0 // 1 if you need D3D11 hook
#define KIERO_INCLUDE_D3D12  0 // 1 if you need D3D12 hook
#define KIERO_INCLUDE_OPENGL 0 // 1 if you need OpenGL hook
#define KIERO_INCLUDE_VULKAN 0 // 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 hook
typedef long(__stdcall* EndScene)(LPDIRECT3DDEVICE9);
static EndScene oEndScene = NULL;

// Declare the detour function
long __stdcall hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
  // ... Your magic here ...
  
  // static bool init = false;
  // if (!init)
  // {
  //  MessageBox(0, "Boom! It's works!", "Kiero", MB_OK);
  //  init = true;
  // }
  
  return oEndScene(pDevice);
}

int kieroExampleThread()
{
  if (kiero::init(kiero::RenderType::D3D9) == kiero::Status::Success)
  // or
  if (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.txt
    kiero::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];
  }

  return 0;
}

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID)
{
  DisableThreadLibraryCalls(hInstance);

  switch (fdwReason)
  {
    case DLL_PROCESS_ATTACH:
      CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)kieroExampleThread, NULL, 0, NULL);
      break;
  }

  return TRUE;
}

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.

评论

暂无评论