Source Code ImGui Implementation through Kiero Hook (DirectX 11)

Hexui Undetected CSGO Cheats PUBG Accounts

obdr

Meme Tier VIP
Sep 22, 2019
175
5,478
18
Game Name
DirectX 11 Games
Anticheat
N/A
Tutorial Link
N/A
How long you been coding/hacking?
+2yrs
I spent some time searching about DirectX 11 and figuring it out and ended up finding a GitHub repository called 'Kiero'. It is used for universal graphical hooking, supporting OpenGL, DirectX 9-12 and Vulkan. So I decided to grab it and make a universal ImGui hook for DirectX 11 (tested on both 32 and 64 bits). This code basically hooks the Present function and sets it up to work with ImGui. If you find any problems, let me know.
Code: https://github.com/rdbo/ImGui-DirectX-11-Kiero-Hook
Screenshots:
dear_imgui___imgui_kiero_hook.PNG


re2_imgui_kiero_hook.PNG


Credits:

https://niemand.com.ar/2019/01/01/how-to-hook-directx-11-imgui/
https://github.com/TsudaKageyu/minhook
https://github.com/Rebzzel/kiero
https://github.com/ocornut/imgui

Download is attached, but please use github link for the latest version
 

Attachments

You can download 0 Attachments
Last edited by a moderator:

clangneko

Silenced
Dank Tier Donator
Jun 22, 2019
26
248
0
I look ur thread and clone ur github's project but its not work for me,I redirection stream out and i found that kiero::init(kiero::RenderType::D3D11) is AlreadyInitializedError , i dont know how to do,can u give me some advice?
 

AngshuUWA

Silenced
Dank Tier Donator
Full Member
Apr 17, 2020
14
338
0
Great!!!
everything good but only one problem when you try to load fonts
 

Attachments

You can download 0 Attachments

obdr

Meme Tier VIP
Sep 22, 2019
175
5,478
18
Great!!!
everything good but only one problem when you try to load fonts
Code? It works for me. There might be a problem with your ImGui Code, not the implementation.
 
Last edited:

AngshuUWA

