| View previous topic :: View next topic |
| Author |
Message |
Bubbletune
Joined: 03 Jan 2009 Posts: 28
|
Posted: Tue Apr 27, 2010 1:52 am Post subject: Game Categories - Source Code |
|
|
I've decided to release the source code of Game Categories for educational purposes. It's licensed under the GPLv3 and I really wish you folks would respect it, and license derivative works under the same license. I'm really not in the mood for a witch-hunt after those who think they can get away with ignoring it. That includes taking structures and so forth from it (they took a long time of reversing and testing to figure out), GPLv3 is the way to go. :)
This is a source code that has had to many overhauls and is no longer the most organised one around, so please don't be to hard on me, although I think I did a pretty good job compared to most of my source codes. It's methods for patching the VSH are at the least a bit odd, so please try the best you can on maintaining compatbility with Game Categories if you ever release something derived from it.
The M33 SDK is thrown inside the 'lib' and 'include' folder in order to make the compilation more universal. Also, the plugin management done in the updater downloaded by Network Update was based on code found here. The appropriate credits for this go out to the M33 Team.
Go ahead and grab it, and don't make me regret releasing it:
http://bubbletune.x-fusion.co.uk/GCv12_Source_Code.rar
- Bubbletune |
|
| Back to top |
|
 |
