PS3 Help GetCurrentUserNumber

LuanTeles

Developer
PSX-Place Supporter
Guys i'm doing some experiments modding the XMBM+ Installer and i'm learning as i'm trying

i'm trying to add the GetCurrentUserNumber to work in the there but the compiler is giving me errors, can someone help me?

I already included the xregistry.h
jxKFPzC.png

nn0JtLF.png
 
Other thing is

Code:
sysLv2FsRename((appfolder+"/app/game_id/XXXXXXXXX/All-All-Install/PS3~dev_hdd0~game/XXXXXXXXX").c_str(),(appfolder+"/app/install/"+(string)gameID_01+"/All-All-Install/PS3~dev_hdd0~game/"+(string)gameID_01).c_str());

Doesn't work, so i made some tests and for some reason anything after the first
Code:
+(string)gameID_01+
breaks the funcion, the code is right because i tested using

Code:
Mess.Dialog(MSG_OK,(appfolder+"/app/install/"+(string)gameID_01+"/All-All-Install/PS3~dev_hdd0~game/"+(string)gameID_01).c_str());

and it returned me the full path i want.

Edit: Seems like it can't create a folder after gameID_01

Eg: gameID_01+"Test" - works
gameID_01+"/Test" - doesn't work

the workaround i thought is:
Code:
sysLv2FsRename((appfolder+"/app/game_id/XXXXXXXXX/All-All-Install/PS3~dev_hdd0~game/XXXXXXXXX").c_str(),(appfolder+"/app/game_id/XXXXXXXXX/All-All-Install/PS3~dev_hdd0~game/"+(string)gameID_01).c_str());
sysLv2FsRename((appfolder+"/app/game_id/XXXXXXXXX").c_str(),(appfolder+"/app/install/"+(string)gameID_01).c_str());

that works but i don't like to have it splitted and won't work in the other place i need to use it



the gameID_xx are defined here

pMU4JWi.png
 
Last edited:
Guys i'm doing some experiments modding the XMBM+ Installer and i'm learning as i'm trying

i'm trying to add the GetCurrentUserNumber to work in the there but the compiler is giving me errors, can someone help me?

I already included the xregistry.h
jxKFPzC.png

nn0JtLF.png

That error happens because you did not link the needed library to your project, and iirc xsetting_CC56EB2D is a vsh export so you can't use it in an homebrew.
An alternative that you could use is this: https://www.psx-place.com/threads/getting-the-current-user.1419/#post-12506
 
Guys i'm doing some experiments modding the XMBM+ Installer and i'm learning as i'm trying

i'm trying to add the GetCurrentUserNumber to work in the there but the compiler is giving me errors, can someone help me?

I already included the xregistry.h
jxKFPzC.png

nn0JtLF.png
Try linking the corresponding stub library?
Iirc it should be libxsetting_export_stub.a or something like that.

Alternatively you could also resolve the export at runtime using the usual getNIDfunc resolver function.
Code:
static void * getNIDfunc(const char * vsh_module, uint32_t fnid)
{
	uint32_t table = (*(uint32_t*)0x1008C) + 0x984; // vsh table address
 
	while(((uint32_t)*(uint32_t*)table) != 0)
	{
		uint32_t* export_stru_ptr = (uint32_t*)*(uint32_t*)table;
 
		const char* lib_name_ptr =  (const char*)*(uint32_t*)((char*)export_stru_ptr + 0x10);
 
		if(strncmp(vsh_module, lib_name_ptr, strlen(lib_name_ptr))==0)
		{
			uint32_t lib_fnid_ptr = *(uint32_t*)((char*)export_stru_ptr + 0x14);
			uint32_t lib_func_ptr = *(uint32_t*)((char*)export_stru_ptr + 0x18);
			uint16_t count = *(uint16_t*)((char*)export_stru_ptr + 6); // number of exports
			for(int i = 0; i < count; i++)
			{
				if(fnid == *(uint32_t*)((char*)lib_fnid_ptr + i*4))
				{
					return (void**)*((uint32_t*)(lib_func_ptr) + i);
				}
			}
		}
		table += 4;
	}
	return 0;
}
 

Similar threads

Back
Top