Post: Help on SPRX Menu
04-09-2015, 07:35 PM #1
azim74
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); When I try to build it says TOC is undefined, please help me

    #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 <typeinfo>
#include <cellstatus.h>
#include <vector>
#include <pthread.h>
#include <locale.h>
#include <cell/error.h>
#include <sys/paths.h>
#include <time.h>

SYS_MODULE_INFO( DBK Public Cheater, 0, 1, 1);
SYS_MODULE_START( _DBK Public Cheater_prx_entry );

SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
SYS_LIB_EXPORT( _DBK Public Cheater_export_function, LIBNAME );

sys_ppu_thread_t create_thread(void (*entry)(uint64_t), int priority, size_t stacksize, const char* threadname,sys_ppu_thread_t id)
{
if(sys_ppu_thread_create(&id, entry, 0, priority , stacksize, 0, threadname) == CELL_OK)
{

}

return id;
}

sys_ppu_thread_t Menu;


struct opd_s
{
int32_t sub;
int32_t toc;
};
namespace TOC_Calls
{
opd_s SV_GameSendServerCommand_t = { 0x228FA8, TOC };
void(*SV_GameSendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV_GameSendServerCommand_t;

opd_s Com_sprintf_t = { 0x00298874, TOC };
int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char *, int, char const *, ...))&Com_sprintf_t;

opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, char* cmd) = (void(*)(int, char*))&SV;
};
opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
int client_s(int clientIndex)
{
return *(int*)0x17BB210 + (0x68B80 * clientIndex);
}
int getInt(const char* button)
{
switch(*(char*) button)
{
//case "+actionslot 1";
return 0x3135;
break;
}
}
namespace Huds
{
union color_s
{
struct
{
int8_t r;
int8_t g;
int8_t b;
int8_t a;
};
int32_t rgba;
};
struct hudelem_s
{
int type;
float x;
float y;
float z;
int targetEntNum;
float fontScale;
float fromFontScale;
float fontScaleStartTime;
float fontScaleTime;
int font;
int alignOrg;
int alignScreen;
color_s color;
color_s fromColor;
int fadeStartTime;
int fadeTime;
int label;
int width;
int height;
int materialIndex;
int fromWidth;
int fromHeight;
int scaleStartTime;
int scaleTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int moveStartTime;
int moveTime;
int time;
int duration;
float value;
int text;
float sort;
color_s glowColor;
int fxBirthTime;
int fxLetterTime;
int fxDecayStartTime;
int fxDecayDuration;
int soundID;
int flags;
};
struct game_hudelem_s
{
hudelem_s elem;
int clientNum;
int team;
int archived;
};
int G_LocalizedStringIndex(const char* Text)
{
opd_s Localized = { 0x001BE6CC, TOC };
int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))&Localized;
return LocalizedStringIndex(Text);
}
opd_s GMI = { 0x001BE744, TOC };
int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
game_hudelem_s* HudElem_Alloc()
{
for (int i = 0; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x00F0E10C + (i * 0xB4));
if (!elem->elem.type) return elem;
}
return (game_hudelem_s*)-1;
}
game_hudelem_s* setShader(int clientIndex, int Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
game_hudelem_s* elem = HudElem_Alloc();
elem->clientNum = clientIndex;
elem->elem.type = 4;
*(int*)0x00F3B198 = 1;
elem->elem.materialIndex = Shader;
*(int*)0x00F3B198 = 0;
elem->elem.width = Width;
elem->elem.height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
return elem;
}

game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0, unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* Elem = HudElem_Alloc();
Elem->clientNum = clientIndex;
Elem->elem.type = 1;
Elem->elem.text = G_LocalizedStringIndex(Text);
Elem->elem.font = Font;
Elem->elem.fontScale = FontScale;
if (Allign != 0)
{ Elem->elem.alignOrg = 5; Elem->elem.alignScreen = Allign; Elem->elem.x = X; Elem->elem.y = Y; }
else
{ Elem->elem.x = X; Elem->elem.y = Y; }
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.glowColor.r = glowR;
Elem->elem.glowColor.g = glowG;
Elem->elem.glowColor.b = glowB;
Elem->elem.glowColor.a = glowA;
return Elem;
}
void HudElem_DestroyAll()
{
opd_s HDA = { 0x001872E8, TOC };
void(*HudElemDestroyAll)() = (void(*)())&HDA;
HudElemDestroyAll();
}


void FoneScaleOverTime(game_hudelem_s* Elem, float FontSize, float Time)
{
Elem->elem.fromFontScale = Elem->elem.fontScale;
Elem->elem.fontScaleTime = Time;
Elem->elem.fontScaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.fontScale = FontSize;
}
void ScaleOverTime(game_hudelem_s *Elem, int time, float width, float height)
{
Elem->elem.fromHeight = Elem->elem.height;
Elem->elem.fromWidth = Elem->elem.width;
Elem->elem.scaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
Elem->elem.height = height;
Elem->elem.width = width;
}
void MoveOverTime(game_hudelem_s *Elem, int time, float x, float y)
{
Elem->elem.fromX = Elem->elem.x;
Elem->elem.fromY = Elem->elem.y;
Elem->elem.fromAlignOrg = Elem->elem.alignOrg;
Elem->elem.fromAlignScreen = Elem->elem.alignScreen;
Elem->elem.moveStartTime = *(int*)0x00FC3DB0;
Elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
Elem->elem.x = x;
Elem->elem.y = y;
}
void FadeOverTime(game_hudelem_s* Elem, float Time, int R, int G, int B, int A)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.fadeTime = (int)floor(Time * 1000 + 0.5);
Elem->elem.fadeStartTime = *(int*)0x00FC3DB0;
}
};
namespace Buttons
{
enum Buttons
{
Up = 0x3135,
Down = 0x3137,
Left = 0x3139,
Right = 0x3231,
X = 0x3235,
Square = 0x3131,
Triangle = 0x3430,
L1 = 0x3133,
L2 = 0x3700,
L3 = 0x3900,
R1 = 0x3100,
R2 = 0x3500,
R3 = 0x3237
};

bool DetectBtn(int clientIndex, Buttons Btn)
{
return *(short*)(*(int*)0x017BB210 + (clientIndex * 0x68B80) + 0x21022) == Btn;
}
};
bool isButtonPressed(int client, const char* button)
{
if(*(int*)client_s(client) + 0x21022 == getInt(button))
return true;
return false;
}
namespace Offsets
{
enum Address
{
//General
com_sprintf = 0x3E4970,
G_LocalizedStringIndex = 0x275B84,
SV_GameSendServerCommand = 0x349F6C,
Cbuf_AddText = 0x313C18,

cl_ingame = 0x1CB68E8,
LocalPlayerName = 0x26C067F,
level_locals_t = 0x1608100,
ObjectiveIndex = level_locals_t + 0x94,
AllowPrecache = level_locals_t + 0x40,
LevelTime = level_locals_t + 0x798,
G_HudElems = 0x15DDB00,
G_MaterialIndex = 0x275E80,
HudelemSize = 0x88,

//Playerstate, m
playerstate_s = 0x1780F28,
playerstate_size = 0x5808,
ClientVelocity = 0x34,
ClientFriction = 0xC,
ClientCurrentWeapon = 0x1B8,
ClientFreeze = 0x5694,
ClientViewModel = 0x54F4,
ClientButtonMonitoring = 0x569C,
ClientAnalogRight = 0x5463,
ClientAnalogLeft = 0x5460,
ClientPlayerName = 0x5544,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,
ClientTeam = 0x5504,
ClientIsAlive = 0x55D0,
ClientStance = 0xFC,
ClientGodMode = 0x18,
ClientPerks = 0x548,
ClientPrimaryCamo = 0x2D8,
ClientSecondaryCamo = 0x2BC,
ClientTactical = 0x30C,
ClientLethal = 0x2F0,
ClientKS1 = 0x42B,
ClientKS2 = 0x430,
ClientKS3 = 0x434,
PrimaryAmmo = 0x43C,
SecondaryAmmo = 0x438,
LethalAmmo = 0x440,
TacticalAmmo = 0x444,

//G_Entity
gentity_s = 0x16B9F20,
gentity_size = 0x31C,
EntModelIndex = 0x16C,
EntOrigin = 0x134,
EntAngles = 0x140,
G_ModelIndex = 0x276180,
G_DObjGetWorldTagPos = 0x2781A4,
Weapon_RocketLauncher_Fire = 0x2A5C28,
G_FireGrenade = 0x215B08,
G_EntLink = 0x2AD440,
G_EntUnlink = 0x2AD5C0,
G_SetOrigin = 0x279698,
G_AddEvent = 0x279950,
G_GivePlayerWeapon = 0x2A8364,
G_InitializeAmmo = 0x1E6838,
G_EntAttach = 0x27783C,
G_EntDetachAll = 0x277BB4,
SetClientViewAngles = 0x1E1D90,
Player_Die = 0x1FD510,
Scr_PlayerKilled = 0x248F20,
ScriptEntCmdGetCommandTimes = 0x267208,
ScriptMover_SetupMove = 0x268A38,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C5A8,
SV_LinkEntity = 0x359C00,
G_TempEntity = 0x279740,
G_SetModel = 0x277644,
G_Spawn = 0x278C60,
G_SpawnTurret = 0x2BA5C8,
G_SpawnHelicopter = 0x22C558,
SP_Turret = 0x2BAE58,
SP_Script_Model = 0x2670E8
};
int getPlayerstate(int clientIndex, int Mod = 0x00)
{
return Offsets::playerstate_s + (Offsets::playerstate_size * clientIndex) + Mod;
}
int G_Entity(int clientIndex, int Mod = 0x00)
{
return Offsets::gentity_s + (Offsets::gentity_size * clientIndex) + Mod;
}
};


bool InGame()
{
if (*(char*)Offsets::cl_ingame != 1)
return false;
return true;
}


Huds::game_hudelem_s*Background[18];
Huds::game_hudelem_s*LeftBar[18];
Huds::game_hudelem_s*RightBar[18];
Huds::game_hudelem_s*Options[18][99];

void storeHuds(int client)
{
Background[client] = Huds::setShader(client, 3, 300, 600, 999, 0, 0, 0, 0, 0, 180);
LeftBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
RightBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
Options[client][1] = Huds::setText(client, "Main Menu", 2, 1.2, 999, 100, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][2] = Huds::setText(client, "Aimbot Menu", 2, 1.2, 999, 140, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][3] = Huds::setText(client, "ESP Menu", 2, 1.2, 999, 180, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][4] = Huds::setText(client, "Targeting Menu", 2, 1.2, 999, 220, 5, 255, 255, 255, 255, 0, 0, 0, 255);
}

void openMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 0.50, 247, 0);
Huds::MoveOverTime(RightBar[client], 0.50, 450, 0);
Huds::MoveOverTime(Options[client][1], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][2], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][3], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][4], 0.50, 320, 100);
}

void closeMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 999, 247, 0);
Huds::MoveOverTime(RightBar[client], 999, 450, 0);
Huds::MoveOverTime(Options[client][1], 999, 320, 100);
Huds::MoveOverTime(Options[client][2], 999, 320, 100);
Huds::MoveOverTime(Options[client][3], 999, 320, 100);
Huds::MoveOverTime(Options[client][4], 999, 320, 100);
}

bool MenuLoaded;
bool MenuOpen[18];

void Menu_thread(std::uint64_t)
{
for(;Winky Winky
{
if (InGame)
{
if (!MenuLoaded)
{
for(int i = 0; i < 18; i++)
{
storeHuds(i);
}

MenuLoaded = true;
}
else
{
for(int i = 0; i < 18; i++)
{
if(!MenuOpen[i])
{
if(Buttons:HappyetectBtn(i, Buttons::Up))
{
openMenu(i);
}
}
else
{
if(Buttons:HappyetectBtn(i, Buttons::Square))
{
closeMenu(i);
}
}

}
}
}
}
}

// An exported function is needed to generate the project's PRX stub export library
extern "C" int _DBK_Public_Cheater_export_function(void)
{
return CELL_OK;
}

extern "C" int _DBK_Public_Cheater_prx_entry(void)
{
create_thread(Menu_thread, 0x5AA, 0x7000, "DBK Public Cheater", Menu);
return 0;
}
(adsbygoogle = window.adsbygoogle || []).push({});
04-10-2015, 12:11 AM #2
Exploited
Award Winner
Originally posted by azim74 View Post
When I try to build it says TOC is undefined, please help me

    #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 <typeinfo>
#include <cellstatus.h>
#include <vector>
#include <pthread.h>
#include <locale.h>
#include <cell/error.h>
#include <sys/paths.h>
#include <time.h>

SYS_MODULE_INFO( DBK Public Cheater, 0, 1, 1);
SYS_MODULE_START( _DBK Public Cheater_prx_entry );

SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
SYS_LIB_EXPORT( _DBK Public Cheater_export_function, LIBNAME );

sys_ppu_thread_t create_thread(void (*entry)(uint64_t), int priority, size_t stacksize, const char* threadname,sys_ppu_thread_t id)
{
if(sys_ppu_thread_create(&id, entry, 0, priority , stacksize, 0, threadname) == CELL_OK)
{

}

return id;
}

sys_ppu_thread_t Menu;


struct opd_s
{
int32_t sub;
int32_t toc;
};
namespace TOC_Calls
{
opd_s SV_GameSendServerCommand_t = { 0x228FA8, TOC };
void(*SV_GameSendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV_GameSendServerCommand_t;

opd_s Com_sprintf_t = { 0x00298874, TOC };
int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char *, int, char const *, ...))&Com_sprintf_t;

opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, char* cmd) = (void(*)(int, char*))&SV;
};
opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
int client_s(int clientIndex)
{
return *(int*)0x17BB210 + (0x68B80 * clientIndex);
}
int getInt(const char* button)
{
switch(*(char*) button)
{
//case "+actionslot 1";
return 0x3135;
break;
}
}
namespace Huds
{
union color_s
{
struct
{
int8_t r;
int8_t g;
int8_t b;
int8_t a;
};
int32_t rgba;
};
struct hudelem_s
{
int type;
float x;
float y;
float z;
int targetEntNum;
float fontScale;
float fromFontScale;
float fontScaleStartTime;
float fontScaleTime;
int font;
int alignOrg;
int alignScreen;
color_s color;
color_s fromColor;
int fadeStartTime;
int fadeTime;
int label;
int width;
int height;
int materialIndex;
int fromWidth;
int fromHeight;
int scaleStartTime;
int scaleTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int moveStartTime;
int moveTime;
int time;
int duration;
float value;
int text;
float sort;
color_s glowColor;
int fxBirthTime;
int fxLetterTime;
int fxDecayStartTime;
int fxDecayDuration;
int soundID;
int flags;
};
struct game_hudelem_s
{
hudelem_s elem;
int clientNum;
int team;
int archived;
};
int G_LocalizedStringIndex(const char* Text)
{
opd_s Localized = { 0x001BE6CC, TOC };
int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))&Localized;
return LocalizedStringIndex(Text);
}
opd_s GMI = { 0x001BE744, TOC };
int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
game_hudelem_s* HudElem_Alloc()
{
for (int i = 0; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x00F0E10C + (i * 0xB4));
if (!elem->elem.type) return elem;
}
return (game_hudelem_s*)-1;
}
game_hudelem_s* setShader(int clientIndex, int Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
game_hudelem_s* elem = HudElem_Alloc();
elem->clientNum = clientIndex;
elem->elem.type = 4;
*(int*)0x00F3B198 = 1;
elem->elem.materialIndex = Shader;
*(int*)0x00F3B198 = 0;
elem->elem.width = Width;
elem->elem.height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
return elem;
}

