Post: Non Host Mod Menu Source Code
01-26-2015, 08:53 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Since I've gotten rid of my Custom Firmware PS3, I've decided to release my stuff so here I'm releasing my Nonhost menu source It's really sloppy, and I coded it very quickly so it is not good coding but it works so idc. I will show each files coding then I will have a media fire link for the full vs project.


Here are all of my system functions like Write_Proc and PatchInJump etc
PS3.h
    
#include <wchar.h>
#include <sys/prx.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <sys/ppu_thread.h>
#include <string.h>
#include <sys/sys_time.h>
#include <sys/time_util.h>
#include <stdarg.h>
#include <assert.h>
#include <sys/process.h>
#include <sys/memory.h>
#include <sys/timer.h>
#include <sys/return_code.h>
#include <sys/prx.h>
#include <stddef.h>
#include <math.h>
#include <stdarg.h>
#include <cellstatus.h>
#include <typeinfo>
#include <vector>
#include <pthread.h>
#include <locale.h>
#include <cell/error.h>
#include <sys/paths.h>
#include <time.h>
#include <cell/sysmodule.h>
#include <sys/ss_get_open_psid.h>
#pragma comment(lib, "sysmodule_stub")
#include <cell/pad.h>
#include <string>
#include <sys/random_number.h>
#pragma comment(lib, "c")

#include <sys/memory.h>

#include <cell/cell_fs.h>
#pragma comment(lib, "fs_stub")
#include <fastmath.h>
#include <ppu_intrinsics.h>
#define TOC ( 0x9A5080 )//1.06
#define ARRAY_SIZE(array) (sizeof((array)) / sizeof((array[0])))
#define titleFontBold24px "fonts/titleFontBold24px"
#define titleFontBold50px "fonts/titleFontBold50px"
#define titleFontBold30px "fonts/titleFontBold30px"
#define titleFontBold36px "fonts/titleFontBold36px"
#define titleFontBold18px "fonts/titleFontBold18px"
#define titleFontBolder24px "fonts/titleFontBolder24px"
#define titleFontBolder50px "fonts/titleFontBolder50px"
#define titleFontBolder30px "fonts/titleFontBolder30px"
#define titleFontBolder36px "fonts/titleFontBolder36px"
#define titleFontBolder18px "fonts/titleFontBolder18px"
#define bodyFontBold "fonts/bodyFontBold"
#define consoleFont "fonts/consoleFont"
#define titleFont "fonts/titleFont"
#define titleFontBold "fonts/titleFontBold"
#define MOUNT_POINT "/dev_hdd0/tmp"
typedef unsigned long DWORD;
typedef char CHAR;
typedef unsigned char BYTE;
typedef int BOOL;
typedef float FLOAT;
typedef CHAR *PCHAR;
#define VOID void
#define CONST const
typedef unsigned short WORD;
typedef DWORD *PDWORD;
#define AngleToShort(X) ((int)((X) * 65536 / 360) & 65535)
#define ShortToAngle(X) ((X) * (360 / 65536))
#define GetPointer(X) *(int*)(X)
#define TRUE true
#define FALSE false
typedef void *PVOID;


#include <sys/types.h>

struct opd_s
{
int32_t sub;
int32_t toc;
};
//Credits to shark
int sys_ppu_thread_exit()
{
system_call_1(41, 0);
return_to_user_prog(int);
}

int console_write(const char * s)
{
uint32_t len;
system_call_4(403, 0, (uint64_t)s, std::strlen(s), (uint64_t)&len);
return_to_user_prog(int);
}

sys_ppu_thread_t MenuThread;
sys_ppu_thread_t create_thread(void(*entry)(uint64_t), int priority, size_t stacksize, const char* threadname, sys_ppu_thread_t tid)
{
if (sys_ppu_thread_create(&tid, entry, 0, priority, stacksize, 0, threadname) != CELL_OK)
{
console_write("Thread creation failed\n");
}
else
{
console_write("Thread created\n");
}
return tid;
}

void sleep(usecond_t time)
{
sys_timer_usleep(time * 1000);
}
void delay(unsigned int mseconds)
{
clock_t goal = (mseconds * 1000) + clock();
while (goal > clock());
}

namespace PS3
{
float floatArray[100];
float* ReadFloat(int address, int length)
{
for (int i = 0; i < length; i++)
{
floatArray[i] = *(float*)(address + (i * 0x04));
}
return floatArray;
}
char byteArray[100];
char* ReadBytes(int address, int length)
{
for (int i = 0; i < length; i++)
{
byteArray[i] = *(char*)(address + (i));
}
return byteArray;
}
void WriteFloat(int address, float* input, int length)
{
for (int i = 0; i < length; i++)
{
*(float*)(address + (i * 4)) = input[i];
}
}
void WriteBytes(int address, char* input, int length)
{
for (int i = 0; i < length; i++)
{
*(char*)(address + (i)) = input[i];
}
}
float intArray[100];
float* ReadInt(int address, int length)
{
for (int i = 0; i < length; i++)
{
intArray[i] = *(int*)(address + (i * 0x04));
}
return intArray;
}
void WriteInt(int address, int* input, int length)
{
for (int i = 0; i < length; i++)
{
*(int*)(intArray + (i * 0x04)) = input[i];
}
}
int32_t write_process(uint64_t ea, const void * data, uint32_t size)
{
system_call_4(905, (uint64_t)sys_process_getpid(), ea, size, (uint64_t)data);
return_to_user_prog(int32_t);
}
int Memcpy(PVOID destination, const PVOID source, size_t size)
{
system_call_4(905, (uint64_t)sys_process_getpid(), (uint64_t)destination, size, (uint64_t)source);
__dcbst(destination);
__sync();
__isync();
return_to_user_prog(int);
}
void PatchInJump(int Address, int Destination, bool Linked) {

// use this data to copy over the address
int FuncBytes[4];

// Get the actual destination address
Destination = *(int *)Destination;

FuncBytes[0] = 0x3D600000 + ((Destination >> 16) & 0xFFFF); // lis %r11, dest>>16
if (Destination & 0x8000) // If bit 16 is 1
FuncBytes[0] += 1;

FuncBytes[1] = 0x396B0000 + (Destination & 0xFFFF); // addi %r11, %r11, dest&0xFFFF
FuncBytes[2] = 0x7D6903A6; // mtctr %r11

FuncBytes[3] = 0x4E800420; // bctr

if (Linked)
FuncBytes[3] += 1; // bctrl

Memcpy((void*)Address, FuncBytes, 4 * 4);
}
void WriteString(int address, char* string)
{
int FreeMem = 0x1D00000;
int strlength = std::strlen(string);
char* strpointer = *(char**)FreeMem = string;
char* StrBytes = PS3::ReadBytes(*(int*)FreeMem, strlength);
PS3::WriteBytes(address, StrBytes, strlength);
}
char returnRead[100];
char* ReadString(int address)
{
memset(&returnRead[0], 0, sizeof(returnRead));
int strlength = 100;
char* StrBytes = ReadBytes(address, strlength);
for (int i = 0; i < strlength; i++)
{
if (StrBytes[i] != 0x00)
returnRead[i] = StrBytes[i];
else
break;
}
return returnRead;
}
char returnR[100];
const char *ReadString1(int address)
{
memset(&returnRead[0], 0, sizeof(returnR));
int strlength = 100;
const char *StrBytes = ReadBytes(address, strlength);
for (int i = 0; i < strlength; i++)
{
if (StrBytes[i] != 0x00)
returnRead[i] = StrBytes[i];
else
break;
}
return returnR;
}
void WriteInt32(int Address, int Input)
{
*(int*)Address = Input;
}
int ReadInt32(int Address)
{
return *(int*)Address;
}
};


