Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // dllmain.cpp : Defines the entry point for the DLL application
- #include "framework.h"
- #include "csgo.hpp"
- #include "mem.h"
- #include <iostream>
- #include <assert.h>
- struct variables
- {
- uintptr_t localPlayer;
- uintptr_t gameModule;
- uintptr_t engineModule;
- uintptr_t glowObject;
- } val;
- struct GlowStruct
- {
- BYTE base[4];
- float red;
- float green;
- float blue;
- float alpha;
- BYTE buffer[16];
- bool renderWhenOccluded;
- bool renderWhenUnOccluded;
- bool fullBloom;
- BYTE buffer1[5];
- int glowStyle;
- };
- void SetTeamGlow(uintptr_t entity, int glowIndex)
- {
- GlowStruct TGlow;
- TGlow = *(GlowStruct*)(val.glowObject + (glowIndex * 0x38));
- TGlow.blue = 1.0f;
- TGlow.alpha = 1.0f;
- TGlow.renderWhenOccluded = true;
- TGlow.renderWhenUnOccluded = false;
- *(GlowStruct*)(val.glowObject + (glowIndex * 0x38)) = TGlow;
- }
- void SetEnemyGlow(uintptr_t entity, int glowIndex)
- {
- GlowStruct EGlow;
- EGlow = *(GlowStruct*)(val.glowObject + (glowIndex * 0x38));
- EGlow.blue = 1.0f;
- EGlow.alpha = 1.0f;
- EGlow.renderWhenOccluded = true;
- EGlow.renderWhenUnOccluded = false;
- *(GlowStruct*)(val.glowObject + (glowIndex * 0x38)) = EGlow;
- }
- DWORD APIENTRY HackThread(HMODULE hModule)
- {
- AllocConsole();
- FILE* f;
- freopen_s(&f, "CONOUT$", "w", stdout);
- uintptr_t moduleBase = (uintptr_t)GetModuleHandle(L"client_panorama.dll");
- std::cout << "Module Base : " << std::hex << moduleBase << std::endl;
- val.localPlayer = (uintptr_t)(moduleBase + hazedumper::signatures::dwLocalPlayer); // 28DC2A3C | 28DC2A3C
- std::cout << "Local Player : " << std::hex << val.localPlayer << std::endl;
- if (val.localPlayer == NULL)
- {
- std::cout << "Local player is NULL - If statement test" << std::endl;
- }
- while (val.localPlayer == NULL)
- {
- std::cout << "Local player is NULL - Loop" << std::endl;
- val.localPlayer = (uintptr_t)(moduleBase + hazedumper::signatures::dwLocalPlayer);
- }
- while (1)
- {
- val.glowObject = (uintptr_t)(moduleBase + hazedumper::signatures::dwGlowObjectManager);
- int myTeam = *(int*)mem::FindDMAAddy(val.localPlayer, { hazedumper::netvars::m_iTeamNum });
- std::cout << "myTeam : " << myTeam << std::endl;
- for (unsigned int i = 0; i < 65; ++i)
- {
- uintptr_t entity = (uintptr_t)(moduleBase + hazedumper::signatures::dwEntityList + i * 0x10); // PROBLEM LIES HERE
- if (entity != NULL)
- {
- std::cout << "Entity is not null check went through" << std::endl;
- std::cout << "Entity Address : " << std::hex << entity << std::endl;
- //uintptr_t glowIndexAddr = (uintptr_t)(entity + hazedumper::netvars::m_iGlowIndex);
- int glowIndex = *(int*)mem::FindDMAAddy(entity, { hazedumper::netvars::m_iGlowIndex });
- //uintptr_t entityTeamAddr = (uintptr_t)(entity + hazedumper::netvars::m_iTeamNum);
- int entityTeam = *(int*)mem::FindDMAAddy(entity, { hazedumper::netvars::m_iTeamNum });
- std::cout << "glowIndex : " << std::dec << glowIndex << std::endl;
- std::cout << "EntityTeam : " << std::dec << entityTeam << std::endl;
- if (entityTeam != 2 && entityTeam != 3) continue; // Performance increase
- if (myTeam == entityTeam)
- {
- std::cout << "Equal to team check" << std::endl;
- SetTeamGlow(entity, glowIndex);
- std::cout << "Set glow fine #1" << std::endl;
- }
- else
- {
- std::cout << "Not Equal to team check" << std::endl;
- SetEnemyGlow(entity, glowIndex);
- std::cout << "Set glow fine #2" << std::endl;
- }
- }
- std::cout << "First loop #" << std::dec << i << '\t' << std::endl;
- Sleep(3);
- }
- if (GetAsyncKeyState(VK_NUMPAD1) & 1)
- {
- break;
- }
- Sleep(5);
- }
- fclose(f);
- FreeConsole();
- 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)HackThread, hModule, 0, nullptr));
- }
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement