Hey All Kind Of PS3 Coders i Have Been Playing Around With it For Some Time ON How to generate Random Number In SPRX/PRX Using What PS3 SDK Gives As, And I Have Found A Solution Doing It Using And SysCall and Modulo
[HIDE]SysCall I have used !
865 0x361 CEXDEXDECR root AuthID sys_ss_random_number_generator int sys_ss_random_number_generator(id,buffer,size), alias sys_get_random_number
The SysCall Function To Make Ps3 Generate Random Number
int sys_get_random_number(int buffer_Size) { //1st parameter SysCall Number of (sys_get_random_number) //2nd parameter AuthID I used 2 cause its the way of using it without an Root Premission //3rd Parameter the Buffer where it writes random number by ps3 a &pointer //4th Parameter The Buffer Size #32bit so set to 32 no need for more xD int buff; system_call_3(0x361, 2, int(&buff), buffer_Size); return buff; }
The Modulo Function That Allows You To Define The Randomization Range Using sys_get_random_number
int Randomizer(int limit) { int Random_Num = sys_get_random_number(32); return (Random_Num % limit) + 1; }
How To Call
int My_Random_Number = Randomizer(99); // this will generate random number from 1 to 99
[/HIDE]