На самом деле я Zodiak
-
Автор темы
- #1
как присвоить чекбоксу imgui::checkbox("glow" &glow) код из отдельного сурса :
при том основной код это
я уже вторые сутки сижу и нихуя не понимаю
пробовал добавить 2 файл цпп и засунуть код
заменив его на
но абсолютно ничего не вышло
Код:
BOOL WINAPI MainThread(HMODULE hModule)
{
DWORD moduleBase = (DWORD)GetModuleHandle("client.dll");
while (!GetAsyncKeyState(VK_INSERT))
{
DWORD LocalPlayer = *(DWORD*)(moduleBase + dwLocalPlayer);
DWORD GlowObjectManager = *(DWORD*)(moduleBase + dwGlowObjectManager);
DWORD EntityList = *(DWORD*)(moduleBase + dwEntityList);
int LocalTeam = *(int*)(LocalPlayer + m_iTeamNum);
for (int i = 1; i < 32; i++)
{
DWORD entity = *(DWORD*)(moduleBase + dwEntityList) + i * 0x10;
if (entity == NULL) continue;
int glowIndex = *(int*)(entity + m_iGlowIndex);
int entityTeam = *(int*)(entity + m_iTeamNum);
if (entityTeam == LocalTeam)
{
//local team
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x4)) = 0.f; //R
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x8)) = 1.f; //G
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0xC)) = 0.f; //B
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x10)) = 1.7f; //a
}
else
{
//enemy team
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x4)) = 1.f; //R
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x8)) = 0.f; //G
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0xC)) = 0.f; //B
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x10)) = 1.7f; //a
}
*(bool*)((GlowObjectManager + glowIndex * 0x38 + 0x24)) = true;
*(bool*)((GlowObjectManager + glowIndex * 0x38 + 0x25)) = false;
}
}
FreeLibraryAndExitThread(hModule, 0);
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)MainThread, hModule, 0, nullptr));
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
при том основной код это
Код:
#include "includes.h"
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
EndScene oEndScene = NULL;
WNDPROC oWndProc;
static HWND window = NULL;
void InitImGui(LPDIRECT3DDEVICE9 pDevice)
{
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
ImGui_ImplWin32_Init(window);
ImGui_ImplDX9_Init(pDevice);
}
bool glow = false;
bool triggerbot = false;
bool init = false;
bool menu = false;
long __stdcall hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
if (!init)
{
InitImGui(pDevice);
init = true;
}
if (GetAsyncKeyState(VK_END))
{
kiero::shutdown();
return 0;
}
if (GetAsyncKeyState(VK_INSERT) & 1)
{
menu = !menu;
}
if (menu)
{
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGui::Begin("fat cock");
ImGui::Checkbox("GLOW", &glow);
ImGui::Checkbox("Trigger", &triggerbot);
ImGui::End();
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
return oEndScene(pDevice);
}
}
LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
if (true && ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam))
return true;
return CallWindowProc(oWndProc, hWnd, uMsg, wParam, lParam);
}
BOOL CALLBACK EnumWindowsCallback(HWND handle, LPARAM lParam)
{
DWORD wndProcId;
GetWindowThreadProcessId(handle, &wndProcId);
if (GetCurrentProcessId() != wndProcId)
return TRUE; // skip to next window
window = handle;
return FALSE; // window found abort search
}
HWND GetProcessWindow()
{
window = NULL;
EnumWindows(EnumWindowsCallback, NULL);
return window;
}
DWORD WINAPI MainThread(LPVOID lpReserved)
{
bool attached = false;
do
{
if (kiero::init(kiero::RenderType::D3D9) == kiero::Status::Success)
{
kiero::bind(42, (void**)& oEndScene, hkEndScene);
do
window = GetProcessWindow();
while (window == NULL);
oWndProc = (WNDPROC)SetWindowLongPtr(window, GWL_WNDPROC, (LONG_PTR)WndProc);
attached = true;
}
} while (!attached);
return TRUE;
}
BOOL APIENTRY DllMain(HMODULE hMod, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hMod);
CreateThread(nullptr, 0, MainThread, hMod, 0, nullptr);
break;
case DLL_PROCESS_DETACH:
kiero::shutdown();
break;
}
return TRUE;
}
пробовал добавить 2 файл цпп и засунуть код
Код:
while (!GetAsyncKeyState(VK_INSERT))
{
DWORD LocalPlayer = *(DWORD*)(moduleBase + dwLocalPlayer);
DWORD GlowObjectManager = *(DWORD*)(moduleBase + dwGlowObjectManager);
DWORD EntityList = *(DWORD*)(moduleBase + dwEntityList);
int LocalTeam = *(int*)(LocalPlayer + m_iTeamNum);
for (int i = 1; i < 32; i++)
{
DWORD entity = *(DWORD*)(moduleBase + dwEntityList) + i * 0x10;
if (entity == NULL) continue;
int glowIndex = *(int*)(entity + m_iGlowIndex);
int entityTeam = *(int*)(entity + m_iTeamNum);
if (entityTeam == LocalTeam)
{
//local team
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x4)) = 0.f; //R
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x8)) = 1.f; //G
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0xC)) = 0.f; //B
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x10)) = 1.7f; //a
}
else
{
//enemy team
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x4)) = 1.f; //R
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x8)) = 0.f; //G
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0xC)) = 0.f; //B
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x10)) = 1.7f; //a
}
*(bool*)((GlowObjectManager + glowIndex * 0x38 + 0x24)) = true;
*(bool*)((GlowObjectManager + glowIndex * 0x38 + 0x25)) = false;
}
}
FreeLibraryAndExitThread(hModule, 0);
return 0;
}
заменив его на
Код:
if (glow)
{
DWORD LocalPlayer = *(DWORD*)(moduleBase + dwLocalPlayer);
DWORD GlowObjectManager = *(DWORD*)(moduleBase + dwGlowObjectManager);
DWORD EntityList = *(DWORD*)(moduleBase + dwEntityList);
int LocalTeam = *(int*)(LocalPlayer + m_iTeamNum);
for (int i = 1; i < 32; i++)
{
DWORD entity = *(DWORD*)(moduleBase + dwEntityList) + i * 0x10;
if (entity == NULL) continue;
int glowIndex = *(int*)(entity + m_iGlowIndex);
int entityTeam = *(int*)(entity + m_iTeamNum);
if (entityTeam == LocalTeam)
{
//local team
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x4)) = 0.f; //R
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x8)) = 1.f; //G
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0xC)) = 0.f; //B
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x10)) = 1.7f; //a
}
else
{
//enemy team
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x4)) = 1.f; //R
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x8)) = 0.f; //G
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0xC)) = 0.f; //B
*(float*)((GlowObjectManager + glowIndex * 0x38 + 0x10)) = 1.7f; //a
}
*(bool*)((GlowObjectManager + glowIndex * 0x38 + 0x24)) = true;
*(bool*)((GlowObjectManager + glowIndex * 0x38 + 0x25)) = false;
}
}
FreeLibraryAndExitThread(hModule, 0);
return 0;
}
но абсолютно ничего не вышло