game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0, unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* Elem = HudElem_Alloc();
Elem->clientNum = clientIndex;
Elem->elem.type = 1;
Elem->elem.text = G_LocalizedStringIndex(Text);
Elem->elem.font = Font;
Elem->elem.fontScale = FontScale;
if (Allign != 0)
{ Elem->elem.alignOrg = 5; Elem->elem.alignScreen = Allign; Elem->elem.x = X; Elem->elem.y = Y; }
else
{ Elem->elem.x = X; Elem->elem.y = Y; }
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.glowColor.r = glowR;
Elem->elem.glowColor.g = glowG;
Elem->elem.glowColor.b = glowB;
Elem->elem.glowColor.a = glowA;
return Elem;
}
void HudElem_DestroyAll()
{
opd_s HDA = { 0x001872E8, TOC };
void(*HudElemDestroyAll)() = (void(*)())&HDA;
HudElemDestroyAll();
}


void FoneScaleOverTime(game_hudelem_s* Elem, float FontSize, float Time)
{
Elem->elem.fromFontScale = Elem->elem.fontScale;
Elem->elem.fontScaleTime = Time;
Elem->elem.fontScaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.fontScale = FontSize;
}
void ScaleOverTime(game_hudelem_s *Elem, int time, float width, float height)
{
Elem->elem.fromHeight = Elem->elem.height;
Elem->elem.fromWidth = Elem->elem.width;
Elem->elem.scaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
Elem->elem.height = height;
Elem->elem.width = width;
}
void MoveOverTime(game_hudelem_s *Elem, int time, float x, float y)
{
Elem->elem.fromX = Elem->elem.x;
Elem->elem.fromY = Elem->elem.y;
Elem->elem.fromAlignOrg = Elem->elem.alignOrg;
Elem->elem.fromAlignScreen = Elem->elem.alignScreen;
Elem->elem.moveStartTime = *(int*)0x00FC3DB0;
Elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
Elem->elem.x = x;
Elem->elem.y = y;
}
void FadeOverTime(game_hudelem_s* Elem, float Time, int R, int G, int B, int A)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.fadeTime = (int)floor(Time * 1000 + 0.5);
Elem->elem.fadeStartTime = *(int*)0x00FC3DB0;
}
};
namespace Buttons
{
enum Buttons
{
Up = 0x3135,
Down = 0x3137,
Left = 0x3139,
Right = 0x3231,
X = 0x3235,
Square = 0x3131,
Triangle = 0x3430,
L1 = 0x3133,
L2 = 0x3700,
L3 = 0x3900,
R1 = 0x3100,
R2 = 0x3500,
R3 = 0x3237
};

bool DetectBtn(int clientIndex, Buttons Btn)
{
return *(short*)(*(int*)0x017BB210 + (clientIndex * 0x68B80) + 0x21022) == Btn;
}
};
bool isButtonPressed(int client, const char* button)
{
if(*(int*)client_s(client) + 0x21022 == getInt(button))
return true;
return false;
}
namespace Offsets
{
enum Address
{
//General
com_sprintf = 0x3E4970,
G_LocalizedStringIndex = 0x275B84,
SV_GameSendServerCommand = 0x349F6C,
Cbuf_AddText = 0x313C18,

cl_ingame = 0x1CB68E8,
LocalPlayerName = 0x26C067F,
level_locals_t = 0x1608100,
ObjectiveIndex = level_locals_t + 0x94,
AllowPrecache = level_locals_t + 0x40,
LevelTime = level_locals_t + 0x798,
G_HudElems = 0x15DDB00,
G_MaterialIndex = 0x275E80,
HudelemSize = 0x88,

//Playerstate, m
playerstate_s = 0x1780F28,
playerstate_size = 0x5808,
ClientVelocity = 0x34,
ClientFriction = 0xC,
ClientCurrentWeapon = 0x1B8,
ClientFreeze = 0x5694,
ClientViewModel = 0x54F4,
ClientButtonMonitoring = 0x569C,
ClientAnalogRight = 0x5463,
ClientAnalogLeft = 0x5460,
ClientPlayerName = 0x5544,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,
ClientTeam = 0x5504,
ClientIsAlive = 0x55D0,
ClientStance = 0xFC,
ClientGodMode = 0x18,
ClientPerks = 0x548,
ClientPrimaryCamo = 0x2D8,
ClientSecondaryCamo = 0x2BC,
ClientTactical = 0x30C,
ClientLethal = 0x2F0,
ClientKS1 = 0x42B,
ClientKS2 = 0x430,
ClientKS3 = 0x434,
PrimaryAmmo = 0x43C,
SecondaryAmmo = 0x438,
LethalAmmo = 0x440,
TacticalAmmo = 0x444,

//G_Entity
gentity_s = 0x16B9F20,
gentity_size = 0x31C,
EntModelIndex = 0x16C,
EntOrigin = 0x134,
EntAngles = 0x140,
G_ModelIndex = 0x276180,
G_DObjGetWorldTagPos = 0x2781A4,
Weapon_RocketLauncher_Fire = 0x2A5C28,
G_FireGrenade = 0x215B08,
G_EntLink = 0x2AD440,
G_EntUnlink = 0x2AD5C0,
G_SetOrigin = 0x279698,
G_AddEvent = 0x279950,
G_GivePlayerWeapon = 0x2A8364,
G_InitializeAmmo = 0x1E6838,
G_EntAttach = 0x27783C,
G_EntDetachAll = 0x277BB4,
SetClientViewAngles = 0x1E1D90,
Player_Die = 0x1FD510,
Scr_PlayerKilled = 0x248F20,
ScriptEntCmdGetCommandTimes = 0x267208,
ScriptMover_SetupMove = 0x268A38,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C5A8,
SV_LinkEntity = 0x359C00,
G_TempEntity = 0x279740,
G_SetModel = 0x277644,
G_Spawn = 0x278C60,
G_SpawnTurret = 0x2BA5C8,
G_SpawnHelicopter = 0x22C558,
SP_Turret = 0x2BAE58,
SP_Script_Model = 0x2670E8
};
int getPlayerstate(int clientIndex, int Mod = 0x00)
{
return Offsets::playerstate_s + (Offsets::playerstate_size * clientIndex) + Mod;
}
int G_Entity(int clientIndex, int Mod = 0x00)
{
return Offsets::gentity_s + (Offsets::gentity_size * clientIndex) + Mod;
}
};


bool InGame()
{
if (*(char*)Offsets::cl_ingame != 1)
return false;
return true;
}


Huds::game_hudelem_s*Background[18];
Huds::game_hudelem_s*LeftBar[18];
Huds::game_hudelem_s*RightBar[18];
Huds::game_hudelem_s*Options[18][99];

void storeHuds(int client)
{
Background[client] = Huds::setShader(client, 3, 300, 600, 999, 0, 0, 0, 0, 0, 180);
LeftBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
RightBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
Options[client][1] = Huds::setText(client, "Main Menu", 2, 1.2, 999, 100, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][2] = Huds::setText(client, "Aimbot Menu", 2, 1.2, 999, 140, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][3] = Huds::setText(client, "ESP Menu", 2, 1.2, 999, 180, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][4] = Huds::setText(client, "Targeting Menu", 2, 1.2, 999, 220, 5, 255, 255, 255, 255, 0, 0, 0, 255);
}

void openMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 0.50, 247, 0);
Huds::MoveOverTime(RightBar[client], 0.50, 450, 0);
Huds::MoveOverTime(Options[client][1], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][2], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][3], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][4], 0.50, 320, 100);
}

void closeMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 999, 247, 0);
Huds::MoveOverTime(RightBar[client], 999, 450, 0);
Huds::MoveOverTime(Options[client][1], 999, 320, 100);
Huds::MoveOverTime(Options[client][2], 999, 320, 100);
Huds::MoveOverTime(Options[client][3], 999, 320, 100);
Huds::MoveOverTime(Options[client][4], 999, 320, 100);
}

bool MenuLoaded;
bool MenuOpen[18];

void Menu_thread(std::uint64_t)
{
for(;Winky Winky
{
if (InGame)
{
if (!MenuLoaded)
{
for(int i = 0; i < 18; i++)
{
storeHuds(i);
}

MenuLoaded = true;
}
else
{
for(int i = 0; i < 18; i++)
{
if(!MenuOpen[i])
{
if(Buttons:HappyetectBtn(i, Buttons::Up))
{
openMenu(i);
}
}
else
{
if(Buttons:HappyetectBtn(i, Buttons::Square))
{
closeMenu(i);
}
}

}
}
}
}
}

// An exported function is needed to generate the project's PRX stub export library
extern "C" int _DBK_Public_Cheater_export_function(void)
{
return CELL_OK;
}

extern "C" int _DBK_Public_Cheater_prx_entry(void)
{
create_thread(Menu_thread, 0x5AA, 0x7000, "DBK Public Cheater", Menu);
return 0;
}


Is your TOC address correct?
04-11-2015, 09:07 AM #3
azim74
Save Point
Originally posted by Exploited View Post
Is your TOC address correct?


When I try and add the TOC Address. It gives a bunch of more Errors.
04-11-2015, 09:37 AM #4
XenonLegend
Gym leader
Originally posted by azim74 View Post
When I try and add the TOC Address. It gives a bunch of more Errors.


You need to include the TOC address.
Look in the code, just change the TOC now.
    

#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 <typeinfo>
#include <cellstatus.h>
#include <vector>
#include <pthread.h>
#include <locale.h>
#include <cell/error.h>
#include <sys/paths.h>
#include <time.h>
#define TOC ( TOC-HERE )//put your TOC here for whatever game this is.
SYS_MODULE_INFO( DBK Public Cheater, 0, 1, 1);
SYS_MODULE_START( _DBK Public Cheater_prx_entry );

SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
SYS_LIB_EXPORT( _DBK Public Cheater_export_function, LIBNAME );

sys_ppu_thread_t create_thread(void (*entry)(uint64_t), int priority, size_t stacksize, const char* threadname,sys_ppu_thread_t id)
{
if(sys_ppu_thread_create(&id, entry, 0, priority , stacksize, 0, threadname) == CELL_OK)
{

}

return id;
}

sys_ppu_thread_t Menu;


struct opd_s
{
int32_t sub;
int32_t toc;
};
namespace TOC_Calls
{
opd_s SV_GameSendServerCommand_t = { 0x228FA8, TOC };
void(*SV_GameSendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV_GameSendServerCommand_t;

opd_s Com_sprintf_t = { 0x00298874, TOC };
int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char *, int, char const *, ...))&Com_sprintf_t;

opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, char* cmd) = (void(*)(int, char*))&SV;
};
opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
int client_s(int clientIndex)
{
return *(int*)0x17BB210 + (0x68B80 * clientIndex);
}
int getInt(const char* button)
{
switch(*(char*) button)
{
//case "+actionslot 1";
return 0x3135;
break;
}
}
namespace Huds
{
union color_s
{
struct
{
int8_t r;
int8_t g;
int8_t b;
int8_t a;
};
int32_t rgba;
};
struct hudelem_s
{
int type;
float x;
float y;
float z;
int targetEntNum;
float fontScale;
float fromFontScale;
float fontScaleStartTime;
float fontScaleTime;
int font;
int alignOrg;
int alignScreen;
color_s color;
color_s fromColor;
int fadeStartTime;
int fadeTime;
int label;
int width;
int height;
int materialIndex;
int fromWidth;
int fromHeight;
int scaleStartTime;
int scaleTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int moveStartTime;
int moveTime;
int time;
int duration;
float value;
int text;
float sort;
color_s glowColor;
int fxBirthTime;
int fxLetterTime;
int fxDecayStartTime;
int fxDecayDuration;
int soundID;
int flags;
};
struct game_hudelem_s
{
hudelem_s elem;
int clientNum;
int team;
int archived;
};
int G_LocalizedStringIndex(const char* Text)
{
opd_s Localized = { 0x001BE6CC, TOC };
int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))&Localized;
return LocalizedStringIndex(Text);
}
opd_s GMI = { 0x001BE744, TOC };
int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
game_hudelem_s* HudElem_Alloc()
{
for (int i = 0; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x00F0E10C + (i * 0xB4));
if (!elem->elem.type) return elem;
}
return (game_hudelem_s*)-1;
}
game_hudelem_s* setShader(int clientIndex, int Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
game_hudelem_s* elem = HudElem_Alloc();
elem->clientNum = clientIndex;
elem->elem.type = 4;
*(int*)0x00F3B198 = 1;
elem->elem.materialIndex = Shader;
*(int*)0x00F3B198 = 0;
elem->elem.width = Width;
elem->elem.height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
return elem;
}

game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0, unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* Elem = HudElem_Alloc();
Elem->clientNum = clientIndex;
Elem->elem.type = 1;
Elem->elem.text = G_LocalizedStringIndex(Text);
Elem->elem.font = Font;
Elem->elem.fontScale = FontScale;
if (Allign != 0)
{ Elem->elem.alignOrg = 5; Elem->elem.alignScreen = Allign; Elem->elem.x = X; Elem->elem.y = Y; }
else
{ Elem->elem.x = X; Elem->elem.y = Y; }
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.glowColor.r = glowR;
Elem->elem.glowColor.g = glowG;
Elem->elem.glowColor.b = glowB;
Elem->elem.glowColor.a = glowA;
return Elem;
}
void HudElem_DestroyAll()
{
opd_s HDA = { 0x001872E8, TOC };
void(*HudElemDestroyAll)() = (void(*)())&HDA;
HudElemDestroyAll();
}


