vshBridge questions

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

Moderators: cheriff, TyRaNiD

Post Reply
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

vshBridge questions

Post by phobox »

vshBridge is a wrapper for functions..

most of the exported functions (maybe all of them :)) do 3 particular things

1) check if the value returned by sceKernelGetUserLevel is < 4.
2) backup k1 and set k1 = k1 >> 16
3) call the original function and restore the k1

I have two questions:
what does it mean to have the value returned by sceKernelGetUserLevel less than 4?

and what happens by setting k1 = k1 >> 16?

whe use to set k1 to 0 to wrap kernel mode function to user mode app....

(a full list of vshBridge function and the corresponding sce* one coming soon)
Ciao! from Italy
ab5000
Posts: 74
Joined: Tue May 06, 2008 2:37 am

Post by ab5000 »

I'm sure step 1 checks if the calling thread can do that thing.
I saw the k1 = k1 >> 16 in most kernel functions. Probably the effective K1 is stored like this (shifted 16-bit right). When using k1 = 0 you don't notice this because 0 >> 16 = 0. (Just some guessing!).

Bye,
ab5000.

Code: Select all

%&#58;include<stdio.h>
int _&#40;int __,int ___,int ____,int _____&#41;
<%for&#40;;____<___;_____=_____*__,____++&#41;;
return _____;%>main&#40;&#41;<%printf
&#40;"%d\n",_&#40;2,5,0,1&#41;&#41;;%>
Post Reply