Перейти к содержанию

[CS GO] замена нетваров (оффсетов) на сигнатуры


Рекомендуемые сообщения

Всем привет!
Найдя на просторах YouTube очень годный гайд по ESP, попробовал сам скомпилировать проект. Но у меня ESP не заработал (хотя брал последние нетвары хоть с гита hazedumper, хоть сам через утилиту hazedumper). Грешу на нетвары.

Можно ли как-то заменить нетвары в ESP из гайда на оффсеты? Так как с Cheat Engine я вроде бы как разобрался, и давно уже нашел структуру игрока, ботов (соответственно их хп, координаты).

имхо: так же я не совсем понял, за что отвечают "dwEntityList" и "dwViewMatrix". Вот с остальным вроде как понятно: "m_iTeamNum" по идее считает количество ботов, "m_iHealth" количество ХП ботов, а "m_vecOrigin" отвечает за XYZ координаты.

Ссылка на комментарий
Поделиться на другие сайты

Исходный код:

Спойлер

#include "Offsets.h"
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>

/* SexOffenderSally helped code a lot/most of this with me, a long time friend! Give him a <3 on discord
Make sure character set is 'Multi-Byte' in project settings! And game must be windowed fullscreen.
Updated offsets: https://github.com/frk1/hazedumper/blob/master/csgo.cs     */

#define EnemyPen 0x000000FF
HBRUSH EnemyBrush = CreateSolidBrush(0x000000FF);

int screenX = GetSystemMetrics(SM_CXSCREEN);
int screenY = GetSystemMetrics(SM_CYSCREEN);

DWORD GetProcId(const wchar_t* procName)
{
	DWORD procId = 0;
	HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
	if (hSnap != INVALID_HANDLE_VALUE)
	{
		PROCESSENTRY32 procEntry;
		procEntry.dwSize = sizeof(procEntry);

		if (Process32First(hSnap, &procEntry))
		{
			do
			{
				if (!_wcsicmp(procEntry.szExeFile, procName))
				{
					procId = procEntry.th32ProcessID;
					break;
				}
			} while (Process32Next(hSnap, &procEntry));

		}
	}
	CloseHandle(hSnap);
	return procId;
}

uintptr_t GetModuleBaseAddress(DWORD procId, const wchar_t* modName)
{
	uintptr_t modBaseAddr = 0;
	HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
	if (hSnap != INVALID_HANDLE_VALUE)
	{
		MODULEENTRY32 modEntry;
		modEntry.dwSize = sizeof(modEntry);
		if (Module32First(hSnap, &modEntry))
		{
			do
			{
				if (!_wcsicmp(modEntry.szModule, modName))
				{
					modBaseAddr = (uintptr_t)modEntry.modBaseAddr;
					break;
				}
			} while (Module32Next(hSnap, &modEntry));
		}
	}
	CloseHandle(hSnap);
	return modBaseAddr;
}

uintptr_t moduleBase = GetModuleBaseAddress(GetProcId(L"csgo.exe"), L"client_panorama.dll");
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, GetProcId(L"csgo.exe"));
HDC hdc = GetDC(FindWindowA(NULL, "Counter-Strike: Global Offensive"));

template<typename T> T RPM(SIZE_T address) {
	//The buffer for data that is going to be read from memory
	T buffer;

	//The actual RPM
	ReadProcessMemory(hProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);

	//Return our buffer
	return buffer;
}

struct view_matrix_t {
	float* operator[ ](int index) {
		return matrix[index];
	}

	float matrix[4][4];
};

struct Vector3
{
	float x, y, z;
};

Vector3 WorldToScreen(const Vector3 pos, view_matrix_t matrix) {
	float _x = matrix[0][0] * pos.x + matrix[0][1] * pos.y + matrix[0][2] * pos.z + matrix[0][3];
	float _y = matrix[1][0] * pos.x + matrix[1][1] * pos.y + matrix[1][2] * pos.z + matrix[1][3];

	float w = matrix[3][0] * pos.x + matrix[3][1] * pos.y + matrix[3][2] * pos.z + matrix[3][3];

	float inv_w = 1.f / w;
	_x *= inv_w;
	_y *= inv_w;

	float x = screenX * .5f;
	float y = screenY * .5f;

	x += 0.5f * _x * screenX + 0.5f;
	y -= 0.5f * _y * screenY + 0.5f;

	return { x,y,w };
}

