(adsbygoogle = window.adsbygoogle || []).push({});
Hey guys,
I made this code for my BO1 SPRX, just to test I wanted to make redboxes. Everytime I try to compile I get this Error:
1> prx.cpp
1>C:\Users\Laurin-ASUS\Desktop\BO1Trainer\BO1Trainer\prx.cpp(132,5): warning 953: return type of function "main" must be "int"
1>
1>Link:
1> undefined reference to `strlen'
1> ps3ppuld 360.1.4229.0 (rel,ps3,360.1,ppu,src @99232 #400917 ) "

\Program Files (x86)\PS3 SDK360\host-win32\sn\bin\ps3ppuld.exe"
1>Command line : error : L0303: error generating PRX (prx-fixup failed)
1>Command line : error : L0064: Linking aborted
But in Visual Studio I get no visible errors.
This is my Code in my PRX:
#include "stdafx.h"
#include <cellstatus.h>
#include <sys/prx.h>
#include <sys/ppu_thread.h>
#include <sys/syscall.h>
#include <sys/memory.h>
#include <ppu_intrinsics.h>
#include <string>
#include <wchar.h>
#include <stdio.h>
#include <stdlib.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 <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>
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);
}
void sleep(usecond_t time)
{
sys_timer_usleep(time * 1000);
}
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(void* destination, const void* 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);
}
const char* ReadString(int addr, int len)
{
char* buff = "";
for(int i =0;i<len;i++)
{
buff
= *(char*)(addr + i);
}
return buff;
}
void PatchInJump(int Address, int Destination, bool Linked)
{
int FuncBytes[4];
Destination = *(int *)Destination;
FuncBytes[0] = 0x3D600000 + ((Destination >> 16) & 0xFFFF);
if (Destination & 0x8000)
FuncBytes[0] += 1;
FuncBytes[1] = 0x396B0000 + (Destination & 0xFFFF);
FuncBytes[2] = 0x7D6903A6;
FuncBytes[3] = 0x4E800420;
if (Linked)
FuncBytes[3] += 1;
Memcpy((void*)Address, FuncBytes, 4 * 4);
}
#define TOC ( 0x0072DCE8 )
struct opd_s
{
int sub;
int toc;
};
namespace ButtonMonitoring
{
int LocalButtons = 0xd19800;
enum Buttons
{
DpadUp = 0x1FF,
DpadDown = 0x20F,
DpadRight = 0x21F,
DpadLeft = -0xC47E5F,
R3 = 0x1CF,
L3 = 0x1BF,
Square = 0xEF,
Cross = 0xCF,
Triangle = 0xFF,
Circle = 0xDF,
LeftCursorUp = 0x27F,
LeftCursorLeft = 0x29F,
LeftCursorRight = 0x2AF,
LeftCursorDown = 0x28F,
R2 = 0x1EF,
L2 = 0x1DF,
L1 = 0x10F,
R1 = 0x11F,
Select = 0x1AF,
Start = 0x19F
};
bool ButtonPressed(Buttons Button)
{
return (*(int*)(LocalButtons + Button) != 0);
}
}
bool RedBoxes = false;
void main(uint64_t nothing)
{
sleep(10000);
unsigned char nop[4] = {0x60, 0x00, 0x00, 0x00};
unsigned char byte[4] = {0x3B, 0x20, 0x00, 0x00};
write_process(0x4C8EC4, nop, 4);
write_process(0x4C8ED0, nop, 4);
write_process(0x4C8ED4, byte, 4);
for (;
{
if (*(char*)0xD1E267 == 0x0A)
{
if (ButtonMonitoring::ButtonPressed(ButtonMonitoring:
padUp))
{
if(!RedBoxes)
{
RedBoxes = true;
unsigned char byte[4] = {0x40, 0x9A, 0x00, 0xC4};
write_process(0xEBDF4,byte,4);
sleep(20);
}
else
{
RedBoxes = false;
unsigned char byte[4] = {0x41, 0x9A, 0x00, 0xC4};
write_process(0xEBDF4,byte,4);
sleep(20);
}
}
}
}
}
SYS_MODULE_INFO( BO1Trainer, 0, 1, 1);
SYS_MODULE_START( _BO1Trainer_prx_entry );
SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
SYS_LIB_EXPORT( _BO1Trainer_export_function, LIBNAME );
extern "C" int _BO1Trainer_export_function(void)
{
return CELL_OK;
}
extern "C" int _BO1Trainer_prx_entry(void)
{
return SYS_PRX_RESIDENT;
}
Bye,