TIFF Font Hack InstallerRandom Homebrew: TIFF Font Hack Installer
Allows you to change the system fonts on your 2.0-2.80 PSP
Friends: Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita

Questions on first PSP Program.

Forum rules
Any post not directly related to programming will be moderated.
Do not request people to code something for you.
Avoid posting messages that do not bring anything to the conversation. We want the threads in this subforum to stay focused.

Questions on first PSP Program.

Postby StorMyu » Fri Jan 27, 2012 4:45 pm

Hi !

I had an idea about making an Eboot swaper using a plugin and swapping on the fly an Eboot loaded in memory at a start of a game, but I've never really programmed for PSP and I just have some questions about it.

as said here by Codestation:
http://wololo.net/talk/viewtopic.php?f=13&t=9276&start=210#p120961

That's what he used to Swap module in his ZeroVSH plugin.
using:
SceModule * sceKernelFindModuleByName(const char *modname);

Here's the questions:

- How the plugins are working ? (in general, I mean there's no execution whatsoever)
- I know the rules are not "do not ask anyone to program for you" so, it's just related to the first question, how could I hook all modules launched ? (like locating every .prx launched in memory to write them in a .txt file for example)
- what are Kernel mode / user mode ? what's the main difference to take into account while programming ?

And probably some others but I'll stop at those for the moment.

by the way, the Eboot swap could be used for translation purpose (like codestation did on Project Diva but not changing just sentences but the whole Eboot from the memory stick), to be able to play UMD with some translations.

Thanks for the future answer.
StorMyu
 
Posts: 21
Joined: Wed Aug 17, 2011 1:39 pm

Re: Questions on first PSP Program.

Postby Xian Nox » Fri Jan 27, 2012 4:54 pm

What you are trying to do is far more advanced than your knowledge on the matter. Please learn PC programming first, then move to PSP.
Spoiler
Disturbed0ne wrote:PS. EVERYONE should like girls. they're just so soft. :oops:
Moderator 80% corrupt. That's funny, I don't feel corrupt. In fact, I feel pretty good.
What looks like a blog of mine can be seen here.
User avatar
Xian Nox
Moderator
 
Posts: 6051
Joined: Fri Nov 05, 2010 5:27 pm
Location: /home/xian/n-field

Re: Questions on first PSP Program.

Postby StorMyu » Fri Jan 27, 2012 5:26 pm

That still doesn't answer the questions...
And I don't see how my knowledge is relevant here, I'm only asking for some informations.
I was just explaining what I wanted to do to give a general idea.

Edit: don't take it bad heh :)
StorMyu
 
Posts: 21
Joined: Wed Aug 17, 2011 1:39 pm

Re: Questions on first PSP Program.

Postby Xian Nox » Fri Jan 27, 2012 5:45 pm

StorMyu wrote:- How the plugins are working ? (in general, I mean there's no execution whatsoever)
Plugins are dynamically loadable/unloadable application modules. They are loaded when needed, and are nothing more than blocks of code. And what do you mean, "there's no execution whatsoever"?
StorMyu wrote:- I know the rules are not "do not ask anyone to program for you" so, it's just related to the first question, how could I hook all modules launched ? (like locating every .prx launched in memory to write them in a .txt file for example)
Different ways. You can find a function's address and overwrite it with your own, or add a jump instruction at its beginning, or you can hook them up in a way similar to that of HBL. This way you can overwrite the one that loads modules, and make it load custom ones instead.
StorMyu wrote:- what are Kernel mode / user mode ? what's the main difference to take into account while programming ?
Kernel mode generally refers to the memory space reserved for the operating system. Similarly, user mode refers to the one for all user applications and their data. Kernel mode applications have more privileges than user-mode applications, and depending on the platform (incl. PSP), may be protected from modification.
Spoiler
Disturbed0ne wrote:PS. EVERYONE should like girls. they're just so soft. :oops:
Moderator 80% corrupt. That's funny, I don't feel corrupt. In fact, I feel pretty good.
What looks like a blog of mine can be seen here.
User avatar
Xian Nox
Moderator
 
Posts: 6051
Joined: Fri Nov 05, 2010 5:27 pm
Location: /home/xian/n-field

Re: Questions on first PSP Program.

Postby StorMyu » Fri Jan 27, 2012 11:14 pm

Xian Nox wrote:Plugins are dynamically loadable/unloadable application modules. They are loaded when needed, and are nothing more than blocks of code. And what do you mean, "there's no execution whatsoever"?

I meant how the plugin will activate or mostly when, because I want the plugin to use my function anytime a module (a prx) is loaded, that's why I was asking about the "execution".
That's probably my main question here... to replace the Eboot.bin from another one in the memory stick when it's loaded.

Thanks for the answers btw.
StorMyu
 
Posts: 21
Joined: Wed Aug 17, 2011 1:39 pm

Re: Questions on first PSP Program.

Postby NightStar3 » Sat Jan 28, 2012 12:53 am

StorMyu wrote:
Xian Nox wrote:Plugins are dynamically loadable/unloadable application modules. They are loaded when needed, and are nothing more than blocks of code. And what do you mean, "there's no execution whatsoever"?

I meant how the plugin will activate or mostly when, because I want the plugin to use my function anytime a module (a prx) is loaded, that's why I was asking about the "execution".
That's probably my main question here... to replace the Eboot.bin from another one in the memory stick when it's loaded.

Thanks for the answers btw.

If you want to redirect files -> hook a driver's (depending on where the file resides) IoOpen function.
Also, if you want to dump a .prx's data to a text file -> patch ProbeExec, dump the data to a local buffer, and write it to the text file.

Hope that helped,
NightStar3

EDIT: If you want to load your function right before a prx is loaded -> patch IoOpen (depending on the driver the module is being loaded from)
Then, you can do checks to see if the module is being passed to IoOpen, and load your function right before it (and pass normal IoOpen to return)
Image
User avatar
NightStar3
VIP
 
Posts: 459
Joined: Mon Sep 27, 2010 8:22 pm
Location: 0x13371A4D

Re: Questions on first PSP Program.

Postby m0skit0 » Sat Jan 28, 2012 2:14 pm

StorMyu wrote:- How the plugins are working ? (in general, I mean there's no execution whatsoever)

VSH/game plugins are kernel modules that are loaded before VSH/game is loaded. And they're executed, indeed.

StorMyu wrote:how could I hook all modules launched ? (like locating every .prx launched in memory to write them in a .txt file for example)

You would need to hook sceKernelLoadModule() at kernel level.

StorMyu wrote:what are Kernel mode / user mode ? what's the main difference to take into account while programming ?

Look MIPS documentation for this. Resuming: kernel mode is like God mode, where you can access anything accessable by software on the PSP. User mode is a restricted mode where games and VSH (basically anything not the kernel) is running (thus limited memory and hardware access).

StorMyu wrote:I meant how the plugin will activate or mostly when

At kernel reset and after all kernel modules (btcnf) are loaded. Check PRO CFW source code for more detailed information.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4787
Joined: Mon Sep 27, 2010 6:01 pm


Return to Programming

Who is online

Users browsing this forum: psbot [Picsearch] and 1 guest