- Katılım
- 22 May 2021
- Mesajlar
- 1,473
- Beğeniler
- 333
c++ ile csgo'da glow kodlama
1-c++da boş proje oluşturun
2-memory.h ve main.cpp isminde dosyalar oluşturun
3-verdiğim kodları yazın
4-Derle kısmından Çözümü derle diyin
iyi hileler...
main.cpp
#include "memory.h"
#include <thread>
namespace offsets
{
// client.dll
constexpr auto localPlayer = 0xDA747C;
constexpr auto entityList = 0x4DC177C;
constexpr auto glowObjectManager = 0x5309C78;
// entity
constexpr auto teamNum = 0xF4;
constexpr auto glowIndex = 0x10488;
}
int main()
{
auto mem = Memory{ "csgo.exe" };
const auto client = mem.GetModuleAddress("client.dll");
while (true)
{
const auto localPlayer = mem.Read<std::uintptr_t>(client + offsets::localPlayer);
const auto glowObjectManager = mem.Read<std::uintptr_t>(client + offsets::glowObjectManager);
for (auto i = 0; i < 64; i++)
{
const auto entity = mem.Read<std::uintptr_t>(client + offsets::entityList + i * 0x10);
if (mem.Read<std::uintptr_t>(entity + offsets::teamNum) == mem.Read<std::uintptr_t>(localPlayer + offsets::teamNum))
continue;
const auto glowIndex = mem.Read<std::int32_t>(entity + offsets::glowIndex);
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0x8, 1.f); // r
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0xC, 0.f); // g
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0x10, 0.f); // b
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0x14, 1.f); // a
mem.Write<bool>(glowObjectManager + (glowIndex * 0x38) + 0x27, true);
mem.Write<bool>(glowObjectManager + (glowIndex * 0x38) + 0x28, true);
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
return 0;
}
memory.h
1-c++da boş proje oluşturun
2-memory.h ve main.cpp isminde dosyalar oluşturun
3-verdiğim kodları yazın
4-Derle kısmından Çözümü derle diyin
iyi hileler...
main.cpp
#include "memory.h"
#include <thread>
namespace offsets
{
// client.dll
constexpr auto localPlayer = 0xDA747C;
constexpr auto entityList = 0x4DC177C;
constexpr auto glowObjectManager = 0x5309C78;
// entity
constexpr auto teamNum = 0xF4;
constexpr auto glowIndex = 0x10488;
}
int main()
{
auto mem = Memory{ "csgo.exe" };
const auto client = mem.GetModuleAddress("client.dll");
while (true)
{
const auto localPlayer = mem.Read<std::uintptr_t>(client + offsets::localPlayer);
const auto glowObjectManager = mem.Read<std::uintptr_t>(client + offsets::glowObjectManager);
for (auto i = 0; i < 64; i++)
{
const auto entity = mem.Read<std::uintptr_t>(client + offsets::entityList + i * 0x10);
if (mem.Read<std::uintptr_t>(entity + offsets::teamNum) == mem.Read<std::uintptr_t>(localPlayer + offsets::teamNum))
continue;
const auto glowIndex = mem.Read<std::int32_t>(entity + offsets::glowIndex);
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0x8, 1.f); // r
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0xC, 0.f); // g
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0x10, 0.f); // b
mem.Write<float>(glowObjectManager + (glowIndex * 0x38) + 0x14, 1.f); // a
mem.Write<bool>(glowObjectManager + (glowIndex * 0x38) + 0x27, true);
mem.Write<bool>(glowObjectManager + (glowIndex * 0x38) + 0x28, true);
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
return 0;
}
memory.h
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <TlHelp32.h>
#include <cstdint>
#include <string_view>
class Memory
{
private:
std::uintptr_t processId = 0;
void* processHandle = nullptr;
public:
// Constructor that finds the process id
// and opens a handle
Memory(const std::string_view processName) noexcept
{
::PROCESSENTRY32 entry = { };
entry.dwSize = sizeof(::PROCESSENTRY32);
const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
while (::Process32Next(snapShot, &entry))
{
if (!processName.compare(entry.szExeFile))
{
processId = entry.th32ProcessID;
processHandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
break;
}
}
if (snapShot) ::CloseHandle(snapShot);
}
// Destructor that frees the opened handle
~Memory() { if (processHandle) ::CloseHandle(processHandle); }
// Returns the base address of a module by name
const std::uintptr_t GetModuleAddress(const std::string_view moduleName) const noexcept
{
::MODULEENTRY32 entry = { };
entry.dwSize = sizeof(::MODULEENTRY32);
const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processId);
std::uintptr_t result = 0;
while (::Module32Next(snapShot, &entry))
{
if (!moduleName.compare(entry.szModule))
{
result = reinterpret_cast<std::uintptr_t>(entry.modBaseAddr);
break;
}
}
if (snapShot) ::CloseHandle(snapShot);
return result;
}
// Read process memory
template <typename T>
constexpr const T& Read(const std::uintptr_t& address) const noexcept
{
T value = { };
::ReadProcessMemory(processHandle, reinterpret_cast<const void*>(address), &value, sizeof(T), NULL);
return value;
}
// Write process memory
template <typename T>
constexpr void Write(const std::uintptr_t& address, const T& value) const noexcept
{
::WriteProcessMemory(processHandle, reinterpret_cast<void*>(address), &value, sizeof(T), NULL);
}
};