-
Автор темы
- #1
Когда сворачиваю игру, зависает кс, она не крашит, поэтому дебажить не получится. Версия 1.70 WIP
C++:
long __stdcall Hooks::Hooked_EndScene(IDirect3DDevice9* pDevice)
{
static auto oEndScene = g_Hooks.pD3D9Hook.get_original<EndSceneFn>(42);
static DWORD ret = (DWORD)_ReturnAddress();
if (ret != (DWORD)_ReturnAddress()) // Endscene is called twice so this prevents us from rendering twice.
return oEndScene(pDevice);
static bool init = true;
if (init)
{
ImGui::CreateContext();
ImGui::GetIO().MouseDrawCursor = true;
ImGui_ImplDX9_Init(pDevice);
ImGui_ImplWin32_Init(g_Hooks.hCSGOWindow);
GUI_Init(pDevice);
init = false;
}
static bool toogle = false;
{
if (GetAsyncKeyState(VK_INSERT) && !toogle)
menu_open = !menu_open, toogle = true;
else if (!GetAsyncKeyState(VK_INSERT) && toogle)
toogle = false;
if (menu_open)
g_GameInput->m_fMouseInitialized = false, g_GameInput->m_fMouseActive = false;
else
g_GameInput->m_fMouseInitialized = true;
}
if (menu_open)
{
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGui::PushFont(menufont);
ImGui::SetNextWindowSize(ImVec2(750, 500));
ImGui::Begin("name", &menu_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
{
static int tabrage = 0;
if (ImGui::Button("Aimbot", ImVec2(177.5, 21)))
tabrage = 0;
ImGui::SameLine();
if (ImGui::Button("Visuals", ImVec2(177.5, 21)))
tabrage = 1;
ImGui::SameLine();
if (ImGui::Button("Misc", ImVec2(177.5, 21)))
tabrage = 2;
ImGui::SameLine();
if (ImGui::Button("Skins", ImVec2(177.5, 21)))
tabrage = 3;
ImGui::Separator();
if (tabrage == 0)
renderaimtab();
else if (tabrage == 2)
rendermisc();
else if (tabrage == 1)
rendervisuals();
}
ImGui::PopFont();
ImGui::End();
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
}
//ImGui::Render();
return oEndScene(pDevice);
}
C++:
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT __stdcall Hooks::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (menu_open)
{
if (ImGui::GetCurrentContext())
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
return true;
}
return CallWindowProc(g_Hooks.pOriginalWNDProc, hWnd, uMsg, wParam, lParam);
}