well i was looking thru my comp and found this old aimbot source
dllmain
Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "hacks.h"
#pragma warning(disable: 4244)
// Is this the VIP release?
// #define VIP
localPtr *player1;
playerTable *players;
guninfo oGuninfo;
short keys[256];
int lastTarget;
bool aiming = false;
DWORD oProtect, nProtect = PAGE_EXECUTE_READWRITE;
// == Hack Settings ==
int AimType = 1;
// 0 - Off
// 1 - Closest to Crosshair
// 2 - Closest by Distance
// 3 - No Preference
float AimLockDist = 4.2f;
// Distance needed for aimbot to lock on.
int AimSpeed = 3;
// 1-30: 30 instantly moves to target.
// 1 lurks towards the target VERY slowly.
// (C++ Default is reversed!)
bool AimKeepTarget = 0;
// Won't switch targets if enabled.
// ===================
// == Necessary Functions ==
bool (*addcommand)(const char*, void*, int);
void (*conoutf)(const char*, ...);
float absf(float a){
if(a<0){return -a;}else{return a;}
}
// =========================
void UserHelp(){
printf("Made By speed\n");
}
void SpeedDetectionBypass(){
short* speedDetection;
speedDetection = (short*)spdPatch;
VirtualProtect((LPVOID)spdPatch,sizeof(short),nProtect,&oProtect);
*speedDetection = 0;
VirtualProtect((LPVOID)spdPatch,sizeof(short),oProtect,&nProtect);
}
void GetLocalPlayer(){
player1 = (localPtr*)pLocal;
}
void GetPlayerTable(){
players = (playerTable*)playerVecPtr;
}
void GetCommandPointer(){
addcommand = (bool (__cdecl*)(const char*, void*, int))addCmdPtr;
}
void GetConsolePointer(){
conoutf = (void (__cdecl*)(const char*, ...))conoutPtr;
}
void ReadGunInfo(){
int i;
guninfo *g;
for(i=0; i<NUMGUNS; i++){
g = (guninfo*)(gStructLocal+(gStructSize * i));
oGuninfo.spread = g->spread;
oGuninfo.recoil = g->recoil;
oGuninfo.maxrecoil = g->maxrecoil;
}
}
void RemoveSpread(int set){
int i;
guninfo *g;
if(set == 0){
printf("Spread Disabled.\n");
for(i=0; i<NUMGUNS; i++){
g = (guninfo*)(gStructLocal+(gStructSize * i));
g->spread = NoSpread;
g = (guninfo*)player1->obj->weapons[i]->infoA;
g->spread = NoSpread;
}
}else{
printf("Spread Enabled.\n");
for(i=0; i<NUMGUNS; i++){
g = (guninfo*)(gStructLocal+(gStructSize * i));
g->spread = oGuninfo.spread;
g = (guninfo*)player1->obj->weapons[i]->infoA;
g->spread = oGuninfo.spread;
}
}
}
void RemoveRecoil(int set){
int i;
guninfo *g;
if(set == 0){
printf("Recoil Disabled.\n");
for(i=0; i<NUMGUNS; i++){
g = (guninfo*)(gStructLocal+(gStructSize * i));
g->maxrecoil = NoRecoil;
g->recoil = NoRecoil;
g = (guninfo*)player1->obj->weapons[i]->infoA;
g->maxrecoil = NoRecoil;
g->recoil = NoRecoil;
}
}else{
printf("Recoil Enabled.\n");
for(i=0; i<NUMGUNS; i++){
g = (guninfo*)(gStructLocal+(gStructSize * i));
g->maxrecoil = oGuninfo.maxrecoil;
g->recoil = oGuninfo.recoil;
g = (guninfo*)player1->obj->weapons[i]->infoA;
g->maxrecoil = oGuninfo.maxrecoil;
g->recoil = oGuninfo.recoil;
}
}
}
void SetSpeed(float spd){
if(spd > 0.0f && spd <= 255.0f){
player1->obj->maxspeed = spd;
printf("Speed set to: %f.\n",spd);
}else{
printf("[ERROR]: Speed set to an invalid value!\n");
}
}
void AimbotSet(int set){
if(set < 0 || set > 2){
AimType = 0;
return;
}
AimType = set;
}
void AimbotSpeed(int speed){
if(speed >= 1 && speed <= 31){
AimSpeed = 31 - speed;
}
}
void AimbotLock(float lock){
if(lock > 3){
AimLockDist = lock;
}
}
void AimbotKeepTarget(int keep){
AimKeepTarget = (keep == 1);
}
void SetESP(int nesp){
//esp = (nesp == 1);
}
void SetupCommands(){
addcommand("recoil", &RemoveRecoil, ARG_1INT);
addcommand("spread", &RemoveSpread, ARG_1INT);
addcommand("speed", &SetSpeed, ARG_1EXPF);
addcommand("aimbot", &AimbotSet, ARG_1INT);
addcommand("aimspeed", &AimbotSpeed, ARG_1INT);
addcommand("aimlock", &AimbotLock, ARG_1EXPF);
addcommand("aimkeep", &AimbotKeepTarget, ARG_1INT);
addcommand("esp", &SetESP, ARG_1INT);
addcommand("About", &UserHelp, ARG_NONE);
}
void SetupKeys(){
intloop(256){
keys[i] = 0;
}
}
void AimAt(vec &from, vec &to, float &yaw, float &pitch, bool ignoreLock = false){
float dist = from.dist(to);
float p = (float)asin((to.z-from.z)/dist)/RAD;
float y = -(float)atan2(to.x-from.x, to.y-from.y)/3.14159*180+180;
dist = (absf(player1->obj->pitch - p) + absf(player1->obj->yaw - y));
if(dist <= AimLockDist || ignoreLock){
yaw = y;
pitch = p;
}else{
float oy = yaw, op = pitch;
yaw += (y-oy)/AimSpeed;
pitch += (p-op)/AimSpeed;
}
}
float GetDist(vec &from, vec &to, float yaw, float pitch){
float ret = 9999.0f;
switch(AimType){
case 1: // Crosshair
float ty,tp;
AimAt(from,to,ty,tp,true);
ret = (absf(player1->obj->pitch - tp) + absf(player1->obj->yaw - ty));
break;
case 2: // Distance
ret = from.distxy(to);
break;
case 3: // No Preference
ret = 0.0f;
break;
}
if(ret < 0){
ret = 9999.0f;
}
return ret;
}
void Aimbot(){
int tTarg = -1;
float np, ny;
float dist = 99999.0f;
aiming = true;
np = player1->obj->pitch;
ny = player1->obj->yaw;
bool doLast = ((lastTarget >= 0)&&AimKeepTarget);
if(doLast){
doLast = ((playerObj*)(*players)[lastTarget]->state == 0);
}
if(!doLast && (AimType > 0)){
vecloop(players){
playerObj *p = (*players)[i];
if(p != 0x00 && p->state == 0 && !isteam(player1->obj->team,p->team)){
float tDist = GetDist(player1->obj->o,p->o,ny,np);
if(tDist < dist){
dist = tDist;
tTarg = i;
lastTarget = i;
}
}
}
}else if(AimType > 0){
tTarg = lastTarget;
}
if(tTarg > -1){
playerObj *aimTarg = (*players)[tTarg];
AimAt(player1->obj->o,aimTarg->o,ny,np);
if((ny >= 0 && ny <= 360) && (np >= -90 && np <= 90)){
player1->obj->yaw = ny;
player1->obj->pitch = np;
}
}
}
void ResetAimbot(){
lastTarget = -1;
aiming = false;
}
void HackLoop(){
while(1){
intloop(256){
keys[i] = GetAsyncKeyState(i);
}
if(keys[VK_LSHIFT]){
Aimbot();
}else if(aiming){
ResetAimbot();
}
Sleep(18);
}
}
void AC_Thread(){
GetLocalPlayer();
GetPlayerTable();
GetCommandPointer();
SpeedDetectionBypass();
ReadGunInfo();
SetupCommands();
SetupKeys();
ResetAimbot();
HackLoop();
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
if(ul_reason_for_call == DLL_PROCESS_ATTACH)
{
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&AC_Thread, 0, 0, 0);
}
return TRUE;
}
hacks
Code:
#pragma once
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "tools.h"
// == DEFINES ==
#define pLocal (0x000000)
#define spdPatch (0x000000)
#define gStructLocal (0x000000)
#define addCmdPtr (0x000000)
#define playerVecPtr (0x000000)
#define conoutPtr (0x000000)
#define gStructSize (0x128)
#define wStructSize (0x70)
#define NoSpread 1
#define NoRecoil 0
#define vecloop(v) for(int i=0;i<(v)->length();i++)
#define intloop(s) for(int i=0;i<s;i++)
#define playerTable vector<playerObj*>
#define isteam(a,b) (strcmp(a, b)==0)
#define RAD ((3.1415927)/180)
// == END DEFINES ==
// == ENUMS ==
enum
{
ARG_1INT, ARG_2INT, ARG_3INT, ARG_4INT,
ARG_NONE,
ARG_1STR, ARG_2STR, ARG_3STR, ARG_4STR, ARG_5STR, ARG_6STR, ARG_7STR, ARG_8STR,
ARG_DOWN,
ARG_1EXP, ARG_2EXP,
ARG_1EXPF, ARG_2EXPF,
ARG_1EST, ARG_2EST,
ARG_IVAL, ARG_FVAL, ARG_SVAL,
ARG_CONC, ARG_CONCW,
ARG_VARI
};
enum { GUN_KNIFE = 0, GUN_PISTOL, GUN_SHOTGUN, GUN_SUBGUN, GUN_SNIPER, GUN_ASSAULT, GUN_GRENADE, GUN_AKIMBO, NUMGUNS };
// == END ENUMS ==
// == FORWARD DEFINITIONS ==
class localPtr;
class playerObj;
struct guninfo;
class weapon;
// == END FORWARD DEFINITIONS ==
class localPtr
{
public:
playerObj* obj; //0000
};
class playerObj
{
public:
__int32 Unknown0; //0000
vec o; //0004
vec vel; //0010
vec delta; //001C
vec newPos; //0028
float yaw; //0034
float pitch; //0038
float roll; //003C
float pitchvel; //0040
float maxspeed; //0044
__int32 timeinair; //0048
float radius; //004C
float eyeheight; //0050
float maxeyeheight; //0054
float aboveeye; //0058
__int8 inwater; //005C
__int8 onfloor; //005D
__int8 onladder; //005E
__int8 jumpnext; //005F
__int8 crouching; //0060
__int8 trycrouch; //0061
__int8 cancollide; //0062
__int8 stuck; //0063
__int32 lastsplash; //0064
__int8 move; //0068
__int8 strafe; //0069
__int8 state; //006A
__int8 type; //006B
float eyeheightvel; //006C
char unknown1[108];
__int32 health; //00DC
__int32 armor; //00E0
char unknown2[112];
__int32 clientnum; //0154
__int32 lastupdate; //0158
__int32 plag; //015C
__int32 ping; //0160
__int32 lifesequence; //0164
__int32 frags; //0168
__int32 flagscore; //016C
__int32 deaths; //0170
char unknown3[20];
__int8 Unknown4; //0188
char name[16]; //0189
char unknown5[244];
char team[16]; //028D
char unknown6[272];
__int16 Unknown7; //03AD
__int8 Unknown8; //03AF
weapon *weapons[NUMGUNS]; //03B0
weapon *prevweaponsel; //03D4
weapon *weaponsel; //03D8
weapon *nextweaponsel; //03DC
weapon *primweap; //03E0
weapon *nextprimweap; //03E4
char unknown10[132];
vec head; //046C
};
struct guninfo
{
char modelname[16]; //0000
char unknown1[244];
__int16 sound; //0104
__int16 reload; //0106
__int16 reloadtime; //0108
__int16 attackdelay; //010A
__int16 damage; //010C
__int16 projspeed; //010E
__int16 part; //0110
__int16 spread; //0112
__int16 recoil; //0114
__int16 magsize; //0116
__int16 mdl_kick_rot; //0118
__int16 mdl_kick_back; //011A
__int16 recoilincrease; //011C
__int16 recoilbase; //011E
__int16 maxrecoil; //0120
__int16 recoilbackfade; //0122
__int16 pushfactor; //0124
__int16 isauto; //0126
};
class weapon
{
public:
__int32 type; //0000
__int32 unknown0; // 0004
playerObj *owner; //0008
__int32 infoA; //000C
__int32 ammoA; //0010
__int32 magA; //0014
__int32 gunwaitA; //0018
char unknown1[88]; // 002C
};
tools
Code:
#include <iostream>
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
#define ASSERT(c) if(!(c)) { __asm int 3 }
template <class T>
struct databuf
{
enum
{
OVERREAD = 1<<0,
OVERWROTE = 1<<1
};
T *buf;
int len, maxlen;
uchar flags;
template <class U>
databuf(T *buf, U maxlen) : buf(buf), len(0), maxlen((int)maxlen), flags(0) {}
const T &get()
{
static T overreadval;
if(len<maxlen) return buf[len++];
flags |= OVERREAD;
return overreadval;
}
databuf subbuf(int sz)
{
sz = min(sz, maxlen-len);
len += sz;
return databuf(&buf[len-sz], sz);
}
void put(const T &val)
{
if(len<maxlen) buf[len++] = val;
else flags |= OVERWROTE;
}
void put(const T *vals, int numvals)
{
if(maxlen-len<numvals) flags |= OVERWROTE;
memcpy(&buf[len], vals, min(maxlen-len, numvals)*sizeof(T));
len += min(maxlen-len, numvals);
}
int length() const { return len; }
int remaining() const { return maxlen-len; }
bool overread() const { return flags&OVERREAD; }
bool overwrote() const { return flags&OVERWROTE; }
void forceoverread()
{
len = maxlen;
flags |= OVERREAD;
}
};
typedef databuf<char> charbuf;
typedef databuf<uchar> ucharbuf;
template <class T> struct vector
{
static const int MINSIZE = 8;
T *buf;
int alen, ulen;
vector() : buf(NULL), alen(0), ulen(0)
{
}
vector(const vector &v) : buf(NULL), alen(0), ulen(0)
{
*this = v;
}
~vector() { setsize(0); if(buf) delete[] (uchar *)buf; }
vector<T> &operator=(const vector<T> &v)
{
setsize(0);
if(v.length() > alen) vrealloc(v.length());
loopv(v) add(v[i]);
return *this;
}
T &add(const T &x)
{
if(ulen==alen) vrealloc(ulen+1);
new (&buf[ulen]) T(x);
return buf[ulen++];
}
T &add()
{
if(ulen==alen) vrealloc(ulen+1);
new (&buf[ulen]) T;
return buf[ulen++];
}
T &dup()
{
if(ulen==alen) vrealloc(ulen+1);
new (&buf[ulen]) T(buf[ulen-1]);
return buf[ulen++];
}
bool inrange(size_t i) const { return i<size_t(ulen); }
bool inrange(int i) const { return i>=0 && i<ulen; }
T &pop() { return buf[--ulen]; }
T &last() { return buf[ulen-1]; }
void drop() { buf[--ulen].~T(); }
bool empty() const { return ulen==0; }
int length() const { return ulen; }
T &operator[](int i) { ASSERT(i>=0 && i<ulen); return buf[i]; }
const T &operator[](int i) const { ASSERT(i >= 0 && i<ulen); return buf[i]; }
void setsize(int i) { ASSERT(i<=ulen); while(ulen>i) drop(); }
void setsizenodelete(int i) { ASSERT(i<=ulen); ulen = i; }
void deletecontentsp() { while(!empty()) delete pop(); }
void deletecontentsa() { while(!empty()) delete[] pop(); }
T *getbuf() { return buf; }
const T *getbuf() const { return buf; }
bool inbuf(const T *e) const { return e >= buf && e < &buf[ulen]; }
template<class ST>
void sort(int (__cdecl *cf)(ST *, ST *), int i = 0, int n = -1)
{
qsort(&buf[i], n<0 ? ulen : n, sizeof(T), (int (__cdecl *)(const void *,const void *))cf);
}
template<class ST>
T *search(T *key, int (__cdecl *cf)(ST *, ST *), int i = 0, int n = -1)
{
return (T *) bsearch(key, &buf[i], n<0 ? ulen : n, sizeof(T), (int (__cdecl *)(const void *,const void *))cf);
}
void vrealloc(int sz)
{
int olen = alen;
if(!alen) alen = max(MINSIZE, sz);
else while(alen < sz) alen *= 2;
if(alen <= olen) return;
uchar *newbuf = new uchar[alen*sizeof(T)];
if(olen > 0)
{
memcpy(newbuf, buf, olen*sizeof(T));
delete[] (uchar *)buf;
}
buf = (T *)newbuf;
}
databuf<T> reserve(int sz)
{
if(ulen+sz > alen) vrealloc(ulen+sz);
return databuf<T>(&buf[ulen], sz);
}
void addbuf(const databuf<T> &p)
{
ulen += p.length();
}
void remove(int i, int n)
{
for(int p = i+n; p<ulen; p++) buf[p-n] = buf[p];
ulen -= n;
}
T remove(int i)
{
T e = buf[i];
for(int p = i+1; p<ulen; p++) buf[p-1] = buf[p];
ulen--;
return e;
}
int find(const T &o)
{
loopi(ulen) if(buf[i]==o) return i;
return -1;
}
void removeobj(const T &o)
{
loopi(ulen) if(buf[i]==o) remove(i--);
}
void replacewithlast(const T &o)
{
if(!ulen) return;
loopi(ulen-1) if(buf[i]==o)
{
buf[i] = buf[ulen-1];
}
ulen--;
}
T &insert(int i, const T &e)
{
add(T());
for(int p = ulen-1; p>i; p--) buf[p] = buf[p-1];
buf[i] = e;
return buf[i];
}
};
struct vec
{
union
{
struct { float x, y, z; };
float v[3];
int i[3];
};
vec() {}
vec(float a, float b, float c) : x(a), y(b), z(c) {}
vec(float *v) : x(v[0]), y(v[1]), z(v[2]) {}
float &operator[](int i) { return v[i]; }
float operator[](int i) const { return v[i]; }
bool iszero() const { return x==0 && y==0 && z==0; }
bool operator==(const vec &o) const { return x == o.x && y == o.y && z == o.z; }
bool operator!=(const vec &o) const { return x != o.x || y != o.y || z != o.z; }
vec operator-() const { return vec(-x, -y, -z); }
vec &mul(float f) { x *= f; y *= f; z *= f; return *this; }
vec &div(float f) { x /= f; y /= f; z /= f; return *this; }
vec &add(float f) { x += f; y += f; z += f; return *this; }
vec &sub(float f) { x -= f; y -= f; z -= f; return *this; }
vec &add(const vec &o) { x += o.x; y += o.y; z += o.z; return *this; }
vec &sub(const vec &o) { x -= o.x; y -= o.y; z -= o.z; return *this; }
float squaredlen() const { return x*x + y*y + z*z; }
float dot(const vec &o) const { return x*o.x + y*o.y + z*o.z; }
float magnitude() const { return sqrtf(squaredlen()); }
vec &normalize() { div(magnitude()); return *this; }
float dist(const vec &e) const { vec t; return dist(e, t); }
float dist(const vec &e, vec &t) const { t = *this; t.sub(e); return t.magnitude(); }
float distxy(const vec &e) const { float dx = e.x - x, dy = e.y - y; return sqrtf(dx*dx + dy*dy); }
float magnitudexy() const { return sqrtf(x*x + y*y); }
bool reject(const vec &o, float max) const { return x>o.x+max || x<o.x-max || y>o.y+max || y<o.y-max; }
vec &cross(const vec &a, const vec &b) { x = a.y*b.z-a.z*b.y; y = a.z*b.x-a.x*b.z; z = a.x*b.y-a.y*b.x; return *this; }
void rotate_around_z(float angle) { *this = vec(cosf(angle)*x-sinf(angle)*y, cosf(angle)*y+sinf(angle)*x, z); }
void rotate_around_x(float angle) { *this = vec(x, cosf(angle)*y-sinf(angle)*z, cosf(angle)*z+sinf(angle)*y); }
void rotate_around_y(float angle) { *this = vec(cosf(angle)*x-sinf(angle)*z, y, cosf(angle)*z+sinf(angle)*x); }
vec &rotate(float angle, const vec &d)
{
float c = cosf(angle), s = sinf(angle);
return rotate(c, s, d);
}
vec &rotate(float c, float s, const vec &d)
{
*this = vec(x*(d.x*d.x*(1-c)+c) + y*(d.x*d.y*(1-c)-d.z*s) + z*(d.x*d.z*(1-c)+d.y*s),
x*(d.y*d.x*(1-c)+d.z*s) + y*(d.y*d.y*(1-c)+c) + z*(d.y*d.z*(1-c)-d.x*s),
x*(d.x*d.z*(1-c)-d.y*s) + y*(d.y*d.z*(1-c)+d.x*s) + z*(d.z*d.z*(1-c)+c));
return *this;
}
void orthogonal(const vec &d)
{
int i = fabs(d.x) > fabs(d.y) ? (fabs(d.x) > fabs(d.z) ? 0 : 2) : (fabs(d.y) > fabs(d.z) ? 1 : 2);
v[i] = d[(i+1)%3];
v[(i+1)%3] = -d[i];
v[(i+2)%3] = 0;
}
};
(also have the stdafx.h/.cpp,targetver)
its detected and outa date noobs cn DL and study it if they want i have better way of doing now i like myn not better than this one so well thank me
or rage me