-
Автор темы
- #1
Не хочет работать, не могу понять, где ошибка Сеты новые
Код:
#include <iostream>
#include <Windows.h>
#include "Memory.hpp"
#include "Offsets.hpp"
#define PROCESS_NAME "csgo.exe"
#define CLIENT_DLL "client.dll"
#define GLOW_OBJECT_DEFENITION_STYLE 0
#define PLAYER_CLASS_ID 40
using namespace std;
Memory memory;
Memory::Module clientDLL;
struct ColorRgba {
float r = 0; // [0,255]
float g = 0; // [0,255]
float b = 0; // [0,255]
float a = 0; // [0,255]
};
struct GlowObjectDefinition {
int nextFreeSlot; //0x0000
unsigned int baseEntity; //0x0004
float color[4]; //0x0008
unsigned long _pad0x0018; //0x0018
float _pad0x001c; //0x001C
float bloomAmount; //0x0020
float noise; //0x0024
bool renderWhenOccluded; //0x0028
bool renderWhenUnoccluded;//0x0029
bool fullBloomrender; //0x002A
unsigned char _pad0x002B[0x1]; //0x002B
int _pad0x002C; //0x002C
int style; //0x0030
int splitScreenSlot; //0x0034
void SetColor(float r, float g, float b, float a) {
color[0] = r / 255.f;
color[1] = g / 255.f;
color[2] = b / 255.f;
color[3] = a / 255.f;
}
void SetColor(ColorRgba value) {
color[0] = value.r / 255.f;
color[1] = value.g / 255.f;
color[2] = value.b / 255.f;
color[3] = value.a / 255.f;
}
};
int main() {
cout << "Waiting for process" << PROCESS_NAME << " ..." << endl;
while (!memory.FindProcess(PROCESS_NAME)) {
Sleep(100);
}
cout << "Process" << PROCESS_NAME << "was found. Starting ..." << endl;
memory.Attach(memory.FindProcess(PROCESS_NAME), PROCESS_ALL_ACCESS);
cout << "Attached to process " << PROCESS_NAME << endl;
clientDLL = memory.GetModule(CLIENT_DLL);
cout << "Module " << CLIENT_DLL << " was loaded. Base: " << clientDLL.base << ", size: " << clientDLL.size << endl;
while (true) {
auto glowObjectManager = memory.Read<DWORD>(clientDLL.base + hazedumper::signatures::dwGlowObjectManager);
auto glowObjectManagerSize = memory.Read<DWORD>(clientDLL.base + hazedumper::signatures::dwGlowObjectManager + sizeof(int));
for (int glowObjectIndex = 0; glowObjectIndex < glowObjectManagerSize; glowObjectIndex++) {
auto glowObjectDefenition = memory.Read<GlowObjectDefinition>(glowObjectManager + glowObjectIndex * sizeof(GlowObjectDefinition));
auto entityClassid = memory.Read<int>(memory.Read<int>(memory.Read<int>(memory.Read<int>(glowObjectDefenition.baseEntity + 0x8) + 0x8) + 0x1) + 0x14);
if (glowObjectDefenition.baseEntity == 0 || entityClassid != PLAYER_CLASS_ID) {
continue;
}
glowObjectDefenition.renderWhenOccluded = true;
glowObjectDefenition.style = GLOW_OBJECT_DEFENITION_STYLE;
glowObjectDefenition.SetColor({0,255,0,255});
memory.Read<GlowObjectDefinition>(glowObjectManager + glowObjectIndex * sizeof(GlowObjectDefinition)), glowObjectDefenition;
}
}
return 0;
}