[SOLVED] List of loaded prx?
[SOLVED] List of loaded prx?
Hi! :)
Is there a way to know which plugins (prx) are loaded?
I tried sceKernelGetModuleIdList but it dosent return my prx (only sceKernelLibrary and my app's module).
I'd like to get a list of loaded prx, then disable one and then enable it. Is it possible?
Many thanks.
Ciaooo
Sakya
Is there a way to know which plugins (prx) are loaded?
I tried sceKernelGetModuleIdList but it dosent return my prx (only sceKernelLibrary and my app's module).
I'd like to get a list of loaded prx, then disable one and then enable it. Is it possible?
Many thanks.
Ciaooo
Sakya
Last edited by sakya on Thu Dec 20, 2007 6:22 pm, edited 1 time in total.
Well, you could do a sceKernelFindModuleByName("sceSystemMemoryManager"). It will return a ptr to a SceModule structure, which is a linked list, just follow it until NULL.
But be careful, the description of the SceModule structure in the pspsdk is wrong. (well not wrong, it is done for 1.00 only).
This is the correct struct for 1.50+
But be careful, the description of the SceModule structure in the pspsdk is wrong. (well not wrong, it is done for 1.00 only).
This is the correct struct for 1.50+
Code: Select all
typedef struct SceModule2
{
struct SceModule2 *next; // 0
u16 attribute; // 4
u8 version[2]; // 6
char modname[27]; // 8
char terminal; // 0x23
char mod_state; // 0x24
char unk1; // 0x25
char unk2[2]; // 0x26
u32 unk3; // 0x28
SceUID modid; // 0x2C
u32 unk4; // 0x30
SceUID mem_id; // 0x34
u32 mpid_text; // 0x38
u32 mpid_data; // 0x3C
void * ent_top; // 0x40
unsigned int ent_size; // 0x44
void * stub_top; // 0x48
u32 stub_size; // 0x4C
u32 entry_addr_; // 0x50
u32 unk5[4]; // 0x54
u32 entry_addr; // 0x64
u32 gp_value; // 0x68
u32 text_addr; // 0x6C
u32 text_size; // 0x70
u32 data_size; // 0x74
u32 bss_size; // 0x78
u32 nsegment; // 0x7C
u32 segmentaddr[4]; // 0x80
u32 segmentsize[4]; // 0x90
} SceModule2;
Hi! :)
Many thanks for your help. :)
I tried with this code in a kernel mode prx:
but it still returns the same IDs returned by sceKernelGetModuleIdList. ;)
Any (other) idea?
EDIT: Sorry for my mistake: it doesen't returns the same IDs.
It returns sceSystemMemoryManager and sceLoaderCore.
I have capture.prx enabled in GAME, but I cannot see it.
Ciaooo
Sakya
Many thanks for your help. :)
I tried with this code in a kernel mode prx:
Code: Select all
int getModuleList(SceUID modid[100], int *modcount){
k1 = pspSdkSetK1(0);
int i = 0;
SceModule2 *ptr = sceKernelFindModuleByName("sceSystemMemoryManager");
while (ptr){
modid[i++] = ptr->modid;
ptr = ptr->next;
}
modcount = &i;
pspSdkSetK1(k1);
return 0;
}
Any (other) idea?
EDIT: Sorry for my mistake: it doesen't returns the same IDs.
It returns sceSystemMemoryManager and sceLoaderCore.
I have capture.prx enabled in GAME, but I cannot see it.
Ciaooo
Sakya
Well, probably the linked list is splitted.
anyways the kernel function sceKernelGetModuleIdList should work. Are you using it correctly?
psplink uses it and it works:
where g_GetModuleList is set to sceKernelGetModuleIdList in 1.50+, and to a internal pspsdk function in 1.00 where the function was broken.
anyways the kernel function sceKernelGetModuleIdList should work. Are you using it correctly?
psplink uses it and it works:
Code: Select all
memset(ids, 0, 100 * sizeof(SceUID));
ret = g_GetModuleIdList(ids, 100 * sizeof(SceUID), &count);
if(ret >= 0)
{
printf("<Module List (%d modules)>\n", count);
for(i = 0; i < count; i++)
{
print_modinfo(ids[i], verbose);
}
}
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
moonlight wrote:Well, you could do a sceKernelFindModuleByName("sceSystemMemoryManager"). It will return a ptr to a SceModule structure, which is a linked list, just follow it until NULL.
But be careful, the description of the SceModule structure in the pspsdk is wrong. (well not wrong, it is done for 1.00 only).
This is the correct struct for 1.5+
Oho! Thanx for this. Finally I can make use of text_addr offsets.How bout data_addr?
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Use it more for Development than for Gaming.
It is probably segmentaddr[1]KickinAezz wrote:moonlight wrote:Well, you could do a sceKernelFindModuleByName("sceSystemMemoryManager"). It will return a ptr to a SceModule structure, which is a linked list, just follow it until NULL.
But be careful, the description of the SceModule structure in the pspsdk is wrong. (well not wrong, it is done for 1.00 only).
This is the correct struct for 1.5+
Oho! Thanx for this. Finally I can make use of text_addr offsets.How bout data_addr?
I've got the same problems using sceKernelGetModuleIdList, but thats because the doc is false :
@param readbufsize - Number of elements in the readbuffer.
-> here its not the number of elements, it should be the size of the buffer.
( parameter name is clear between )
Code: Select all
/**
* Get a list of module IDs. NOTE: This is only available on 1.5 firmware
* and above. For V1 use ::pspSdkGetModuleIdList.
*
* @param readbuf - Buffer to store the module list.
* @param readbufsize - Number of elements in the readbuffer.
* @param idcount - Returns the number of module ids
*
* @return >= 0 on success
*/
int sceKernelGetModuleIdList(SceUID *readbuf, int readbufsize, int *idcount);
-> here its not the number of elements, it should be the size of the buffer.
( parameter name is clear between )