void DrawFilledRect(int x, int y, int w, int h)
{
	RECT rect = { x, y, x + w, y + h };
	FillRect(hdc, &rect, EnemyBrush);
}

void DrawBorderBox(int x, int y, int w, int h, int thickness)
{
	DrawFilledRect(x, y, w, thickness); //Top horiz line
	DrawFilledRect(x, y, thickness, h); //Left vertical line
	DrawFilledRect((x + w), y, thickness, h); //right vertical line
	DrawFilledRect(x, y + h, w + thickness, thickness); //bottom horiz line
}

void DrawLine(float StartX, float StartY, float EndX, float EndY)
{
	int a, b = 0;
	HPEN hOPen;
	HPEN hNPen = CreatePen(PS_SOLID, 2, EnemyPen);// penstyle, width, color
	hOPen = (HPEN)SelectObject(hdc, hNPen);
	MoveToEx(hdc, StartX, StartY, NULL); //start
	a = LineTo(hdc, EndX, EndY); //end
	DeleteObject(SelectObject(hdc, hOPen));
}

int main()
{
	while (true)
	{
		view_matrix_t vm = RPM<view_matrix_t>(moduleBase + dwViewMatrix);
		int localteam = RPM<int>(RPM<DWORD>(moduleBase + dwEntityList) + m_iTeamNum);

		for (int i = 1; i < 64; i++)
		{
			uintptr_t pEnt = RPM<DWORD>(moduleBase + dwEntityList + (i * 0x10));

			int health = RPM<int>(pEnt + m_iHealth);
			int team = RPM<int>(pEnt + m_iTeamNum);

			Vector3 pos = RPM<Vector3>(pEnt + m_vecOrigin);
			Vector3 head;
			head.x = pos.x;
			head.y = pos.y;
			head.z = pos.z + 75.f;
			Vector3 screenpos = WorldToScreen(pos, vm);
			Vector3 screenhead = WorldToScreen(head, vm);
			float height = screenhead.y - screenpos.y;
			float width = height / 2.4f;

			if (screenpos.z >= 0.01f && team != localteam && health > 0 && health < 101) {
				DrawBorderBox(screenpos.x - (width / 2), screenpos.y, width, height, 1);
				DrawLine(screenX / 2, screenY, screenpos.x, screenpos.y);
			}
		}
	}
}

 


Нетвары на данный момент для пиратки 1.37.7.8 (тестил и на лицензии с другими нетварами, итог тот же ?) :

Спойлер

#pragma once
#define dwEntityList 0x4DA2E24
#define dwViewMatrix 0x4D94724
#define m_iTeamNum 0xF4
#define m_iHealth 0x100
#define m_vecOrigin 0x138

 

 

Изменено пользователем Around
Ссылка на комментарий
Поделиться на другие сайты

Что раз никто не отвечает, отвечю я своей умной головой).

Я просто не отвечаю потому что мои сообщение часто удаляют и снижают репутацию, Так сказать указывают мне мое место а я не хочу в это место!

Михаил Ремизов Вот на этом канале ведущий сделал ESP, интернал то есть DLL который нужно заинжекить карбюратором.

Ты, как я понял хочешь сделать экстернал то есть exe файл запускаешь и у тебя отрисовывается ESP.

Ты запустил игру в оконном режиме? Такой способ будет мерцать в оконном а в полноэкранном вроде вообще отрисовыватся не будет.

Ты ввел команду -insecure вроде так? что бы отключить античит вроде VAC славится без защитностю но не настолько) Что бы так просто считывать данные из игры.

Надо понять проблемма в твоем коде или с оффсетами  и нетварами.

Если сами так называемые нетвары да оффсеты и смещениями погоняющие верные, попробуй старые шутеры КС1.6 запусти с ботами и ищи нужные данные с помощю CE: Количество игроков, твою структуру, структуру врагов.