void FoneScaleOverTime(game_hudelem_s* Elem, float FontSize, float Time)
{
Elem->elem.fromFontScale = Elem->elem.fontScale;
Elem->elem.fontScaleTime = Time;
Elem->elem.fontScaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.fontScale = FontSize;
}
void ScaleOverTime(game_hudelem_s *Elem, int time, float width, float height)
{
Elem->elem.fromHeight = Elem->elem.height;
Elem->elem.fromWidth = Elem->elem.width;
Elem->elem.scaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
Elem->elem.height = height;
Elem->elem.width = width;
}
void MoveOverTime(game_hudelem_s *Elem, int time, float x, float y)
{
Elem->elem.fromX = Elem->elem.x;
Elem->elem.fromY = Elem->elem.y;
Elem->elem.fromAlignOrg = Elem->elem.alignOrg;
Elem->elem.fromAlignScreen = Elem->elem.alignScreen;
Elem->elem.moveStartTime = *(int*)0x00FC3DB0;
Elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
Elem->elem.x = x;
Elem->elem.y = y;
}
void FadeOverTime(game_hudelem_s* Elem, float Time, int R, int G, int B, int A)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.fadeTime = (int)floor(Time * 1000 + 0.5);
Elem->elem.fadeStartTime = *(int*)0x00FC3DB0;
}
};
namespace Buttons
{
enum Buttons
{
Up = 0x3135,
Down = 0x3137,
Left = 0x3139,
Right = 0x3231,
X = 0x3235,
Square = 0x3131,
Triangle = 0x3430,
L1 = 0x3133,
L2 = 0x3700,
L3 = 0x3900,
R1 = 0x3100,
R2 = 0x3500,
R3 = 0x3237
};

bool DetectBtn(int clientIndex, Buttons Btn)
{
return *(short*)(*(int*)0x017BB210 + (clientIndex * 0x68B80) + 0x21022) == Btn;
}
};
bool isButtonPressed(int client, const char* button)
{
if(*(int*)client_s(client) + 0x21022 == getInt(button))
return true;
return false;
}
namespace Offsets
{
enum Address
{
//General
com_sprintf = 0x3E4970,
G_LocalizedStringIndex = 0x275B84,
SV_GameSendServerCommand = 0x349F6C,
Cbuf_AddText = 0x313C18,

cl_ingame = 0x1CB68E8,
LocalPlayerName = 0x26C067F,
level_locals_t = 0x1608100,
ObjectiveIndex = level_locals_t + 0x94,
AllowPrecache = level_locals_t + 0x40,
LevelTime = level_locals_t + 0x798,
G_HudElems = 0x15DDB00,
G_MaterialIndex = 0x275E80,
HudelemSize = 0x88,

//Playerstate, m
playerstate_s = 0x1780F28,
playerstate_size = 0x5808,
ClientVelocity = 0x34,
ClientFriction = 0xC,
ClientCurrentWeapon = 0x1B8,
ClientFreeze = 0x5694,
ClientViewModel = 0x54F4,
ClientButtonMonitoring = 0x569C,
ClientAnalogRight = 0x5463,
ClientAnalogLeft = 0x5460,
ClientPlayerName = 0x5544,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,
ClientTeam = 0x5504,
ClientIsAlive = 0x55D0,
ClientStance = 0xFC,
ClientGodMode = 0x18,
ClientPerks = 0x548,
ClientPrimaryCamo = 0x2D8,
ClientSecondaryCamo = 0x2BC,
ClientTactical = 0x30C,
ClientLethal = 0x2F0,
ClientKS1 = 0x42B,
ClientKS2 = 0x430,
ClientKS3 = 0x434,
PrimaryAmmo = 0x43C,
SecondaryAmmo = 0x438,
LethalAmmo = 0x440,
TacticalAmmo = 0x444,

//G_Entity
gentity_s = 0x16B9F20,
gentity_size = 0x31C,
EntModelIndex = 0x16C,
EntOrigin = 0x134,
EntAngles = 0x140,
G_ModelIndex = 0x276180,
G_DObjGetWorldTagPos = 0x2781A4,
Weapon_RocketLauncher_Fire = 0x2A5C28,
G_FireGrenade = 0x215B08,
G_EntLink = 0x2AD440,
G_EntUnlink = 0x2AD5C0,
G_SetOrigin = 0x279698,
G_AddEvent = 0x279950,
G_GivePlayerWeapon = 0x2A8364,
G_InitializeAmmo = 0x1E6838,
G_EntAttach = 0x27783C,
G_EntDetachAll = 0x277BB4,
SetClientViewAngles = 0x1E1D90,
Player_Die = 0x1FD510,
Scr_PlayerKilled = 0x248F20,
ScriptEntCmdGetCommandTimes = 0x267208,
ScriptMover_SetupMove = 0x268A38,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C5A8,
SV_LinkEntity = 0x359C00,
G_TempEntity = 0x279740,
G_SetModel = 0x277644,
G_Spawn = 0x278C60,
G_SpawnTurret = 0x2BA5C8,
G_SpawnHelicopter = 0x22C558,
SP_Turret = 0x2BAE58,
SP_Script_Model = 0x2670E8
};
int getPlayerstate(int clientIndex, int Mod = 0x00)
{
return Offsets::playerstate_s + (Offsets::playerstate_size * clientIndex) + Mod;
}
int G_Entity(int clientIndex, int Mod = 0x00)
{
return Offsets::gentity_s + (Offsets::gentity_size * clientIndex) + Mod;
}
};


bool InGame()
{
if (*(char*)Offsets::cl_ingame != 1)
return false;
return true;
}


Huds::game_hudelem_s*Background[18];
Huds::game_hudelem_s*LeftBar[18];
Huds::game_hudelem_s*RightBar[18];
Huds::game_hudelem_s*Options[18][99];

void storeHuds(int client)
{
Background[client] = Huds::setShader(client, 3, 300, 600, 999, 0, 0, 0, 0, 0, 180);
LeftBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
RightBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
Options[client][1] = Huds::setText(client, "Main Menu", 2, 1.2, 999, 100, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][2] = Huds::setText(client, "Aimbot Menu", 2, 1.2, 999, 140, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][3] = Huds::setText(client, "ESP Menu", 2, 1.2, 999, 180, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][4] = Huds::setText(client, "Targeting Menu", 2, 1.2, 999, 220, 5, 255, 255, 255, 255, 0, 0, 0, 255);
}

void openMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 0.50, 247, 0);
Huds::MoveOverTime(RightBar[client], 0.50, 450, 0);
Huds::MoveOverTime(Options[client][1], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][2], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][3], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][4], 0.50, 320, 100);
}

void closeMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 999, 247, 0);
Huds::MoveOverTime(RightBar[client], 999, 450, 0);
Huds::MoveOverTime(Options[client][1], 999, 320, 100);
Huds::MoveOverTime(Options[client][2], 999, 320, 100);
Huds::MoveOverTime(Options[client][3], 999, 320, 100);
Huds::MoveOverTime(Options[client][4], 999, 320, 100);
}

bool MenuLoaded;
bool MenuOpen[18];

void Menu_thread(std::uint64_t)
{
for(;Winky Winky
{
if (InGame)
{
if (!MenuLoaded)
{
for(int i = 0; i < 18; i++)
{
storeHuds(i);
}

MenuLoaded = true;
}
else
{
for(int i = 0; i < 18; i++)
{
if(!MenuOpen[i])
{
if(Buttons:HappyetectBtn(i, Buttons::Up))
{
openMenu(i);
}
}
else
{
if(Buttons:HappyetectBtn(i, Buttons::Square))
{
closeMenu(i);
}
}

}
}
}
}
}

// An exported function is needed to generate the project's PRX stub export library
extern "C" int _DBK_Public_Cheater_export_function(void)
{
return CELL_OK;
}

extern "C" int _DBK_Public_Cheater_prx_entry(void)
{
create_thread(Menu_thread, 0x5AA, 0x7000, "DBK Public Cheater", Menu);
return 0;
}

04-12-2015, 09:44 AM #5
azim74
Save Point
Originally posted by XenonLegend View Post
You need to include the TOC address.
Look in the code, just change the TOC now.
    

#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 <typeinfo>
#include <cellstatus.h>
#include <vector>
#include <pthread.h>
#include <locale.h>
#include <cell/error.h>
#include <sys/paths.h>
#include <time.h>
#define TOC ( TOC-HERE )//put your TOC here for whatever game this is.
SYS_MODULE_INFO( DBK Public Cheater, 0, 1, 1);
SYS_MODULE_START( _DBK Public Cheater_prx_entry );

SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
SYS_LIB_EXPORT( _DBK Public Cheater_export_function, LIBNAME );

sys_ppu_thread_t create_thread(void (*entry)(uint64_t), int priority, size_t stacksize, const char* threadname,sys_ppu_thread_t id)
{
if(sys_ppu_thread_create(&id, entry, 0, priority , stacksize, 0, threadname) == CELL_OK)
{

}

return id;
}

sys_ppu_thread_t Menu;


struct opd_s
{
int32_t sub;
int32_t toc;
};
namespace TOC_Calls
{
opd_s SV_GameSendServerCommand_t = { 0x228FA8, TOC };
void(*SV_GameSendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV_GameSendServerCommand_t;

opd_s Com_sprintf_t = { 0x00298874, TOC };
int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char *, int, char const *, ...))&Com_sprintf_t;

opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, char* cmd) = (void(*)(int, char*))&SV;
};
opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
int client_s(int clientIndex)
{
return *(int*)0x17BB210 + (0x68B80 * clientIndex);
}
int getInt(const char* button)
{
switch(*(char*) button)
{
//case "+actionslot 1";
return 0x3135;
break;
}
}
namespace Huds
{
union color_s
{
struct
{
int8_t r;
int8_t g;
int8_t b;
int8_t a;
};
int32_t rgba;
};
struct hudelem_s
{
int type;
float x;
float y;
float z;
int targetEntNum;
float fontScale;
float fromFontScale;
float fontScaleStartTime;
float fontScaleTime;
int font;
int alignOrg;
int alignScreen;
color_s color;
color_s fromColor;
int fadeStartTime;
int fadeTime;
int label;
int width;
int height;
int materialIndex;
int fromWidth;
int fromHeight;
int scaleStartTime;
int scaleTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int moveStartTime;
int moveTime;
int time;
int duration;
float value;
int text;
float sort;
color_s glowColor;
int fxBirthTime;
int fxLetterTime;
int fxDecayStartTime;
int fxDecayDuration;
int soundID;
int flags;
};
struct game_hudelem_s
{
hudelem_s elem;
int clientNum;
int team;
int archived;
};
int G_LocalizedStringIndex(const char* Text)
{
opd_s Localized = { 0x001BE6CC, TOC };
int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))&Localized;
return LocalizedStringIndex(Text);
}
opd_s GMI = { 0x001BE744, TOC };
int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
game_hudelem_s* HudElem_Alloc()
{
for (int i = 0; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x00F0E10C + (i * 0xB4));
if (!elem->elem.type) return elem;
}
return (game_hudelem_s*)-1;
}
game_hudelem_s* setShader(int clientIndex, int Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
game_hudelem_s* elem = HudElem_Alloc();
elem->clientNum = clientIndex;
elem->elem.type = 4;
*(int*)0x00F3B198 = 1;
elem->elem.materialIndex = Shader;
*(int*)0x00F3B198 = 0;
elem->elem.width = Width;
elem->elem.height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
return elem;
}

