PS3 [Introduction] How to access metadata_db_hdd through registory.xml

sandungas

Developer
DISCLAIMER
This was originally written in a rush and intended to be posted as a reply to this thread https://www.psx-place.com/threads/gran-turismo-6.30190/#post-248484 but i decided to create a new thread with it to discuss it and for research purposes
If someone have some suggestions to convert this into a serious tutorial please tell, in the meantime i will left it this way, i guess there could be some innacuracy where i mentioned some access paths

I need to update my games as well, but I'd need to check what needs fixing. some game names place them out of order even with alphabetizing and stuff like A, uppercase, and a lowercase are considered separate letters, and one will always come after the Z's.
Im going to explain in short our limitations when accesing databases and using registory.xml for the filters, i hope to dont derrail the thread too much, please read/review it calmly

The stuff inside registory.xml follows a hierarchy like a tree with branches, everytime we "enter" in registory.xml we do it by loading the tag <Table key="view_selected">
The confusing thing is the "view_selected" tag is located in a intermediate position, but forget about his position, "view_selected" is always accessed as the second level of the hierarchy inside registory.xml (loaded inmediatly after "root"), so we always access registory.xml with something like... root.view_selected.something

We do it by specifying the name of the "branch" as example: view_selected, we need to tell the name of that "something" (this is made in the other XMB files that loads stuff from registory.xml)
As example... this code snippet is the complete branch for root.view_selected.view_game.all (note we are doing 3 jumps down by accesing registory.xml that way), what it does is to display all the games (i guess this is the standard look of game column)
In the official registory.xml the tags are organized in a different way... what im posting here is exactly the same xml code but reorganized in a more intuitive way where you can read it following the idea that the firmware is loading it "from top to bottom"
Code:
<?xml version="1.0" encoding="UTF-8"?>

<XMBML version="1.0">
	<View id="root">
		<Attributes>

			<Table key="view_selected">
				<Pair key="game"><String>view_game.all</String></Pair>
			</Table>
		
			<Table key="view_game">
				<Pair key="all"><String>xcb://localhost/query?limit=2048&ssort=root.sort_selected.game_all&limit=2048&scond=root.cond_selected.game_all</String></Pair>
			</Table>

			
			
			
			<Table key="sort_selected">
				<Pair key="game_all"><String>sort_game.time_created_descend</String></Pair>
			</Table>

			<Table key="sort_game">
				<Pair key="time_created_descend"><String>sort=-Game:Common.stat.rating-Game:Common.timeCreated+Game:Common.titleForSort-Game:Game.category</String></Pair>
			</Table>

			<Table key="cond_selected">
				<Pair key="game_all"><String>cond_game.all_default</String></Pair>
			</Table>

			<Table key="cond_game">
				<Pair key="all_default"><String>cond=An+Game:Game.category GD+An+Game:Game.category 2D+An+Game:Game.category CB+An+Game:Game.category HM+An+Game:Game.category AT+An+Game:Game.category AV+An+Game:Game.category AM+An+Game:Game.category AP+An+Game:Game.category VF+An+Game:Game.category BV+An+Game:Game.category WT+An+Game:Game.category SF+An+Game:Game.category AS+AL+Game:Common.stat.rating 299</String></Pair>
			</Table>
			
		</Attributes>

		<Items>
			<Item key="view_selected"		attr="view_selected" />
			<Item key="view_game"			attr="view_game" />
			<Item key="sort_selected"		attr="sort_selected" />
			<Item key="sort_game"			attr="sort_game" />
			<Item key="cond_selected"		attr="cond_selected" />
			<Item key="cond_game"			attr="cond_game" />
		</Items>
	</View>
</XMBML>

What happens inmediatly after view_selected.game.view_game.all is it triggers the function xcb://localhost/query? and it uses a sort and a cond (the values for them are located in the next "jump" another level down in the hierarchy)

What you are doing in the categorizing mods is to change the cond and sort, the names used in them are literally codenames used in the databases (metadata_db_hdd etc...), and are accessed also as a hierachy, the cond is used to either include or exclude stuff, so incase of doubts just include everything and focus your attention in sort that is more interesting
In this case sort is accesing the database starting with "game" with things like... Game:Common.stat.rating (3 "jumps" down in the hierarchy inside metadatab_hdd_db)

Your problem about the sorting method being "case insensitive" or "case insensitive" seems to be because GameOS is based on linux/unix
But as far i know the info stored inside the databases (like metadata_db_hdd) is "case sensitive agnostic"
Sony could have implemented something at higher code levels to select either case sensitive or insentitive, i dont know, but it never was documented or found... so i dont really know how it works, i never experimented with it
What i can tell you is our limitation basically depends of the "parameters" that can be seen in this table (maybe there are some more missing):
https://www.psdevwiki.com/ps3/XMBML_Functions#xcb:.2F.2Flocalhost.2Fquery.3F
This is the only stuff we can do with xcb://localhost/query? function

Other than that... our limitation is the "target" we want to use from the database contents... lets say... if there is some value that could be interesting for us we can focus our search a lot better, there is a lot of stuff stored in the databases (more than 100 values for each content as far i remember, usually only a few of them are used though)
To take a peak i suggest to use this app i made, is pretty noob, but it outputs lot of info (everything for a "game" entry, there is only 1 unknown value left, not implemented in the program, the program ignores it because is unknown)
https://www.psx-place.com/threads/db3crawler.27543/

Is very easy to use, you can drag and drop the file metadata_db_hdd on top of the .exe
Or by command line it have 2 or 3 options (one of them outputs debug info where you can see the offsets and you can follow them to review the file with a hexeditor)

And remember... in command line you can finish your command with > output.txt to create a txt file with all the output info (a lot easyer to review it, this is actually the correct way to use the program because the amount of info that outputs is massive, lol)
 
Last edited:

Similar threads

Back
Top