public static void Godmode(int client, Boolean State)
{
if (State == true) PS3.SetMemory(0x00E04128, new byte[] { 0xFF, 0xFF });
else PS3.SetMemory(0x00E04128, new byte[] { 0x00, 0x64 });
}
#include "data.h"
#include<string>
#include <math.h>
void (*SV_GSSC)(int clientIndex, unsigned int type, char*fmt) = (void(__cdecl*)(int,unsigned int, char*))0x824D3A48;
int (*G_ModelIndex)(char*name) = (int(__cdecl*)(char*))0x82428F50;
int (*GTemp)(float*source, int r4) = (int(__cdecl*)(float*,int))0x8242B430;
void (*G_FreeEntity)(int ent) = (void(__cdecl*)(int))0x8242AC00;
float (*flrand)(float min, float max) = (float(__cdecl*)(float,float))0x82429B00;
int (*G_EffectIndex)(char*effectName) = (int(__cdecl*)(char*))0x8215C6B0;
void (*setClientViewAngles)(int entity, float*angles) = (void(__cdecl*)(int,float*))0x823D80E0;
const char*mflags[6] = { "none", "noclip", "ufo", "noclip2", "freeze", "freeze controls" };
// /***************************************
// * Modding Class v1.0.0 *
// * *
// * Created by Bitwise *
// * *
// * 16/04/14 *
// * *
// * https://codexera.com *
// * *
// ****************************************/
/*void suicideFix(int clientIndex)//bo2
{
data().WriteInt64(0x82318B44, (((0x38600000) << 10) + 0x1D43031C ));
data().WriteInt16(0x82318B44+2, (short)clientIndex);//<- Idea from xDex
PlayerCmd_Suicide(clientIndex);
}
void playFxOnTag(int effectId, int ent, char*tagName)//bo2
{
int (*G_TagIndex)(char*tagName) = (int(__cdecl*)(char*))0x82389418;
int (*SV_DObjGetBoneIndex)(int ent, int bone) = (int(__cdecl*)(int,int))0x8236906C;
void (*SV_DObjDumpInfo)(int ent) = (void(__cdecl*)(int))0x82430178;
int (*G_ModelName)(int index) = (int(__cdecl*)(int))0x82388F48;
int (*G_FindConfigstringIndex)(char*name, int start, int max, int create, char*errormsg) = (int(__cdecl*)(char*,int,int,int,char*))0x823889B0;
void (*G_AddEvent)(int ent, int event, int param) = (void(__cdecl*)(int,int,int))0x8238A250
char*(*SL_ConvertToString(int stringValue) = (char*(__cdecl*)(int))0x82532A00;
if(effectId <= 0) printf("effect id %i is invalid\n", effectId); goto error;
if(*(short*)(ent + 0x16C) == 0) printf("cannot play fx on entity without a model\n"); goto error;
if(strchr(tagName, 0x22) != 0) printf("cannot use \" characters in tag names\n"); goto error;
if(SV_DObjGetBoneIndex(ent,G_TagIndex(tagName))>=0) goto bla;
SV_DObjDumpInfo(ent); printf("tag '%s' does not exist on entity with model '%s'\n", tagName, SL_ConvertToString(G_ModelName(*(short*)(ent + 0x16C)))); goto error;
bla:
char*dare = data().va("%03d%s\n", effectId, tagName);
G_AddEvent(ent, 0x57, G_FindConfigstringIndex(dare, 0x6FA, 0x100, 1, ""));
error:
return;
}*/
enum : int { x, y, z }coord_t;
typedef enum : int { none, noclip, ufo, noclip2, freeze, freeze_controls=8 }mFlag;
class Mod
{
public:
struct bit { static int playerId; static int cFx; static int cEq; static float*origin[3]; static float*angle[3]; static int teamId; static bool tbag;};
Mod(int clientIndex, bool update);
~Mod();
int playerState();
int gentity();
int clients();
void playEffects(char*effectName,int effectId);
void removeEffects();
void doEarthquake(float scale, int duration, float radius);
void delEarthquake();
bool weaponState();
bool ADS();
bool Recoil();
bool switchingWeapons();
bool pickUpWeapons();
bool Offhand();//Grenades, ect
void setPlayerHealth(int amount);
void setSpreadOverride(int spread);
void resetSpreadOverride();
void toggleMFlag(mFlag flag);
void randomTele();
void getCrosshairPos(float*dest);
void tBag();
void setRedBox(bool enabled);
void disableKillstreak(bool enabled);
void setModel(char*modelName);
void setGamertag(char*gamertag);
void setClantag(char*clantag);
void setViewModel(char*viewModelName);
void disablePMFlag(bool enabled);
void setOrigin(float*newOrigin);
void setAngles(float*newAngles);
int closestClient();
void aimAt(int clientIndex);
bool Jump();
bool Sprint();
bool Alive();
bool Hurt();
void findString(int ep, int size, char*id);
};
Data data();
Mod::Mod(int clientIndex, bool update = false)
{
bit.playerId = clientIndex;
if(update)
bit.origin[x] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x1C); bit.angle[x] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x194);
bit.origin[y] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x20); bit.angle[y] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x19;
bit.origin[z] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x24); bit.angle[z] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x200);
bit.teamId = data().ReadInt32(0x832F1200 + (clientIndex * 0x3700) + 0x3064); //If no, 0x3080/4
}
Mod::~Mod()
{
bit.playerId &= ~bit.playerId;
for(int i = 0; i < 3; i++){
bit.origin[i], bit.angle[i] = 0;}
bit.teamId, bit.tbag = 0;
}
int Mod::playerState()
{
return 0x832F1200 + (bit.playerId * 0x3700);
}
int Mod::gentity()
{
return 0x8336AD80 + (bit.playerId * 0x280);
}
int Mod::clients()
{
return 0x839DD780 + 0x207E90 + (bit.playerId * 0x6FA00);
}
void Mod::playEffects(char*effectName,int effectId=0)
{
bit.cFx = GTemp(*bit.origin, 0x5B);
data().WriteInt32(bit.cFx + 0x9C, (!effectId ? G_EffectIndex(effectName) : effectId));
data().WriteInt64(bit.cFx + 0x40, 0x00);
data().WriteFloat(bit.cFx + 0x3C, 270.0f);
}
void Mod::removeEffects()
{
G_FreeEntity(bit.cFx); memset((void*)(bit.cFx), 0x00, 0x270);
}
void Mod::doEarthquake(float scale, int duration, float radius)
{
bit.cEq = GTemp(*bit.origin, 0x65);
data().WriteFloat(bit.cEq + 0x54, scale);
data().WriteInt32(bit.cEq + 0x5C, duration);
data().WriteFloat(bit.cEq + 0x58, radius);
}
void Mod::delEarthquake()
{
data().WriteInt32(bit.cEq + 0x5C, 0);
}
bool Mod::weaponState()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x80 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x80));//Will return true if the flag holds 0x80
}
bool Mod::ADS()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x20 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x20));
}
bool Mod::Recoil()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x400 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x400));
}
bool Mod::switchingWeapons()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x800 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x800));
}
bool Mod::pickUpWeapons()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x8000 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x8000));
}
bool Mod::Offhand()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x1000 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x1000));
}
void Mod::setPlayerHealth(int amount)
{
data().WriteInt32(gentity() + 0x1A8, amount);
}
void Mod::setSpreadOverride(int spread)
{
data().WriteInt32(playerState() + 0x430, spread);
data().WriteInt32(playerState() + 0x434, 0x02);
}
void Mod::resetSpreadOverride()
{
data().WriteInt32(playerState() + 0x434, 0x01);
data().WriteFloat(playerState() + 0x428, 255.0f);
}
void Mod::toggleMFlag(mFlag flag)
{
data().WriteInt32(playerState() + 0x3210, (!data().ReadInt32(playerState() + 0x331C) ? (int)flag : 0x00);
int val = (int)flag; if(flag & val -= 3;
end: V_GSSC(bit.playerId, 1, data().va("e \"%s %s\"", mflags[val], (data().checkInt32(playerState() + 0x3120, flag) ? "on" : "off")));
}
void Mod::randomTele()
{
data().WriteFloat(playerState() + 0x1C, *bit.origin[x] + flrand(0,146.9));
data().WriteFloat(playerState() + 0x20, *bit.origin[y] + flrand(5,146.9));
data().WriteFloat(playerState() + 0x24,*bit.origin[z] + flrand(10,146.9));
}
void Mod::getCrosshairPos(float*dest)
{
data().Angles2Origin(*bit.angle, *bit.origin);
float*crosshair[3] = { bit.origin[0] + 125, bit.origin[1], bit.origin[2] };
for(int i = 0; i < 3; i++)
dest[i] = *crosshair[i];
}
/*void doEarthquake(float scale, int duration, float*source, float radius)
{
int eq = G_Temp(source,0x5C);
*(float*)(eq + 0x5 = scale;
*(float*)(eq + 0x5c) = radius;
*(int*)(eq + 0x60) = duration;
}*/
/*
Bypass IP Banning
*(int*)0x82427424 = 0x38600000;//li r3, 0 //Will never set the IP to be banned
*/
void Mod::tBag()
{
for(;
{
if(!bit.tbag) break; goto end;
data().WriteInt32_ORd(playerState() + 0xC, (0x04 | 0x02));
}
end:
data().WriteInt32_AND(playerState() + 0xC, ~0x06);
}
void Mod::setRedBox(bool enabled)
{
data().WriteInt32(playerState() + 0x10, (enabled ? 0x10 : 0x00));
}
void Mod::disableKillstreak(bool enabled)
{
data().WriteUInt32(playerState() + 0xA60 + 0xC, 0x03); //When the player press's dpad right, a checkerboard will be displayed instead of it doing the actual action
}
void Mod::setModel(char*modelName)
{
data().WriteInt16(gentity() + 0x170, (short)G_ModelIndex(modelName));
}
void Mod::setGamertag(char*gamertag)
{
data().WriteString(playerState() + 0x309C, (strlen(gamertag) > 31 ? data().ReadString(playerState() + 0x309C) : gamertag);
SV_GSSC(bit.playerId, 1, data().va("e \"Gamertag set to %s\"", data().ReadString(playerState() + 0x309C)));
end: return;
}
void Mod::setClantag(char*clanTag)
{
data().WriteString(playerState() + 0x309C, (strlen(clanTag) > 4 ? data().ReadString(playerState() + 0x310C) : clanTag);
SV_GSSC(bit.playerId, 1, data().va("e \"Clantag set to %s\"", data().ReadString(playerState() + 0x310C)));
end: return;
}
void Mod::setViewModel(char*viewModelName)
{
data().WriteInt32(playerState() + 0x3054, G_ModelIndex(viewModelName));
}
void Mod::disablePMFlag(bool enabled)
{
data().WriteInt32_Shifted(playerState() + 0xC, (enabled?0:1), 16);
}
bool Mod::Jump()
{
data().WriteInt32(playerState() + 0xC, (!data().ReadInt32(playerState() + 0xC) ? 0x02 : 0x00));
return (data().checkInt32(playerState() + 0xC, 0x02));
}
void Mod::setOrigin(float*newOrigin)
{
data().WriteInt32(playerState() + 0x1C, newOrigin[x]);
data().WriteInt32(playerState() + 0x20, newOrigin[y]);
data().WriteInt32(playerState() + 0x24, newOrigin[z]);
}
void Mod::setAngles(float*newAngles)
{
setClientViewAngles(gentity(), newAngles);
}
bool Mod::Sprint()
{
data().WriteInt32(playerState() + 0xC, (!data().ReadInt32(playerState() + 0xC) ? 0x04 : 0x00));
end: return (data().checkInt32(playerState() + 0xC, 0x04));
}
bool Mod::Alive()
{
return (data().ReadInt32(gentity() + 0x1A > 0);
}
bool Mod::Hurt()
{
return (data().ReadInt32(gentity() + 0x1A > 0 && data().ReadInt32(gentity() + 0x1A <= 35);
}
void Mod::findString(int ep, int size, char*id)
{
for(int i = 0; i != size; i++)//Goes through evert state within the structure
if(strstr((char*)(ep + (bit.playerId * size) + i),id)) printf("%08X = %s", i, id);
else continue;
}
/*
ALL THE FOLLOWING ARE TO DO WITH CO GHOSTS, BUT NOT ADDED TO THE CLASS. JUST USED THIS HEADER AS DIRECT REVERSING/BRAIN STORMING
float Vec3DistanceSq(float*p1,float*p2)
{
float*dest[3];
data().subVec(p2, p1, dest);
return (dest[0]*dest[0] + dest[1]*dest[1] + dest[2]*dest[2]);
}
bool Closer(float*start, float*v1,float*v2)
{
float f1 = Vec3DistranceSq(start, v1), f2 = Vec3DistanceSq(start, v2);
return (f1 < f2);
}
void doSomeShit(int clientIndex, int r4, float*f3)
{
int nextThink = *(int*)(getEntity(clientIndex) + 0x1AC);
nextThink *= r4;
*(int*)(getPlayerState(clientIndex) + 0x33D4) = ((nextThink + 0x32) / 0x64);
if(*(int*)(getPlayerState(clientIndex) + 0x33D4) >= 0)
{
float*myOrigin[3] = { *(float*)(getPlayerState(clientIndex) + 0x1C), *(float*)(getPlayerState(clientIndex) + 0x20), *(float*)(getPlayerState(clientIndex) + 0x24) };
*(float*)(getPlayerState(clientIndex) + 0x33DC) = (f3[2] - myOrigin[0]);
*(float*)(getPlayerState(clientIndex) + 0x33E0) = (f3[1] - myOrigin[1]);
*(float*)(getPlayerState(clientIndex) + 0x33E4) = (f3[0] - myOrigin[2]);
}
}
/*int closestClient(int clientIndex)
{
__asm
{
mr r31, r3
li r10, 0xC
mtctr r10
b dahLoop
dahLoop:
mr r3, r10
bl getEntity
mr r30, r3
lwz r5, 0x1A8(r30)#Get health
cmpwi cr6, r5, 0#check if dead
ble cr6, contine#if dead continue
mr r29, r31
mr r3, r29
bl getPlayerState
mr r11, r3
lwz r6, 0x3064(r11)#get teamid
mr r3, r10
bl getPlayerState
mr r12, r3
lwz r7, 0x3064(r12)#get teamid
cmpw cr6, r6, r7#check if the same
beq cr6, contine#if same continue
lfs f3, 0x1C(r11)#get the X origin
lfs r4, 0x1C(r12)#get the X origin
fsub f5, f3, f4 #minus the origin
fmul f6, f5, f5 #mulltiple the subtracted vector1 twice
fsqrts f7, f6 #find the square root
#fcmpo
bdzn dahLoop
contine:
b dahLoop
}
}
struct playerState_s
{
char padding[0x4];
int bobCylce; // 0x08
int pm_flags; // 0x0C
int visionFlags; // 0x10
char padding2[0x40A]; // 0x41C
int wFlags; // 0x420
};
unsigned __int64 getXuidPopup()
{
*(__int64*)(0x83C9B258 + 0x9042 = *(__int64*)(0x83C9B258 + 0x90430);
return *(unsigned __int64*)(0x83C9B258 + 0x9042;
}
void (*SV_LinkEntity)(int entity) = (void(__cdecl*)(int))0x824EB6C8;
void Solid(int entity,bool enabled)
{
while((*(short*)(entity + 0x17A) != *(short*)0x834D912)
{
if(enabled)
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0x2080;
else *(int*)(entity + 0x0 &= ~0x01; *(int*)(entity + 0x11C) = 1;
SV_LinkEntity(entity);
else
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0;
else *(int*)(entity + 0x0 |= 0x01;
SV_LinkEntity(entity);
}
}
int getBrushModel()
{
int id;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_prisionbreak"))
id = 0x38;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_dart"))
id = 0x6B;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_lonestar"))
id = 0x6A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_frag"))
id = 0x55;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_snow"))
id = 0x56;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_fahrenheit"))
id = 0xA8;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_hasima"))
id = 0x63;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_warhawk"))
id = 0x45;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_soverign"))
id = 0x72;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_zebra"))
id = 0x44;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_skeleton"))
id = 0x3A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_chasm"))
id = 0x49;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_flooded") || !strcmp(Dvar_GetString("ui_mapname"),"mp_strikezone"))
id = 0x57;
return 0x8336AD80 + (id * 0x280);
}
void CloneBrushModelToScriptModel(int entity, bool enabled)
{
int script_brushmodel = getBrushModel();
SV_UnLinkEntity(entity);
if(enabled)
*(int*)(entity + 0x8C) = *(int*)(script_brushmodel + 0x8C);
*(unsigned char*)(entity + 0x101) = 04;
SV_SetBrushModel(entity);
*(int*)(entity + 0x11C) |= *(int*)(script_brushmodel + 0x11C);
else
*(int*)(entity + 0x8C)=0;*(int*)(entity + 0x11C)=0;*(unsigned char*)(entity + 0x101)
SV_LinkEntity(entity);
}
void (*Scr_NotifyNum)(int entnum, unsigned int classnum, unsigned short stringValue, unsigned int paramcount) = (void(__cdecl*)(int,unsigned int, unsigned short, unsigned int))0x82496EB8;
void (*Scr_FreeHudElemConstStrings)(int hud) = (void(__cdecl*)(int))0x823E9330;
void (*Scr_FreeEntityNum)(int entnum, unsigned int classnum) = (void(__cdecl*)(int,unsigned int))0x82493A10;
void deleteHudElement(int hud)
{
int index = *(int*)(0x8327ED28 - hud) / 0xBB;
Scr_NotifyNum(index, 1, *(short*)0x834D90AE, 0);
Scr_FreeHudElemConstStrings(hud);
Scr_FreeEntityNum(index, 1);
}
typedef enum : int
{
EV_NONE,
EV_FOLIAGE_SOUND,
EV_STOP_WEAPON_SOUND,
EV_SOUND_ALIAS,
EV_SOUND_ALIAS_AS_MASTER,
EV_STOPSOUNDS,
EV_STANCE_FORCE_STAND,
EV_STANCE_FORCE_CROUCH,
EV_STANCE_FORCE_PRONE,
EV_STANCE_INVALID,
EV_ITEM_PICKUP,
EV_AMMO_PICKUP,
EV_EMPTY_OFFHAND_PRIMARY,
EV_EMPTY_OFFHAND_SECONDARY,
EV_OFFHAND_END_NOTIFY,
EV_RESET_ADS,
EV_RELOAD,
EV_RELOAD_FROM_EMPTY,
EV_RELOAD_START,
EV_RELOAD_END,
EV_RELOAD_START_NOTIFY,
EV_RELOAD_ADDAMMO,
EV_RAISE_WEAPON,
EV_FIRST_RAISE_WEAPON,
EV_PULLBACK_WEAPON,
EV_FIRE_WEAPON_END,
EV_FIRE_WEAPON,
EV_FIRE_WEAPON_LASTSHOT,
EV_FIRE_RICOCHET,
EV_RECHAMBER_WEAPON,
EV_EJECT_BRASS,
EV_FIRE_WEAPON_LEFT,
EV_FIRE_WEAPON_LASTSHOT_LEFT,
EV_EJECT_BRASS_LEFT,
EV_HITCLIENT_FIRE_WEAPON,
EV_HITCLIENT_FIRE_WEAPON_LASTSHOT,
EV_HITCLIENT_FIRE_WEAPON_LEFT,
EV_HITCLIENT_FIRE_WEAPON_LASTSHOT_LEFT,
EV_SV_FIRE_WEAPON,
EV_SV_FIRE_WEAPON_LASTSHOT,
EV_SV_FIRE_WEAPON_LEFT,
EV_SV_FIRE_WEAPON_LASTSHOT_LEFT,
EV_FIRE_MELEE_SWIPE,
EV_FIRE_MELEE_STAND,
EV_FIRE_MELEE_CROUCH
EV_PREP_OFFHAND,
EV_USE_OFFHAND,
EV_SWITCH_OFFHAND,
EV_MELEE_HIT,
EV_MELEE_MISS,
EV_MELEE_BLOOD,
EV_MELEE_BLOOD_STAND,
EV_MELEE_BLOOD_CROUCH,
EV_SV_FIRE_TURRET,
EV_FIRE_VEH_TURRET,
EV_FIRE_TURRET,
EV_FIRE_SENTRY,
EV_FIRE_QUADBARREL_1,
EV_FIRE_QUADBARREL_2,
EV_BULLET_HIT,
EV_BULLET_HIT_EXPLODE,
EV_BULLET_HIT_SHIELD,
EV_BULLET_HIT_CLIENT_SMALL,
EV_BULLET_HIT_CLIENT_LARGE,
EV_BULLET_HIT_CLIENT_EXPLODE,
EV_BULLET_HIT_CLIENT_SHIELD,
EV_BULLET_DESTROY_CLIENT_SHIELD,
EV_DROP_CLIENT_SHIELD,
EV_EXPLOSIVE_IMPACT_ON_SHIELD,
EV_EXPLOSIVE_SPLASH_ON_SHIELD,
EV_GRENADE_BOUNCE,
EV_GRENADE_STICK,
EV_GRENADE_REST,
EV_GRENADE_ROLL,
EV_GRENADE_EXPLODE,
EV_GRENADE_PICKUP,
EV_GRENADE_LETGO,
EV_ROCKET_EXPLODE,
EV_TRIAL_DESTROY,
EV_FLASHBANG_EXPLODE,
EV_CUSTOM_EXPLODE,
EV_DUD_EXPLODE,
EV_DUD_IMPACT
EV_TROPHY_EXPLODE,
EV_BULLET,
EV_PLAY_FX,
EV_PLAY_FX_ON_TAG,
EV_STOP_FX_ON_TAG,
EV_KILL_FX_ON_TAG,
EV_PLAY_FX_ON_TAG_FOR_CLIENTS,
EV_PHYS_EXPLOSION_SPHERE,
EV_PHYS_EXPLOSION_CYLINDER
EV_PHYS_EXPLOSION_JOLT,
EV_RADIUSDAMAGE,
EV_PHYS_JITTER,
EV_EARTHQUAKE,
EV_GRENADE_SUICIDE,
EV_DETONATE,
EV_NIGHTVISION_WEAR,
EV_NIGHTVISION_REMOVE,
EV_MISSLE_REMOTE_BOOST,
EV_PLAY_RUMBLE_ON_ENT,
EV_PLAY_RUMBLE_ON_POS,
EV_PLAY_RUMBLELOOP_ON_ENT,
EV_PLAY_RUMBLELOOP_ON_POS,
EV_STOP_RUMBLE,
EV_STOP_ALL_RUMBLES,
EV_VARIABLE_ZOOM_CHANGE,
EV_OBITUARY,
EV_NO_PRIMARY_GRENADE_HINT,
EV_NO_SECONDARY_GRENADE_HINT,
EV_TARGET_TOO_CLOSE_HINT,
EV_TARGET_NOT_ENOUGH_CLEARANCE_HINT,
EV_LOCKON_REQUIRED,
EV_VEHICLE_COLLISION,
EV_VEHICLE_SUSPENSION_SOFT,
EV_VEHICLE_SUSPENSION_HARD,
EV_FOOTSTEP_RUN,
EV_FOOTSTEP_WALK,
EV_FOOTSTEP_PRONE,
EV_JUMP,
EV_LANDING_FIRST0,
EV_LANDING_FIRST1,
EV_LANDING_FIRST2,
EV_LANDING_FIRST3,
EV_LANDING_FIRST4,
EV_LANDING_FIRST5,
EV_LANDING_FIRST6,
EV_LANDING_FIRST7,
EV_LANDING_FIRST8,
EV_LANDING_FIRST9,
EV_LANDING_FIRST10,
EV_LANDING_FIRST11,
EV_LANDING_FIRST12,
EV_LANDING_FIRST13,
EV_LANDING_FIRST14,
EV_LANDING_FIRST15,
EV_LANDING_FIRST16,
EV_LANDING_FIRST17,
EV_LANDING_FIRST18,
EV_LANDING_FIRST19,
EV_LANDING_FIRST20,
EV_LANDING_FIRST21,
EV_LANDING_FIRST22,
EV_LANDING_FIRST23,
EV_LANDING_FIRST24,
EV_LANDING_FIRST25,
EV_LANDING_FIRST26,
EV_LANDING_FIRST27,
EV_LANDING_FIRST28,
EV_LANDING_FIRST29,
EV_LANDING_FIRST30,
EV_LANDING_PAIN_FIRST0,
EV_LANDING_PAIN_FIRST1,
EV_LANDING_PAIN_FIRST2,
EV_LANDING_PAIN_FIRST3,
EV_LANDING_PAIN_FIRST4,
EV_LANDING_PAIN_FIRST5,
EV_LANDING_PAIN_FIRST6,
EV_LANDING_PAIN_FIRST7,
EV_LANDING_PAIN_FIRST8,
EV_LANDING_PAIN_FIRST9,
EV_LANDING_PAIN_FIRST10,
EV_LANDING_PAIN_FIRST11,
EV_LANDING_PAIN_FIRST12,
EV_LANDING_PAIN_FIRST13,
EV_LANDING_PAIN_FIRST14,
EV_LANDING_PAIN_FIRST15,
EV_LANDING_PAIN_FIRST16,
EV_LANDING_PAIN_FIRST17,
EV_LANDING_PAIN_FIRST18,
EV_LANDING_PAIN_FIRST19,
EV_LANDING_PAIN_FIRST20,
EV_LANDING_PAIN_FIRST21,
EV_LANDING_PAIN_FIRST22,
EV_LANDING_PAIN_FIRST23,
EV_LANDING_PAIN_FIRST24,
EV_LANDING_PAIN_FIRST25,
EV_LANDING_PAIN_FIRST26,
EV_LANDING_PAIN_FIRST27,
EV_LANDING_PAIN_FIRST28,
EV_LANDING_PAIN_FIRST29,
EV_LANDING_PAIN_FIRST30,
EV_MANTLE,
EV_SLIDE_START,
EV_SLIDE_EASE_OUT,
EV_EXPLODER,
EV_PHYSICS_IMPACT_SOUND,
EV_PORTABLE_RADAR_PING
}eventTypes;
int AllocString(char*str,int r4)
{
byte R11 = *(byte*)(str), R10 = R11;
loc:
byte R9 = R11;
R11 += 1;
if(R9 & 0) goto loc;
else
R11 -= R10;
return SL_GetStringOfSize(str, 1, (R11+1),6);
return 0;
}
bool isHost()
{
char*GT = new char[0x20];
XUserGetName(0,GT,0);
return !strcmp((char*)0x839EAB68,GT);
}
struct trace_t
{
float fraction;//0
float normal[3];//4
char padding[8];//0x10
TraceHitType hitType;//0x18
unsigned short hitId;//0x1C
char _padding[0xC];
};
enum TraceHitType
{
None,
entity,
dynet_model,
dynet_brush,
UNKNOWN
};
unsigned short Trace_GetEntityHitId(trace_t*lel)
{
if(lel->hitType & dynet_model || lel->hitType & dynet_brush || lel->hitType & UNKNOWN) return 0x7FE;
if(lel->hitType & entity) return 0x7FF;
else return lel->hitId;
}
struct destination
{
char*name;
unsigned int clientIndex;
short Int16, *Int16_3[3];
int Int32, *Int32_3[3];
__int64 Int64, *Int64_3[3];
float Float, *Vector3[3];
unsigned char Byte, *Byte_3[3];
};
*(int*)0x81679904 = 0x60000000;
0x28 into the strack frame (from r3 pretty much, kinda confusing) being set to 0x5AC00000000D81E (__int64)
1D8000000
void bulletTrace(float*start, float*end, bool hitCharacters, int entity)
{
destination dest;
trace_t targ;
G_LocationalTrace(&targ, start, end, *(int*)entity, (hitCharacters ? 0x280E831 : 0x80A831), (*(unsigned char*)0x8285B850));
for(int i = 0; i <= 2; i++)
*dest.Vector3[i] = ((end[i]-start[i]) * targ.fraction) + start[i];
unsigned short entity = (Trace_GetEntityHitId(&targ) & 0xFFFF);
if(entity < 0x7FE) dest.clientIndex = (int)entity;
if(dest.fraction != 1.0) int index = (int)dest.normal[2]; int result; __asm { srawi result, index, 0x14 }; dest.name = Com_SurfaceTypeToName(result & 0x1F);
}
bool bulletTracePassed(float*start, float*end, bool hitCharacters, int entity)
{
return G_LocationalTracePassed(start,end,*(int*)entity,0x7FF,(hitCharacters ? 0x280E831 : 0x80A831),0);
}
int (*GetLocMatIndex)(char*mat) = (int(__cdecl*)(char*))0x821F99D8;
void BeginLocationSelector(char*locationSelector, int r4, float selectorSize)
{
}
void getTagOrigin(int clientIndex, char*tagName)
{
}
int spawn(char*modelName, float*source, float*angles = 0.0, bool solid=true)
{
int entity = G_Spawn();
*(short*)(entity + 0x170) = G_ModelIndex(modelName);
*(float*)(entity + 0x13 = source[0];
*(float*)(entity + 0x13C) = source[1];
*(float*)(entity + 0x140) = source[2];
*(float*)(entity + 0x144) = angles[0];
*(float*)(entity + 0x14 = angles[1];
*(float*)(entity + 0x14C) = angles[2];
Solid(entity, solid);
CloneScriptModelToBrushModel(entity, solid);
return entity;
}
bool enabled[18] = {true};
void shootEffect(int clientIndex, char*effectName="explosions/grenadeExp_water")//v0.0.1 - Bitwise
{
while(enabled[clientIndex])
{
for(;{
desination dest;
float*vec[3], *end[3], *eye[3];
Mod client(clientIndex);
if(Buttons(clientIndex) & BUTTON_RT)
client.Recoil();
data().AnglesToForward(*client.bit.angle, vec);
for(int i = 0; i <= 2; i++)
*end[i] = (vec[i]*20000);
//client.getTagOrigin("tag_eye", eye); //Not yet done
bulletTrace(eye, eye+end, true, getEntity(clientIndex));
doEffect(effectName, *dest.Vector3);
doEarthquake(0.3, 1, *dest.Vector3,1000);
}
}
}*/
int Mod::closestClient()
{
int cl;
for(int i = 0; i < 0xC; i++)
{
if(data().ReadInt32(0x8336AD80 + (i * 0x280) + 0x1A <= 0 || bit.teamId == data().ReadInt32(0x832F1200 + (i * 0x3700) + 0x3064)) continue;
while(data().Distance(bit.origin[0], data().ReadFloat(0x832F1200 + (i * 0x3700) + 0x1C)) < 149.6f)
cl = i;
}
return cl;
}
void Mod::aimAt(int clientIndex)
{
float*origin[3] = { data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x1C), data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x20), data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x24) };
data().Origin2Angles(*origin, *bit.angle);
setAngles(*bit.angle);
}
/*
Random new function to call of duty, didn't finish it something else came up lol
int (*GetIndexForEntity)(gentity_s*ent) = (int(__cdecl*)(gentity_s*))0x8246D8A8;
void doSomeShitt(gentity_s*ent)
{
if(ent->s.eType & 0xA)
{
int index = GetIndexForEntity(ent);
}
}*/
public static void Godmode(int client, Boolean State)
{
if (State == true) PS3.SetMemory(0x00E04128, new byte[] { 0xFF, 0xFF });
else PS3.SetMemory(0x00E04128, new byte[] { 0x00, 0x64 });
}
#include "data.h"
#include<string>
#include <math.h>
void (*SV_GSSC)(int clientIndex, unsigned int type, char*fmt) = (void(__cdecl*)(int,unsigned int, char*))0x824D3A48;
int (*G_ModelIndex)(char*name) = (int(__cdecl*)(char*))0x82428F50;
int (*GTemp)(float*source, int r4) = (int(__cdecl*)(float*,int))0x8242B430;
void (*G_FreeEntity)(int ent) = (void(__cdecl*)(int))0x8242AC00;
float (*flrand)(float min, float max) = (float(__cdecl*)(float,float))0x82429B00;
int (*G_EffectIndex)(char*effectName) = (int(__cdecl*)(char*))0x8215C6B0;
void (*setClientViewAngles)(int entity, float*angles) = (void(__cdecl*)(int,float*))0x823D80E0;
const char*mflags[6] = { "none", "noclip", "ufo", "noclip2", "freeze", "freeze controls" };
// /***************************************
// * Modding Class v1.0.0 *
// * *
// * Created by Bitwise *
// * *
// * 16/04/14 *
// * *
// * https://codexera.com *
// * *
// ****************************************/
/*void suicideFix(int clientIndex)//bo2
{
data().WriteInt64(0x82318B44, (((0x38600000) << 10) + 0x1D43031C ));
data().WriteInt16(0x82318B44+2, (short)clientIndex);//<- Idea from xDex
PlayerCmd_Suicide(clientIndex);
}
void playFxOnTag(int effectId, int ent, char*tagName)//bo2
{
int (*G_TagIndex)(char*tagName) = (int(__cdecl*)(char*))0x82389418;
int (*SV_DObjGetBoneIndex)(int ent, int bone) = (int(__cdecl*)(int,int))0x8236906C;
void (*SV_DObjDumpInfo)(int ent) = (void(__cdecl*)(int))0x82430178;
int (*G_ModelName)(int index) = (int(__cdecl*)(int))0x82388F48;
int (*G_FindConfigstringIndex)(char*name, int start, int max, int create, char*errormsg) = (int(__cdecl*)(char*,int,int,int,char*))0x823889B0;
void (*G_AddEvent)(int ent, int event, int param) = (void(__cdecl*)(int,int,int))0x8238A250
char*(*SL_ConvertToString(int stringValue) = (char*(__cdecl*)(int))0x82532A00;
if(effectId <= 0) printf("effect id %i is invalid\n", effectId); goto error;
if(*(short*)(ent + 0x16C) == 0) printf("cannot play fx on entity without a model\n"); goto error;
if(strchr(tagName, 0x22) != 0) printf("cannot use \" characters in tag names\n"); goto error;
if(SV_DObjGetBoneIndex(ent,G_TagIndex(tagName))>=0) goto bla;
SV_DObjDumpInfo(ent); printf("tag '%s' does not exist on entity with model '%s'\n", tagName, SL_ConvertToString(G_ModelName(*(short*)(ent + 0x16C)))); goto error;
bla:
char*dare = data().va("%03d%s\n", effectId, tagName);
G_AddEvent(ent, 0x57, G_FindConfigstringIndex(dare, 0x6FA, 0x100, 1, ""));
error:
return;
}*/
enum : int { x, y, z }coord_t;
typedef enum : int { none, noclip, ufo, noclip2, freeze, freeze_controls=8 }mFlag;
class Mod
{
public:
struct bit { static int playerId; static int cFx; static int cEq; static float*origin[3]; static float*angle[3]; static int teamId; static bool tbag;};
Mod(int clientIndex, bool update);
~Mod();
int playerState();
int gentity();
int clients();
void playEffects(char*effectName,int effectId);
void removeEffects();
void doEarthquake(float scale, int duration, float radius);
void delEarthquake();
bool weaponState();
bool ADS();
bool Recoil();
bool switchingWeapons();
bool pickUpWeapons();
bool Offhand();//Grenades, ect
void setPlayerHealth(int amount);
void setSpreadOverride(int spread);
void resetSpreadOverride();
void toggleMFlag(mFlag flag);
void randomTele();
void getCrosshairPos(float*dest);
void tBag();
void setRedBox(bool enabled);
void disableKillstreak(bool enabled);
void setModel(char*modelName);
void setGamertag(char*gamertag);
void setClantag(char*clantag);
void setViewModel(char*viewModelName);
void disablePMFlag(bool enabled);
void setOrigin(float*newOrigin);
void setAngles(float*newAngles);
int closestClient();
void aimAt(int clientIndex);
bool Jump();
bool Sprint();
bool Alive();
bool Hurt();
void findString(int ep, int size, char*id);
};
Data data();
Mod::Mod(int clientIndex, bool update = false)
{
bit.playerId = clientIndex;
if(update)
bit.origin[x] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x1C); bit.angle[x] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x194);
bit.origin[y] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x20); bit.angle[y] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x19;
bit.origin[z] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x24); bit.angle[z] = data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x200);
bit.teamId = data().ReadInt32(0x832F1200 + (clientIndex * 0x3700) + 0x3064); //If no, 0x3080/4
}
Mod::~Mod()
{
bit.playerId &= ~bit.playerId;
for(int i = 0; i < 3; i++){
bit.origin[i], bit.angle[i] = 0;}
bit.teamId, bit.tbag = 0;
}
int Mod::playerState()
{
return 0x832F1200 + (bit.playerId * 0x3700);
}
int Mod::gentity()
{
return 0x8336AD80 + (bit.playerId * 0x280);
}
int Mod::clients()
{
return 0x839DD780 + 0x207E90 + (bit.playerId * 0x6FA00);
}
void Mod::playEffects(char*effectName,int effectId=0)
{
bit.cFx = GTemp(*bit.origin, 0x5B);
data().WriteInt32(bit.cFx + 0x9C, (!effectId ? G_EffectIndex(effectName) : effectId));
data().WriteInt64(bit.cFx + 0x40, 0x00);
data().WriteFloat(bit.cFx + 0x3C, 270.0f);
}
void Mod::removeEffects()
{
G_FreeEntity(bit.cFx); memset((void*)(bit.cFx), 0x00, 0x270);
}
void Mod::doEarthquake(float scale, int duration, float radius)
{
bit.cEq = GTemp(*bit.origin, 0x65);
data().WriteFloat(bit.cEq + 0x54, scale);
data().WriteInt32(bit.cEq + 0x5C, duration);
data().WriteFloat(bit.cEq + 0x58, radius);
}
void Mod::delEarthquake()
{
data().WriteInt32(bit.cEq + 0x5C, 0);
}
bool Mod::weaponState()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x80 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x80));//Will return true if the flag holds 0x80
}
bool Mod::ADS()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x20 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x20));
}
bool Mod::Recoil()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x400 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x400));
}
bool Mod::switchingWeapons()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x800 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x800));
}
bool Mod::pickUpWeapons()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x8000 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x8000));
}
bool Mod::Offhand()
{
data().WriteInt32(playerState() + 0x420, (!data().ReadInt32(playerState() + 0x420) ? 0x1000 : 0x00));
end: return (data().checkInt32(playerState() + 0x420, 0x1000));
}
void Mod::setPlayerHealth(int amount)
{
data().WriteInt32(gentity() + 0x1A8, amount);
}
void Mod::setSpreadOverride(int spread)
{
data().WriteInt32(playerState() + 0x430, spread);
data().WriteInt32(playerState() + 0x434, 0x02);
}
void Mod::resetSpreadOverride()
{
data().WriteInt32(playerState() + 0x434, 0x01);
data().WriteFloat(playerState() + 0x428, 255.0f);
}
void Mod::toggleMFlag(mFlag flag)
{
data().WriteInt32(playerState() + 0x3210, (!data().ReadInt32(playerState() + 0x331C) ? (int)flag : 0x00);
int val = (int)flag; if(flag & val -= 3;
end: if(val & {val -= 3;} SV_GSSC(bit.playerId, 1, data().va("e \"%s %s\"", mflags[val], (data().checkInt32(playerState() + 0x3120, flag) ? "on" : "off")));
}
void Mod::randomTele()
{
data().WriteFloat(playerState() + 0x1C, *bit.origin[x] + flrand(0,146.9));
data().WriteFloat(playerState() + 0x20, *bit.origin[y] + flrand(5,146.9));
data().WriteFloat(playerState() + 0x24,*bit.origin[z] + flrand(10,146.9));
}
void Mod::getCrosshairPos(float*dest)
{
data().Angles2Origin(*bit.angle, *bit.origin);
float*crosshair[3] = { bit.origin[0] + 125, bit.origin[1], bit.origin[2] };
for(int i = 0; i < 3; i++)
dest[i] = *crosshair[i];
}
/*void doEarthquake(float scale, int duration, float*source, float radius)
{
int eq = G_Temp(source,0x5C);
*(float*)(eq + 0x5 = scale;
*(float*)(eq + 0x5c) = radius;
*(int*)(eq + 0x60) = duration;
}*/
/*
Bypass IP Banning
*(int*)0x82427424 = 0x38600000;//li r3, 0 //Will never set the IP to be banned
*/
void Mod::tBag()
{
for(;
{
if(!bit.tbag) break; goto end;
data().WriteInt32_ORd(playerState() + 0xC, (0x04 | 0x02));
}
end:
data().WriteInt32_AND(playerState() + 0xC, ~0x06);
}
void Mod::setRedBox(bool enabled)
{
data().WriteInt32(playerState() + 0x10, (enabled ? 0x10 : 0x00));
}
void Mod::disableKillstreak(bool enabled)
{
data().WriteUInt32(playerState() + 0xA60 + 0xC, 0x03); //When the player press's dpad right, a checkerboard will be displayed instead of it doing the actual action
}
void Mod::setModel(char*modelName)
{
data().WriteInt16(gentity() + 0x170, (short)G_ModelIndex(modelName));
}
void Mod::setGamertag(char*gamertag)
{
data().WriteString(playerState() + 0x309C, (strlen(gamertag) > 31 ? data().ReadString(playerState() + 0x309C) : gamertag);
SV_GSSC(bit.playerId, 1, data().va("e \"Gamertag set to %s\"", data().ReadString(playerState() + 0x309C)));
end: return;
}
void Mod::setClantag(char*clanTag)
{
data().WriteString(playerState() + 0x309C, (strlen(clanTag) > 4 ? data().ReadString(playerState() + 0x310C) : clanTag);
SV_GSSC(bit.playerId, 1, data().va("e \"Clantag set to %s\"", data().ReadString(playerState() + 0x310C)));
end: return;
}
void Mod::setViewModel(char*viewModelName)
{
data().WriteInt32(playerState() + 0x3054, G_ModelIndex(viewModelName));
}
void Mod::disablePMFlag(bool enabled)
{
data().WriteInt32_Shifted(playerState() + 0xC, (enabled?0:1), 16);
}
bool Mod::Jump()
{
data().WriteInt32(playerState() + 0xC, (!data().ReadInt32(playerState() + 0xC) ? 0x02 : 0x00));
return (data().checkInt32(playerState() + 0xC, 0x02));
}
void Mod::setOrigin(float*newOrigin)
{
data().WriteInt32(playerState() + 0x1C, newOrigin[x]);
data().WriteInt32(playerState() + 0x20, newOrigin[y]);
data().WriteInt32(playerState() + 0x24, newOrigin[z]);
}
void Mod::setAngles(float*newAngles)
{
setClientViewAngles(gentity(), newAngles);
}
bool Mod::Sprint()
{
data().WriteInt32(playerState() + 0xC, (!data().ReadInt32(playerState() + 0xC) ? 0x04 : 0x00));
end: return (data().checkInt32(playerState() + 0xC, 0x04));
}
bool Mod::Alive()
{
return (data().ReadInt32(gentity() + 0x1A > 0);
}
bool Mod::Hurt()
{
return (data().ReadInt32(gentity() + 0x1A > 0 && data().ReadInt32(gentity() + 0x1A <= 35);
}
void Mod::findString(int ep, int size, char*id)
{
for(int i = 0; i != size; i++)//Goes through evert state within the structure
if(strstr((char*)(ep + (bit.playerId * size) + i),id)) printf("%08X = %s", i, id);
else continue;
}
/*
ALL THE FOLLOWING ARE TO DO WITH CO GHOSTS, BUT NOT ADDED TO THE CLASS. JUST USED THIS HEADER AS DIRECT REVERSING/BRAIN STORMING
float Vec3DistanceSq(float*p1,float*p2)
{
float*dest[3];
data().subVec(p2, p1, dest);
return (dest[0]*dest[0] + dest[1]*dest[1] + dest[2]*dest[2]);
}
bool Closer(float*start, float*v1,float*v2)
{
float f1 = Vec3DistranceSq(start, v1), f2 = Vec3DistanceSq(start, v2);
return (f1 < f2);
}
void doSomeShit(int clientIndex, int r4, float*f3)
{
int nextThink = *(int*)(getEntity(clientIndex) + 0x1AC);
nextThink *= r4;
*(int*)(getPlayerState(clientIndex) + 0x33D4) = ((nextThink + 0x32) / 0x64);
if(*(int*)(getPlayerState(clientIndex) + 0x33D4) >= 0)
{
float*myOrigin[3] = { *(float*)(getPlayerState(clientIndex) + 0x1C), *(float*)(getPlayerState(clientIndex) + 0x20), *(float*)(getPlayerState(clientIndex) + 0x24) };
*(float*)(getPlayerState(clientIndex) + 0x33DC) = (f3[2] - myOrigin[0]);
*(float*)(getPlayerState(clientIndex) + 0x33E0) = (f3[1] - myOrigin[1]);
*(float*)(getPlayerState(clientIndex) + 0x33E4) = (f3[0] - myOrigin[2]);
}
}
/*int closestClient(int clientIndex)
{
__asm
{
mr r31, r3
li r10, 0xC
mtctr r10
b dahLoop
dahLoop:
mr r3, r10
bl getEntity
mr r30, r3
lwz r5, 0x1A8(r30)#Get health
cmpwi cr6, r5, 0#check if dead
ble cr6, contine#if dead continue
mr r29, r31
mr r3, r29
bl getPlayerState
mr r11, r3
lwz r6, 0x3064(r11)#get teamid
mr r3, r10
bl getPlayerState
mr r12, r3
lwz r7, 0x3064(r12)#get teamid
cmpw cr6, r6, r7#check if the same
beq cr6, contine#if same continue
lfs f3, 0x1C(r11)#get the X origin
lfs r4, 0x1C(r12)#get the X origin
fsub f5, f3, f4 #minus the origin
fmul f6, f5, f5 #mulltiple the subtracted vector1 twice
fsqrts f7, f6 #find the square root
#fcmpo
bdzn dahLoop
contine:
b dahLoop
}
}
struct playerState_s
{
char padding[0x4];
int bobCylce; // 0x08
int pm_flags; // 0x0C
int visionFlags; // 0x10
char padding2[0x40A]; // 0x41C
int wFlags; // 0x420
};
unsigned __int64 getXuidPopup()
{
*(__int64*)(0x83C9B258 + 0x9042 = *(__int64*)(0x83C9B258 + 0x90430);
return *(unsigned __int64*)(0x83C9B258 + 0x9042;
}
void (*SV_LinkEntity)(int entity) = (void(__cdecl*)(int))0x824EB6C8;
void Solid(int entity,bool enabled)
{
while((*(short*)(entity + 0x17A) != *(short*)0x834D912)
{
if(enabled)
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0x2080;
else *(int*)(entity + 0x0 &= ~0x01; *(int*)(entity + 0x11C) = 1;
SV_LinkEntity(entity);
else
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0;
else *(int*)(entity + 0x0 |= 0x01;
SV_LinkEntity(entity);
}
}
int getBrushModel()
{
int id;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_prisionbreak"))
id = 0x38;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_dart"))
id = 0x6B;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_lonestar"))
id = 0x6A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_frag"))
id = 0x55;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_snow"))
id = 0x56;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_fahrenheit"))
id = 0xA8;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_hasima"))
id = 0x63;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_warhawk"))
id = 0x45;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_soverign"))
id = 0x72;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_zebra"))
id = 0x44;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_skeleton"))
id = 0x3A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_chasm"))
id = 0x49;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_flooded") || !strcmp(Dvar_GetString("ui_mapname"),"mp_strikezone"))
id = 0x57;
return 0x8336AD80 + (id * 0x280);
}
void CloneBrushModelToScriptModel(int entity, bool enabled)
{
int script_brushmodel = getBrushModel();
SV_UnLinkEntity(entity);
if(enabled)
*(int*)(entity + 0x8C) = *(int*)(script_brushmodel + 0x8C);
*(unsigned char*)(entity + 0x101) = 04;
SV_SetBrushModel(entity);
*(int*)(entity + 0x11C) |= *(int*)(script_brushmodel + 0x11C);
else
*(int*)(entity + 0x8C)=0;*(int*)(entity + 0x11C)=0;*(unsigned char*)(entity + 0x101)
SV_LinkEntity(entity);
}
void (*Scr_NotifyNum)(int entnum, unsigned int classnum, unsigned short stringValue, unsigned int paramcount) = (void(__cdecl*)(int,unsigned int, unsigned short, unsigned int))0x82496EB8;
void (*Scr_FreeHudElemConstStrings)(int hud) = (void(__cdecl*)(int))0x823E9330;
void (*Scr_FreeEntityNum)(int entnum, unsigned int classnum) = (void(__cdecl*)(int,unsigned int))0x82493A10;
void deleteHudElement(int hud)
{
int index = *(int*)(0x8327ED28 - hud) / 0xBB;
Scr_NotifyNum(index, 1, *(short*)0x834D90AE, 0);
Scr_FreeHudElemConstStrings(hud);
Scr_FreeEntityNum(index, 1);
}
typedef enum : int
{
EV_NONE,
EV_FOLIAGE_SOUND,
EV_STOP_WEAPON_SOUND,
EV_SOUND_ALIAS,
EV_SOUND_ALIAS_AS_MASTER,
EV_STOPSOUNDS,
EV_STANCE_FORCE_STAND,
EV_STANCE_FORCE_CROUCH,
EV_STANCE_FORCE_PRONE,
EV_STANCE_INVALID,
EV_ITEM_PICKUP,
EV_AMMO_PICKUP,
EV_EMPTY_OFFHAND_PRIMARY,
EV_EMPTY_OFFHAND_SECONDARY,
EV_OFFHAND_END_NOTIFY,
EV_RESET_ADS,
EV_RELOAD,
EV_RELOAD_FROM_EMPTY,
EV_RELOAD_START,
EV_RELOAD_END,
EV_RELOAD_START_NOTIFY,
EV_RELOAD_ADDAMMO,
EV_RAISE_WEAPON,
EV_FIRST_RAISE_WEAPON,
EV_PULLBACK_WEAPON,
EV_FIRE_WEAPON_END,
EV_FIRE_WEAPON,
EV_FIRE_WEAPON_LASTSHOT,
EV_FIRE_RICOCHET,
EV_RECHAMBER_WEAPON,
EV_EJECT_BRASS,
EV_FIRE_WEAPON_LEFT,
EV_FIRE_WEAPON_LASTSHOT_LEFT,
EV_EJECT_BRASS_LEFT,
EV_HITCLIENT_FIRE_WEAPON,
EV_HITCLIENT_FIRE_WEAPON_LASTSHOT,
EV_HITCLIENT_FIRE_WEAPON_LEFT,
EV_HITCLIENT_FIRE_WEAPON_LASTSHOT_LEFT,
EV_SV_FIRE_WEAPON,
EV_SV_FIRE_WEAPON_LASTSHOT,
EV_SV_FIRE_WEAPON_LEFT,
EV_SV_FIRE_WEAPON_LASTSHOT_LEFT,
EV_FIRE_MELEE_SWIPE,
EV_FIRE_MELEE_STAND,
EV_FIRE_MELEE_CROUCH
EV_PREP_OFFHAND,
EV_USE_OFFHAND,
EV_SWITCH_OFFHAND,
EV_MELEE_HIT,
EV_MELEE_MISS,
EV_MELEE_BLOOD,
EV_MELEE_BLOOD_STAND,
EV_MELEE_BLOOD_CROUCH,
EV_SV_FIRE_TURRET,
EV_FIRE_VEH_TURRET,
EV_FIRE_TURRET,
EV_FIRE_SENTRY,
EV_FIRE_QUADBARREL_1,
EV_FIRE_QUADBARREL_2,
EV_BULLET_HIT,
EV_BULLET_HIT_EXPLODE,
EV_BULLET_HIT_SHIELD,
EV_BULLET_HIT_CLIENT_SMALL,
EV_BULLET_HIT_CLIENT_LARGE,
EV_BULLET_HIT_CLIENT_EXPLODE,
EV_BULLET_HIT_CLIENT_SHIELD,
EV_BULLET_DESTROY_CLIENT_SHIELD,
EV_DROP_CLIENT_SHIELD,
EV_EXPLOSIVE_IMPACT_ON_SHIELD,
EV_EXPLOSIVE_SPLASH_ON_SHIELD,
EV_GRENADE_BOUNCE,
EV_GRENADE_STICK,
EV_GRENADE_REST,
EV_GRENADE_ROLL,
EV_GRENADE_EXPLODE,
EV_GRENADE_PICKUP,
EV_GRENADE_LETGO,
EV_ROCKET_EXPLODE,
EV_TRIAL_DESTROY,
EV_FLASHBANG_EXPLODE,
EV_CUSTOM_EXPLODE,
EV_DUD_EXPLODE,
EV_DUD_IMPACT
EV_TROPHY_EXPLODE,
EV_BULLET,
EV_PLAY_FX,
EV_PLAY_FX_ON_TAG,
EV_STOP_FX_ON_TAG,
EV_KILL_FX_ON_TAG,
EV_PLAY_FX_ON_TAG_FOR_CLIENTS,
EV_PHYS_EXPLOSION_SPHERE,
EV_PHYS_EXPLOSION_CYLINDER
EV_PHYS_EXPLOSION_JOLT,
EV_RADIUSDAMAGE,
EV_PHYS_JITTER,
EV_EARTHQUAKE,
EV_GRENADE_SUICIDE,
EV_DETONATE,
EV_NIGHTVISION_WEAR,
EV_NIGHTVISION_REMOVE,
EV_MISSLE_REMOTE_BOOST,
EV_PLAY_RUMBLE_ON_ENT,
EV_PLAY_RUMBLE_ON_POS,
EV_PLAY_RUMBLELOOP_ON_ENT,
EV_PLAY_RUMBLELOOP_ON_POS,
EV_STOP_RUMBLE,
EV_STOP_ALL_RUMBLES,
EV_VARIABLE_ZOOM_CHANGE,
EV_OBITUARY,
EV_NO_PRIMARY_GRENADE_HINT,
EV_NO_SECONDARY_GRENADE_HINT,
EV_TARGET_TOO_CLOSE_HINT,
EV_TARGET_NOT_ENOUGH_CLEARANCE_HINT,
EV_LOCKON_REQUIRED,
EV_VEHICLE_COLLISION,
EV_VEHICLE_SUSPENSION_SOFT,
EV_VEHICLE_SUSPENSION_HARD,
EV_FOOTSTEP_RUN,
EV_FOOTSTEP_WALK,
EV_FOOTSTEP_PRONE,
EV_JUMP,
EV_LANDING_FIRST0,
EV_LANDING_FIRST1,
EV_LANDING_FIRST2,
EV_LANDING_FIRST3,
EV_LANDING_FIRST4,
EV_LANDING_FIRST5,
EV_LANDING_FIRST6,
EV_LANDING_FIRST7,
EV_LANDING_FIRST8,
EV_LANDING_FIRST9,
EV_LANDING_FIRST10,
EV_LANDING_FIRST11,
EV_LANDING_FIRST12,
EV_LANDING_FIRST13,
EV_LANDING_FIRST14,
EV_LANDING_FIRST15,
EV_LANDING_FIRST16,
EV_LANDING_FIRST17,
EV_LANDING_FIRST18,
EV_LANDING_FIRST19,
EV_LANDING_FIRST20,
EV_LANDING_FIRST21,
EV_LANDING_FIRST22,
EV_LANDING_FIRST23,
EV_LANDING_FIRST24,
EV_LANDING_FIRST25,
EV_LANDING_FIRST26,
EV_LANDING_FIRST27,
EV_LANDING_FIRST28,
EV_LANDING_FIRST29,
EV_LANDING_FIRST30,
EV_LANDING_PAIN_FIRST0,
EV_LANDING_PAIN_FIRST1,
EV_LANDING_PAIN_FIRST2,
EV_LANDING_PAIN_FIRST3,
EV_LANDING_PAIN_FIRST4,
EV_LANDING_PAIN_FIRST5,
EV_LANDING_PAIN_FIRST6,
EV_LANDING_PAIN_FIRST7,
EV_LANDING_PAIN_FIRST8,
EV_LANDING_PAIN_FIRST9,
EV_LANDING_PAIN_FIRST10,
EV_LANDING_PAIN_FIRST11,
EV_LANDING_PAIN_FIRST12,
EV_LANDING_PAIN_FIRST13,
EV_LANDING_PAIN_FIRST14,
EV_LANDING_PAIN_FIRST15,
EV_LANDING_PAIN_FIRST16,
EV_LANDING_PAIN_FIRST17,
EV_LANDING_PAIN_FIRST18,
EV_LANDING_PAIN_FIRST19,
EV_LANDING_PAIN_FIRST20,
EV_LANDING_PAIN_FIRST21,
EV_LANDING_PAIN_FIRST22,
EV_LANDING_PAIN_FIRST23,
EV_LANDING_PAIN_FIRST24,
EV_LANDING_PAIN_FIRST25,
EV_LANDING_PAIN_FIRST26,
EV_LANDING_PAIN_FIRST27,
EV_LANDING_PAIN_FIRST28,
EV_LANDING_PAIN_FIRST29,
EV_LANDING_PAIN_FIRST30,
EV_MANTLE,
EV_SLIDE_START,
EV_SLIDE_EASE_OUT,
EV_EXPLODER,
EV_PHYSICS_IMPACT_SOUND,
EV_PORTABLE_RADAR_PING
}eventTypes;
int AllocString(char*str,int r4)
{
byte R11 = *(byte*)(str), R10 = R11;
loc:
byte R9 = R11;
R11 += 1;
if(R9 & 0) goto loc;
else
R11 -= R10;
return SL_GetStringOfSize(str, 1, (R11+1),6);
return 0;
}
bool isHost()
{
char*GT = new char[0x20];
XUserGetName(0,GT,0);
return !strcmp((char*)0x839EAB68,GT);
}
struct trace_t
{
float fraction;//0
float normal[3];//4
char padding[8];//0x10
TraceHitType hitType;//0x18
unsigned short hitId;//0x1C
char _padding[0xC];
};
enum TraceHitType
{
None,
entity,
dynet_model,
dynet_brush,
UNKNOWN
};
unsigned short Trace_GetEntityHitId(trace_t*lel)
{
if(lel->hitType & dynet_model || lel->hitType & dynet_brush || lel->hitType & UNKNOWN) return 0x7FE;
if(lel->hitType & entity) return 0x7FF;
else return lel->hitId;
}
struct destination
{
char*name;
unsigned int clientIndex;
short Int16, *Int16_3[3];
int Int32, *Int32_3[3];
__int64 Int64, *Int64_3[3];
float Float, *Vector3[3];
unsigned char Byte, *Byte_3[3];
};
*(int*)0x81679904 = 0x60000000;
0x28 into the strack frame (from r3 pretty much, kinda confusing) being set to 0x5AC00000000D81E (__int64)
1D8000000
void bulletTrace(float*start, float*end, bool hitCharacters, int entity)
{
destination dest;
trace_t targ;
G_LocationalTrace(&targ, start, end, *(int*)entity, (hitCharacters ? 0x280E831 : 0x80A831), (*(unsigned char*)0x8285B850));
for(int i = 0; i <= 2; i++)
*dest.Vector3[i] = ((end[i]-start[i]) * targ.fraction) + start[i];
unsigned short entity = (Trace_GetEntityHitId(&targ) & 0xFFFF);
if(entity < 0x7FE) dest.clientIndex = (int)entity;
if(dest.fraction != 1.0) int index = (int)dest.normal[2]; int result; __asm { srawi result, index, 0x14 }; dest.name = Com_SurfaceTypeToName(result & 0x1F);
}
bool bulletTracePassed(float*start, float*end, bool hitCharacters, int entity)
{
return G_LocationalTracePassed(start,end,*(int*)entity,0x7FF,(hitCharacters ? 0x280E831 : 0x80A831),0);
}
int (*GetLocMatIndex)(char*mat) = (int(__cdecl*)(char*))0x821F99D8;
void BeginLocationSelector(char*locationSelector, int r4, float selectorSize)
{
}
void getTagOrigin(int clientIndex, char*tagName)
{
}
int spawn(char*modelName, float*source, float*angles = 0.0, bool solid=true)
{
int entity = G_Spawn();
*(short*)(entity + 0x170) = G_ModelIndex(modelName);
*(float*)(entity + 0x13 = source[0];
*(float*)(entity + 0x13C) = source[1];
*(float*)(entity + 0x140) = source[2];
*(float*)(entity + 0x144) = angles[0];
*(float*)(entity + 0x14 = angles[1];
*(float*)(entity + 0x14C) = angles[2];
Solid(entity, solid);
CloneScriptModelToBrushModel(entity, solid);
return entity;
}
bool enabled[18] = {true};
void shootEffect(int clientIndex, char*effectName="explosions/grenadeExp_water")//v0.0.1 - Bitwise
{
while(enabled[clientIndex])
{
for(;{
desination dest;
float*vec[3], *end[3], *eye[3];
Mod client(clientIndex);
if(Buttons(clientIndex) & BUTTON_RT)
client.Recoil();
data().AnglesToForward(*client.bit.angle, vec);
for(int i = 0; i <= 2; i++)
*end[i] = (vec[i]*20000);
//client.getTagOrigin("tag_eye", eye); //Not yet done
bulletTrace(eye, eye+end, true, getEntity(clientIndex));
doEffect(effectName, *dest.Vector3);
doEarthquake(0.3, 1, *dest.Vector3,1000);
}
}
}*/
int Mod::closestClient()
{
int cl;
for(int i = 0; i < 0xC; i++)
{
if(data().ReadInt32(0x8336AD80 + (i * 0x280) + 0x1A <= 0 || bit.teamId == data().ReadInt32(0x832F1200 + (i * 0x3700) + 0x3064)) continue;
while(data().Distance(bit.origin[0], data().ReadFloat(0x832F1200 + (i * 0x3700) + 0x1C)) < 149.6f)
cl = i;
}
return cl;
}
void Mod::aimAt(int clientIndex)
{
float*origin[3] = { data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x1C), data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x20), data().ReadFloat(0x832F1200 + (clientIndex * 0x3700) + 0x24) };
data().Origin2Angles(*origin, *bit.angle);
setAngles(*bit.angle);
}
/*
Random new function to call of duty, didn't finish it something else came up lol
int (*GetIndexForEntity)(gentity_s*ent) = (int(__cdecl*)(gentity_s*))0x8246D8A8;
void doSomeShitt(gentity_s*ent)
{
if(ent->s.eType & 0xA)
{
int index = GetIndexForEntity(ent);
}
}*/
Copyright © 2024, NextGenUpdate.
All Rights Reserved.