game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0, unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* Elem = HudElem_Alloc();
Elem->clientNum = clientIndex;
Elem->elem.type = 1;
Elem->elem.text = G_LocalizedStringIndex(Text);
Elem->elem.font = Font;
Elem->elem.fontScale = FontScale;
if (Allign != 0)
{ Elem->elem.alignOrg = 5; Elem->elem.alignScreen = Allign; Elem->elem.x = X; Elem->elem.y = Y; }
else
{ Elem->elem.x = X; Elem->elem.y = Y; }
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.glowColor.r = glowR;
Elem->elem.glowColor.g = glowG;
Elem->elem.glowColor.b = glowB;
Elem->elem.glowColor.a = glowA;
return Elem;
}
void HudElem_DestroyAll()
{
opd_s HDA = { 0x001872E8, TOC };
void(*HudElemDestroyAll)() = (void(*)())&HDA;
HudElemDestroyAll();
}


void FoneScaleOverTime(game_hudelem_s* Elem, float FontSize, float Time)
{
Elem->elem.fromFontScale = Elem->elem.fontScale;
Elem->elem.fontScaleTime = Time;
Elem->elem.fontScaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.fontScale = FontSize;
}
void ScaleOverTime(game_hudelem_s *Elem, int time, float width, float height)
{
Elem->elem.fromHeight = Elem->elem.height;
Elem->elem.fromWidth = Elem->elem.width;
Elem->elem.scaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
Elem->elem.height = height;
Elem->elem.width = width;
}
void MoveOverTime(game_hudelem_s *Elem, int time, float x, float y)
{
Elem->elem.fromX = Elem->elem.x;
Elem->elem.fromY = Elem->elem.y;
Elem->elem.fromAlignOrg = Elem->elem.alignOrg;
Elem->elem.fromAlignScreen = Elem->elem.alignScreen;
Elem->elem.moveStartTime = *(int*)0x00FC3DB0;
Elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
Elem->elem.x = x;
Elem->elem.y = y;
}
void FadeOverTime(game_hudelem_s* Elem, float Time, int R, int G, int B, int A)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.fadeTime = (int)floor(Time * 1000 + 0.5);
Elem->elem.fadeStartTime = *(int*)0x00FC3DB0;
}
};
namespace Buttons
{
enum Buttons
{
Up = 0x3135,
Down = 0x3137,
Left = 0x3139,
Right = 0x3231,
X = 0x3235,
Square = 0x3131,
Triangle = 0x3430,
L1 = 0x3133,
L2 = 0x3700,
L3 = 0x3900,
R1 = 0x3100,
R2 = 0x3500,
R3 = 0x3237
};

bool DetectBtn(int clientIndex, Buttons Btn)
{
return *(short*)(*(int*)0x017BB210 + (clientIndex * 0x68B80) + 0x21022) == Btn;
}
};
bool isButtonPressed(int client, const char* button)
{
if(*(int*)client_s(client) + 0x21022 == getInt(button))
return true;
return false;
}
namespace Offsets
{
enum Address
{
//General
com_sprintf = 0x3E4970,
G_LocalizedStringIndex = 0x275B84,
SV_GameSendServerCommand = 0x349F6C,
Cbuf_AddText = 0x313C18,

cl_ingame = 0x1CB68E8,
LocalPlayerName = 0x26C067F,
level_locals_t = 0x1608100,
ObjectiveIndex = level_locals_t + 0x94,
AllowPrecache = level_locals_t + 0x40,
LevelTime = level_locals_t + 0x798,
G_HudElems = 0x15DDB00,
G_MaterialIndex = 0x275E80,
HudelemSize = 0x88,

//Playerstate, m
playerstate_s = 0x1780F28,
playerstate_size = 0x5808,
ClientVelocity = 0x34,
ClientFriction = 0xC,
ClientCurrentWeapon = 0x1B8,
ClientFreeze = 0x5694,
ClientViewModel = 0x54F4,
ClientButtonMonitoring = 0x569C,
ClientAnalogRight = 0x5463,
ClientAnalogLeft = 0x5460,
ClientPlayerName = 0x5544,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,
ClientTeam = 0x5504,
ClientIsAlive = 0x55D0,
ClientStance = 0xFC,
ClientGodMode = 0x18,
ClientPerks = 0x548,
ClientPrimaryCamo = 0x2D8,
ClientSecondaryCamo = 0x2BC,
ClientTactical = 0x30C,
ClientLethal = 0x2F0,
ClientKS1 = 0x42B,
ClientKS2 = 0x430,
ClientKS3 = 0x434,
PrimaryAmmo = 0x43C,
SecondaryAmmo = 0x438,
LethalAmmo = 0x440,
TacticalAmmo = 0x444,

//G_Entity
gentity_s = 0x16B9F20,
gentity_size = 0x31C,
EntModelIndex = 0x16C,
EntOrigin = 0x134,
EntAngles = 0x140,
G_ModelIndex = 0x276180,
G_DObjGetWorldTagPos = 0x2781A4,
Weapon_RocketLauncher_Fire = 0x2A5C28,
G_FireGrenade = 0x215B08,
G_EntLink = 0x2AD440,
G_EntUnlink = 0x2AD5C0,
G_SetOrigin = 0x279698,
G_AddEvent = 0x279950,
G_GivePlayerWeapon = 0x2A8364,
G_InitializeAmmo = 0x1E6838,
G_EntAttach = 0x27783C,
G_EntDetachAll = 0x277BB4,
SetClientViewAngles = 0x1E1D90,
Player_Die = 0x1FD510,
Scr_PlayerKilled = 0x248F20,
ScriptEntCmdGetCommandTimes = 0x267208,
ScriptMover_SetupMove = 0x268A38,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C5A8,
SV_LinkEntity = 0x359C00,
G_TempEntity = 0x279740,
G_SetModel = 0x277644,
G_Spawn = 0x278C60,
G_SpawnTurret = 0x2BA5C8,
G_SpawnHelicopter = 0x22C558,
SP_Turret = 0x2BAE58,
SP_Script_Model = 0x2670E8
};
int getPlayerstate(int clientIndex, int Mod = 0x00)
{
return Offsets::playerstate_s + (Offsets::playerstate_size * clientIndex) + Mod;
}
int G_Entity(int clientIndex, int Mod = 0x00)
{
return Offsets::gentity_s + (Offsets::gentity_size * clientIndex) + Mod;
}
};


bool InGame()
{
if (*(char*)Offsets::cl_ingame != 1)
return false;
return true;
}


Huds::game_hudelem_s*Background[18];
Huds::game_hudelem_s*LeftBar[18];
Huds::game_hudelem_s*RightBar[18];
Huds::game_hudelem_s*Options[18][99];

void storeHuds(int client)
{
Background[client] = Huds::setShader(client, 3, 300, 600, 999, 0, 0, 0, 0, 0, 180);
LeftBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
RightBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
Options[client][1] = Huds::setText(client, "Main Menu", 2, 1.2, 999, 100, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][2] = Huds::setText(client, "Aimbot Menu", 2, 1.2, 999, 140, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][3] = Huds::setText(client, "ESP Menu", 2, 1.2, 999, 180, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][4] = Huds::setText(client, "Targeting Menu", 2, 1.2, 999, 220, 5, 255, 255, 255, 255, 0, 0, 0, 255);
}

void openMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 0.50, 247, 0);
Huds::MoveOverTime(RightBar[client], 0.50, 450, 0);
Huds::MoveOverTime(Options[client][1], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][2], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][3], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][4], 0.50, 320, 100);
}

void closeMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 999, 247, 0);
Huds::MoveOverTime(RightBar[client], 999, 450, 0);
Huds::MoveOverTime(Options[client][1], 999, 320, 100);
Huds::MoveOverTime(Options[client][2], 999, 320, 100);
Huds::MoveOverTime(Options[client][3], 999, 320, 100);
Huds::MoveOverTime(Options[client][4], 999, 320, 100);
}

bool MenuLoaded;
bool MenuOpen[18];

void Menu_thread(std::uint64_t)
{
for(;Winky Winky
{
if (InGame)
{
if (!MenuLoaded)
{
for(int i = 0; i < 18; i++)
{
storeHuds(i);
}

MenuLoaded = true;
}
else
{
for(int i = 0; i < 18; i++)
{
if(!MenuOpen[i])
{
if(Buttons:HappyetectBtn(i, Buttons::Up))
{
openMenu(i);
}
}
else
{
if(Buttons:HappyetectBtn(i, Buttons::Square))
{
closeMenu(i);
}
}

}
}
}
}
}

// An exported function is needed to generate the project's PRX stub export library
extern "C" int _DBK_Public_Cheater_export_function(void)
{
return CELL_OK;
}

extern "C" int _DBK_Public_Cheater_prx_entry(void)
{
create_thread(Menu_thread, 0x5AA, 0x7000, "DBK Public Cheater", Menu);
return 0;
}





Bro now it says Error 18 Expected a ")".

    
#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 <typeinfo>
#include <cellstatus.h>
#include <vector>
#include <pthread.h>
#include <locale.h>
#include <cell/error.h>
#include <sys/paths.h>
#include <time.h>
#define TOC ( 00D67E98 )//Credits to XenonLegend

SYS_MODULE_INFO( DBK Public Cheater, 0, 1, 1);
SYS_MODULE_START( _DBK Public Cheater_prx_entry );

SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
SYS_LIB_EXPORT( _DBK Public Cheater_export_function, LIBNAME );

sys_ppu_thread_t create_thread(void (*entry)(uint64_t), int priority, size_t stacksize, const char* threadname,sys_ppu_thread_t id)
{
if(sys_ppu_thread_create(&id, entry, 0, priority , stacksize, 0, threadname) == CELL_OK)
{

}

return id;
}

sys_ppu_thread_t Menu;


struct opd_s
{
int32_t sub;
int32_t toc;
};
namespace TOC_Calls
{
opd_s SV_GameSendServerCommand_t = { 0x228FA8, TOC };
void(*SV_GameSendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV_GameSendServerCommand_t;

opd_s Com_sprintf_t = { 0x00298874, TOC };
int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char *, int, char const *, ...))&Com_sprintf_t;

opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, char* cmd) = (void(*)(int, char*))&SV;
};
opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
int client_s(int clientIndex)
{
return *(int*)0x17BB210 + (0x68B80 * clientIndex);
}
int getInt(const char* button)
{
switch(*(char*) button)
{
//case "+actionslot 1";
return 0x3135;
break;
}
}
namespace Huds
{
union color_s
{
struct
{
int8_t r;
int8_t g;
int8_t b;
int8_t a;
};
int32_t rgba;
};
struct hudelem_s
{
int type;
float x;
float y;
float z;
int targetEntNum;
float fontScale;
float fromFontScale;
float fontScaleStartTime;
float fontScaleTime;
int font;
int alignOrg;
int alignScreen;
color_s color;
color_s fromColor;
int fadeStartTime;
int fadeTime;
int label;
int width;
int height;
int materialIndex;
int fromWidth;
int fromHeight;
int scaleStartTime;
int scaleTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int moveStartTime;
int moveTime;
int time;
int duration;
float value;
int text;
float sort;
color_s glowColor;
int fxBirthTime;
int fxLetterTime;
int fxDecayStartTime;
int fxDecayDuration;
int soundID;
int flags;
};
struct game_hudelem_s
{
hudelem_s elem;
int clientNum;
int team;
int archived;
};
int G_LocalizedStringIndex(const char* Text)
{
opd_s Localized = { 0x001BE6CC, TOC };
int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))&Localized;
return LocalizedStringIndex(Text);
}
opd_s GMI = { 0x001BE744, TOC };
int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
game_hudelem_s* HudElem_Alloc()
{
for (int i = 0; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x00F0E10C + (i * 0xB4));
if (!elem->elem.type) return elem;
}
return (game_hudelem_s*)-1;
}
game_hudelem_s* setShader(int clientIndex, int Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
game_hudelem_s* elem = HudElem_Alloc();
elem->clientNum = clientIndex;
elem->elem.type = 4;
*(int*)0x00F3B198 = 1;
elem->elem.materialIndex = Shader;
*(int*)0x00F3B198 = 0;
elem->elem.width = Width;
elem->elem.height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
return elem;
}

game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0, unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* Elem = HudElem_Alloc();
Elem->clientNum = clientIndex;
Elem->elem.type = 1;
Elem->elem.text = G_LocalizedStringIndex(Text);
Elem->elem.font = Font;
Elem->elem.fontScale = FontScale;
if (Allign != 0)
{ Elem->elem.alignOrg = 5; Elem->elem.alignScreen = Allign; Elem->elem.x = X; Elem->elem.y = Y; }
else
{ Elem->elem.x = X; Elem->elem.y = Y; }
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.glowColor.r = glowR;
Elem->elem.glowColor.g = glowG;
Elem->elem.glowColor.b = glowB;
Elem->elem.glowColor.a = glowA;
return Elem;
}
void HudElem_DestroyAll()
{
opd_s HDA = { 0x001872E8, TOC };
void(*HudElemDestroyAll)() = (void(*)())&HDA;
HudElemDestroyAll();
}