Here is my button monitoring
Buttons.h
    
namespace LocalButtons
{
enum xxx
{
R3 = 0xD05793,//Open
L1 = 0xD05703,
Triangle = 0xD056f7,//Close
Square = 0xD056EB,//Select
DpadUp = 0xD057B7,//ScrollUp
DpadDown = 0xD057C3//Scroll Down
};
}
bool LocalPressed(int Button, bool open = false)
{
if (!open){
if (*(char*)Button == 0x01)
return true;
else return false;
}
else
{
if (*(char*)0xD05703 == 0x01 && *(char*)0xD05793 == 0x01)
return true;
else return false;
}
}


Here is some game structures.. some of the stuff is wrong but 95% is correct
Structures.h
    
typedef struct Vector2
{
FLOAT x, y;
Vector2()
{
x = y = 0;
}
Vector2(FLOAT x, FLOAT y)
{
this->x = x;
this->y = y;
}

} Vector2, *PVector2;
typedef struct Vector3
{
FLOAT x, y, z;
Vector3()
{
x = y = z = 0;
}
Vector3(FLOAT x, FLOAT y, FLOAT z)
{
this->x = x; this->y = y; this->z = z;
}
const BOOL operator== (Vector3 const &Vector)
{
return (this->x == Vector.x && this->y == Vector.y && this->z == Vector.z);
}
const Vector3& operator+ (Vector3 const &Vector)
{
return Vector3(this->x + Vector.x, this->y + Vector.y, this->z + Vector.z);
}
const Vector3& operator- (Vector3 const &Vector)
{
return Vector3(this->x - Vector.x, this->y - Vector.y, this->z - Vector.z);
}

FLOAT Distance(Vector3 const &Vector)
{
return sqrt(DistanceEx(Vector));
}
FLOAT DistanceEx(Vector3 const &Vector)
{
FLOAT _x = this->x - Vector.x, _y = this->y - Vector.y, _z = this->z - Vector.z;
return ((_x * _x) + (_y * _y) + (_z * _z));
}
FLOAT DotProduct(Vector3 const &Vector)
{
return (this->x * Vector.x) + (this->y * Vector.y) + (this->z * Vector.z);
}
const Vector3 &RoundHalfUp()
{
return Vector3(floor(this->x + 0.5), floor(this->y + 0.5), floor(this->z + 0.5));
}\
const Vector3 &RoundHalfDown()
{
return Vector3(floor(this->x + 0.5), floor(this->y + 0.5), floor(this->z + 0.5));
}
} Vector3, *PVector3;
Vector3 GetDifference(Vector3 numArray, Vector3 numArray2)
{
Vector3 Difference;
Difference.x = (numArray2.x - numArray.x);
Difference.y = (numArray2.y - numArray.y);
Difference.z = (numArray2.z - numArray.z);
return Difference;
}
float Get3dDistance(Vector3 c1, Vector3 c2)
{
float dx = c2.x - c1.x;
float dy = c2.y - c1.y;
float dz = c2.z - c1.z;

return sqrt((float)((dx * dx) + (dy * dy) + (dz * dz)));
}
typedef struct Vector4
{
FLOAT x, y, z, a;
Vector4()
{
x = y = z = a = 0;
}
Vector4(FLOAT x, FLOAT y, FLOAT z, FLOAT a)
{
this->x = x;
this->y = y;
this->z = z;
this->a = a;
}

} Vector4, *PVector4;
typedef struct cgs_t
{
BYTE _0x0000[36];
CHAR Gametype[32]; // 0x0024
CHAR HostName[260]; // 0x0044
DWORD MaxClients; // 0x0148
DWORD PrivateClients; // 0x014C
CHAR Mapname[64]; // 0x0150
BYTE _0x0190[54100];
} cgs_t, *pcgs_t; // size 0xD4E4

typedef struct usercmd_s
{
DWORD ServerTime; // 0x0000
DWORD Buttons; // 0x0004
DWORD ViewAngles[3]; // 0x0008
CHAR _0x0014[48];
} usercmd_s, *pusercmd_s; // size 0x44
typedef struct clientActive_t
{
BYTE _0x0000[248];
Vector3 Origin; // 0x00F8
BYTE _0x0104[12];
Vector3 SpawnAngles; // 0x0110
BYTE _0x011C[15436];
Vector3 ViewAngles; // 0x3D68
usercmd_s UserCommands[128]; // 0x3D74
DWORD CommandNumber; // 0x5F74
BYTE _0x5F78[42184];

DWORD GetUserCommandNumber()
{
return CommandNumber & 0x7F;
}
pusercmd_s GetUserCommand(DWORD CommandNumber)
{
return &UserCommands[CommandNumber]; /* # r10 = r11 & 0x7F */
}
} clientActive_t, *pclientActive_t; // size 0x10440

#define FLAG_CROUCHED 0x04
#define FLAG_PRONE 0x08
typedef enum entityType_t
{
ET_GENERAL = 0x0,
ET_PLAYER = 0x1,
ET_PLAYER_CORPSE = 0x2,
ET_ITEM = 0x3,
ET_MISSILE = 0x4,
ET_INVISIBLE = 0x5,
ET_SCRIPTMOVER = 0x6,
ET_SOUND_BLEND = 0x7,
ET_FX = 0x8,
ET_LOOP_FX = 0x9,
ET_PRIMARY_LIGHT = 0xA,
ET_TURRET = 0xB,
ET_HELICOPTER = 0xC,
ET_PLANE = 0xD,
ET_VEHICLE = 0xE,
ET_VEHICLE_COLLMAP = 0xF,
ET_VEHICLE_CORPSE = 0x10,
ET_VEHICLE_SPAWNER = 0x11,
ET_AGENT = 0x12,
ET_AGENT_CORPSE = 0x13
} entityType_t;
#pragma pack(push, 2)
typedef struct centity_s
{
BYTE _0x0000[20];
Vector3 Origin; // 0x0014
Vector3 Angles; // 0x0020
BYTE _0x002C[64];
DWORD Flags; // 0x006C
BYTE _0x0070[102];
DWORD ClientNumber; // 0x00D6
BYTE _0x00DA[10];
BYTE EntityType; // 0x00E4
BYTE _0x00E5[63];
DWORD WeaponIndex; // 0x0124
BYTE _0x0128[179];
BYTE Alive; // 0x01DB
BYTE _0x01DC[48];

DWORD GetCurrentWeaponIndex()
{
return WeaponIndex & 0x3FF; /* r11 = r28 & 0x3FF */
}
} centity_s, *pcentity_s; // size 0x020C
#pragma pack(pop)
typedef struct refdef_s
{
BYTE _0x0000[4];
WORD Width; // 0x0004
WORD Height; // 0x0006
BYTE _0x0008[8];
Vector2 Fov; // 0x0010
Vector3 ViewOrigin; // 0x0018 or 24DEC
Vector3 ViewAxis[3]; // 0x0024
BYTE _0x0048[4];
FLOAT ZoomProgress; // 0x004C
Vector3 _ViewOrigin; // 0x0050
} refdef_s, *prefdef_s; // custom size
typedef struct playerName_t
{
CHAR PlayerName[32]; // 0x0000
BYTE _0x0020[268];
}; // custom size
typedef struct clientInfo_t
{
BYTE _0x0000[232];
DWORD Team; // 0x00E8
BYTE _0x0010[2888];
} clientInfo_t, *pclientInfo_t; // size 0xC34
typedef struct cg_s
{
BYTE ClientNumber; // 0x0000
BYTE _0x0001[75];
DWORD ServerTime; // 0x004C
BYTE _0x0050[8];
DWORD Flags; // 0x0058
BYTE _0x005C[28];
Vector3 Origin; // 0x0078 or 0xC0A88 left
Vector3 Velocity; // 0x0084
BYTE _0x0090[344];
DWORD Health; // 0x01E8
BYTE _0x01EC[114244];
playerName_t playerNames[18]; // 0x1C030
BYTE _0x1D35C[113272];//0x37AA8
refdef_s refdef; // 0x38FC0
BYTE _0x39054[429120];// 429120
clientInfo_t clientInfo[18]; // 0xA1C94
BYTE _0xAF4E0[71200];
} cg_s, *pcg_s; // size 0xC0B00

typedef struct WeaponDef
{
CONST PCHAR InternalName; // 0x0000
CONST PCHAR DisplayName; // 0x0004
CONST PCHAR OverlayName; // 0x0008
BYTE _0x000C[2216];
} WeaponDef, *PWeaponDef; // size 0x08B4

typedef enum XAssetType
{
material = 0x05,
font = 0x1C,
weapon = 0x22,
rawfile = 0x2B,
scriptfile = 0x2C,
structureddatadef = 0x2F
} XAssetType;
pclientActive_t xLocalClient;
pcentity_s xEntities;
pcgs_t xcgs;
pcg_s xcg;
Vector3 Difference;
Vector3 GetVec(Vector3 Attacker, Vector3 Target)
{
Difference.x = (Target.x - Attacker.x);
Difference.y = (Target.y - Attacker.y);
Difference.z = (Target.z - Attacker.z);
return Difference;
}


Here is my threadings
Prx.cpp
    
#include "PS3.h"
#include "Buttons.h"
#include "Structures.h"

#include <wchar.h>
#include <sys/prx.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <sys/ppu_thread.h>
#include <string.h>
#include <sys/sys_time.h>
#include <sys/time_util.h>
#include <stdarg.h>
#include <assert.h>
#include <sys/process.h>
#include <sys/memory.h>
#include <sys/timer.h>
#include <sys/return_code.h>
#include <sys/prx.h>
#include <stddef.h>
#include <math.h>
#include <stdarg.h>
#include <cellstatus.h>
#include <typeinfo>
#include <vector>
#include <pthread.h>
#include <locale.h>
#include <cell/error.h>
#include <sys/paths.h>
#include <sys/fs.h>
#include <sys/fs_external.h>
#include <cell/cell_fs.h>
#include <cell/fs/cell_fs_file_api.h>

#include <time.h>

typedef enum ModdedExternalFileLoad
{
Cbuff_AddText_L,//Loads cmd.txt
SV_GameSendServerCommand_L,//Loads sv.txt, only works if host
Name_Change,//Changes your local name
None//Loads nothing
} ModdedExternalFileLoad;

bool menuopen = false;
int scroll;
float menupos = -1000;
const char *menutext = "Advanced UAV\nNo Recoil\nThermal Overlay\nLaser\nSteady Aim\nGhost Players\nSilent Gun\nPlayer Outline Menu\nWallhack\nThird Person\nCompass Size\nPro-mod\nHeat Vision\nDraw Menu\nChams\nLoad Menu\nAimbot [BETA]";
const char *menutitle = "^1Off Host Menu v1.2";
const char *xprint = "";
int SubMenu = 0;
float scrollerY = 110;
int maxScroll = 16;

int xcg_s(int mod = 0x00)
{
int ptr = GetPointer(0xCCD6FC);
return (ptr + mod);
}
int xclientInfo(int client, int mod = 0x00)
{
int temp = xcg_s(0xA1C94);//returns cg->ClientInfo
int temp1 = temp + (client * 0xC34);//returns cg->ClientInfo[client]
int temp2 = temp1 + mod;//returns cg->ClientInfo[client].Mod
return temp2;
}


void xScrolling(int Scroll)
{
scroll = Scroll;
int StartY = 110;
int Y = StartY + (scroll * 32.5);
if (scrollerY < Y)
{
while (scrollerY < Y)
{
scrollerY++;
sleep(1);
}
}
else if (scrollerY > Y)
{
while (scrollerY > Y)
{
scrollerY--;
sleep(1);
}
}
}
void xMoveScroller(int mode = 1)
{
if (mode == 1)//Down
{
if (scroll == maxScroll)
xScrolling(0);
else
{
scroll++;
xScrolling(scroll);
}
}
else
{
if (scroll == 0)
xScrolling(maxScroll);
else
{
scroll--;
xScrolling(scroll);
}
}
}

