_Hooking sceUsb_

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

_Hooking sceUsb_

Post by jean »

I posted this in some other thread around, but that thread is falling in the abyss of unread posts!! I'm trying to patch sceUsb functions using apihook.c (part of pikey). Patches are reported to be applied correctly. I first tried to log onto a file each single call, but nothing ever happens so i thought i hooked the wrong functions (logging stops after patches are applied).
Then i thought that there are problems writing to a file (with standard functions sceIoOpen(), sceIoWrite()) from a system library, so i tryed to mess up things to see if it has effect; i made sceUsbStart() replacement returning always 1: this prevents USB mass storage to be activated (ahah!something is moving...) eventually with an error, but can't forbid programs like mapThis to find the USB GPS (and things continue not to be logged on file...). In the very end, i tryed to output some debug info to SIO, but this hangs the PSP (same problem we got with pikey: i guess it calls some function not yet in memory in the moment of module startup...)
PLEASE....any suggestion????????
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Depending on the fuction's parameters, pass an Identifiable pointer address and use it to do logging.

Reason sceIo* wont work is sceUsb doesnt import that lib.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Hhmm...ok, i forgot that my replacement functions are part of sceUsb once hooked..so now i know why logging doesn't take place as expected. I don't understand what you mean by "passing an identifiable address", or at least i guess i understand the general concept but i am not able to do it...can you give a short example? By the way, i still can't understand why signalling failure in usb module load function works some times and some other not...same thing i noticed while trying to hook OSK functions. Can someone explain the general lines so i can continue researching on my own?????? Thanks in advance.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Suppose
#define EVIDIDENTIFIER 98485123
#define BITSIDENTIFIER -340348

int SetEventFlag_Rs (SceUID evid, u32 bits)

Big Hint :)
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Post Reply