В каждой структуре хп координаты здоровье и также направление камеры X и Y, если ничего не забыл.

Сначала попробуй на КС1.6, если получится переходи на КС ГО.

Легче всего сделать на assaultcube 

Спойлер

#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
#include <gdiplus.h>
#include <math.h>
#define FLT_MAX     3.40282347E+38F
typedef struct
{
    float x, y, z, w;
} Vec4;
//2 Dimensional Vector(Screen)
typedef struct
{
    float x, y;
} Vec2;
//3 Dimensional Vector(Ingame)
typedef struct
{
    float x, y,z;
} Vec3;
typedef struct
{
    Vec3 Pos;
    Vec3 HeadPos;
    int Health,Team;
    char Name[20];
} Entities;
typedef struct
{
    Vec3 Pos;
    int Health,Team,Base;
} LocalPlayer;

DWORD LocalPlayerOffset=0x509B74;
DWORD RVSF_Team=0x32C;
DWORD Viewx=0x40;
DWORD Viewy=0x44;
DWORD EntityBaseOffset=0x50F4F8;
DWORD PlayerCountAddress=0x50F500;
DWORD xPosOffset=0x34;
DWORD yPosOffset=0x38;
DWORD zPosOffset=0x3c;
DWORD pistolMag=0x70;
DWORD RifleMag=0x128;
DWORD RifleAmmo=0x150;
DWORD GrenadeAmmount=0x158;
DWORD PlayerSpeed=0x80;
DWORD ViewMatrixAddress=0x501AE8;
DWORD Health=0xF8;
DWORD ForceAttack=0x224;

int handle;
int pid;
HDC hdcAC;
HWND hwndAC_Client;
void MemStart();
int ReadMem(LPCVOID Address,LPVOID ReadVar,int SizeDataType);
int WriteMem(LPCVOID Address,LPVOID WriteVar,int SizeDataType);
int WorldToScreen(Vec3 pos, Vec2 *screen, float matrix[16], int windowWidth, int windowHeight);
void DrawFilledRect(int x, int y, int w, int h,HBRUSH color);
void DrawBorderBox(int x, int y, int w, int h, int thickness);
void DrawHealthESP(int x, int y, int w, float h, int thickness,int Health);
void DrawString(int x, int y, COLORREF color, const char* text);
void ESP(Vec3 EnemyPosition,Vec3 enemyHeadPos,float Matrix[16],int PlayerHealth,char PlayerName[20]);
void ReadEntityInfo(int i,Entities *ent);
void ReadLocalPlayerInfo(LocalPlayer *local);
Vec2 CalcAngles(Vec3 CoordsToEnemy, float distance);
Vec2 vScreen, vHead;
HBRUSH color;
HBRUSH HealthESPColor;
COLORREF TextCOLOR;
HFONT Font;
int EntityBase;
int main()
{
    TextCOLOR = RGB(255, 255, 255);
    HealthESPColor=CreateSolidBrush(RGB(0,255,0));
    color=CreateSolidBrush(RGB(255,0,0));
    float hypo;
    float newDistance;
    int playercountread;
    //Finding the PID of the process via WindowName and getting permissions to read the addresses in this process
    MemStart();
    //if we cant get permissions
    while(handle==0)
    {
        printf("Start AssaultCube!\n");
        getchar();
        printf("Retrying...\n");
        MemStart();
    }
    Vec2 angle;
    while(1)
    {
        printf("\rThank you for using Rainy's Shitty Assault Cube Hack | https://github.com/RainyPT/ACHack");
        hypo=FLT_MAX;
        newDistance=0;
        ReadMem(PlayerCountAddress,&playercountread,sizeof(int));
        Entities entity[playercountread];
        LocalPlayer local;
        for(int i=4; i<(playercountread*4); i+=4)
        {
            ReadLocalPlayerInfo(&local);
            ReadEntityInfo(i,&entity[i/4]);
            int newammo=1337;
            WriteMem(local.Base+RifleAmmo,&newammo,sizeof(int));
            float viewMatrix[16];
            ReadMem(ViewMatrixAddress, &viewMatrix, sizeof(viewMatrix));
            if(local.Team!=entity[i/4].Team)
            {
                if(entity[i/4].Health>0)
                {
                    ESP(entity[i/4].Pos,entity[i/4].HeadPos,viewMatrix,entity[i/4].Health,entity[i/4].Name);
                    Vec3 CoordsToEnemy= {entity[i/4].Pos.x-local.Pos.x,entity[i/4].Pos.y-local.Pos.y,entity[i/4].Pos.z-local.Pos.z};
                    newDistance=sqrt((CoordsToEnemy.x*CoordsToEnemy.x)+(CoordsToEnemy.y*CoordsToEnemy.y)+(CoordsToEnemy.z*CoordsToEnemy.z));
                    if (newDistance < hypo)
                    {
                        hypo = newDistance;
                        angle=CalcAngles(CoordsToEnemy,newDistance);
                    }
                }
            }
        }
        if(GetAsyncKeyState(VK_LBUTTON))
        {
            WriteMem(local.Base+Viewx,&angle,sizeof(angle));
        }
    }
    CloseHandle(handle);
    return 0;
}
void ReadLocalPlayerInfo(LocalPlayer *local)
{
    ReadMem(LocalPlayerOffset,&local->Base,sizeof(int));
    ReadMem(local->Base+RVSF_Team,&local->Team,sizeof(int));
    ReadMem(local->Base+xPosOffset,&local->Pos,sizeof(local->Pos));
}
void ReadEntityInfo(int i,Entities *ent)
{
    ReadMem(EntityBaseOffset,&EntityBase,sizeof(int));
    ReadMem(EntityBase+i,&EntityBase,sizeof(int));
    if(EntityBase!=0)
    {
        ReadMem(EntityBase+RVSF_Team,&ent->Team,sizeof(int));
        ReadMem(EntityBase+xPosOffset, &ent->Pos, sizeof(ent->Pos));
        ReadMem(EntityBase+Health, &ent->Health, sizeof(int));
        ReadMem(EntityBase+0x225,&ent->Name,20);
        ReadMem(EntityBase+0x4, &ent->HeadPos, sizeof(ent->HeadPos));
    }

}
Vec2 CalcAngles(Vec3 CoordsToEnemy, float distance)
{
    Vec2 angle;
    angle.x = -atan2f(CoordsToEnemy.x, CoordsToEnemy.y) / M_PI * 180.0f + 180.0f;
    angle.y = asinf((CoordsToEnemy.z) / distance) * 180.0f / M_PI;
    return angle;
}
void ESP(Vec3 EnemyPosition,Vec3 enemyHeadPos,float Matrix[16],int PlayerHealth,char PlayerName[20])
{
    if(WorldToScreen(EnemyPosition,&vScreen,Matrix,1024,768))
    {
        if(WorldToScreen(enemyHeadPos,&vHead,Matrix,1024,768))
        {
            float height=vHead.y-vScreen.y;
            float width=height / 2.4f;
            DrawBorderBox(vScreen.x - (width / 2), vScreen.y, width, height, 2);
            DrawHealthESP(vScreen.x - (width / 2), vScreen.y, width, height, 3,PlayerHealth);
            DrawString(vScreen.x, vScreen.y, TextCOLOR, PlayerName);
        }
    }
}
int WorldToScreen(Vec3 pos, Vec2 *screen, float matrix[16], int windowWidth, int windowHeight) // 3D to 2D
{
    //Matrix-vector Product, multiplying world(eye) coordinates by projection matrix = clipCoords
    Vec4 clipCoords;
    clipCoords.x = pos.x*matrix[0] + pos.y*matrix[4] + pos.z*matrix[8] + matrix[12];
    clipCoords.y = pos.x*matrix[1] + pos.y*matrix[5] + pos.z*matrix[9] + matrix[13];
    clipCoords.z = pos.x*matrix[2] + pos.y*matrix[6] + pos.z*matrix[10] + matrix[14];
    clipCoords.w = pos.x*matrix[3] + pos.y*matrix[7] + pos.z*matrix[11] + matrix[15];

    if (clipCoords.w < 0.1f)
        return 0;

    //perspective division, dividing by clip.W = Normalized Device Coordinates
    Vec3 NDC;
    NDC.x = clipCoords.x / clipCoords.w;
    NDC.y = clipCoords.y / clipCoords.w;
    NDC.z = clipCoords.z / clipCoords.w;

    //Transform to window coordinates
    screen->x=(windowWidth / 2 * NDC.x) + (NDC.x + windowWidth / 2);
    screen->y=-(windowHeight / 2 * NDC.y) + (NDC.y + windowHeight / 2);
    return 1;
}
void DrawFilledRect(int x, int y, int w, int h,HBRUSH color)
{
    RECT rect = { x, y, x + w, y + h};
    FillRect(hdcAC, &rect, color);
}