void FoneScaleOverTime(game_hudelem_s* Elem, float FontSize, float Time)
{
Elem->elem.fromFontScale = Elem->elem.fontScale;
Elem->elem.fontScaleTime = Time;
Elem->elem.fontScaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.fontScale = FontSize;
}
void ScaleOverTime(game_hudelem_s *Elem, int time, float width, float height)
{
Elem->elem.fromHeight = Elem->elem.height;
Elem->elem.fromWidth = Elem->elem.width;
Elem->elem.scaleStartTime = *(int*)0x00FC3DB0;
Elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
Elem->elem.height = height;
Elem->elem.width = width;
}
void MoveOverTime(game_hudelem_s *Elem, int time, float x, float y)
{
Elem->elem.fromX = Elem->elem.x;
Elem->elem.fromY = Elem->elem.y;
Elem->elem.fromAlignOrg = Elem->elem.alignOrg;
Elem->elem.fromAlignScreen = Elem->elem.alignScreen;
Elem->elem.moveStartTime = *(int*)0x00FC3DB0;
Elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
Elem->elem.x = x;
Elem->elem.y = y;
}
void FadeOverTime(game_hudelem_s* Elem, float Time, int R, int G, int B, int A)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.fadeTime = (int)floor(Time * 1000 + 0.5);
Elem->elem.fadeStartTime = *(int*)0x00FC3DB0;
}
};
namespace Buttons
{
enum Buttons
{
Up = 0x3135,
Down = 0x3137,
Left = 0x3139,
Right = 0x3231,
X = 0x3235,
Square = 0x3131,
Triangle = 0x3430,
L1 = 0x3133,
L2 = 0x3700,
L3 = 0x3900,
R1 = 0x3100,
R2 = 0x3500,
R3 = 0x3237
};

bool DetectBtn(int clientIndex, Buttons Btn)
{
return *(short*)(*(int*)0x017BB210 + (clientIndex * 0x68B80) + 0x21022) == Btn;
}
};
bool isButtonPressed(int client, const char* button)
{
if(*(int*)client_s(client) + 0x21022 == getInt(button))
return true;
return false;
}
namespace Offsets
{
enum Address
{
//General
com_sprintf = 0x3E4970,
G_LocalizedStringIndex = 0x275B84,
SV_GameSendServerCommand = 0x349F6C,
Cbuf_AddText = 0x313C18,

cl_ingame = 0x1CB68E8,
LocalPlayerName = 0x26C067F,
level_locals_t = 0x1608100,
ObjectiveIndex = level_locals_t + 0x94,
AllowPrecache = level_locals_t + 0x40,
LevelTime = level_locals_t + 0x798,
G_HudElems = 0x15DDB00,
G_MaterialIndex = 0x275E80,
HudelemSize = 0x88,

//Playerstate, m
playerstate_s = 0x1780F28,
playerstate_size = 0x5808,
ClientVelocity = 0x34,
ClientFriction = 0xC,
ClientCurrentWeapon = 0x1B8,
ClientFreeze = 0x5694,
ClientViewModel = 0x54F4,
ClientButtonMonitoring = 0x569C,
ClientAnalogRight = 0x5463,
ClientAnalogLeft = 0x5460,
ClientPlayerName = 0x5544,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,
ClientTeam = 0x5504,
ClientIsAlive = 0x55D0,
ClientStance = 0xFC,
ClientGodMode = 0x18,
ClientPerks = 0x548,
ClientPrimaryCamo = 0x2D8,
ClientSecondaryCamo = 0x2BC,
ClientTactical = 0x30C,
ClientLethal = 0x2F0,
ClientKS1 = 0x42B,
ClientKS2 = 0x430,
ClientKS3 = 0x434,
PrimaryAmmo = 0x43C,
SecondaryAmmo = 0x438,
LethalAmmo = 0x440,
TacticalAmmo = 0x444,

//G_Entity
gentity_s = 0x16B9F20,
gentity_size = 0x31C,
EntModelIndex = 0x16C,
EntOrigin = 0x134,
EntAngles = 0x140,
G_ModelIndex = 0x276180,
G_DObjGetWorldTagPos = 0x2781A4,
Weapon_RocketLauncher_Fire = 0x2A5C28,
G_FireGrenade = 0x215B08,
G_EntLink = 0x2AD440,
G_EntUnlink = 0x2AD5C0,
G_SetOrigin = 0x279698,
G_AddEvent = 0x279950,
G_GivePlayerWeapon = 0x2A8364,
G_InitializeAmmo = 0x1E6838,
G_EntAttach = 0x27783C,
G_EntDetachAll = 0x277BB4,
SetClientViewAngles = 0x1E1D90,
Player_Die = 0x1FD510,
Scr_PlayerKilled = 0x248F20,
ScriptEntCmdGetCommandTimes = 0x267208,
ScriptMover_SetupMove = 0x268A38,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C5A8,
SV_LinkEntity = 0x359C00,
G_TempEntity = 0x279740,
G_SetModel = 0x277644,
G_Spawn = 0x278C60,
G_SpawnTurret = 0x2BA5C8,
G_SpawnHelicopter = 0x22C558,
SP_Turret = 0x2BAE58,
SP_Script_Model = 0x2670E8
};
int getPlayerstate(int clientIndex, int Mod = 0x00)
{
return Offsets::playerstate_s + (Offsets::playerstate_size * clientIndex) + Mod;
}
int G_Entity(int clientIndex, int Mod = 0x00)
{
return Offsets::gentity_s + (Offsets::gentity_size * clientIndex) + Mod;
}
};


bool InGame()
{
if (*(char*)Offsets::cl_ingame != 1)
return false;
return true;
}


Huds::game_hudelem_s*Background[18];
Huds::game_hudelem_s*LeftBar[18];
Huds::game_hudelem_s*RightBar[18];
Huds::game_hudelem_s*Options[18][99];

void storeHuds(int client)
{
Background[client] = Huds::setShader(client, 3, 300, 600, 999, 0, 0, 0, 0, 0, 180);
LeftBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
RightBar[client] = Huds::setShader(client, 3, 3, 600, 999, 0, 0, 0, 213, 255, 255);
Options[client][1] = Huds::setText(client, "Main Menu", 2, 1.2, 999, 100, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][2] = Huds::setText(client, "Aimbot Menu", 2, 1.2, 999, 140, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][3] = Huds::setText(client, "ESP Menu", 2, 1.2, 999, 180, 5, 255, 255, 255, 255, 0, 0, 0, 255);
Options[client][4] = Huds::setText(client, "Targeting Menu", 2, 1.2, 999, 220, 5, 255, 255, 255, 255, 0, 0, 0, 255);
}

void openMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 0.50, 247, 0);
Huds::MoveOverTime(RightBar[client], 0.50, 450, 0);
Huds::MoveOverTime(Options[client][1], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][2], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][3], 0.50, 320, 100);
Huds::MoveOverTime(Options[client][4], 0.50, 320, 100);
}

void closeMenu(int client)
{
Huds::MoveOverTime(Background[client], 0.50, 250, 0);
Huds::MoveOverTime(LeftBar[client], 999, 247, 0);
Huds::MoveOverTime(RightBar[client], 999, 450, 0);
Huds::MoveOverTime(Options[client][1], 999, 320, 100);
Huds::MoveOverTime(Options[client][2], 999, 320, 100);
Huds::MoveOverTime(Options[client][3], 999, 320, 100);
Huds::MoveOverTime(Options[client][4], 999, 320, 100);
}

bool MenuLoaded;
bool MenuOpen[18];

void Menu_thread(std::uint64_t)
{
for(;Winky Winky
{
if (InGame)
{
if (!MenuLoaded)
{
for(int i = 0; i < 18; i++)
{
storeHuds(i);
}

MenuLoaded = true;
}
else
{
for(int i = 0; i < 18; i++)
{
if(!MenuOpen[i])
{
if(Buttons:HappyetectBtn(i, Buttons::Up))
{
openMenu(i);
}
}
else
{
if(Buttons:HappyetectBtn(i, Buttons::Square))
{
closeMenu(i);
}
}

}
}
}
}
}

// An exported function is needed to generate the project's PRX stub export library
extern "C" int _DBK_Public_Cheater_export_function(void)
{
return CELL_OK;
}

extern "C" int _DBK_Public_Cheater_prx_entry(void)
{
create_thread(Menu_thread, 0x5AA, 0x7000, "DBK Public Cheater", Menu);
return 0;
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo