I want to find/locate a driver (MS, for example) in the memory during runtime and it's functions list.
Reasons are that for one project I want to call functions of the driver that don't have wrappers in the usual sceIo....() functions - at least not to my knowledge. (IoInit() would be one) - and for another app, I'd like to hook some (like done when doing flash-over-USB, but for something else).
I already have this snippet, which I also have successfully used:
Code: Select all
PspIoDrv *FindDriver(char *drvname)
{
u32 *mod = (u32 *)sceKernelFindModuleByName("sceIOFileManager");
if (!mod)
{
return NULL;
}
u32 text_addr = *(mod+27);
u32 *(* GetDevice)(char *) = (void *)(text_addr+0x16D4);
u32 *u;
u = GetDevice(drvname);
if (!u)
{
return NULL;
}
return (PspIoDrv *)u[1];
}
So, I need a more generic way of finding the driver and it's functions list.
Anyone be willing to hint me into the right direction? :)