Draan
Joined: 17 Oct 2009 Posts: 55
|
Posted: Tue Apr 27, 2010 6:21 am Post subject: |
|
|
Sweety! I was thinking about reversing it...
Many thanks :) |
|
| Back to top |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Tue Apr 27, 2010 1:24 pm Post subject: |
|
|
Thanks for GPL-ing your work :) This gonna be interesting to dwelve into, since I have very little knowledge about VSH :P _________________
| The Incredible Bill Gates wrote: | | The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. |
|
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Wed Apr 28, 2010 1:28 am Post subject: |
|
|
thanks for this, have you discovered something else in reversing vsh modules?
for example would you be able to create an homebrew with vsh look and feel, using sony's sceCommonGui, sceCommonUtils and scePaf (or scePafmini that from my tests can be perfectely loaded in game mode)?
vsh modules have been written in c or c++? i think c++ looking at the complexity of structures and pointers that i got reversing some of those modules... but i see that you use c structures like SceContextItem, SceVshItem, SceSysconfItem, SceCallbackItem... _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Draan
Joined: 17 Oct 2009 Posts: 55
|
Posted: Wed Apr 28, 2010 1:51 am Post subject: |
|
|
| phobox wrote: | thanks for this, have you discovered something else in reversing vsh modules?
for example would you be able to create an homebrew with vsh look and feel, using sony's sceCommonGui, sceCommonUtils and scePaf (or scePafmini that from my tests can be perfectely loaded in game mode)? |
Um, there is VLF library by Dark_Alex. |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Wed Apr 28, 2010 3:14 am Post subject: |
|
|
yes i know _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Bubbletune
Joined: 03 Jan 2009 Posts: 28
|
Posted: Wed Apr 28, 2010 6:03 am Post subject: |
|
|
| phobox wrote: | thanks for this, have you discovered something else in reversing vsh modules?
for example would you be able to create an homebrew with vsh look and feel, using sony's sceCommonGui, sceCommonUtils and scePaf (or scePafmini that from my tests can be perfectely loaded in game mode)?
vsh modules have been written in c or c++? i think c++ looking at the complexity of structures and pointers that i got reversing some of those modules... but i see that you use c structures like SceContextItem, SceVshItem, SceSysconfItem, SceCallbackItem... |
Oh, the VSH modules are definitely written in C++. As Game Categories is written in C though, there's good signs of this, for example:
| Code: | | int AddVshItemPatched(void *arg, int topitem, SceVshItem *item) |
The first argument is actually a pointer to the current class, and in C++ this would've been obsolete. There's more signs of them using classes, and what I did in Game Categories by simplifying them to structures was done solely out of lazyness.
I figured out those structures by reversing a number of VSH functions and playing around with the values - and testing, lots, lots of testing. However, they aren't even used to the fullest in Game Categories, simply because I figured out a large part of those structures solely out of curiousity, not for any practical purposes. I've still got plenty information about the VSH in stock, and VSH-wise, Game Categories is just a start. It's just that I've never found a practical use for the information.
About creating homebrew with the same look and feel as the VSH: I haven't invested time in that as VLF is perfectly fine. I did work out the usage of a number of options of these modules though, such as showing a messagebox in VSH-style (/user/main.c should have a function called ShowErrorBox if I recall correctly). |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Wed Apr 28, 2010 5:31 pm Post subject: |
|
|
Did you ever get it working with the Video menu?
Or did you try, and find it not possible?
Something Sony should have implemented from the beginning is folders in the Video menu. _________________ If not actually, then potentially. |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Wed Apr 28, 2010 10:21 pm Post subject: |
|
|
@bubbletune
ok vsh modules are written in c++.
but in order to use vsh look and feel in homebrews we don't need them.
In my opinion modules needed are
common_gui
paf (or pafmini)
common_utils (maybe)
i Think that only paf is written in c++ while the other two are written in c.
paf is required only because it is imported by common_gui and in homebrew i think we only need functions exported by common_gui.
For page layout, texts etc i think we can use custom rco's...
in conclusion i think that in order to create vlf (vsh look and feel =P) homebrews we need to know how to use common_gui and how to create a completely home made, fully customizable rco.
What do you think?
common_gui is written in c? or at least functions exported are in C? (meaning without c++ mangled names).
have some of common_gui nids had ever been cracked? _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Apr 28, 2010 11:53 pm Post subject: |
|
|
| Doesn't paf do it's own memory heap allocation/management and provide it's own libc? |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Thu Apr 29, 2010 12:16 am Post subject: |
|
|
yes it does. _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Bubbletune
Joined: 03 Jan 2009 Posts: 28
|
Posted: Thu Apr 29, 2010 1:28 am Post subject: |
|
|
| Torch wrote: | | Doesn't paf do it's own memory heap allocation/management and provide it's own libc? |
Yes it does, I'm using both of those inside the user module of Game Categories. |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Thu Apr 29, 2010 2:15 am Post subject: |
|
|
in game_categories.h you have
| Code: |
// Imported from user module: common_gui.prx
int sceVshCommonGuiDisplayContext(void *arg, char *page, char *plane, int width, char *mlist, void *temp1, void *temp2);
|
this is the function used to display the lateral menu right?
well,
i see that you patch the value width and set it to 1.
can you please explain me why and what is that value for? _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Bubbletune
Joined: 03 Jan 2009 Posts: 28
|
Posted: Thu Apr 29, 2010 3:04 am Post subject: |
|
|
| phobox wrote: | in game_categories.h you have
| Code: |
// Imported from user module: common_gui.prx
int sceVshCommonGuiDisplayContext(void *arg, char *page, char *plane, int width, char *mlist, void *temp1, void *temp2);
|
this is the function used to display the lateral menu right?
well,
i see that you patch the value width and set it to 1.
can you please explain me why and what is that value for? |
Indeed, it is used by the code that displays laterals, but just calling that function on it's own doesn't do the job (that function name is made up by me, I don't know the real name). As for patching the 'width' value, that's simply the dimensions of the lateral, the higher you make it the larger the lateral gets. By default it's set to zero but some strings used in Game Categories don't fit that way. If I recall correctly there is another way to patch that, which involves patching one of the values in the RCO. This works just as fine, though. |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Thu Apr 29, 2010 4:24 am Post subject: |
|
|
so something more must be done in order to make the menu appear? do you know what perhaps?
btw
sceVshCommonGui_D3EC527D is responsible for creating the title bar (arg1 is the icon, arg2 the text, arg3 unk) _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Bubbletune
Joined: 03 Jan 2009 Posts: 28
|
Posted: Thu Apr 29, 2010 6:05 am Post subject: |
|
|
| phobox wrote: | so something more must be done in order to make the menu appear? do you know what perhaps?
btw
sceVshCommonGui_D3EC527D is responsible for creating the title bar (arg1 is the icon, arg2 the text, arg3 unk) |
Ugh. Well you could always assign a context menu to an icon and call OnXmbContextMenu from vshmain, which is what I always do. But that's in the VSH itself and not inside homebrew. |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Thu May 06, 2010 3:43 am Post subject: |
|
|
oh well i see.
do you have more info on vsh modules than those present in your sources? _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Davee
Joined: 22 Jun 2009 Posts: 59
|
Posted: Thu May 06, 2010 3:44 am Post subject: |
|
|
| phobox wrote: | oh well i see.
do you have more info on vsh modules than those present in your sources? |
Game Categories not enough for you? |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Fri May 07, 2010 12:12 am Post subject: |
|
|
yes yes
but maybe i can save some time to discover things that have already been discovered by others. _________________ Ciao! from Italy |
|
| Back to top |
|
 |
Zer01ne
Joined: 08 Sep 2008 Posts: 29
|
Posted: Fri May 07, 2010 1:38 am Post subject: |
|
|
| Code: |
// TopItem ID
#define topitem_system 0x00
#define topitem_photo 0x01
#define topitem_music 0x02
#define topitem_video 0x03
#define topitem_tv 0x04
#define topitem_game 0x05
#define topitem_network 0x06
#define topitem_psn 0x07
// Network Item Value
#define network_help_id 0x1D
#define network_help_relocate 0x01
#define network_help_action 0x16
#define network_help_action_arg 0x02
#define network_lftv_id 0x19
#define network_lftv_relocate 0x01
#define network_lftv_action 0x12
#define network_lftv_action_arg 0x00
#define network_skype_id 0x1E
#define network_skype_relocate 0x01
#define network_skype_action 0x18
#define network_skype_action_arg 0x00
#define network_1seg_id 0x1F
#define network_1seg_relocate 0x01
#define network_1seg_action 0x19
#define network_1seg_action_arg 0x00
#define network_premo_id 0x1C
#define network_premo_relocate 0x01
#define network_premo_action 0x15
#define network_premo_action_arg 0x00
#define network_radio_id 0x21
#define network_radio_relocate 0x01
#define network_radio_action 0x1B
#define network_radio_action_arg 0x00
#define network_rss_id 0x1A
#define network_rss_relocate 0x01
#define network_rss_action 0x08
#define network_rss_action_arg 0x05
#define network_browser_id 0x18
#define network_browser_relocate 0x01
#define network_browser_action 0x10
#define network_browser_action_arg 0x00
#define network_search_id 0x22
#define network_search_relocate 0x01
#define network_search_action 0x1D
#define network_search_action_arg 0x06
#define psspot_id 0x20
#define psspot_relocate 0x01
#define psspot_action 0x1A
#define psspot_action_arg 0x03
// Game Item Value
#define game_sharing_id 0x13
#define game_sharing_relocate 0x01
#define game_sharing_action 0x0C
#define game_sharing_action_arg 0x00
#define game_savedata_id 0x14
#define game_savedata_relocate 0x01
#define game_savedata_action 0x0B
#define game_savedata_action_arg 0x00
#define game_umd_id 0x15
#define game_umd_relocate 0x02
#define game_umd_action 0x01
#define game_umd_action_arg 0x09
#define game_umd_update_id 0x17
#define game_umd_update_relocate 0x02
#define game_umd_update_action 0x0F
#define game_umd_update_action_arg 0x01
#define game_ms_id 0x16
#define game_ms_relocate 0x03
#define game_ms_action 0x0F
#define game_ms_action_arg 0x02
// Photo Item Value
#define photo_umd_id 0x0E
#define photo_umd_relocate 0x02
#define photo_umd_action 0x06
#define photo_umd_action_arg 0x00
#define photo_camera_id 0x1B
#define photo_camera_relocate 0x01
#define photo_camera_action 0x13
#define photo_camera_action_arg 0x00
#define photo_ms_id 0x0D
#define photo_ms_relocate 0x03
#define photo_ms_action 0x05
#define photo_ms_action_arg 0x09
// Video Item Value
#define video_umd_id 0x11
#define video_umd_relocate 0x02
#define video_umd_action 0x09
#define video_umd_action_arg 0x00
#define video_ms_id 0x13
#define video_ms_relocate 0x03
#define video_ms_action 0x0A
#define video_ms_action_arg 0x00
// Music Item Value
#define music_umd_id 0x10
#define music_umd_relocate 0x03
#define music_umd_action 0x07
#define music_umd_action_arg 0x03
#define music_ms_id 0x0F
#define music_ms_relocate 0x03
#define music_ms_action 0x06
#define music_ms_action_arg 0x02
// Sysconf Item Value
#define sysconf_cf_id 0x08
#define sysconf_cf_relocate 0x01
#define sysconf_cf_action 0x02
#define sysconf_cf_action_arg 0x01
#define sysconf_network_update_id 0x00
#define sysconf_network_update_relocate 0x01
#define sysconf_network_update_action 0x04
#define sysconf_network_update_action_arg 0x00
#define sysconf_usb_id 0x01
#define sysconf_usb_relocate 0x01
#define sysconf_usb_action 0x02
#define sysconf_usb_action_arg 0x05
#define sysconf_video_id 0x00
#define sysconf_video_relocate 0x01
#define sysconf_video_action 0x02
#define sysconf_video_action_arg 0x00
#define sysconf_photo_id 0x03
#define sysconf_photo_relocate 0x01
#define sysconf_photo_action 0x02
#define sysconf_photo_action_arg 0x01
#define sysconf_console_id 0x04
#define sysconf_console_relocate 0x01
#define sysconf_console_action 0x02
#define sysconf_console_action_arg 0x02
#define sysconf_powersave_id 0x07
#define sysconf_powersave_relocate 0x01
#define sysconf_powersave_action 0x02
#define sysconf_powersave_action_arg 0x08
#define sysconf_sound_id 0x09
#define sysconf_sound_relocate 0x01
#define sysconf_sound_action 0x02
#define sysconf_sound_action_arg 0x06
// Psn Item Value
#define psn_signup_id 0x23
#define psn_signup_relocate 0x01
#define psn_signup_action 0x1E
#define psn_signup_action_arg 0x00
#define psn_account_id 0x24
#define psn_account_relocate 0x01
#define psn_account_action 0x1E
#define psn_account_action_arg 0x01
#define psn_pss_id 0x25
#define psn_pss_relocate 0x01
#define psn_pss_action 0x1E
#define psn_pss_action_arg 0x02
#define psn_tdmb_id 0x26
#define psn_tdmb_relocate 0x01
#define psn_tdmb_action 0x1F
#define psn_tdmb_action_arg 0x06
#define psn_board_id 0x27
#define psn_board_relocate 0x01
#define psn_board_action 0x1E
#define psn_board_action_arg 0x07
// Not Usable
#define psn_update_id 0x28
#define psn_update_relocate 0x01
#define psn_update_action 0x02
#define psn_update_action_arg 0x0B
|
|
|
| Back to top |
|
 |
Davee
Joined: 22 Jun 2009 Posts: 59
|
Posted: Fri May 07, 2010 4:28 am Post subject: |
|
|
| phobox wrote: | yes yes
but maybe i can save some time to discover things that have already been discovered by others. |
Then use VLF?? |
|
| Back to top |
|
 |
|