Precision regarding sctrlHENFindFunction

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Precision regarding sctrlHENFindFunction

Post by sauron_le_noir »

When hooking a kernel function in the samples that i have seen programmers
use sctrHENFindFunction like this sample got from iop.prx:

orgaddr[0]=sctrlHENFindFunction("sceIOFileManager", "IoFileMgrForUser", 0x06A70004);

this function get the address of the nid 0x06A7004 aka sceIoMkdir
i have found the nid from http://silverspring.lan.st/

My question Is this code firmware independant even if sony change is nids ?
Does M33 firmware do all the job ?

Another question what does this function do ?
int level = sctrlKernelSetUserLevel(8);

it save the userlevel into the var level but what is the userlevel ?
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

You only need to search for the 3.52 NIDs. The M33 NIDs resolver will handle the random NIDs even in this function.

Userlevel is required for some privileged operations. In the case of iop.prx all the functions are syscalls, so they will be executed in the context of the thread that called the function, i.e. a user mode thread. By setting the userlever=8, the level of the calling user mode thread will be 8 and it can access the restricted functions like assigning flash0:/ for read/write etc.
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

thx torch for the reply as you have see the sample is taken from your iop.prx.

where do you find all this information ? is there a site regrouping system resources or just talking to guys like moonlight , tyranid etc .....
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

I asked moonlight. The iop.prx is his not mine, I just added the code in module_stop to undo the patches on unloading the module, otherwise it broke the M33 patches in the XMB.
Post Reply