SDK/SPRX/C++/C Rand...
 
Notifications
Clear all

SDK/SPRX/C++/C Random Number Generator Code


KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 9 years ago

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]

Reply
Name of the Video Game, and any other Tags
3 Replies
SaiMods
Posts: 2
(@SaiMods)
New Member
Joined: 9 years ago

Seems Legit enough 10/1 rating

Reply
xHARDHeMPuS
Posts: 122
(@xhardhempus)
Estimable Member
Joined: 9 years ago

Nice 🙂

Reply
Posts: 0
(@EERZZ)
New Member
Joined: 9 years ago

thanks I will test

Reply