Silenced
Dank Tier Donator
Full Member
Apr 17, 2020
14
338
0
Code? It works for me. There might be a problem with your ImGui Code, not the implementation.
C++:
if (!init)
    {
        if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)& pDevice)))
        {
            pDevice->GetImmediateContext(&pContext);
            DXGI_SWAP_CHAIN_DESC sd;
            pSwapChain->GetDesc(&sd);
            window = sd.OutputWindow;
            ID3D11Texture2D* pBackBuffer;
            pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)& pBackBuffer);
            pDevice->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetView);
            pBackBuffer->Release();
            oWndProc = (WNDPROC)SetWindowLongPtr(window, GWLP_WNDPROC, (LONG_PTR)WndProc);
            InitImGui();

            init = true;
        }

        else
            return oPresent(pSwapChain, SyncInterval, Flags);
    }
    ImGuiIO& io = ImGui::GetIO(); (void)io;
    ImFont* rudaeg = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\impact.ttf", 18.0f);
    static std::string fepe="FPE";
    ImGui_ImplWin32_NewFrame();
    ImGui_ImplDX11_NewFrame();
    ImGui::NewFrame();
    if (g_ShowMenu) {
        static bool pen = false;
        static bool prewaw = false;
        ImGuiWindowFlags fhgl = 0;
        fhgl |= ImGuiWindowFlags_NoTitleBar;
        fhgl |= ImGuiWindowFlags_NoResize;

        //    ImGui::ShowDemoWindow();
        darkui();
        ImGui::Begin("g", &pen, fhgl);
        ImGui::SetWindowSize(ImVec2(200, 400));
        ImGui::TextColored(ImVec4(1.00, 0.74, 0.00, 1.0), "Loaded");
        ImGui::SameLine();
        ImGui::TextColored(ImVec4(0.22, 0.22, 0.27, 1.0), "test1");
        ImGui::Checkbox("here", &prewaw);
        if (ImGui::Button("here")) {
        }

        ImGui::Dummy(ImVec2(0.0f, 250));
        ImGui::TextColored(ImVec4(0.01, 0.86, 0.22, 1.0), "Fps: (%.1f)", ImGui::GetIO().Framerate);

        ImGui::End();
When i remove
C++:
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImFont* rudaeg = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\impact.ttf", 18.0f);
It works fine
but i want to load it
 
Last edited:

metrix

0x90
Meme Tier VIP
Fleep Tier Donator
Trump Tier Donator
Oct 11, 2013
255
7,968
12
C++:
if (!init)
    {
        if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)& pDevice)))
        {
            pDevice->GetImmediateContext(&pContext);
            DXGI_SWAP_CHAIN_DESC sd;
            pSwapChain->GetDesc(&sd);
            window = sd.OutputWindow;
            ID3D11Texture2D* pBackBuffer;
            pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)& pBackBuffer);
            pDevice->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetView);
            pBackBuffer->Release();
            oWndProc = (WNDPROC)SetWindowLongPtr(window, GWLP_WNDPROC, (LONG_PTR)WndProc);
            InitImGui();

            init = true;
        }

        else
            return oPresent(pSwapChain, SyncInterval, Flags);
    }
    ImGuiIO& io = ImGui::GetIO(); (void)io;
    ImFont* rudaeg = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\impact.ttf", 18.0f);
    static std::string fepe="FPE";
    ImGui_ImplWin32_NewFrame();
    ImGui_ImplDX11_NewFrame();
    ImGui::NewFrame();
    if (g_ShowMenu) {
        static bool pen = false;
        static bool prewaw = false;
        ImGuiWindowFlags fhgl = 0;
        fhgl |= ImGuiWindowFlags_NoTitleBar;
        fhgl |= ImGuiWindowFlags_NoResize;

        //    ImGui::ShowDemoWindow();
        darkui();
        ImGui::Begin("g", &pen, fhgl);
        ImGui::SetWindowSize(ImVec2(200, 400));
        ImGui::TextColored(ImVec4(1.00, 0.74, 0.00, 1.0), "Loaded");
        ImGui::SameLine();
        ImGui::TextColored(ImVec4(0.22, 0.22, 0.27, 1.0), "test1");
        ImGui::Checkbox("here", &prewaw);
        if (ImGui::Button("here")) {
        }

        ImGui::Dummy(ImVec2(0.0f, 250));
        ImGui::TextColored(ImVec4(0.01, 0.86, 0.22, 1.0), "Fps: (%.1f)", ImGui::GetIO().Framerate);

        ImGui::End();
When i remove
C++:
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImFont* rudaeg = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\impact.ttf", 18.0f);
It works fine
but i want to load it
What you expect from (void)io;?
Also you might only do this once in init and not load it again and again.
Pretty sure your path is wrong and that's why it crashes.
Attach Debugger and watch what happens in AddFontFromFileTTF. Pretty sure it can't load the font.
 

obdr

Meme Tier VIP
Sep 22, 2019
175
5,478
18
C++:
if (!init)
    {
        if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)& pDevice)))
        {
            pDevice->GetImmediateContext(&pContext);
            DXGI_SWAP_CHAIN_DESC sd;
            pSwapChain->GetDesc(&sd);
            window = sd.OutputWindow;
            ID3D11Texture2D* pBackBuffer;
            pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)& pBackBuffer);
            pDevice->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetView);
            pBackBuffer->Release();
            oWndProc = (WNDPROC)SetWindowLongPtr(window, GWLP_WNDPROC, (LONG_PTR)WndProc);
            InitImGui();

            init = true;
        }

        else
            return oPresent(pSwapChain, SyncInterval, Flags);
    }
    ImGuiIO& io = ImGui::GetIO(); (void)io;
    ImFont* rudaeg = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\impact.ttf", 18.0f);
    static std::string fepe="FPE";
    ImGui_ImplWin32_NewFrame();
    ImGui_ImplDX11_NewFrame();
    ImGui::NewFrame();
    if (g_ShowMenu) {
        static bool pen = false;
        static bool prewaw = false;
        ImGuiWindowFlags fhgl = 0;
        fhgl |= ImGuiWindowFlags_NoTitleBar;
        fhgl |= ImGuiWindowFlags_NoResize;

        //    ImGui::ShowDemoWindow();
        darkui();
        ImGui::Begin("g", &pen, fhgl);
        ImGui::SetWindowSize(ImVec2(200, 400));
        ImGui::TextColored(ImVec4(1.00, 0.74, 0.00, 1.0), "Loaded");
        ImGui::SameLine();
        ImGui::TextColored(ImVec4(0.22, 0.22, 0.27, 1.0), "test1");
        ImGui::Checkbox("here", &prewaw);
        if (ImGui::Button("here")) {
        }

        ImGui::Dummy(ImVec2(0.0f, 250));
        ImGui::TextColored(ImVec4(0.01, 0.86, 0.22, 1.0), "Fps: (%.1f)", ImGui::GetIO().Framerate);

        ImGui::End();
When i remove
C++:
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImFont* rudaeg = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\impact.ttf", 18.0f);
It works fine
but i want to load it
This worked for me:
C++:
void InitImGui()
{
    ImGui::CreateContext();
    ImGuiIO& io = ImGui::GetIO();
    io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
    
    //Load Font
    ImFontConfig cfg;
    cfg.FontDataOwnedByAtlas = false;
    ImFont* font = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Impact.ttf", 18, &cfg);
    
    ImGui_ImplWin32_Init(window);
    ImGui_ImplDX11_Init(pDevice, pContext);
}
 
  • Like
Reactions: AngshuUWA

AngshuUWA

Silenced
Dank Tier Donator
Full Member
Apr 17, 2020
14
338
0
This worked for me:
C++:
void InitImGui()
{
    ImGui::CreateContext();
    ImGuiIO& io = ImGui::GetIO();
    io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
   
    //Load Font
    ImFontConfig cfg;
    cfg.FontDataOwnedByAtlas = false;
    ImFont* font = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Impact.ttf", 18, &cfg);
   
    ImGui_ImplWin32_Init(window);
    ImGui_ImplDX11_Init(pDevice, pContext);
}
Worked for me as well was pretty sure it wasn't the path Good release! 👍
 

Plavnik

certified gamer
Fleep Tier Donator
Trump Tier Donator
Dank Tier Donator
Top Poster Of Month
Apr 10, 2019
43
2,458
0
This is the best template I use for ImGui. It's easy and compatible for someone whose new to C++!

Thanks man! :D
 

Plavnik

certified gamer
Fleep Tier Donator
Trump Tier Donator
Dank Tier Donator
Top Poster Of Month
Apr 10, 2019
43
2,458
0
Ignoring everything I said in the GHB I see, going straight to d3d11 imgui pastes
I'm doing the GHB still just looking at other stuff as well. :FeelsBadMan:
 

Rake

I'm not your friend
Administrator
Jan 21, 2014
12,992
79,068
2,465
You are following people and what they do. When will the doxxing come? 🤣 🤣
I have highly advanced radar for retardation, I'm beta testing neuralink for elon musk

1609787043158.png


People literally bend their dicks around and fuck themselves in the ass, and then wonder who is fucking them. It's human nature unfortunately, which is why our species needs to be firebombed back to the stone age
 

Plavnik

certified gamer
Fleep Tier Donator
Trump Tier Donator
Dank Tier Donator
Top Poster Of Month
Apr 10, 2019
43
2,458
0
I have highly advanced radar for retardation, I'm beta testing neuralink for elon musk

1609787043158.png

People literally bend their dicks around and fuck themselves in the ass, and then wonder who is fucking them. It's human nature unfortunately, which is why our species needs to be firebombed back to the stone age
Petko123
How you think he found me? 😭
 

Rake

I'm not your friend
Administrator
Jan 21, 2014
12,992
79,068
2,465
When you signed up, you had to tick the little box "I accept the rules of forum and Rake as my supreme leader" which gave him the inside into all your information. Your address, you bank account, your mother's asshole.. everything. You better read them rules next time boy. :trollface: :kappa:
nah I got him with the COVID tracking phone app that the NSA put on his phone, backdoored that shit globally
 
Community Mods