void DrawBorderBox(int x, int y, int w, int h, int thickness)
{
    DrawFilledRect(x+2, y, w-2, thickness,color);
    DrawFilledRect(x, y, thickness, h,color);
    DrawFilledRect((x + w), y, thickness, h,color);
    DrawFilledRect(x, y + h, w + thickness, thickness,color);
}
void DrawHealthESP(int x, int y, int w, float h, int thickness,int health)
{
    h=h*((float)health/100);
    DrawFilledRect(x+5, y, thickness, h,HealthESPColor);
}
void DrawString(int x, int y, COLORREF color, const char* text)
{
    SetTextAlign(hdcAC, TA_CENTER | TA_NOUPDATECP);
    SetBkColor(hdcAC, RGB(0, 0, 0));
    SetBkMode(hdcAC, TRANSPARENT);
    SetTextColor(hdcAC, color);
    SelectObject(hdcAC, Font);
    TextOutA(hdcAC, x, y, text, strlen(text));
    DeleteObject(Font);
}
void MemStart()
{
    hwndAC_Client=FindWindow(0, "AssaultCube");
    hdcAC=GetDC(hwndAC_Client);
    GetWindowThreadProcessId(hwndAC_Client,&pid);
    handle=OpenProcess(PROCESS_ALL_ACCESS,0,pid);
}
int ReadMem(LPCVOID Address,LPVOID ReadVar,int SizeDataType)
{
    return ReadProcessMemory(handle,Address,ReadVar,SizeDataType,0);
}
int WriteMem(LPCVOID Address,LPVOID WriteVar,int SizeDataType)
{
    return WriteProcessMemory(handle,Address,WriteVar,SizeDataType,0);
}

 

Просто компилишь и работает нашел на Гуидед ХАКИНГ) .

 

 

Ссылка на комментарий
Поделиться на другие сайты

18 часов назад, NubZilla сказал:

Сначала выведи в консоль количество игроков и твои координаты, удостоверся что твои оффсеты правильные.

В консоли игры? Можно по подробнее?

Изменено пользователем Around
Ссылка на комментарий
Поделиться на другие сайты

35 минут назад, Around сказал:

В консоли игры? Можно по подробнее?

Сначала в обычную консоль выведи количество ботов вместе с тобой или игроков в обычную консоль винды. В консоль куда новички пишут Hello World ты выведи на экран количество игроков.

Желательно в цикле чтобы ты перезаходил с различными количествами ботов, и у тебя в консоли выводилось количество игроков. То есть постоянно считывалось и выводилось.

Если выведешь количество игроков значит что ты нашел правильный указатель(наверное многоуровневый) по которому показывается количество игроков.

Изменено пользователем NubZilla
Ссылка на комментарий
Поделиться на другие сайты

6 минут назад, NubZilla сказал:

Сначала в обычную консоль выведи количество ботов вместе с тобой или игроков в обычную консоль винды. В консоль куда новички пишут Hello World ты выведи на экран количество игроков.

Желательно в цикле чтобы ты перезаходил с различными количествами ботов, и у тебя в консоли выводилось количество игроков. То есть постоянно считывалось и выводилось.

Если выведешь количество игроков значит что ты нашел правильный указатель(наверное многоуровневый) по которому показывается количество игроков.

Понял, спасибо! Пойду делать.

Ссылка на комментарий
Поделиться на другие сайты

×
×
  • Создать...

Важная информация

Находясь на нашем сайте, Вы автоматически соглашаетесь соблюдать наши Условия использования.