Advertisement
Guest User

Glow

a guest
Jan 26th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3.  
  4. namespace offset {
  5. #include "Offsets.h"
  6.     using namespace hazedumper::netvars;
  7.     using namespace hazedumper::signatures;
  8. }
  9.  
  10. #include "Memory.h"
  11. Memory memory;
  12.  
  13. struct GlowStruct {
  14.     BYTE buffer0[4];
  15.     float r, g, b, a;
  16.     BYTE buffer1[16];
  17.     bool renderWhenOccluded;
  18.     bool renderWhenUnoccluded;
  19.     bool fullBloom;
  20.     BYTE buffer2[5];
  21.     int glowStyle;
  22. };
  23.  
  24. struct varS {
  25.     uintptr_t procid = NULL;
  26.     uintptr_t client = NULL;
  27.     uintptr_t engine = NULL;
  28.     uintptr_t glowObject = NULL;
  29.  
  30. } var;
  31.  
  32. void Setup() {
  33.     var.procid = memory.getProcess(L"csgo.exe");
  34.     var.client = memory.getModule(var.procid, L"client_panorama.dll");
  35.     var.engine = memory.getModule(var.procid, L"engine.dll");
  36.  
  37. }
  38.  
  39. class LocalPlayer {
  40. public:
  41.     uintptr_t entity = NULL;
  42.     int health = NULL;
  43.     int team = NULL;
  44.  
  45.     void Update() {
  46.         entity = memory.read<uintptr_t>(var.client + offset::dwLocalPlayer);
  47.         if (entity != NULL) {
  48.             health = memory.read<int>(entity + offset::m_iHealth);
  49.             team = memory.read<int>(entity + offset::m_iTeamNum);
  50.         }
  51.     }
  52.  
  53. };
  54.  
  55. class OtherPlayer {
  56. public:
  57.     uintptr_t entity = NULL;
  58.     int health = NULL;
  59.     int team = NULL;
  60.  
  61.     void Glow(float r, float g, float b, float a, int style = 0, bool bloom = false) {
  62.         int glowIndex = memory.read<int>(entity + offset::m_iGlowIndex);
  63.         GlowStruct gs;
  64.         gs = memory.read<GlowStruct>(var.glowObject + (glowIndex * 0x38));
  65.         gs.r = r, gs.g = g, gs.b = b, gs.a = a;
  66.         gs.glowStyle = style;
  67.         gs.renderWhenOccluded = true;
  68.         gs.renderWhenUnoccluded = false;
  69.         gs.fullBloom = bloom;
  70.         memory.write<GlowStruct>(var.glowObject + (glowIndex * 0x38), gs);
  71.     }
  72.  
  73.     void Update() {
  74.         if (entity != NULL) {
  75.             health = memory.read<int>(entity + offset::m_iHealth);
  76.             team = memory.read<int>(entity + offset::m_iTeamNum);
  77.         }
  78.     }
  79.  
  80. };
  81.  
  82. class PlayerList {
  83. private:
  84.     OtherPlayer list[64];
  85.  
  86. public:
  87.     OtherPlayer& operator[] (int Index) {
  88.         return list[Index];
  89.     }
  90.  
  91.     void Update() {
  92.         for (int i = 0; i < 64; i++) {
  93.             list[i].entity = memory.read<uintptr_t>(var.client + offset::dwEntityList + 0x10 * i);
  94.             if (list[i].entity != NULL)
  95.                 list[i].Update();
  96.         }
  97.         var.glowObject = memory.read<uintptr_t>(var.client + offset::dwGlowObjectManager);
  98.     }
  99.  
  100. };
  101.  
  102.  
  103.  
  104. int main() {
  105.     Setup();
  106.     LocalPlayer player;
  107.     PlayerList others;
  108.  
  109.     while (true) {
  110.         player.Update();
  111.         others.Update();
  112.  
  113.         for (int i = 0; i < 64; i++)
  114.             if (others[i].entity != player.entity && others[i].health > 0) {
  115.                 if (others[i].team == player.team)
  116.                     others[i].Glow(0, 0, 1, 0.5f);
  117.                 else
  118.                     others[i].Glow(1, 0, 0, 0.5f);
  119.             }
  120.  
  121.     }
  122.  
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement