ImGui::GetColorU32how can I get the RGB - hexadecimal values and write them to a .ini file?
Посмотреть вложение 164155
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
typedef HRESULT(WINAPI* _EndScene)(IDirect3DDevice9*); //прототип
_EndScene oEndScene; //экземпляр прототипа, для возврата оригинала
typedef HRESULT(WINAPI* _Reset)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
_Reset oReset;
HRESULT WINAPI myEndScene(IDirect3DDevice9* m_pDevice)
{
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
return oEndScene(m_pDevice); // возврат оригинала
}
HRESULT WINAPI myReset(IDirect3DDevice9* m_pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
{
auto result = oReset(m_pDevice, pPresentationParameters);
return result;
}
void InitHook()
{
void** vTableDevice = *(void***)(*(DWORD*)0xC97C28); // адрес Device
VMTHookManager* vmtHooks = new VMTHookManager(vTableDevice);
oEndScene = (_EndScene)vmtHooks->Hook(42, (void*)myEndScene); // 42 - номер EndScene
}
int WINAPI Thread()
{
while (*(DWORD*)0xC8D4C0 != 9) // проверка на статус загрузки игры
Sleep(100);
InitHook();
return 0;
}
BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Thread, NULL, NULL, NULL);
return TRUE;
}
ImGui_ImplDX9_InvalidateDeviceObjects(); в Resetигра вылетает, что не так?
C++:#include <Windows.h> #include <d3d9.h> #include <d3dx9.h> #pragma comment(lib, "d3d9.lib") #pragma comment(lib, "d3dx9.lib") typedef HRESULT(WINAPI* _EndScene)(IDirect3DDevice9*); //прототип _EndScene oEndScene; //экземпляр прототипа, для возврата оригинала typedef HRESULT(WINAPI* _Reset)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*); _Reset oReset; HRESULT WINAPI myEndScene(IDirect3DDevice9* m_pDevice) { ImGui_ImplDX9_NewFrame(); ImGui_ImplWin32_NewFrame(); ImGui::NewFrame(); ImGui::EndFrame(); ImGui::Render(); ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData()); return oEndScene(m_pDevice); // возврат оригинала } HRESULT WINAPI myReset(IDirect3DDevice9* m_pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters) { auto result = oReset(m_pDevice, pPresentationParameters); return result; } void InitHook() { void** vTableDevice = *(void***)(*(DWORD*)0xC97C28); // адрес Device VMTHookManager* vmtHooks = new VMTHookManager(vTableDevice); oEndScene = (_EndScene)vmtHooks->Hook(42, (void*)myEndScene); // 42 - номер EndScene } int WINAPI Thread() { while (*(DWORD*)0xC8D4C0 != 9) // проверка на статус загрузки игры Sleep(100); InitHook(); return 0; } BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) { if (dwReason == DLL_PROCESS_ATTACH) CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Thread, NULL, NULL, NULL); return TRUE; }
продолжать терпеть неудачуImGui_ImplDX9_InvalidateDeviceObjects(); в Reset
В начало Present:продолжать терпеть неудачу
Посмотреть вложение 164232
static bool ImGui_inited = false;
if (!ImGui_inited) {
ImGui::CreateContext();
ImGui_ImplWin32_Init(**reinterpret_cast<HWND**>(0xC17054));
ImGui_ImplDX9_Init(m_pDevice);
ImGui_inited = true;
}
спасибо, еще один вопрос, как добавить движение окну?В начало Present:
C++:static bool ImGui_inited = false; if (!ImGui_inited) { ImGui::CreateContext(); ImGui_ImplWin32_Init(**reinterpret_cast<HWND**>(0xC17054)); ImGui_ImplDX9_Init(m_pDevice); ImGui_inited = true; }
спасибо, еще один вопрос, как добавить движение окну?
#include "memory.h"
#include "vector.h"
#include <thread>
namespace offset
{
constexpr ::std::ptrdiff_t localPlayer = 0xDC04CC;
constexpr ::std::ptrdiff_t flags = 0x104;
constexpr ::std::ptrdiff_t forceJump = 0x52868EC;
constexpr ::std::ptrdiff_t entityList = 0x52868EC;
constexpr ::std::ptrdiff_t teamNum = 0xF4;
// клиент
constexpr ::std::ptrdiff_t dwLocalPlayer = 0xDC04CC;
constexpr ::std::ptrdiff_t dwEntityList = 0x4DDC90C;
// двигатель
constexpr ::std::ptrdiff_t dwClientState = 0x58CFDC;
constexpr ::std::ptrdiff_t dwClientState_ViewAngles = 0x4D90;
constexpr ::std::ptrdiff_t dwClientState_GetLocalPlayer = 0x180;
// организация
constexpr ::std::ptrdiff_t m_dwBoneMatrix = 0x26A8;
constexpr ::std::ptrdiff_t m_bDormant = 0xED;
constexpr ::std::ptrdiff_t m_iTeamNum = 0xF4;
constexpr ::std::ptrdiff_t m_lifeState = 0x25F;
constexpr ::std::ptrdiff_t m_vecOrigin = 0x138;
constexpr ::std::ptrdiff_t m_vecViewOffset = 0x108;
constexpr ::std::ptrdiff_t m_aimPunchAngle = 0x303C;
constexpr ::std::ptrdiff_t m_bSpottedByMask = 0x980;
}
constexpr Vector3 CalculateAngle(
const Vector3& localPosition,
const Vector3& enemyPosition,
const Vector3& viewAngles) noexcept
{
return ((enemyPosition - localPosition).ToAngle() - viewAngles);
}
main()
{
// инициализировать класс памяти
const auto memory = Memory{ "csgo.exe" };
// адреса модулей
const auto client = memory.GetModuleAddress("client.dll");
const auto engine = memory.GetModuleAddress("engine.dll");
// бесконечный цикл
while (true)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
// кнопка aimbot
if (!GetAsyncKeyState(VK_XBUTTON2))
continue;
// получить местнахождения игрока
const auto localPlayer = memory.Read<std::uintptr_t>(client + offset::dwLocalPlayer);
const auto localTeam = memory.Read<std::int32_t>(localPlayer + offset::m_iTeamNum);
// eye position = origin + viewOffset
const auto localEyePosition = memory.Read<Vector3>(localPlayer + offset::m_vecOrigin) +
memory.Read<Vector3>(localPlayer + offset::m_vecViewOffset);
const auto clientState = memory.Read<std::uintptr_t>(engine + offset::dwClientState);
const auto localPlayerId =
memory.Read<std::int32_t>(clientState + offset::dwClientState_GetLocalPlayer);
const auto viewAngles = memory.Read<Vector3>(clientState + offset::dwClientState_ViewAngles);
const auto aimPunch = memory.Read<Vector3>(localPlayer + offset::m_aimPunchAngle) * 2;
// значение fov aimbot
auto bestFov = 8.f;
auto bestAngle = Vector3{ };
for (auto i = 1; i <= 360; ++i)
{
const auto player = memory.Read<std::uintptr_t>(client + offset::dwEntityList + i * 0x10);
if (memory.Read<std::int32_t>(player + offset::m_iTeamNum) == localTeam)
continue;
if (memory.Read<bool>(player + offset::m_bDormant))
continue;
if (memory.Read<std::int32_t>(player + offset::m_lifeState))
continue;
if (memory.Read<std::int32_t>(player + offset::m_bSpottedByMask) & (1 << localPlayerId))
{
const auto boneMatrix = memory.Read<std::uintptr_t>(player + offset::m_dwBoneMatrix);
// положение головы игрока в 3D-пространстве
//индекс костей
const auto playerHeadPosition = Vector3{
memory.Read<float>(boneMatrix + 0x30 * 8 + 0x0C),
memory.Read<float>(boneMatrix + 0x30 * 8 + 0x1C),
memory.Read<float>(boneMatrix + 0x30 * 8 + 0x2C)
};
const auto angle = CalculateAngle(
localEyePosition,
playerHeadPosition,
viewAngles + aimPunch
);
const auto fov = std::hypot(angle.x, angle.y);
if (fov < bestFov)
{
bestFov = fov;
bestAngle = angle;
}
}
}
// плавность aimbot
if (!bestAngle.IsZero())
memory.Write<Vector3>(clientState + offset::dwClientState_ViewAngles, viewAngles + bestAngle / 1.f); // значение smoothing
}
}
main()
{
const auto memory = Memory{ "csgo.exe" };
const auto client = memory.GetModuleAddress("client.dll");
while (true)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1));
const auto localPlayer = memory.Read<std::uintptr_t>(client + offset::localPlayer);
if (!localPlayer)
continue;
const auto localPlayerTeam = memory.Read<std::uintptr_t>(localPlayer + offset::teamNum);
const auto localPlayerFlags = memory.Read<std::uintptr_t>(localPlayer + offset::flags);
// сам бхоп
if (GetAsyncKeyState(VK_SPACE))
(localPlayerFlags & (1 << 0)) ?
memory.Write<std::uintptr_t>(client + offset::forceJump, 6) :
memory.Write<std::uintptr_t>(client + offset::forceJump, 4);
}
}
вот так наверно, не проверял.Как объединить 2 main в 1 и привязать к imgui меню?
Код:#include "memory.h" #include "vector.h" #include <thread> namespace offset { constexpr ::std::ptrdiff_t localPlayer = 0xDC04CC; constexpr ::std::ptrdiff_t flags = 0x104; constexpr ::std::ptrdiff_t forceJump = 0x52868EC; constexpr ::std::ptrdiff_t entityList = 0x52868EC; constexpr ::std::ptrdiff_t teamNum = 0xF4; // клиент constexpr ::std::ptrdiff_t dwLocalPlayer = 0xDC04CC; constexpr ::std::ptrdiff_t dwEntityList = 0x4DDC90C; // двигатель constexpr ::std::ptrdiff_t dwClientState = 0x58CFDC; constexpr ::std::ptrdiff_t dwClientState_ViewAngles = 0x4D90; constexpr ::std::ptrdiff_t dwClientState_GetLocalPlayer = 0x180; // организация constexpr ::std::ptrdiff_t m_dwBoneMatrix = 0x26A8; constexpr ::std::ptrdiff_t m_bDormant = 0xED; constexpr ::std::ptrdiff_t m_iTeamNum = 0xF4; constexpr ::std::ptrdiff_t m_lifeState = 0x25F; constexpr ::std::ptrdiff_t m_vecOrigin = 0x138; constexpr ::std::ptrdiff_t m_vecViewOffset = 0x108; constexpr ::std::ptrdiff_t m_aimPunchAngle = 0x303C; constexpr ::std::ptrdiff_t m_bSpottedByMask = 0x980; } constexpr Vector3 CalculateAngle( const Vector3& localPosition, const Vector3& enemyPosition, const Vector3& viewAngles) noexcept { return ((enemyPosition - localPosition).ToAngle() - viewAngles); } main() { // инициализировать класс памяти const auto memory = Memory{ "csgo.exe" }; // адреса модулей const auto client = memory.GetModuleAddress("client.dll"); const auto engine = memory.GetModuleAddress("engine.dll"); // бесконечный цикл while (true) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); // кнопка aimbot if (!GetAsyncKeyState(VK_XBUTTON2)) continue; std::this_thread::sleep_for(std::chrono::milliseconds(1)); const auto localPlayer = memory.Read<std::uintptr_t>(client + offset::localPlayer); if (!localPlayer) continue; const auto localPlayerTeam = memory.Read<std::uintptr_t>(localPlayer + offset::teamNum); const auto localPlayerFlags = memory.Read<std::uintptr_t>(localPlayer + offset::flags); // сам бхоп if (GetAsyncKeyState(VK_SPACE)) (localPlayerFlags & (1 << 0)) ? memory.Write<std::uintptr_t>(client + offset::forceJump, 6) : memory.Write<std::uintptr_t>(client + offset::forceJump, 4); } // получить местнахождения игрока const auto localPlayer = memory.Read<std::uintptr_t>(client + offset::dwLocalPlayer); const auto localTeam = memory.Read<std::int32_t>(localPlayer + offset::m_iTeamNum); // eye position = origin + viewOffset const auto localEyePosition = memory.Read<Vector3>(localPlayer + offset::m_vecOrigin) + memory.Read<Vector3>(localPlayer + offset::m_vecViewOffset); const auto clientState = memory.Read<std::uintptr_t>(engine + offset::dwClientState); const auto localPlayerId = memory.Read<std::int32_t>(clientState + offset::dwClientState_GetLocalPlayer); const auto viewAngles = memory.Read<Vector3>(clientState + offset::dwClientState_ViewAngles); const auto aimPunch = memory.Read<Vector3>(localPlayer + offset::m_aimPunchAngle) * 2; // значение fov aimbot auto bestFov = 8.f; auto bestAngle = Vector3{ }; for (auto i = 1; i <= 360; ++i) { const auto player = memory.Read<std::uintptr_t>(client + offset::dwEntityList + i * 0x10); if (memory.Read<std::int32_t>(player + offset::m_iTeamNum) == localTeam) continue; if (memory.Read<bool>(player + offset::m_bDormant)) continue; if (memory.Read<std::int32_t>(player + offset::m_lifeState)) continue; if (memory.Read<std::int32_t>(player + offset::m_bSpottedByMask) & (1 << localPlayerId)) { const auto boneMatrix = memory.Read<std::uintptr_t>(player + offset::m_dwBoneMatrix); // положение головы игрока в 3D-пространстве //индекс костей const auto playerHeadPosition = Vector3{ memory.Read<float>(boneMatrix + 0x30 * 8 + 0x0C), memory.Read<float>(boneMatrix + 0x30 * 8 + 0x1C), memory.Read<float>(boneMatrix + 0x30 * 8 + 0x2C) }; const auto angle = CalculateAngle( localEyePosition, playerHeadPosition, viewAngles + aimPunch ); const auto fov = std::hypot(angle.x, angle.y); if (fov < bestFov) { bestFov = fov; bestAngle = angle; } } } // плавность aimbot if (!bestAngle.IsZero()) memory.Write<Vector3>(clientState + offset::dwClientState_ViewAngles, viewAngles + bestAngle / 1.f); // значение smoothing } }
Спасибо код собирается но аим бот не работает а бхоп работает при нажатие кнопки аима и пробелавот так наверно, не проверял.
не совсем понял вопроса "как привязать к имгуй"? что значит привязать? а вообще у тебя же чит экстернал, тебе нужно создавать окно и поверх игры этот имгуй рисовать а не в игре
Да все нормально выводит. Как вариант пробуй %08X.Посмотреть вложение 164479
как выводить только "ABCDEF", а не "ABCDEF66"?
тот же результат. мне нужно получать ABCDEF, обрезая два последних символаДа все нормально выводит. Как вариант пробуй %08X.
Не допонял сначала. Щас (color >> 8). Хотя зачем тебе это я фиг знает. Если ты хочешь цвет игрока так выводит, то мне проще альфа канал установить на FF значение.тот же результат. мне нужно получать ABCDEF, обрезая два последних символа
Посмотреть вложение 164485