forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Install a bootstrap and return to application... how?
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 2:05 am    Post subject: Reply with quote

Ok, all resolved!
I'm not using esported functions!
Now I've built a prx that load the executables in a determinate mode, all passed with arg!
Thanks very much for all!
Oh, excuse for my very bad english, but while writing my problem I learn english! ;)
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 2:14 am    Post subject: Reply with quote

Pirata Nervo, (maybe) I've a solution for you!
I've passed 4 args to prx and for that I've used only a string!
Use strtok to divide the string!
This is a example:
Code:

char* arguments = (char*)malloc( strlen(path) + strlen(target) +1);
sprintf("%s{%s", path, target);
sceKernelStartModule(mod, strlen(arguments), arguments, NULL, NULL);

And in the prx use strtok to divide the string on '{';
The only problem that I've encoured is that you cannot (I think) pass a very long string, but is only a possible problem of one of my function not a limitation of LoadModule funct!
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 07, 2008 2:33 am    Post subject: Reply with quote

lol I knew How to pass the arguments but it's easier for me to add just a new line to my writeFile function instead of adding a new value to a for loop, creating a new string, etc :P

Thanks anyway.
About the size of the string, you can have a very long string as long as you allocate it :)
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 2:38 am    Post subject: Reply with quote

Thanks!
Now, a new problem, how to load a kernel mode pbp?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 07, 2008 2:43 am    Post subject: Reply with quote

you can't load kernel mode pbp's unless you have 1.50 kernel addon installed on your psp.
THat's why we use exports :P
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 3:17 am    Post subject: Reply with quote

If I use that function exported I can load kernel mode pbp's?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 07, 2008 3:57 am    Post subject: Reply with quote

no.
exports are made to don't use kernel mode pbp's and use kernel mode functions exported from kernel prx
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 4:20 am    Post subject: Reply with quote

And then? How Irshell launch kernel pbp?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 07, 2008 4:25 am    Post subject: Reply with quote

I am not ahman(ask him) but I know it is not that way :)
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 4:41 am    Post subject: Reply with quote

Ok, but there's no one function to load kernel pbp's? Whit loadexec I cannot load a kernel pbp?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 07, 2008 4:41 am    Post subject: Reply with quote

nop otherwise dont you think we could run kernel pbp from vsh?
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 4:48 am    Post subject: Reply with quote

What it means "nop"? ( I've think to asm code but I think is not true! )
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 07, 2008 4:48 am    Post subject: Reply with quote

nop means no lol
and is also an instruction in asm
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Mon Jul 07, 2008 4:52 am    Post subject: Reply with quote

?? Assemly nop is not = no operation ?
However I haven't understand your post, we can or not run kernel pbp's with loadexec!
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 07, 2008 5:48 am    Post subject: Reply with quote

nop can mean NO in english
in assembly means No Operation
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Tue Jul 08, 2008 2:37 am    Post subject: Reply with quote

Ok ok, thanks! I'll search around for a solution! ( If IrShell can do that it is possible )!
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Tue Jul 08, 2008 2:51 am    Post subject: Reply with quote

Pirata Nervo wrote:
nop can mean NO in english


shouldn't it be "nope" ? because we don't speech "nop" and "nope" the same way : "nop" probably as in "top", "nope" probably as in "slope"
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Tue Jul 08, 2008 4:05 am    Post subject: Reply with quote

lol maybe but as always wrote nop lol
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
ldqmoon



Joined: 04 Dec 2007
Posts: 13

PostPosted: Sun Jul 13, 2008 4:56 pm    Post subject: Reply with quote

I tried the follow code , it's ok.
Code:
int main_thread(SceSize args, void *argp)
{
   sceKernelDelayThread(10*100000);

   // Hook exit game function
   SceModule *mod;
   mod = sceKernelFindModuleByName("sceLoadExec");
   if(mod) apiHookByName(mod->modid, "LoadExecForUser","sceKernelExitGame", exit_to_mypspmenu);

   sceKernelExitDeleteThread(0);
   return 0;

}


but when I change the code to :
Code:
int main_thread(SceSize args, void *argp)

{
   // Hook exit game function
   sceKernelDelayThread(10*100000);

   SceModule *mod;
   mod = sceKernelFindModuleByName("sceController_Service");
   if(mod){
         apiHookByName(mod->modid, "sceCtrl","sceCtrlReadBufferPositive", sceCtrlReadBufferPositiveFake);
        }
   sceKernelExitDeleteThread(0);
   return 0;

}
int sceCtrlReadBufferPositiveFake(SceCtrlData *pad_data, int count)

{

    return 0;     // return 0, do nothing when key pressed.

}


it won't work.

I want to hook the controller function. but It seems not work. i don't know why.
Back to top
View user's profile Send private message
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Sun Jul 13, 2008 7:51 pm    Post subject: Reply with quote

Try to use this funct:
( Are you sure about sceController_Service? Where I can fine the name of all the modules? )
Code:


u32 orig_funcs;

int FunctPatched(void)
{
    return 0;
}

orig_funcs = sctrlHENFindFunction("sceController_Service", "sceCtrl", 0x1F803938);

sctrlHENPatchSyscall(orig_funcs, FunctPatched);
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Mon Jul 14, 2008 6:49 am    Post subject: Reply with quote

yes sceController_Service exists.
you can check the libraries names here http://silverspring.lan.st
NID: 0x1F803938

@ldqmoon, your "fake" function only returns 0. it does nothing.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Super Sheep



Joined: 23 Mar 2008
Posts: 31

PostPosted: Mon Jul 14, 2008 11:59 am    Post subject: Reply with quote

@ldqmoon

Use the functions from the M33 SDK.

Code:
   int sceCtrlReadBufferPositivePatched(SceCtrlData* pad, int count)
   {
      //code
   }
   
   u32 OriginalFunction;

   OriginalFunction = FindProc("sceController_Service", "sceCtrl_driver", 0x1F803938);

   sctrlHENPatchSyscall(OriginalFunction, sceCtrlReadBufferPositivePatched);
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Tue Jul 15, 2008 2:00 am    Post subject: Reply with quote

Yes, I've know a way to get the NID of a funct.
Thanks Pirata Nervo!
Super Sheep, your funct is the same as my...
Back to top
View user's profile Send private message
Super Sheep



Joined: 23 Mar 2008
Posts: 31

PostPosted: Tue Jul 15, 2008 7:06 am    Post subject: Reply with quote

No it's not. My function can actually do something. Yours will constantly return 0. So the PSP will detect no buttons pressed. However i guess you're right since thats what he wants to do for some reason =/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
darkness



Joined: 15 Jun 2008
Posts: 121

PostPosted: Wed Jul 16, 2008 3:03 am    Post subject: Reply with quote

Oh, yes, my PatchedFunct is only a sample, the function has to be changed as yours, but you have specified the correctly arg!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group