Post: How to make a sprx and read/write to the memory
07-20-2014, 03:47 AM #1
Winter
Purple God
(adsbygoogle = window.adsbygoogle || []).push({});

What you will need:

Visual Studio 2010
PS3SDK (Any Version as long as it is 4gb+)
PS3 Plugins for Visual Studio (version v3 4.20 of prodg)
A little bit of C++ knowledge


First off you want to start off by downloading Visual Studio 2010.
If you're planning to learn how to make things in C++ I shouldn't need to explain/link you to vs 2010 and install it.

you'll need to reinstall ProDG. (google prodg and this video will come up You must login or register to view this content. download it from there)
Once it's downloaded, Open it obviously.

Next you want to select this
You must login or register to view this content.
It will say something like "Install vs 2010 integration"

Once that's installed we'll need the PS3SDK, Sadly I cannot post anything related to the download link.
So you're on your own there. But i'll tell you this much it needs to be 4+ gb or it wont work.
Anyways onto the tutorial!


You want to start out by opening vs 2010 then creating a new project
You must login or register to view this content.
If SCE > PS3 isn't there you've obviously messed up along the way or haven't install PS3SDK.

Select PS3 PPU Project
Next this Window will come up
You must login or register to view this content.

Press Next then press PPU PRX project
Now click Finish


Next you want to open up the solution explorer and open prx.cpp

Most likely it will show like 7 errors
You must login or register to view this content.
Just right click on one of the errors and press "Show IntelliSense Errors"

and their gone, Don't worry about some things that are underlined, the error list is your friend.

Next you want to add these up at the top of your project
    
#include <sys/sys_time.h>
#include <sys/syscall.h>
#include <sys/ppu_thread.h>
#include <string.h>
#include <sys/syscall.h>
#include <stdarg.h>
#include <stddef.h>
#include <sys/timer.h>


You must login or register to view this content.

then add these in above SYS_MODULE_INFO
    
void sleep(usecond_t time)
{
sys_timer_usleep(time * 1000);
}

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

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


You must login or register to view this content.

First we need to make a thread

First add in this above PS3_PPU_Project1_prx_entry
    
void thread_entry(uint64_t arg)
{

}//This is where all your mods will begin ^_^


in PS3_PPU_Project1_prx_entry
or what ever you named your project_prx_entry

add this
    
create_thread(thread_entry, 0x4AA, 0x6000, "Main_Thread");
return 0;


Now we can get started!

Basics to writing the memory in C++.

You can read/write the memory in C++ like this:

Writing the Memory//I'm not entirely sure if this is correct, but it should be.
1 byte - *(char*)0x0000000 = 0x01; //Yes this is literately how you write the memory in C++.
2 bytes - *(short*)0x00000000 = 0x01;
3 bytes - *(float*)0x00000000 = 0x01;
4 bytes - *(int*)0x00000000 = 0x01;
8 bytes - *(double*)0x00000000 = 0x01;

Example:
    