opd_s VA_t = { 0x4CDCA4, TOC };
opd_s CG_BoldGameMessage_t = { 0x1B60B8, TOC };
opd_s CG_GameMessage_t = { 0x1B6044, TOC };//0x1B6044
opd_s sv_gamesendservercommand_t = { 0x432C9C, TOC };
opd_s stdc_snprintf = { 0x6AEF5C, TOC };
opd_s Cbuf_AddText_t = { 0x38FCAC, TOC };
opd_s Dvar_GetBool_t = { 0x4C4D60, TOC };
opd_s Dvar_GetString_t = { 0x4C4EA8, TOC };
opd_s R_AddCmdDrawStretchPic_t = { 0x5D59D8, TOC };//Maybe 0x5D5980
opd_s R_AddCmdDrawText_t = { 0x5D5F28, TOC };
opd_s Material_RegisterHandle_t = { 0x5C9900, TOC };
opd_s R_RegisterFont_t = { 0x22B938, TOC };
opd_s AimAssist_GetTagPos_t = { 0x0010D90, TOC };
opd_s SL_GetStringOfSize_t = { 0x03DB080, TOC };
opd_s CG_CanSeePlayer_t = { 0x0212878, TOC };
opd_s CL_SetViewAngles_t = { 0x219620, TOC };

