PS3 Toolset v1.1.003 Update

In xsetting_CC56EB2D_class_t found in the VSH export, these have 3-4 parameters
https://github.com/aldostools/webMAN-MOD/blob/master/vsh/xregistry.h#L493-L496
Code:
int32_t (*GetRegistryValue)(uint32_t userid, uint32_t packetid, int *value);
int32_t (*GetRegistryString)(uint32_t userid, uint32_t packetid, char * value, uint32_t maxlen);
int32_t (*SetRegistryValue)(uint32_t userid, uint32_t packetid, int value);
int32_t (*SetRegistryString)(uint32_t userid, uint32_t packetid, char *value, uint32_t maxlen);

It looks like there 2 kind of returned values: int32_t and char*

In xsetting_D0261D72_class_t, there are only 2-3 parameters
https://github.com/aldostools/webMAN-MOD/blob/master/vsh/xregistry.h#L613-L496
Code:
uint32_t (*saveRegistryIntValue)(int32_t, int32_t);            // id, value
uint32_t (*loadRegistryIntValue)(int32_t, int32_t*);           // id, value
uint32_t (*saveRegistryStringValue)(int32_t, char *, int32_t); // id, string, len
uint32_t (*loadRegistryStringValue)(int32_t, char *, int32_t); // id, string, len

The class xsetting_CC56EB2D is per user, while the class xsetting_D0261D72 is global.

In webMAN MOD, there is a legacy code for get/set value implemented without VSH exports.
https://github.com/aldostools/webMAN-MOD/blob/master/include/language.h#L256-L327

However, the web command /xmb.ps3$xregistry(<id>) uses the VSH exports mentioned above.
 
In xsetting_CC56EB2D_class_t found in the VSH export, these have 3-4 parameters
https://github.com/aldostools/webMAN-MOD/blob/master/vsh/xregistry.h#L493-L496
Code:
int32_t (*GetRegistryValue)(uint32_t userid, uint32_t packetid, int *value);
int32_t (*GetRegistryString)(uint32_t userid, uint32_t packetid, char * value, uint32_t maxlen);
int32_t (*SetRegistryValue)(uint32_t userid, uint32_t packetid, int value);
int32_t (*SetRegistryString)(uint32_t userid, uint32_t packetid, char *value, uint32_t maxlen);

It looks like there 2 kind of returned values: int32_t and char*

In xsetting_D0261D72_class_t, there are only 2-3 parameters
https://github.com/aldostools/webMAN-MOD/blob/master/vsh/xregistry.h#L613-L496
Code:
uint32_t (*saveRegistryIntValue)(int32_t, int32_t);            // id, value
uint32_t (*loadRegistryIntValue)(int32_t, int32_t*);           // id, value
uint32_t (*saveRegistryStringValue)(int32_t, char *, int32_t); // id, string, len
uint32_t (*loadRegistryStringValue)(int32_t, char *, int32_t); // id, string, len

The class xsetting_CC56EB2D is per user, while the class xsetting_D0261D72 is global.

In webMAN MOD, there is a legacy code for get/set value implemented without VSH exports.
https://github.com/aldostools/webMAN-MOD/blob/master/include/language.h#L256-L327

However, the web command /xmb.ps3$xregistry(<id>) uses the VSH exports mentioned above.
Then integers & strings are the only types used by the xsetting class..
It confirms my findings but it does not provide answers regarding that freak length value used in vsh...

The xRegistryGetList x3 export seems to be the best way to get an exhaustive list of every registry entry, without having to work out the various user profiles that may be in play, it returns all setting entries that match a string passed as argument. To get all entries, you can use "/*" or to get only user profile related entries, you can use "/setting/user" etc..
 
Then integers & strings are the only types used by the xsetting class..
It confirms my findings but it does not provide answers regarding that freak length value used in vsh...

The xRegistryGetList x3 export seems to be the best way to get an exhaustive list of every registry entry, without having to work out the various user profiles that may be in play, it returns all setting entries that match a string passed as argument. To get all entries, you can use "/*" or to get only user profile related entries, you can use "/setting/user" etc..

I checked xregistry.sys using my PS3 Registry Editor.exe included in PS3 Tools Collection, and all settings were integer or string, except the root entry that is listed as "binary" but the length is 4 bytes.

You could check if yours have more binary entries.

If you need the source code, I can provide it, although I don't know if VB5 code will be useful for your project.
 
I checked xregistry.sys using my PS3 Registry Editor.exe included in PS3 Tools Collection, and all settings were integer or string, except the root entry that is listed as "binary" but the length is 4 bytes.

You could check if yours have more binary entries.

If you need the source code, I can provide it, although I don't know if VB5 code will be useful for your project.
Ah.. So here we are, there is a binary type & it is defined with length ==4 & type == 0.
And the entry value has to be a pointer in that case? The root value may not provide that info though..

Great, thanks.. ;-)
 
@sandungas @M4j0r @aldostools

I have had to reverse engineer the x3 vsh exports to read/write xregistry.sys contents for my ps3 toolset. I got most of the answers I was seeking & so far I have been able to list & edit every Xregistry entry I tested without corrupting the registry but I still have a doubt over something.
The xRegistryGetValue export takes 6 arguments, r3 the handle of the Xregistry instance, r4 the pointer to the setting string xRegistry entry, r5 a pointer to get the returned entry value & r6/r7/r8 3 other pointers to get returned values which I determined to be r6 entry length & r7 entry type & if I am not mistaken for the third, r8, a reference to the resources allocated for data extraction so they can be freed once you obtained the data using the xRegistryDestroy x3 vsh export..

The xRegistrySetValue export takes 5 arguments, r3 the handle of the Xregistry instance, r4 the pointer to the setting string entry, r5 the value to set for the entry ie a 32bit integer or a pointer to a string & r6/r7 pointers for entry length & entry type.
I dont know how the x3 exports works, i just added a ilst here as a reminder back in 2017 because at that time zerotolerance (i think it was him) was publishing the lists in the VSH exports page and i was keeping an eye at them and called my attention, but in most of them are not mentioned the parameters

From testing results, here is what I established.

When the entry type is == 1, the entry is a string, the entry value must be a pointer & the entry length is the value string length.

When the entry type is == 0, the entry value is an integer & the entry length is set to 0.

However, in my reversing I encountered code in vsh that uses xRegistrySetValue & where the entry length is set to 4, the entry type is 0 I think the entry value is an integer (not a pointer) although I can't be sure from the reversing & I haven't checked in the debugger yet as I don't really know when/how that specific sub is executed.
Anyway that combo of values does not fit with the rules I have so far (ie an integer value given a length value > 0) so I must be missing something, can anyone explain it?
Is there more than 2 types of entries (32bit integer or string) by any chance?

And in that vein, is it possible to have binary entries in the registry? xRegistryGetValue internally processes the registry as nodes in a cxml tree & it matches node attributes to determine type/length.. In the possible type attributes I noticed that there is a "bin" type suggesting "binary"?
Do you guys know anything about that?

We should maybe update the wiki ps3 vsh export x3 section with the info gathered about export arguments, I also gathered arguments for other x3 exports like getList, destroyList..
The value_type = 0 is a boolean in binary, im not sure if the length for booleans is always 4 bytes or 1 bit though

And btw... for curiosity sake... in the PARAM.SFO there is an special data type (custom by sony) that stores hex values as an string, i dont remember if it was me, but we named it "utf8-S" (as far i remember this is an unnofficial name, and the suffix "S" means special)
It would not surprise me if the xRegistry.sys uses this special data type too
 
Last edited:
Back
Top