for (;Winky Winky//Since the code practically runs once you'll need to add a loop
{
if (InGame())//Detects when it's InGame so it knows when to run and not every half a millisecond.
{
sleep(5000); //Sleeps for 5 seconds then executes your code below.
*(char*)0x1786418 = 0x40; //Thanks to mango for the player speed offset, This sets your speed x2 so we'll know if it works or not ^_^
}
}


Reading the Memory
same concept
1 byte - *(char*)0x0000000;
2 bytes - *(short*)0x00000000;
3 bytes - *(float*)0x00000000;
4 bytes - *(int*)0x00000000;
8 bytes - *(double*)0x00000000;

Example:
    
for (;Winky Winky//Since the code practically runs once you'll need to add a loop
{
if (InGame())//Detects when it's InGame so it knows when to run and not every half a millisecond.
{
sleep(5000); //Sleeps for 5 seconds then executes your code below.
if (*(char*)0x1786418 == 63)
{
*(char*)0x1786418 = 0x40; //Thanks to mango for the player speed offset, This sets your speed x2 so we'll know if it works or not ^_^
}
else
{ *(char*)0x1786418 = 0x3F; /*Obviously this wouldn't work because it would turn it on and off every 5 seconds*/ }
}
}


I'll post how to use rpc soon ^_^ enjoy, Also I've probably done something wrong here along the lines so people like SC58 that feel the need to correct me go ahead, plus, I've only been doing C++ for two days.

Credits:
Sony - For making the PS3SDK, vs integration and PS3 ^^
Shark - Big Help with teaching me C++
Bad Luck Brian - RPC + Other stuff
Theriftboy - He did magical stuff
If there's anyone else that needs to be in here let me know lol
Last edited by Winter ; 07-21-2014 at 04:07 PM. Reason: Updated Versions.

The following 34 users say thank you to Winter for this useful post:

aburezk, anxify, B777x, BaSs_HaXoR, BoatyMcBoatFace, Boliberrys, BossamBemass, ChOcOsKiZo, Confusing, dieterds, EG6, flynhigh09, FusionIsDaName, popcornmods, Geo, hackeveryone, ImAzazel, iRnZ, iTzzTrojan, kainer wainer, KareraHekku, lahyene77, LaRip8, Mango_Knife, NotALegitPlayer, oCoyeks, OLDSCHOOLMODZHD, Pyro577, RTE, Slinky, SyTry, UnknownNightmare, ViolentFelon

The following user groaned Winter for this awful post:

xSynthmodz
07-21-2014, 03:45 PM #11
Citadel
Samurai Poster
Originally posted by tryme View Post
just wonder why you are saying to reinstall prodg? and also you do not state which version of visual studio, express, pro or ultimate. though the ps3 sdk plugin for vs isn't compatible to express (freeware) version from the sdk readme, it does indeed work only with express. i have installed 3.4 sdk and have installed 2010 express later. afterwards i have installed the vs plugin from 4.0 sdk and now everything works fine. i hadn't to reinstall anything.


A long as it has c++ it will be fine
07-21-2014, 04:02 PM #12
tryme
Do a barrel roll!
i was only referring to the sdk vs studio plugin, but nvm. maybe i was lucky, cause it should not work with express version.
07-22-2014, 10:26 PM #13
Winter
Purple God
Originally posted by Citadel View Post
A long as it has c++ it will be fine


I'm not actually sure if VS 2010 Express comes with C++
07-22-2014, 10:29 PM #14
Citadel
Samurai Poster
Originally posted by Winter View Post
I'm not actually sure if VS 2010 Express comes with C++


Not sure. I only have 2013 so looks like I won't be making an prx files lol. I'm to lazy to get a crappy version of vs when I already have a good one Smile
07-22-2014, 10:32 PM #15
Winter
Purple God
Originally posted by Citadel View Post
Not sure. I only have 2013 so looks like I won't be making an prx files lol. I'm to lazy to get a crappy version of vs when I already have a good one Smile


To bad xD, If you install the ps3sdk I'm pretty sure you can just open it in vs 2013, I use my menu project in vs 2012 (I like the icon) lol
11-06-2014, 04:18 AM #16
optantic
Pokemon Trainer
how to you nop a breakpoint when using sprx?
if use *(int*)0x00001234 = 0x60000000; or *(unsigned int*)0x0001234 = 0x60000000;
it simply kills the whole sprx process rendering everything useless
11-06-2014, 12:08 PM #17
Originally posted by optantic View Post
how to you nop a breakpoint when using sprx?
if use *(int*)0x00001234 = 0x60000000; or *(unsigned int*)0x0001234 = 0x60000000;
it simply kills the whole sprx process rendering everything useless


You have to use a syscall for that.
11-06-2014, 02:28 PM #18
optantic
Pokemon Trainer
Originally posted by Doctor
You have to use a syscall for that.

it works now. Thanks for the tip
Last edited by optantic ; 11-06-2014 at 03:13 PM.
11-22-2014, 01:44 AM #19
Xavier Hidden
Are you high?
Originally posted by Winter View Post
To bad xD, If you install the ps3sdk I'm pretty sure you can just open it in vs 2013, I use my menu project in vs 2012 (I like the icon) lol


I already have VS2013 so I'm not going to be going to 2010. Now, where can I get the PS3sdk from, I've looked everywhere. If someone gives me sdk v3.70, will it work on the latest ps3 cfw 4.60ita?

The best source for the latest ps3 sdk's are listed on the ps3devwiki site but no download links to them are available. Again,i ask, will any version of an sdk work on the latest cfw, or do you need to have PS3SDK v4.66 to work?
You must login or register to view this content.
Last edited by Xavier Hidden ; 11-22-2014 at 01:53 AM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo