PS3 Apollo save tool (development thread)

Discussion in 'Homebrew Development' started by bucanero, Jan 25, 2020.

  1. 1,810
    1,584
    297
    LuanTeles

    LuanTeles Senior Member

    Joined:
    May 15, 2017
    Messages:
    1,810
    Likes Received:
    1,584
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    Civil Engineer
    Location:
    São Paulo - Brazil
    Home Page:

    I can't wait to try this out

    Nice work
     
    bucanero likes this.
  2. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    tps, sandungas, Algol and 2 others like this.
  3. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    Development notes about detecting the PSID, User ID and Account ID for the current console/user:

    To properly resign saves, you need to know those IDs (among other things), but I couldn't find a simple way to gather them all in a consistent way across firmware versions (CFW, HEN, DEX, CEX, et al.) :(
    For example, the PSID can be recovered with lv2 peeks, but the address depends on the firmware version/type, so you must keep an address table and update the tool every time a new firmware shows up. :confused:

    But... there's a place where the PS3 always stores all those IDs already, and it's a save-game's PARAM.SFO :)
    so I used that in my advantage, to create a firmware-independent way to acquire the ids. ;)

    Since I already needed to save the Apollo app settings, I decided to:
    • on first run: create my own save-game file, using the internal PS3 save functions
    • read my own save-game's PARAM.SFO, and get the PSID, UserID, and Account ID
    • save the detected IDs back into the App settings (so I can speed up the process next launch)
    • on next launch: just read the app settings, and load the IDs
    The code for this trick can be found here (based on the psl1ght example by Kakaroto):
    https://github.com/bucanero/apollo-ps3/blob/master/source/save_util.c

    cheers!
     
    Last edited: Feb 9, 2020
    DeViL303, Algol, Zar and 1 other person like this.
  4. 2,882
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,882
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
    Inside SFO there is no IDPS, but "ConsoleID".

    And BTW: There is two ownership systems on PS3. One is for account not bind with SEN account, and one with binded.

    What do You thinking about in future releases adding:
    • VMC import/export (decrypted for old emulators) and encrypted (for new ps2 emulator)
    • mass import/export saves with/without (depend on user options) Copy Prohibited attrib removing
     
    Louis Garry likes this.
  5. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    well, it's called "PSID" on psdev Wiki :confused3: ( https://www.psdevwiki.com/ps3/PARAM.SFO#PARAMS ); see offset 0x1C.

    I know that is usually referred as ConsoleID (e.g. docs from flatz tools), but even in the source code of SFO patcher it's defined as psid, so I kept that name in my code too
    Code:
    typedef struct sfo_param_params_s {
        u8 unk1[12];
        u32 unk2;
        u32 unk3;
        u32 unk4;
        u32 user_id_1;
        u8 psid[SFO_PSID_SIZE];
        u32 user_id_2;
        u8 account_id[SFO_ACCOUNT_ID_SIZE];
        u8 chunk[0];
    } sfo_param_params_t;
    ( https://github.com/bucanero/pfd_sfo...816bee4d63da76ded5da/sfopatcher/src/sfo.c#L31 )

    and actually now that I was reviewing the param.sfo Wiki again, I realize that when there's no PSN account, it should be filled with binary zeros (0x00) instead of ASCII zeros "0". I need to fix that in Apollo. :oops:


    About the features: I never messed around other save formats on the PS3, so I'd need to do some research first before I try to do PS2 or PSP saves. Is there any info or source code available about that vmc encryption?

    the "mass resign/copy" feature looks like a popular one, and it should be doable. I just need to find a simple way to "tag" the saves you want to process and then run the batch. Maybe a first approach could be to allow "mass resign" and "mass unlock" , and if it works nicely then it could be extended.
     
    Last edited: Feb 10, 2020
    Algol likes this.
  6. 2,882
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,882
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
    @bucanero I save You some time on research. ;)

    Locking/unlocking PS3 saves:
    1. change 1 to 0 in Copy Prohibited parram in PARAM.SFO
    2. rebuild PFD
    Importing PSX VMC:
    • in case of *.bin, *.ddf, *.mcd, *.mci, *.mcr, *.ps, *.psm, *.srm, *.vm1, *.VM1, just copy it to "/dev_hdd0/vmc/savedata/<any name>/" and change file extension to VM1.
    • in case of *.mem and *.vgs: cut first 0x40
    • in case of *.gme cut first 0x0F40
    • in case of *.vmp I don't remember how much to cut, but PSX MC always starting from "MC" ASCII string (You can easily figure out by converting to VMP using this tool https://github.com/dots-tb/vita-mcr2vmp/releases then check output file in hex editor what he added)
    Remember to keep VM1 as is case sensitivity (vm1 will not be seen).
    PSX VMC always have exactly 128KiB.

    Importing decrypted PS2 VMC:

    1. check if memory card images are ECC or nonECC. PS3 support only vmc with ECC (it is sufficient just checking the file size, non ECC = exactly 8MiB and ECC = 8650752)
    2. if nonECC, add ECC, ;) if ECC just copy to the same place as PSX VMC but with *.VM2 extension.
    Formats could be: *.ps2, *.vmc, *.bin (there are just names, like in most cases of PSX vmc ;]).

    Importing encrypted PS2 VMC:
    The same rules as above but place is different and target format is different. Place is "dev_hdd0/game/<PS2 Classic game>/<and here I don't know where to put it, sorry>/SCEVMC0.VME".

    VME can be forged by python scripts (update hashes or something like that), so maybe You will be able to recreate it based on *.py (unpack the exe of course).

    Importing PSP saves:
    saves are folder with save files inside and probably they are dropped in "dev_hdd0/home/<user number>/savedata_minis/<PSP game/". But I don't know for sure.

    - - -

    I also suggesting to import/export saves/vmcs from hardcoded paths, to keep order on USB storage, ^^ In example:

    "dev_usb000/PS3/APOLLO/PS1/*.*"
    "dev_usb000/PS3/APOLLO/PS2/*.*"
    "dev_usb000/PS3/APOLLO/PS3/" (for import also "/PS3/SAVEDATA/")
    "dev_usb000/PS3/APOLLO/PSP/"

    Also maybe putting user all IDs with as "dev_usb000/PS3/APOLLO/ownership.txt"?

    Of course this is only a proposition.
     

    Attached Files:

    Last edited: Feb 10, 2020
    bucanero and Cypher_CG89 like this.
  7. 3,538
    1,937
    297
    Cypher_CG89

    Cypher_CG89 Senior Member

    Joined:
    Jul 30, 2018
    Messages:
    3,538
    Likes Received:
    1,937
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    Lead Graphic Artist/Dev, VENOM ELITE GAMING
    Location:
    North East, England, UK
    Home Page:
    That is not the IDPS, what it show's is the PSID, which is a local, offline ID for the PS3.

    IDPS and PSID are 2 different things.
     
    bucanero and Berion like this.
  8. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    oh yes, you're right :encouragement: in my notes I was referring to the PSID (which can be found in param.sfo), but for some reason when I replied to Berion I wrote IDPS. I fixed it now to avoid confusion.
     
    Algol and Cypher_CG89 like this.
  9. 3,538
    1,937
    297
    Cypher_CG89

    Cypher_CG89 Senior Member

    Joined:
    Jul 30, 2018
    Messages:
    3,538
    Likes Received:
    1,937
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    Lead Graphic Artist/Dev, VENOM ELITE GAMING
    Location:
    North East, England, UK
    Home Page:
    I did notice that in everything else you have wrote " PSID " then a random " IDPS " comment here lol...

    EDIT: I was tempted to add a sarcastic " Think you need to re-read that page " comment as well lol.
     
    bucanero likes this.
  10. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    hey @Berion ,thanks a lot for all the information! :cool2: it saves me a lot of time on research ! :D
    currently only the PS3 unlock is implemented , and it seems it was the easiest one :-p

    I'll probably check the PS2 stuff first, but I think that I won't be able to test the decrypted ones because I only have a Super-slim ps3 so I can only run ps2 games with the built-in emulator.

    For the PS1 game-saves, can I try those with the super-slim anyway? sorry to ask but I hardly used my ps3 for ps1/ps2/psp stuff.

    thanks again, cheers!
     
    Algol likes this.
  11. 2,882
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,882
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
    @bucanero Only PS2 decrypted VMC needs PS3 with EE/GS (I also don't have it, but You can blindly do it as I described, ^^). For the rest, tests can be make on any model because for any of those contents are in use the same emulators, which reading data from the same places in the same form. :)

    I didn't write details about PSP saves and encrypted PS2 VMCs because I never using them. Only PSX stuff (but PS2 not encrypted stuff is almost the same).

    BTW: Of course after all this operations, XMB database update is needed. I didn't check yet Your app, but if You don't doing it, check Hermes's ZIP packages installer (it was the old way of installing stuff before we have PKG support for fake-signed pkgs).
     
  12. 135
    77
    82
    Algol

    Algol Member

    Joined:
    Sep 20, 2016
    Messages:
    135
    Likes Received:
    77
    Trophy Points:
    82
    Gender:
    Male
    @bucanero : j'ai une proposition.

    Pourrais-tu ajouter à cet excellent travail la possibilité d'installer dans les SAVEs des "cheat codes" en provenance des fichiers compatibles avec ceux fournis pour le "Brute-Force-Save-Data" ???
    Je possède deux consoles qui sont uniquement compatibles avec le HFW-4.85.1/HEN-3.00 (une CECH-3004B et une CECH-4204C), toutes les deux ont quelques jeux PS1, PS2, PS3 et du PSN.
    Merci par avance pour ta contribution à la scène PS3.

    Algol "le papy".

    Traduction EN via Google :

    Could you add to this excellent work the possibility of installing in SAVEs "cheat codes" from files compatible with those provided for "Brute-Force-Save-Data" ???
    I have two consoles which are only compatible with the HFW-4.85.1/HEN-3.00 (a CECH-3004B and a CECH-4204C), both have some PS1, PS2, PS3 and PSN games.
    Thank you in advance for your contribution to the PS3 scene.

    Algol "le papy".
     
  13. 2,882
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,882
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
  14. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
  15. 2,882
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,882
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
    Thanks.
    Well, most of graphics aren't mine. I just make a composition from:

    https://www.dafont.com/ancient-heads.font
    https://www.pngguru.com/free-transparent-background-png-clipart-kzdcj
    https://www.pngguru.com/free-transparent-background-png-clipart-ilxmj
    https://www.pngguru.com/free-transparent-background-png-clipart-kkniu

    So, should I cut them and give You coordinates of xy for every bitmaps or maybe You prefer staying in current design? ^^" If You willing to implementing it, could we make it not on blocks (those blurs and distortions are horrible, really) but on hardcoded coordinates (as I understand, it is still possible in Tin3D) so we can have crisp and sharp image?
     
    Last edited: Feb 11, 2020
  16. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    oh for sure I'll be happy to implement this new design! (also I can leave Artemis in peace and stop stealing stuff from it) :-p

    yes, I'll try to get around those coordinates from tiny3d, so if you cut/prepare the images (.png's with an alpha layer) and give me the x-y coords I'll implement it. Let's asume a 1920x1080 screen for the coordinates, right?
     
    Algol likes this.
  17. 2,882
    2,752
    372
    Berion

    Berion Developer

    Joined:
    Feb 3, 2015
    Messages:
    2,882
    Likes Received:
    2,752
    Trophy Points:
    372
    Gender:
    Male
    Location:
    Poland
    Yeah, definitely 1920x1080. ^^

    I still needs few things to polished and few to make but I should give You everything in this week.

    Top-left is the start point for each (0,0 is top-left, then 0+x, 0+y), right?

    BTW: If You want in future more options in main menu, there is still free space for two pedestals. Just in case. ^^
     
    Algol likes this.
  18. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    yes, coords (0,0) from top-left, to bottom-right :encouragement:

    no worries, send it whenever you can, I still have a lot of stuff to do (not to mention all the ideas and feature requests that I've seen around :D )

    heheh those additional pedestals might come handy if I end up doing all the ideas and features! :D
     
    Algol likes this.
  19. 468
    795
    147
    bucanero

    bucanero Developer

    Joined:
    Jun 29, 2019
    Messages:
    468
    Likes Received:
    795
    Trophy Points:
    147
    Gender:
    Male
    Location:
    Argentina
    Home Page:
    adding those save-game patches is a possibility; I'm going to ask @aldostools if he would be kind to share some source code parts from Bruteforce data so I can add the parsing/applying of cheat patches to Apollo.

    hopefully we'll be able port those features to the ps3. I'll update when I have more information.

    Edit: weird, I tried to send aldos a message on the forum but I've got an error "You may not start a conversation with the following recipients". I'll try to reach him on Github
     
    Last edited: Feb 11, 2020
    Algol likes this.
  20. 353
    134
    97
    Luisile

    Luisile Member

    Joined:
    Feb 21, 2019
    Messages:
    353
    Likes Received:
    134
    Trophy Points:
    97
    Gender:
    Male
    Question:
    Is possible with this tool rising Save file from cfw console onto a ofw console?
    Lets say i have played hitman absolution on a cfw console, then i have acuired the originál game and I Will continue play it on an ofw console.
     

Share This Page