float WHITE[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
float shader[4] = { 0, 0, 0, .2f };
float scroller[4] = { 1,0,0,.5 };
float blue[4] = { 0, 0, 1, .4 };
float RED[4] = { 1, 0, 0, 1 };


char*(*VA)(const char * format, ...) = (char*(*)(const char *, ...))&VA_t;
WORD(*SL_GetStringOfSize)(CONST PCHAR Text, DWORD User, DWORD Length, DWORD Type) = (WORD(*)(CONST PCHAR, DWORD, DWORD, DWORD))&SL_GetStringOfSize_t;
BOOL(*CG_CanSeePlayer)(DWORD LocalClientNum, pcentity_s centity_s, DWORD Mask) = (BOOL(*)(DWORD, pcentity_s, DWORD))&CG_CanSeePlayer_t;
VOID(*AimAssist_GetTagPos)(DWORD LocalClientNumber, pcentity_s centity_s, WORD Tag, Vector3& Position) = (VOID(*)(DWORD, pcentity_s, WORD, Vector3&Winky Winky)&AimAssist_GetTagPos_t;
void(*CG_BoldGameMessage)(int localClient, const char * text) = (void(*)(int, const char *))&CG_BoldGameMessage_t;
void(*CG_GameMessage)(int localClient, const char * text) = (void(*)(int, const char *))&CG_GameMessage_t;
void print(const char * text, bool bold = false)
{
if (!bold)
CG_GameMessage(0, text);
else CG_BoldGameMessage(0, text);
}
void(*SV_GameSendServerCommand)(int clientNum, int type, const char * command) = (void(*)(int, int, const char *))&sv_gamesendservercommand_t;
int(*Com_Sprintf)(char* destination, size_t len, const char* format, ...) = (int(*)(char*, size_t, const char*, ...))&stdc_snprintf;
bool(*Dvar_GetBool)(const char * dvar) = (bool(*)(const char *))&Awesome facevar_GetBool_t;
const char*(*Dvar_GetString)(const char * dvar) = (const char*(*)(const char *))&Awesome facevar_GetString_t;
void(*Cbuf_AddText)(int localClient, const char * text) = (void(*)(int, const char *))&Cbuf_AddText_t;
void*(*R_RegisterShader)(const char * material, int imageTrack) = (void*(*)(const char *, int))&Material_RegisterHandle_t;
void*(*R_RegisterFont)(const char * font, int imageTrack) = (void*(*)(const char *, int))&R_RegisterFont_t;
void(*CL_SetViewAngles)(int localClientNum, const float * angles) = (void(*)(int, const float *))&CL_SetViewAngles_t;
typedef void(*R_DSI)(float x, float y, float w, float h, float xScale, float yScale, float xay, float yay, const float *color, void * material);
R_DSI R_AddCmdDrawStretchPic = (R_DSI)(opd_s*)&R_AddCmdDrawStretchPic_t;
void(*R_AddCmdDrawText)(const char *text, int maxChars, void *font, float x, float y, float xScale, float yScale, float rotation, const float *color, int style) = (void(*)(const char*, int, void*, float, float, float, float, float, const float*, int))&R_AddCmdDrawText_t;

pclientActive_t LocalClient;
pcentity_s Entities;
pcgs_t cgs;
pcg_s cg;
Vector3 GetTagPosition(DWORD ClientNumber, CONST PCHAR Tag)
{
Vector3 Position;
AimAssist_GetTagPos(0, &Entities[ClientNumber], SL_GetStringOfSize(Tag, 1, strlen(Tag) + 1, Cool Man (aka Tustin), Position);
return Position;
}
int strCmp(const char* str1, const char* str2)
{
int diff = 0;

if (*(str1) == 0x00 || *(str2) == 0x00) { return -1; }

for (int i = 0; i < 0x600; i++)
{
if (*(str1 + i) == 0x00 || *(str2 + i) == 0x00) { break; }
if (*(str1 + i) != *(str2 + i)) { diff++; }
}

return diff;
}
int Nearest;
int GetNearestPlayer(int clientIndex)
{
int nearestClient = 0;
float nearestDistance = 99999999;
for (int i = 0; i < cgs->MaxClients; i++)
{
if (i != clientIndex)
{
if ((Entities[i].Alive & 1) == TRUE)
{
if (*(DWORD*)xclientInfo(clientIndex, 0xECool Man (aka Tustin) != 0)
{
if (*(DWORD*)xclientInfo(clientIndex, 0xECool Man (aka Tustin) != *(DWORD*)xclientInfo(i, 0xECool Man (aka Tustin))
{
float Distance = Get3dDistance(LocalClient->Origin, Entities[i].Origin);
if (Distance < nearestDistance)
{
nearestDistance = Distance;//Remove if weird
nearestClient = i;
}
}
}
else
{
float Distance = Get3dDistance(LocalClient->Origin, Entities[i].Origin);
if (Distance < nearestDistance)
{
nearestDistance = Distance;
nearestClient = i;
}
}
}
}
}
return nearestClient;
}
Vector3 VectorToAngles(Vector3 CONST &Awesome faceelta)
{
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 Vector3(-Pitch, Yaw, 0);
}


bool isHost()
{
if (strcmp(Dvar_GetString("sv_hostname"), Dvar_GetString("name")) == 0)
return true;
else return false;
}

static int isMounted(const char *path)
{
int i, err;
CellFsStat status;


for (i = 0; i < 15; i++) {
err = cellFsStat(path, &status);
if (err == CELL_FS_SUCCEEDED) {
console_write("\nfslib Started\n");
return 1;
}

}
console_write("\nfslib failed\n");
return 0;
}
void ReadTextFile(ModdedExternalFileLoad filetype)
{
char str[200];
CellFsErrno err;
int fd, dir;
char w[100], r[100], buf[200];
uint64_t sw, pos, sr, rd;
if (isMounted(MOUNT_POINT))
{
if (filetype == Cbuff_AddText_L)
err = cellFsOpen(MOUNT_POINT"/offhost/cmd.txt", CELL_FS_O_RDONLY, &fd, NULL, 0);
else if (filetype == SV_GameSendServerCommand_L)
err = cellFsOpen(MOUNT_POINT"/offhost/sv.txt", CELL_FS_O_RDONLY, &fd, NULL, 0);
else if (filetype == Name_Change)
err = cellFsOpen(MOUNT_POINT"/offhost/name.txt", CELL_FS_O_RDONLY, &fd, NULL, 0);
if (err == 0)
{
err = cellFsRead(fd, str, sizeof(str), &sw);
if (err != 0)
console_write("Failed to read file");
if (filetype == Cbuff_AddText_L)
Cbuf_AddText(0, str);
else if (filetype == SV_GameSendServerCommand_L && isHost())
SV_GameSendServerCommand(-1, 0, str);
else if (filetype == Name_Change)
PS3::WriteString(0x029672e0, str);
err = cellFsClose(fd);
if (err != 0)
console_write("Failed to close file");
}
}
}
void DrawText(const char *xtext, float xx, float xy, const char *xfont, float xfontSize)
{
R_AddCmdDrawText(xtext, 0x7FFFFFFF, R_RegisterFont(xfont, 0), xx, xy, xfontSize, xfontSize, 0, WHITE, 0);
}
void DrawShader(float x, float y, float width, float height, const float * color, const char * material)
{
R_AddCmdDrawStretchPic(x, y, width, height, 1, 1, 1, 1, color, R_RegisterShader(material, 0));
}

void CL_DrawTextHook()
{
//DrawShader(450, 0, 400, 1000, shader, "black");
DrawShader(menupos - 10, 0, 5, 1000, scroller, "white");
DrawShader(menupos - 10, 0, 500, 1000, shader, "white");
DrawShader(menupos - 10, scrollerY, 500, 35, scroller, "white");
DrawText(menutitle, menupos, 100, titleFontBold, 1);
DrawText(menutext, menupos, 150, bodyFontBold, 1);

DrawShader(300, 0, 400, 400, RED, "white");
DrawText("This is a text example", 400, 200, consoleFont, 1);
}
float angles[3];
float* vectoangles(Vector3 Angles)
{
float forward;
float yaw, pitch;
float PI = 3.1415926535897931;
if (Angles.x == 0 && Angles.y == 0)
{
yaw = 0;
if (Angles.z > 0) pitch = 90.00;
else pitch = 270.00;
}
else
{
if (Angles.x != -1) yaw = (float)(atan2((double)Angles.y, (double)Angles.x) * 180.00 / PI);
else if (Angles.y > 0) yaw = 90.00;
else yaw = 270;
if (yaw < 0) yaw += 360.00;

forward = (float)sqrt((double)(Angles.x * Angles.x + Angles.y * Angles.y));
pitch = (float)(atan2((double)Angles.z, (double)forward) * 180.00 / PI);
if (pitch < 0) pitch += 360.00;
}
angles[0] = -pitch;
angles[1] = yaw + 30;
angles[2] = 0;

return angles;
}
char NOP[] = { 0x60, 0x00, 0x00, 0x00 };
bool UAV, Recoil, RB, Laser, SteadyAim, Ghosts, SilentGun, Wallhack, thirdP, compass, promod, heatvision, chams, aimbot;
int two = 0, tgo = 0, too = 0, tdbo = 0, tpo = 0, twf = 0, tgf = 0, tof = 0, tdbf = 0, tpf = 0;
void Select()
{
if (SubMenu == 0)
{
if (scroll == 0)
{
if (!UAV)
{
char On[] = { 0x00 };
PS3::write_process(0x1913FB, &On, sizeof(On));
UAV = true;
print("^2Advanced UAV");
}
else
{
char Off[] = { 0x01 };
PS3::write_process(0x1913FB, &Off, sizeof(Off));
print("^1Advanced UAV");
UAV = false;
}

}
else if (scroll == 1)
{
if (!Recoil)
{
PS3::write_process(0x002101AC, &NOP, sizeof(NOP));
Recoil = true;
print("^2No Recoil");
}
else
{
char xRec[] = { 0x4B, 0xF6, 0x15, 0x3D };
PS3::write_process(0x002101AC, &xRec, sizeof(xRec));
Recoil = false;
print("^1No Recoil");
}
}
else if (scroll == 2)
{
if (!RB)
{
char xRB[] = { 0x01 };
PS3::write_process(0x00199943, &xRB, sizeof(RB));
RB = true;
print("^2Thermal Overlay");
}
else
{
char xRB[] = { 0x00 };
PS3::write_process(0x00199943, &xRB, sizeof(RB));
RB = false;
print("^1Thermal Overlay");
}
}
else if (scroll == 3)
{
if (!Laser)
{
char xLaser[] = { 0x01 };
PS3::write_process(0x00202FB3, &xLaser, sizeof(xLaser));
Laser = true;
print("^2Laser");
}
else
{
char xLaser[] = { 0x00 };
PS3::write_process(0x00202FB3, &xLaser, sizeof(xLaser));
Laser = false;
print("^1Laser");
}
}
else if (scroll == 4)
{
if (!SteadyAim)
{
char SA[] = { 0x00 };
PS3::write_process(0x001720FF, &SA, sizeof(SA));
SteadyAim = true;
print("^2Steady Aim");
}
else
{
char SA[] = { 0x02 };
PS3::write_process(0x001720FF, &SA, sizeof(SA));
SteadyAim = false;
print("^1Steady Aim");
}
}
else if (scroll == 5)
{
if (!Ghosts)
{
char xGhosts[] = { 0x01 };
PS3::write_process(0x005DCB8F, &xGhosts, sizeof(xGhosts));
Ghosts = true;
print("^2Ghost Players");
}
else
{
char xGhosts[] = { 0x00 };
PS3::write_process(0x005DCB8F, &xGhosts, sizeof(xGhosts));
Ghosts = false;
print("^1Ghost Players");
}
}
else if (scroll == 6)
{
if (!SilentGun)
{
char xSG[] = { 0x01 };
PS3::write_process(0x0020FFDB, &xSG, sizeof(xSG));
SilentGun = true;
print("^2Silent Gun");
}
else
{
char xSG[] = { 0x00 };
PS3::write_process(0x0020FFDB, &xSG, sizeof(xSG));
SilentGun = false;
print("^1Silent Gun");
}
}
else if (scroll == 7)
{
xScrolling(0);
SubMenu = 1;
menutitle = "^1Player Outline";
menutext = "Default\n^1Red\n^2Green\n^5Cyan\n^3Yellow";
maxScroll = 4;
}
else if (scroll == Cool Man (aka Tustin)
{
if (!Wallhack)
{
char WH[] = { 0x42 };
PS3::write_process(0x2619D7C, &WH, sizeof(WH));
Wallhack = true;
print("^2Wallhack");
}
else
{
char WH[] = { 0x40 };
PS3::write_process(0x2619D7C, &WH, sizeof(WH));
Wallhack = false;
print("^1Wallhack");
}
}
else if (scroll == 9)
{
if (!thirdP)
{
Cbuf_AddText(0, "set camera_thirdPerson 1");
thirdP = true;
print("^2Third Person");
}
else
{
Cbuf_AddText(0, "set camera_thirdPerson 0");
thirdP = false;
print("^1Third Person");
}
}
else if (scroll == 10)
{

if (compass)
{
Cbuf_AddText(0, "set compassSize 2");
compass = false;
print("^2Big Compass");
}
else
{
Cbuf_AddText(0, "set compassSize 1");
compass = true;
print("^1Big Compass");
}
}
else if (scroll == 11)
{
if (!promod)
{
Cbuf_AddText(0, "set cg_fov 100");
promod = true;
print("^2Promod");
}
else
{
Cbuf_AddText(0, "set cg_fov 65");
promod = false;
print("^1Promod");
}
}
else if (scroll == 12)
{
print("^1This mod was removed due to uselessness :(");
}
else if (scroll == 13)
{
xScrolling(0);
SubMenu = 3;
menutitle = "^1Draw Menu";
menutext = "Outline Colors\nFilled Colors";
maxScroll = 1;
}
else if (scroll == 14)
{
if (!chams)
{
char on[] = { 0x38, 0xC0, 0x00, 0x09 };
PS3::write_process(0x001C6C48, &on, sizeof(on));
chams = true;
print("^2Chams");
}
else
{
char on[] = { 0x63, 0xC6, 0x00, 0x00 };
PS3::write_process(0x001C6C48, &on, sizeof(on));
chams = true;
print("^1Chams");
}
}
else if (scroll == 15)
{
xScrolling(0);
SubMenu = 2;
menutitle = "^1Load Menu";
menutext = "Load Custom Cbuff_AddText\nLoad Custom ServerCommand\nLoad Name Changer";
maxScroll = 2;
}
else if (scroll == 16)
{
if (!aimbot)
{
print("^2Aimbot BETA MODE");
aimbot = true;
}
else
{
print("^1Aimbot BETA MODE");
aimbot = false;

}
}
}
else if (SubMenu == 1)
{
if (scroll == 0)
{
char color[] = { 0x00 };
PS3::write_process(0x00202FA3, &color, sizeof(color));
print("Player Outlines Switched");
}
else if (scroll == 1)
{
char color[] = { 0x04 };
PS3::write_process(0x00202FA3, &color, sizeof(color));
print("^1Player Outlines Switched");
}
else if (scroll == 2)
{
char color[] = { 0x06 };
PS3::write_process(0x00202FA3, &color, sizeof(color));
print("^2Player Outlines Switched");
}
else if (scroll == 3)
{
char color[] = { 0x08 };
PS3::write_process(0x00202FA3, &color, sizeof(color));
print("^5Player Outlines Switched");
}
else if (scroll == 4)
{
char color[] = { 0x0c };
PS3::write_process(0x00202FA3, &color, sizeof(color));
print("^3Player Outlines Switched");
}
}
else if (SubMenu == 2)
{
if (scroll == 0)
{
ReadTextFile(Cbuff_AddText_L);
print("^2cmd.txt loaded!");
}
else if (scroll == 1)
{
if (!isHost())
print("^1You have to be host for this!");
else
{
ReadTextFile(SV_GameSendServerCommand_L);
print("^2sv.txt loaded!");
}
}
else if (scroll == 2)
{
ReadTextFile(Name_Change);
print("^2name.txt loaded!");
}
}
else if (SubMenu == 3)
{
if (scroll == 0)
{
xScrolling(0);
SubMenu = 4;
menutitle = "^1Outline Colors";
menutext = "Draw Weapons\nDraw Grenades\nDraw Objects\nDraw Dead Bodies\nDraw Players";
maxScroll = 4;
}
else if (scroll == 1)
{
xScrolling(0);
SubMenu = 5;
menutitle = "^1Filled Colors";
menutext = "Draw Weapons\nDraw Grenades\nDraw Objects\nDraw Dead Bodies\nDraw Players";
maxScroll = 4;
}
}
else if (SubMenu == 4)
{
if (scroll == 0)
{
if (two == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 1;
print("Draw Weapons");
}
else if (two == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x02 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 2;
print("^0Draw Weapons");
}
else if (two == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x04 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 3;
print("^1Draw Weapons");
}
else if (two == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x06 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 4;
print("^2Draw Weapons");
}
else if (two == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x08 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 5;
print("^5Draw Weapons");
}
else if (two == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0A };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 6;
print("^Awesome faceraw Weapons");
}
else if (two == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0C };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 7;
print("^3Draw Weapons");
}
else if (two == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0E };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
two = 0;
print("^4Draw Weapons");
}
}
else if (scroll == 1)
{
if (tgo == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 1;
print("Draw Grenades");
}
else if (tgo == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x02 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 2;
print("^0Draw Grenades");
}
else if (tgo == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x04 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 3;
print("^1Draw Grenades");
}
else if (tgo == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x06 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 4;
print("^2Draw Grenades");
}
else if (tgo == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x08 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 5;
print("^5Draw Grenades");
}
else if (tgo == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0A };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 6;
print("^Awesome faceraw Grenades");
}
else if (tgo == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0C };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 7;
print("^3Draw Grenades");
}
else if (tgo == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0E };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgo = 0;
print("^4Draw Grenades");
}
}
else if (scroll == 2)
{
if (too == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 1;
print("Draw Objects");
}
else if (too == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x02 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 2;
print("^0Draw Objects");
}
else if (too == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x04 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 3;
print("^1Draw Objects");
}
else if (too == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x06 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 4;
print("^2Draw Objects");
}
else if (too == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x08 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 5;
print("^5Draw Objects");
}
else if (too == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0A };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 6;
print("^Awesome faceraw Objects");
}
else if (too == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0C };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 7;
print("^3Draw Objects");
}
else if (too == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0E };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
too = 0;
print("^4Draw Objects");
}
}
else if (scroll == 3)
{
if (tdbo == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));//0x001C7E04
tdbo = 1;
print("Draw Dead Bodies");
}
else if (tdbo == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x02 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbo = 2;
print("^0Draw Dead Bodies");
}
else if (tdbo == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x04 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbo = 3;
print("^1Draw Dead Bodies");
}
else if (tdbo == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x06 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbo = 4;
print("^2Draw Dead Bodies");
}
else if (tdbo == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x08 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbo = 5;
print("^5Draw Dead Bodies");
}
else if (tdbo == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0A };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbo = 6;
print("^Awesome faceraw Dead Bodies");
}
else if (tdbo == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0C };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbo = 7;
print("^3Draw Dead Bodies");
}
else if (tdbo == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0E };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbo = 0;
print("^4Draw Dead Bodies");
}
}
else if (scroll == 4)
{
if (tpo == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));//0x001C6C48
tpo = 1;
print("Draw Players");
}
else if (tpo == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x02 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpo = 2;
print("^0Draw Players");
}
else if (tpo == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x04 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpo = 3;
print("^1Draw Players");
}
else if (tpo == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x06 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpo = 4;
print("^2Draw Players");
}
else if (tpo == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x08 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpo = 5;
print("^5Draw Players");
}
else if (tpo == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0A };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpo = 6;
print("^Awesome faceraw Players");
}
else if (tpo == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0C };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpo = 7;
print("^3Draw Players");
}
else if (tpo == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x0E };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpo = 0;
print("^4Draw Players");
}
}
}
else if (SubMenu == 5)
{
if (scroll == 0)
{
if (twf == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 1;
print("Draw Weapons Filed");
}
else if (twf == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x12 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 2;
print("^1Draw Weapons Filed");
}
else if (twf == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x14 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 3;
print("^1Draw Weapons Filed");
}
else if (twf == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x16 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 4;
print("^2Draw Weapons Filed");
}
else if (twf == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x18 };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 5;
print("^5Draw Weapons Filed");
}
else if (twf == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1A };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 6;
print("^Happyraw Weapons Filed");
}
else if (twf == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1C };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 7;
print("^3Draw Weapons Filed");
}
else if (twf == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1E };
PS3::write_process(0x1A17A4, &outline, sizeof(outline));
twf = 0;
print("^4Draw Weapons Filed");
}
}
else if (scroll == 1)
{
if (tgf == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 1;
print("Draw Grenades Filed");
}
else if (tgf == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x12 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 2;
print("^1Draw Grenades Filed");
}
else if (tgf == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x14 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 3;
print("^1Draw Grenades Filed");
}
else if (tgf == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x16 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 4;
print("^2Draw Grenades Filed");
}
else if (tgf == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x18 };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 5;
print("^5Draw Grenades Filed");
}
else if (tgf == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1A };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 6;
print("^Happyraw Grenades Filed");
}
else if (tgf == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1C };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 7;
print("^3Draw Grenades Filed");
}
else if (tgf == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1E };
PS3::write_process(0x001A2068, &outline, sizeof(outline));
tgf = 0;
print("^4Draw Grenades Filed");
}
}
else if (scroll == 2)
{
if (tof == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 1;
print("Draw Objects Filed");
}
else if (tof == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x12 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 2;
print("^1Draw Objects Filed");
}
else if (tof == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x14 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 3;
print("^1Draw Objects Filed");
}
else if (tof == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x16 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 4;
print("^2Draw Objects Filed");
}
else if (tof == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x18 };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 5;
print("^5Draw Objects Filed");
}
else if (tof == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1A };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 6;
print("^Happyraw Objects Filed");
}
else if (tof == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1C };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 7;
print("^3Draw Objects Filed");
}
else if (tof == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1E };
PS3::write_process(0x001A2744, &outline, sizeof(outline));
tof = 0;
print("^4Draw Objects Filed");
}
}
else if (scroll ==3)
{
if (tdbf == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 1;
print("Draw Dead Bodies Filed");
}
else if (tdbf == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x12 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 2;
print("^1Draw Dead Bodies Filed");
}
else if (tdbf == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x14 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 3;
print("^1Draw Dead Bodies Filed");
}
else if (tdbf == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x16 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 4;
print("^2Draw Dead Bodies Filed");
}
else if (tdbf == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x18 };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 5;
print("^5Draw Dead Bodies Filed");
}
else if (tdbf == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1A };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 6;
print("^Happyraw Dead Bodies Filed");
}
else if (tdbf == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1C };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 7;
print("^3Draw Dead Bodies Filed");
}
else if (tdbf == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1E };
PS3::write_process(0x001C7E04, &outline, sizeof(outline));
tdbf = 0;
print("^4Draw Dead Bodies Filed");
}
}
else if (scroll == 4)
{
if (tpf == 0)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x00 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpf = 1;
print("Draw Players Filed");
}
else if (tpf == 1)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x12 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpf = 2;
print("^1Draw Players Filed");
}
else if (tpf == 2)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x14 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpf = 3;
print("^1Draw Players Filed");
}
else if (tpf == 3)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x16 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpf = 4;
print("^2Draw Players Filed");
}
else if (tpf == 4)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x18 };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpf = 5;
print("^5Draw Players Filed");
}
else if (tpf == 5)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1A };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpf = 6;
print("^Happyraw Players Filed");
}
else if (tpf == 6)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1C };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));//0x001C6C48
tpf = 7;
print("^3Draw Players Filed");
}
else if (tpf == 7)
{
char outline[] = { 0x38, 0xC0, 0x00, 0x1E };
PS3::write_process(0x001C6C48, &outline, sizeof(outline));
tpf = 0;
print("^4Draw Players Filed");
}
}
}
}
void Start(uint64_t arg)
{
for (;Winky Winky
{
if (Dvar_GetBool("cl_ingame"))
{
if (LocalPressed(LocalButtons::R3, true) && !menuopen)
{
menupos = 800;
menutitle = "^1Off Host Menu v1.2";
menutext = "Advanced UAV\nNo Recoil\nThermal Overlay\nLaser\nSteady Aim\nGhost Players\nSilent Gun\nPlayer Outline Menu\nWallhack\nThird Person\nCompass Size\nPro-mod\nHeat Vision\nDraw Menu\nChams\nLoad Menu\nAimbot [BETA]";
console_write("Menu open\n");
menuopen = true;
}
else if (LocalPressed(LocalButtons::Triangle) && menuopen)
{
if (SubMenu == 0){
xScrolling(0);
menupos = -1000;
menutitle = "";
menutext = "";
console_write("Menu Closed\n");
menuopen = false;
}
else
{
xScrolling(0);
menutitle = "^1Off Host Menu v1.2";
menutext = "Advanced UAV\nNo Recoil\nThermal Overlay\nLaser\nSteady Aim\nGhost Players\nSilent Gun\nPlayer Outline Menu\nWallhack\nThird Person\nCompass Size\nPro-mod\nHeat Vision\nDraw Menu\nChams\nLoad Menu\nAimbot [BETA]";
SubMenu = 0;
maxScroll = 16;
sleep(100);
}
}
else if (LocalPressed(LocalButtons:HappypadDown) && menuopen)
{
xMoveScroller();
sleep(75);
}
else if (LocalPressed(LocalButtons:HappypadUp) && menuopen)
{
xMoveScroller(0);
sleep(75);

}
else if (LocalPressed(LocalButtons::Square) && menuopen)
{
Select();
sleep(150);
}
sleep(45);
}
else
{
console_write("Notingame\n");
sleep(45);
}
sleep(1);
}
}

void Aimbot(uint64_t nothing)
{
for (;Winky Winky
{
if (Dvar_GetBool("cl_ingame") == TRUE)
{
if (aimbot){
LocalClient = (pclientActive_t)GetPointer(0xD075E0);
Entities = (pcentity_s)GetPointer(0xCCD704);
cg = (pcg_s)GetPointer(0xCCD6FC);
cgs = (pcgs_t)GetPointer(0xCCD700);
if ((Entities[cg->ClientNumber].Alive & 1) == FALSE)
{
console_write("\nDead\n");
}
if (LocalClient->GetUserCommand(LocalClient->GetUserCommandNumber())->Buttons & 0x80800 && (Entities[cg->ClientNumber].Alive & 1) == TRUE) // LT
{
DWORD ClosestClientNumber = GetNearestPlayer(cg->ClientNumber);
char buf[0x200];
Com_Sprintf(buf, sizeof(buf), "%s is %ld \n", cg->playerNames[ClosestClientNumber].PlayerName, Entities[ClosestClientNumber].ClientNumber);
console_write(buf);
if (ClosestClientNumber != -1 && ClosestClientNumber != cg->ClientNumber)
{
if (*(DWORD*)xclientInfo(cg->ClientNumber, 0xECool Man (aka Tustin) == *(DWORD*)xclientInfo(ClosestClientNumber, 0xECool Man (aka Tustin))
console_write("THIS IS YOUR TEAMATE\n");
else{
Vector3 Position = Entities[ClosestClientNumber].Origin;
Position.z -= (cg->Flags & FLAG_CROUCHED) ? 35 : 50;
Vector3 Delta = Position - Entities[cg->ClientNumber].Origin;
LocalClient->ViewAngles = VectorToAngles(Delta) - LocalClient->SpawnAngles;
}
}
}
sleep(45);
}
}
sleep(1);
}
}
SYS_MODULE_INFO( PS3_PPU_Project2, 0, 1, 1);
SYS_MODULE_START( _PS3_PPU_Project2_prx_entry );

SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
SYS_LIB_EXPORT( _PS3_PPU_Project2_export_function, LIBNAME );

// An exported function is needed to generate the project's PRX stub export library
extern "C" int _PS3_PPU_Project2_export_function(void)
{
return CELL_OK;
}
//f
extern "C" int _PS3_PPU_Project2_prx_entry(void)
{
PS3::PatchInJump(0x4A5508, (int)CL_DrawTextHook, false);
sys_ppu_thread_t id;
sys_ppu_thread_t aimbot;
sys_ppu_thread_create(&id, Start, 0, 2000, 0x80000, SYS_PPU_THREAD_CREATE_JOINABLE, "BP's Offhost Menu - NGU");
sys_ppu_thread_create(&aimbot, Aimbot, 0, 3000, 0x4000, SYS_PPU_THREAD_CREATE_JOINABLE, "BP's Offhost Menu - Aimbot - NGU");
return SYS_PRX_RESIDENT;
}


Here are my additional dependencies that are in the project
    
$(SCE_PS3_ROOT)\target\ppu\lib\libc.a
$(SCE_PS3_ROOT)\target\ppu\lib\libc_stub.a
$(SN_PS3_PATH)\ppu\lib\sn\libsn.a
$(SCE_PS3_ROOT)\target\ppu\lib\libm.a
$(SCE_PS3_ROOT)\target\ppu\lib\libio_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsysutil_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsyscall.a
$(SCE_PS3_ROOT)\target\ppu\lib\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\fno-exceptions\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\fno-exceptions\fno-rtti\libstdc++_stub.a


You must login or register to view this content.

The following 19 users say thank you to Black Panther for this useful post:

/SneakerStreet/, 1austin112, Bigmoneyhustlin, Blaze Modding, Sabotage, Geo, HiddenHour, iTпDM, Welsh, Kryptus, LBK, Not Rage, RatchetBooty, SaberNGU, Smoky420, Swaqq, xhevanlyx, xMrJR, zRayz-
02-24-2015, 02:32 AM #20
jake111
Pokemon Trainer
do you need a jailbroken ps3?
02-24-2015, 01:29 PM #21
Originally posted by jake111 View Post
do you need a jailbroken ps3?


Yes..
02-27-2015, 03:19 AM #22
mariokilla23
Vault dweller
Originally posted by Black
Yes..


So this isn't cfg? Haha jk
02-27-2015, 10:41 PM #23
jake111
Pokemon Trainer
Originally posted by Black
Yes..


Damm I need to find a way to jailbreak my ps3
03-01-2015, 05:52 PM #24
KINGDOM HEARTS3
Do a barrel roll!
Woow cool
03-02-2015, 08:54 AM #25
Not Rage
Can’t trickshot me!
Much thanks Happy
04-07-2015, 01:00 AM #26
how do I install this??
04-07-2015, 02:39 PM #27
do i need a debug eboot to call this sprx?
10-10-2015, 03:44 PM #28
You've just ported the released Xbox source, why not leave credit where it's due? Why take credit...ChocoDrack

EDIT
Jfc, that source code gave me cancer...why would you use the ps3 native mem functions when you've loaded an image into mem? A simple pointed typecast is enough, as I see you've declared functions just for that...but result to write_process? 0 logic, all leeched...main reason this scene has a bad name EnzoTrue story
Last edited by Bitwise ; 10-10-2015 at 03:56 PM.

The following 2 users say thank you to Bitwise for this useful post:

LBK, SyGnUs

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo