Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "Utilities.h"
- #include "AW_game.h"
- #include "ServComm.h"
- #include <time.h>
- extern _SERVER_GET_CUSTOM_RESPONCE cData;
- addrs_s addrs;
- aimbot bot;
- toggles_s toggles;
- vec4 engine_white = vec4(1, 1, 1, 1);
- vec4 engine_black = vec4(0, 0, 0, 1);
- vec4 engine_red = vec4(1, 0, 0, 0.8f);
- vec4 engine_green = vec4(0, 1, 0, 1);
- vec4 engine_blue = vec4(0, 0, 1, 1);
- vec4 engine_orange = vec4(1.0f, 0.5f, 0.0f, 0.8f);
- pclientActive_t LocalClient;
- pcentity_s Entities;
- pcgs_t cgs;
- pcg_s cg;
- bool worldToScreen(vec3& WorldLocation, vec2& Screen)
- {
- vec3 Local = WorldLocation - cg->refdef.ViewOrigin, Transform;
- Transform.x = Local.DotProduct(cg->refdef.ViewAxis[1]);
- Transform.y = Local.DotProduct(cg->refdef.ViewAxis[2]);
- Transform.z = Local.DotProduct(cg->refdef.ViewAxis[0]);
- if(Transform.z < 0.01) return false;
- Screen.x = (cg->refdef.Width / 2) * ( 1 - (Transform.x / cg->refdef.Fov.x / Transform.z));
- Screen.y = (cg->refdef.Height / 2) * ( 1 - (Transform.y / cg->refdef.Fov.y / Transform.z));
- return (Transform.z > 0);
- }
- vec3 VectorToAngles(vec3 &Delta)
- {
- float Forward, Yaw, Pitch;
- if(Delta.x == 0 && Delta.y == 0)
- {
- Yaw = 0;
- if(Delta.z > 0)
- { Pitch = 90; }
- else { Pitch = 270; }
- }
- else
- {
- if(Delta.x)
- { Yaw = (atan2(Delta.y, Delta.x) * 180 / 3.14159265358979323846); }
- else if(Delta.y > 0)
- { Yaw = 90; }
- else { Yaw = 270; }
- if(Yaw < 0)
- { Yaw += 360; }
- Forward = sqrt((Delta.x * Delta.x) + (Delta.y * Delta.y));
- Pitch = (atan2(Delta.z, Forward) * 180 / 3.14159265358979323846);
- if(Pitch < 0)
- { Pitch += 360; }
- }
- return vec3(-Pitch, Yaw, 0);
- }
- DWORD __declspec(naked) CL_WritePacketHookStub(DWORD LocalClientNumber)
- {
- __asm
- {
- li r3, 1
- nop
- nop
- nop
- nop
- nop
- nop
- blr
- }
- }
- int aimbot::closestClient(DWORD Client, bool VisibilityCheck)
- {
- DWORD Closest = -1;
- float Distance = 9999999999999999999;
- vec3 Player = Entities[Client].Origin;
- for(DWORD i = 0; i < cgs->MaxClients; i++)
- {
- if(i == Client || !(Entities[i].Alive & 1)) continue;
- if(cg->clientInfo[i].Team == cg->clientInfo[Client].Team)
- if(cg->clientInfo[i].Team != 0) continue;
- if(!CG_CanSeePlayer(0, &Entities[i], 0x2805823) && VisibilityCheck) continue;
- float DistanceToTarget = Player.Distance(Entities[i].Origin);
- if(DistanceToTarget < Distance)
- {
- Distance = DistanceToTarget;
- Closest = i;
- }
- }
- if(VisibilityCheck && Closest == -1){
- return closestClient(Client, false);
- }
- return Closest;
- }
- vec3 aimbot::tagPosition(DWORD ClientNumber, CONST PCHAR Tag)
- {
- vec3 Position;
- AimAssist_GetTagPos(0, &Entities[ClientNumber], SL_GetStringOfSize(Tag, 1, strlen(Tag) + 1, 8), Position);
- Position.z -= (cg->Flags & CLIENT_FLAG_CROUCHED) ? 35 : 50;
- return Position;
- }
- void aimbot::addPrediction(int client, vec3 in, vec3 old, vec3 *out, float Prediction)
- {
- *out = in - old;
- out->x *= Prediction;
- out->y *= Prediction;
- out->z *= Prediction;
- }
- void engine::DrawLine(float X1, float Y1, float X2, float Y2, float Width, vec4& Color)
- {
- float X, Y, Angle, L1, L2, H1;
- H1 = Y2 - Y1;
- L1 = X2 - X1;
- L2 = sqrt(L1 * L1 + H1 * H1);
- X = X1 + ((L1 - L2) / 2);
- Y = Y1 + (H1 / 2);
- Angle = (float)atan(H1 / L1) * (180 / 3.14159265358979323846);
- CG_DrawRotatedPicPhysical(addrs.screenPlacement, X, Y, L2, Width, Angle, Color, DB_FindXAssetHeader(material, "white", 1));
- }
- void engine::MakeESPLine(vec3 Center, float X1, float Y1, float Z1, float X2, float Y2, float Z2, vec4 Color)
- {
- vec2 XY1, XY2;
- if(worldToScreen(vec3(Center.x + X1, Center.y + Y1, Center.z + Z1), XY1) && worldToScreen(vec3(Center.x + X2, Center.y + Y2, Center.z+ Z2), XY2)){
- DrawLine(XY1.x, XY1.y, XY2.x, XY2.y, 2, Color);
- }
- }
- void engine::Make3DBox(vec3 Center, float W, float H, vec4 Color)
- {
- MakeESPLine(Center, -W, -W, 0, W, -W, 0, Color);
- MakeESPLine(Center, -W, -W, 0, -W, W, 0, Color);
- MakeESPLine(Center, W, W, 0, W, -W, 0, Color);
- MakeESPLine(Center, W, W, 0, -W, W, 0, Color);
- MakeESPLine(Center, -W, -W, 0, -W, -W, H, Color);
- MakeESPLine(Center, -W, W, 0, -W, W, H, Color);
- MakeESPLine(Center, W, -W, 0, W, -W, H, Color);
- MakeESPLine(Center, W, W, 0, W, W, H, Color);
- MakeESPLine(Center, -W, -W, H, W, -W, H, Color);
- MakeESPLine(Center, -W, -W, H, -W, W, H, Color);
- MakeESPLine(Center, W, W, H, W, -W, H, Color);
- MakeESPLine(Center, W, W, H, -W, W, H, Color);
- }
- UINT ui_menuOptionCount = 0;
- float ui_x = 60.0f;
- float ui_y = 240.0f;
- float ui_width = 160.0f;
- float ui_height = 200.0f;
- bool test = false;
- void ui_render_option(char option[255], bool enabled){
- float optionYcalc = ui_menuOptionCount > 0?20 * ui_menuOptionCount:0;
- CL_DrawTextPhysical(va("%s ^7[%s^7]", option, enabled?"^2ON":"^1OFF"), 0x7FFFFFFF, DB_FindXAssetHeader(font, "fonts/bodyFont", 0), ui_x+5, (ui_y + 30) + optionYcalc, 1, 1, 0, engine_white, 0);
- ui_menuOptionCount++;
- };
- void ui_render(){
- CG_DrawRotatedPicPhysical(addrs.screenPlacement, ui_x, ui_y, ui_width, ui_height, 0, engine_black, DB_FindXAssetHeader(material, "white", 1));
- ui_render_option("Aimbot:", false);
- ui_render_option("ESP:", false);
- ui_render_option("UAV:", true);
- test = true;
- ui_menuOptionCount = 0;
- }
- void engine(bool ingame){
- vec4 color = engine_green;
- CL_DrawTextPhysical("XBLParanoid - Bypassed", 0x7FFFFFFF, DB_FindXAssetHeader(font, "fonts/bodyFont", 0), 40, 40, 1, 1, 0, color, 0);
- return;
- char *aimbot;
- switch(toggles.mode){
- case MODE_DISABLED: aimbot = "^1Off"; break;
- case MODE_NORMAL: aimbot = "^2Normal"; break;
- case MODE_PREDICT: aimbot = "^2Prediction"; break;
- }
- CL_DrawTextPhysical(ingame?"XBLParanoid":va("Toggle aimbot/ESP with (LS) | Aimbot/ESP: %s", aimbot), 0x7FFFFFFF, DB_FindXAssetHeader(font, "fonts/bodyFont", 0), 40, 40, 1, 1, 0, color, 0);
- if(!ingame || !toggles.mode>MODE_DISABLED) return;
- float CenterX = cg->refdef.Width / 2, CenterY = cg->refdef.Height / 2;
- engine::DrawLine(CenterX, CenterY - 15, CenterX, CenterY + 15, 3, engine_black);
- engine::DrawLine(CenterX - 15, CenterY, CenterX + 15, CenterY, 3, engine_black);
- for(DWORD i = 0; i < cgs->MaxClients; i++)
- {
- vec2 Screen;
- vec3 Origin = aimbot::tagPosition(i, "j_head");
- if(worldToScreen(Origin, Screen))
- {
- bool friendly = (cg->clientInfo[i].Team == cg->clientInfo[cg->ClientNumber].Team);
- if(i == cg->ClientNumber || !(Entities[i].Alive & 1)) continue;
- if(friendly) color = engine_green;
- else
- {
- if(CG_CanSeePlayer(0, &Entities[i], 0x2805823)){
- color = engine_red;
- PCHAR text = "!!!ENEMY VISIBLE KILL THAT NIGGER BEFORE HE KILLS YOU!!!"; //Added alil nigger joke text lol
- DWORD tmpfont = DB_FindXAssetHeader(font, "fonts/bigDevFont", 0);
- CL_DrawTextPhysical(text, 0x7FFFFFFF, tmpfont, 500 - (R_TextWidth(text, 0x7FFFFFFF, tmpfont) / 2), 50, 2, 1, 0, color, 0);
- engine::DrawLine(CenterX, CenterY - 20, CenterX, CenterY + 20, 4.5, engine_red);
- engine::DrawLine(CenterX - 20, CenterY, CenterX + 20, CenterY, 4.5, engine_red);
- }
- else color = engine_orange;
- }
- if(!friendly) engine::DrawLine(Screen.x, Screen.y, CenterX, CenterY, 1, color);
- engine::Make3DBox(Entities[i].Origin, 12, 60, color);
- DWORD tmpfont = DB_FindXAssetHeader(font, "fonts/smallDevFont", 0);
- CONST PCHAR Text = va("%s ^5[%0.2fm]", cg->playerNames[i].PlayerName, Origin.Distance(Entities[cg->ClientNumber].Origin) * 0.0254);
- CL_DrawTextPhysical(Text, 0x7FFFFFFF, tmpfont, Screen.x - (R_TextWidth(Text, 0x7FFFFFFF, tmpfont) / 2), Screen.y, 1, 1, 0, color, 0);
- }
- }
- }
- DWORD CL_WritePacketHook(DWORD localClient)
- {
- if(Dvar_Getbool("cl_ingame") && toggles.mode>MODE_DISABLED)
- {
- LocalClient = (pclientActive_t)*(PDWORD)addrs.clientActive;
- Entities = (pcentity_s)*(PDWORD)addrs.centity;
- cg = (pcg_s)*(PDWORD)addrs.cg;
- cgs = (pcgs_t)*(PDWORD)addrs.cgs;
- pusercmd_s UserCommand = LocalClient->GetUserCommand(LocalClient->GetUserCommandNumber());
- //DbgPrint("IN GAME");
- if(UserCommand->Buttons & 0x80800) // LT
- {
- //DbgPrint("Ingame button DOWN!");
- DWORD ClosestClientNumber = aimbot::closestClient(cg->ClientNumber);
- if(ClosestClientNumber != -1)
- {
- vec3 targetAngles;
- if(toggles.mode == MODE_PREDICT){
- vec3 currentPos = aimbot::tagPosition(ClosestClientNumber, "j_head");
- vec3 myCurrentPos = aimbot::tagPosition(cg->ClientNumber, "j_head");
- vec3 predictedPos, myPredictedPos;
- if(ClosestClientNumber == bot.lastClient)
- {
- aimbot::addPrediction(ClosestClientNumber, currentPos, bot.lastPos, &predictedPos, 1.316f);
- predictedPos.x += currentPos.x;
- predictedPos.y += currentPos.y;
- predictedPos.z += currentPos.z;
- }else predictedPos = currentPos;
- aimbot::addPrediction((int)cg->ClientNumber, myCurrentPos, bot.lastPos, &myPredictedPos, 1.316f);
- myPredictedPos.x += myCurrentPos.x;
- myPredictedPos.y += myCurrentPos.y;
- myPredictedPos.z += myCurrentPos.z;
- bot.lastPos = currentPos;
- bot.myLastPos = myCurrentPos;
- targetAngles = VectorToAngles(predictedPos - myPredictedPos);
- }else if(toggles.mode==MODE_NORMAL) targetAngles = VectorToAngles(aimbot::tagPosition(ClosestClientNumber, "j_head") - Entities[cg->ClientNumber].Origin);
- LocalClient->ViewAngles = targetAngles - LocalClient->SpawnAngles;
- }
- }
- }
- return CL_WritePacketHookStub(localClient);
- }
- void CG_DrawFPSHook(){
- bool ingame = Dvar_Getbool("cl_ingame");
- engine(ingame);
- if(!ingame){
- if(toggles.clicked){
- if(toggles.click++>55){
- toggles.click = 0;
- toggles.clicked = false;
- }
- return;
- }
- if(Key_IsDown(0, KEY_LS)){
- if(toggles.mode++>1) toggles.mode = MODE_DISABLED;
- toggles.clicked = true;
- //DbgPrint("getstringofsize = %i", SL_GetStringOfSize("j_head", 1, strlen("j_head") + 1, 8));
- //DbgPrint("LS Down");
- }
- }
- }
- int XNetXnAddrToMachineHook(int xnaddr, unsigned long long * pqwMachineId)
- {
- srand(time(0));
- if(!*(int*)(xnaddr + 0x4)) *pqwMachineId = 0; return -1;
- *pqwMachineId = 0xFA00000000000000 | (0x2000000 | rand() % 0x7FFFFF);
- return 0;
- }
- void aw_ini(){
- addrs.ini();
- bot.reset();
- toggles.reset();
- *(QWORD*)(0x822EB2EC) = 0x8921005061490000; //XboxLive Gold - TU12
- *(QWORD*)(0x822EB344) = 0x8921005061490000; //XBDM - TU12
- *(DWORD*)0x82306018 = 0x60000000; //TU12
- *(DWORD*)0x8230601C = 0x60000000; //TU12
- *(DWORD*)0x821B6998 = 0x60000000; //TU12
- *(DWORD*)0x821B699C = 0x60000000; //TU12
- *(DWORD*)0x821B5F14 = 0x60000000; //TU12
- *(DWORD*)0x8230603C = 0x60000000; //TU12
- *(DWORD*)0x82306040 = 0x60000000; //TU12
- *(DWORD*)0x821DA574 = 0x60000000; //TU12
- *(DWORD*)0x821B58F8 = 0x60000000; //TU12
- //*(PDWORD)addrs.getTagPos_error = cData.ppc_nop;
- //*(PDWORD)addrs.crosshair = 0x3F800000;
- //*(PDWORD)addrs.recoil = cData.ppc_nop;
- *(PDWORD)addrs.chams = 0x38C00005;
- //*(PDWORD)addrs.uav = 0x3B200001;
- /**(DWORD*)0x826919DC = 0x3B200001; // UAV
- *(DWORD*)0x826919E0 = 0x3B200001; // UAV
- *(DWORD*)0x826919E4 = 0x3B200001; // UAV*/
- //PatchInJump((DWORD*)0x82193950, (DWORD)XNetXnAddrToMachineHook);
- //PatchInJump((PDWORD)addrs.drawFps_ptr, (DWORD)CG_DrawFPSHook, false); //removed for xbls
- //HookFunctionStart((PDWORD)addrs.writePacket_ptr, (PDWORD)CL_WritePacketHookStub, (DWORD)CL_WritePacketHook);
- }
- //0x826B8080 + 0x224 | nop | redbox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement