#include "stdafx.h"
#include <math.h>
#include <windows.h>
#include <iostream>
#include <conio.h>
#include <tlhelp32.h>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <sstream>
#include <Windows.h>
#include <cmath>
#define DIKEYBOARD_L 0x0426
#pragma comment(lib, "Psapi.lib")
using namespace std;
char Myname[32] = "M a n t a R o c h e n";
struct player // our playerstruct...
{
BYTE hp; // here the hp will be saved...
char name[32]; // the name in chars...
BYTE team; // the team... 0 = spec, 2 = t, 3 = ct
float x; // x coord
float y; // y...
float z; // z...
float pitch; // pitch
float yaw; // yaw
float roll; // angle
} players[64] = {0}; // struct array to save the readout data - max 64 players
bool isLow;
int Triggerkey;
int a = 30;
int c = 600;
int focusindex = 64;
int oppositeTeam(int team)
{
if (team == 2)
{
return 3;
}
else if (team == 3)
{
return 2;
}
else
{
return 0;
}
}
float rechnen(player eins, player zwei) {
float x;
float y;
float z;
float ergebnis;
x = eins.x - zwei.x;
x = x * x;
y = eins.y - zwei.y;
y = y * y;
z = eins.z - zwei.z;
z = z * z;
ergebnis = sqrt(x+y+z);
//Gibt das ergebnis an main zurück
return ergebnis;
}
const int RadarOffset = 0x71EA14;
const int BhopOffset = 0x6F5874;
const int BhopOffsetB = 0x1F0;
const int TriggerOffset = 0x6F5874;
const int TriggerOffsetB = 0x1458;
const int RadarOffsetB = 0xC;
int tempAdress, BaseAdress;
DWORD GetModuleBaseExtern(const DWORD dwProcessId, const char *szModuleName)
{
#ifdef _GMBE_CHECK_PARAMS_
if (!dwProcessID) || (!szModuleName) return 0;
#endif
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId);
if (!hSnap) return 0;
MODULEENTRY32 me;
me.dwSize = sizeof(MODULEENTRY32);
DWORD dwReturn = 0;
if (Module32First(hSnap, &me)) {
while (Module32Next(hSnap, &me)) {
if (lstrcmpi(me.szModule, szModuleName) == 0) {
dwReturn = (DWORD)me.modBaseAddr;
break;
}
}
}
CloseHandle(hSnap);
return dwReturn;
}
int main(int argc, char *argv[])
{
DWORD destSize;
destSize=500;
GetPrivateProfileString("trigger","Myname","NULL",Myname,destSize,"C://settings.ini");
cout << " Auszug deines Namens aus der Settings.ini : " << Myname << endl;
// Wenn die Variablen aus der Ini nicht eingelesen werden können, steht nach dem Aufruf der Default-Wert in Test, EinPfad oder Test (In diesem Beispiel "NULL");
SetConsoleTitle( "Mantas Aimer - Exorbital gut" );
HWND hwnd = NULL;
DWORD pid;
HANDLE hProcess;
DWORD clientbase;
DWORD enginebase;
int Triggerbase;
int InCrosshair;
int Bhopbase;
double hyp;
double delta_x;
double delta_y;
double delta_z;
float yaw;
float pitch;
float roll;
float backup;
float pitchalt;
int iTarget;
cout << " Starte jetzt CS:S du Lappen." << endl;
while(hwnd==NULL)
{
hwnd = FindWindow (NULL, "Counter-Strike Source");
cout << " Es ist ja immer noch nicht an ! " << endl;
Sleep(1000);
}
SetForegroundWindow (hwnd);
while (!(GetForegroundWindow() == hwnd))
{
Sleep(100);
}
GetWindowThreadProcessId (hwnd, &pid);
hProcess = OpenProcess (PROCESS_ALL_ACCESS, 0, pid);
cout << " Isch hab ihn gefunden ;) " << endl;
cout << " _____ _____ _ " << endl;
cout << " | __|___ _ _ ___ ___ __ | __|_ _ ___| |_ " << endl;
cout << " |__ | . | | | _| _| -_| | __| | | _| '_|" << endl;
cout << " |_____|___|___|_| |___|___| |__| |___|___|_,_|" << endl;
cout << "" << endl;
clientbase = GetModuleBaseExtern(pid, "client.dll");
enginebase = GetModuleBaseExtern(pid, "engine.dll");
while (true)
{
tempAdress = clientbase + RadarOffset;
ReadProcessMemory(hProcess, (LPVOID)tempAdress, &BaseAdress, sizeof(BaseAdress), 0);
tempAdress = BaseAdress + RadarOffsetB;
ReadProcessMemory(hProcess, (LPVOID)tempAdress, &BaseAdress, sizeof(BaseAdress), 0);
BYTE Playerteam[64] = {0};
BYTE buffer[65*0x140];
tempAdress = BaseAdress;
ReadProcessMemory(hProcess, (LPVOID)tempAdress, &buffer, 65*0x140, 0);
for ( int i = 0; i <= 64; i++) // copying the relevant data in our extra structs.
{
memcpy(&players[i].team, &buffer[0x140*i+0x34], sizeof(players[i].team));
memcpy(&players[i].name, &buffer[0x140*i+0x14], sizeof(players[i].name));
memcpy(&players[i].x, &buffer[0x140*i+0x3C], sizeof(players[i].x));
memcpy(&players[i].y, &buffer[0x140*i+0x40], sizeof(players[i].y));
memcpy(&players[i].z, &buffer[0x140*i+0x44], sizeof(players[i].z));
memcpy(&players[i].pitch, &buffer[0x140*i+0x48], sizeof(players[i].pitch));
memcpy(&players[i].yaw, &buffer[0x140*i+0x4C], sizeof(players[i].yaw));
memcpy(&players[i].roll, &buffer[0x140*i+0x50], sizeof(players[i].roll));
}
isLow = FALSE; // we havent found right now our name
for (int i = 0; i <= 64; i++) // identifying focusplayer
{
if (strcmp(Myname, players[i].name) == 0) // is that us?
{
if (!isLow) // first player found with that name?
{
isLow = TRUE; // yeeeaaah
focusindex = i; // gotcha!
break; // breaking up with you 
}
}
}
for ( int iLoopCounter = 1; iLoopCounter <= 64; iLoopCounter++ && iLoopCounter != focusindex )
{
iTarget = 3;
float ergebnis0 = rechnen(players[0], players[focusindex]);
float ergebnis1 = rechnen(players[1], players[focusindex]);
float ergebnis2 = rechnen(players[2], players[focusindex]);
float ergebnis3 = rechnen(players[3], players[focusindex]);
if( ergebnis1 < ergebnis0 )
{
iTarget = iLoopCounter;
}
if(ergebnis2 < ergebnis1 )
{
iTarget = iLoopCounter;
}
if(ergebnis2 < ergebnis1 )
{
iTarget = iLoopCounter;
}
if(ergebnis3 < ergebnis2 )
{
iTarget = iLoopCounter;
}
}
/*Your xyz coordinates in the game
Dim my_x As Single
Dim my_y As Single
Dim my_z As Single
//The enemy coordinates in game
Dim nme_x As Single
Dim nme_y As Single
Dim nme_z As Single
//static testing values for aiming at
//nme_x = -103.08
//nme_y = 1526.4
//nme_z = 96.03
*/
//aimbot correction testing (height depth)
players[iTarget].z = players[iTarget].z + 55;
players[iTarget].x = players[iTarget].x - 10;
players[iTarget].y = players[iTarget].y + 5;
cout << iTarget << endl;
Sleep(500);
//math shit
roll = 0;
delta_x = players[focusindex].x - players[iTarget].x;
delta_y = players[focusindex].y - players[iTarget].y;
delta_z = players[focusindex].z - players[iTarget].z;
hyp = sqrt((delta_x * delta_x) + (delta_y * delta_y) + (delta_z * delta_z));
pitch = atan(delta_z / hyp) * 57.295779513082;
//sometimes a certain view angle goes to 0 and makes the aimbot go crazy, this will use the last non 0 integer so you can maintain a smooth non glitchy aimbot
if (delta_x == 0)
{
delta_x = backup;
}
//this saves your last view angle for backup in case it is 0 next time around
backup = delta_x;
yaw = atan(delta_y / delta_x) * 57.295779513082;
if (delta_x > 0)
{
yaw = yaw + 180;
}
if (GetAsyncKeyState(VK_SPACE))
{
ReadProcessMemory (hProcess,(LPCVOID)(enginebase + 0x3EA964),&pitchalt, sizeof(pitchalt), NULL);
cout << pitchalt << endl;
Sleep(300);
WriteProcessMemory (hProcess,(LPVOID)(enginebase + 0x3EA964), &pitch, sizeof(pitch), NULL);
WriteProcessMemory (hProcess,(LPVOID)(enginebase + 0x3EA968), &yaw, sizeof(yaw), NULL);
}
Sleep(1);
}
Sleep(1);
return 0;
}