Ok so this is the second time I Post this, this time it should be on the right forum and nothing breaking the rules basicly like last time I wanted to know if I could message someone to review my code wich is C++ and my first actual working cheat and give some advice and tell me if it would get insta VAC ban or undetected. I dont think I can send PM's until I reach a certain ammount of posts but if Im wrong tell me how to PM and I can send u code.
Thx
Code:
#include <windows.h>
#include <tlhelp32.h>
#include <iostream>
DWORD LBASE = 0xA6E444; // Local Player Base
DWORD Cross = 0xA940; //Crosshair ID
DWORD TEAM = 0xF0; //Team Offset 2 - Terrorist 3 - Counter Terrorist
DWORD EntBase = 0x4A5C9C4; //Player List
DWORD Coff; // Client Offset
DWORD ID; //Game ProcessID
HANDLE ph; // Game Handle
DWORD GetProc(char * name); //Get ProcID
DWORD GetDLL(char * name);//Get Client
const DWORD ProcSize = sizeof(PROCESSENTRY32);
const DWORD ModSize = sizeof(MODULEENTRY32);
struct User {
DWORD Base;
DWORD Player;
DWORD ID;
DWORD Team;
DWORD MyTeam;
DWORD Enemy[32];
DWORD Temp = 0;
void Once()
{
ReadProcessMemory(ph, (PBYTE *)(Coff + LBASE), &Base, sizeof(DWORD), NULL); // Gets Player Base Address
ReadProcessMemory(ph, (PBYTE *)(Base + 0xF0), &MyTeam, sizeof(DWORD), NULL); // Gets My Team
//std::cout << "My Team: " << MyTeam << "\n";
for (int i = 0; i < 32; i++)
{
ReadProcessMemory(ph,(PBYTE *)(Coff + EntBase + (i * 0x10)),&Player,sizeof(DWORD),NULL); // Gets Player
ReadProcessMemory(ph, (PBYTE *)(Player + TEAM), &Team, sizeof(DWORD), NULL); // Gets Player Team
//std::cout << "ID : " << i + 1 << "Team: " << Team << "\n";
if (Team != MyTeam && (Team == 2 || Team == 3)) // If Player Is not on our Team add hem to Enemy List otherwise do nothing
{
Enemy[Temp] = i+1;
Temp++;
}
}
//std::cout << Enemy[0] << std::endl << Enemy[1] << std::endl << Enemy[2] << std::endl << Enemy[3] << std::endl << Enemy[4] << std::endl;
}
void ReadInfo()//Read player Crosshair ID
{
ReadProcessMemory(ph,(PBYTE *)(Base + Cross),&ID,sizeof(DWORD),NULL);
}
};
int main()
{
Sleep(1000);
User P;
ID = GetProc("csgo.exe");
ph = OpenProcess(PROCESS_VM_READ, 0, ID);
Coff = GetDLL("client.dll");
P.Once();
while (!GetAsyncKeyState(VK_END))
{
Sleep(2);
P.ReadInfo();
//std::cout << P.ID << "\n";
for (int i = 0; i < 32;i++){
if (P.ID == P.Enemy[i] && P.ID != 0) {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
}
}
CloseHandle(ph);
//system("PAUSE");
return 0;
}
DWORD GetProc(char * name) //Get ProcID
{
PROCESSENTRY32 proc;
proc.dwSize = ProcSize;
HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if (Process32First(snap, &proc))
{
do {
if (!strcmp(proc.szExeFile,name))
{
CloseHandle(snap);
return proc.th32ProcessID;
}
} while (Process32Next(snap, &proc));
}
return 0;
}
DWORD GetDLL(char * name) //Get Client.dll Base address
{
MODULEENTRY32 mod;
mod.dwSize = ModSize;
HANDLE m = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,ID);
if (Module32First(m, &mod))
{
do {
if (!strcmp(name, mod.szModule))
{
CloseHandle(m);
return (DWORD)mod.modBaseAddr;
}
} while (Module32Next(m,&mod));
}
return 0;
}