PS3 Apollo save tool (development thread)

Regarding the fake act.dat restore on HEN, I've submitted a pull request to add this feature directly on the HEN plugin:
https://github.com/PS3Xploit/PS3HEN/pull/35

I can't say if it will get merged or not, but at least it's a possible solution for those who don't have webman mod to restore the act.dat file on boot.
were you able to test the act.dat code? when i tried it, i could not get it to work (without using the webman script).

i noticed that my real PSN account did not have a act.bak so i renamed the act.dat to act.bak. it did not work so i deleted that account/user and made a new user. i used apollo to create fake act.dat but this also did not work.

if i leave the webman script, everything is good. without it, the act.bak is not copied to act.dat when modded hen enables.
 
were you able to test the act.dat code? when i tried it, i could not get it to work (without using the webman script).

Hi @Coro , just to confirm; you built the HEN plugin .sprx using the code (branch) from my pull-request, and then replaced the plugin in your PS3, right? then you tested enabling HEN with the new plugin and the act.bak was not copied to act.dat
is that correct?

I've been really busy these days (changed jobs), but I'll try to take a look during the weekend.

@aldostools by any chance did you check the PR, or do you have any comments since you're more experienced with plugins?
 
Hi @Coro , just to confirm; you built the HEN plugin .sprx using the code (branch) from my pull-request, and then replaced the plugin in your PS3, right? then you tested enabling HEN with the new plugin and the act.bak was not copied to act.dat
is that correct?
i downloaded the zip from your github. i copy and pasted only the changes found HERE.

i compiled the sprx and then compiled HEN with that new sprx. (i changed the startup notice so i could be sure that i had enabled the correct BIN.) there were no compile errors.

i thought maybe detecting "savedLastCreatedUserId" was the issue. i created two new users to be sure. i also deleted my real PSN account and used Apollo to make a fake account on the last user created.

i had only limited time to tinker with it last night. if i find time tonight, i will compile the files in the github zip directly and test them.
 
@bucanero
i noticed this line in the code
Code:
if((cellFsStat(path1,&stat)==0) && (cellFsStat(path1,&stat)!=0))
there are two "path1". should there be one "path1" and one "path2" instead?

oh you're totally right!
Yes it should be path 1 and path 2. I'll update the PR later today.
Thanks a lot for reviewing it!!

basically the code tries to check that the backup file exist, and the .dat file doesn't exist. (So avoiding to overwrite the original if it exists)

I can share a binary with the fixed code in case you want to test again
 
Last edited:
it would be nice, yes. i tried to compile with path2, but i messed up copying the files from my VM (i think i removed the usb stick early).

Hi Coro,
I have updated the pull request with the fix (using path2 now). I have also built the .sprx so you can try it out:
https://www.mediafire.com/file/xnog2k2t1ci4k77/HENplugin.rar/file

you should only need to replace the .sprx in your PS3, and then when HEN starts it will copy the act.bak -> act.dat

let me know, and thanks for the help!

btw, @jcorrea you might want to check the plugin too :D
 
@bucanero

Quel est le cheminement pour installer ce "PlugIn" dans une console SuperSlim sous le HEN-3.0.3 ???
Merci par avance.

What is the process for installing this "PlugIn" in a SuperSlim console under the HEN-3.0.3 ???
Thanks in advance.

Algol "le papy".

PS : as-tu eu le temps de chercher l'erreur sur le traitement des fichiers ".bin" (VMC) de 16, 32 Mo ???
 
What is the process for installing this "PlugIn" in a SuperSlim console under the HEN-3.0.3 ???
Thanks in advance.

Algol "le papy".

PS : as-tu eu le temps de chercher l'erreur sur le traitement des fichiers ".bin" (VMC) de 16, 32 Mo ???

About the plugin, you only need to replace the henplugin.sprx in your ps3 HDD with the one in the .rar link. Remember to make a backup of the original plugin .sprx just in case.

About the VME memory card encryption, I checked it today and indeed there was a bug, as all the code was assuming 8MB memory card files. I changed it, so it can encrypt 16mb and 32mb files too.
I was able to get .VME files for those 16 and 32 mb examples that you shared, but I didn't test if the ps2classic emulator can actually load it or not.

Anyways, if you want to test, here's the EBOOT.BIN build with the fix for vme:
https://www.mediafire.com/file/0rphcfipy3z34h9/vme-test.zip/file

Keep in mind that the raw memory card "generic.bin" files you shared need to be converted to VM2 first (Apollo can convert and add ECC check). Then the ".VM2" file can be encrypted to VME
 
@bucanero i have discoveted that my HEN ps3 does not have a savedLastCreatedUserId file. my CFW ps3 does have it. (maybe it was removed when i removed the real psn account?)

so i am thinking maybe it would be better to either:

1) search all possible folders under home folder
OR
2) store the files in a special folder with names to identify their intended location (such as 0001.act.bak)
 
About the plugin, you only need to replace the henplugin.sprx in your ps3 HDD with the one in the .rar link. Remember to make a backup of the original plugin .sprx just in case.
Je suis désolé de me répéter mais dans quel répertoire dois-je mettre ce "HENplugin.sprx" car je ne trouve nulle part l'original sur ma console SuperSlim (sous le HFW-4.88.1/HEN-3.0.3) ???
J'ai cherché dans tout le DD interne et je ne l'ai pas trouvé.

Merci par avance pour ta réponse @bucanero .


I'm sorry to repeat myself but in which directory should I put this "HENplugin.sprx" because I can't find the original anywhere on my SuperSlim console (under the HFW-4.88.1/HEN-3.0.3) ???
I searched all of the internal HD and couldn't find it.

Thank you in advance for your response @bucanero.
 
@bucanero i have discoveted that my HEN ps3 does not have a savedLastCreatedUserId file. my CFW ps3 does have it. (maybe it was removed when i removed the real psn account?)

so i am thinking maybe it would be better to either:

1) search all possible folders under home folder
OR
2) store the files in a special folder with names to identify their intended location (such as 0001.act.bak)

have you tried creating a new account in the PS3 with HEN? the savedLastCreatedUserId should be there... I checked on my ps3 with HEN, and is on the dev_flash2/ folder. Let me know if you try and if the file shows up after creating a new account or not.

a quick-fix /fallback for this code would be to: try to open savedLastCreatedUserId, if it fails, assume a total of "100" ids to check, and just continue with the same code.

I know there are other options and alternatives to handle this, but I think this one is simple enough
Code:
    int fd, max_uid = 100;

    if(cellFsOpen("/dev_flash2/etc/savedLastCreatedUserId", CELL_FS_O_RDONLY, &fd, NULL, 0) == CELL_FS_SUCCEEDED)
    {
       cellFsRead(fd, (void *) &max_uid, 4, &read);
       cellFsClose(fd);
    }
 
have you tried creating a new account in the PS3 with HEN? the savedLastCreatedUserId should be there... I checked on my ps3 with HEN, and is on the dev_flash2/ folder. Let me know if you try and if the file shows up after creating a new account or not.

I don't remember to have seen that file o_O. You could try this alternative method for restore_act_dat().
It is more efficient (it creates a symlink instead of read/write files), and doesn't rely on external files to find the user accounts.

Code:
static int sysLv2FsLink(const char *oldpath, const char *newpath)
{
    system_call_2(810, (uint64_t)(uint32_t)oldpath, (uint64_t)(uint32_t)newpath);
    return_to_user_prog(int);
}
void restore_act_dat(void);
void restore_act_dat(void)
{
    int fd;
    if(cellFsOpendir("/dev_hdd0/home", &fd) == CELL_FS_SUCCEEDED)
    {
        CellFsStat stat;
        char path1[64], path2[64];
        CellFsDirent dir; uint64_t read;
        while (1)
        {
            if(cellFsReaddir(fd, &dir, &read) != CELL_FS_SUCCEEDED) break;
            sprintf(path1, "/dev_hdd0/home/%s/exdata/act.bak", dir.d_name);
            sprintf(path2, "/dev_hdd0/home/%s/exdata/act.dat", dir.d_name);
            if((cellFsStat(path2, &stat) != CELL_FS_SUCCEEDED) && (cellFsStat(path1, &stat) == CELL_FS_SUCCEEDED))
            {
                sysLv2FsLink(path1, path2);
            }
        }
        cellFsClosedir(fd);
    }
}
 
I don't remember to have seen that file o_O. You could try this alternative method for restore_act_dat().
It is more efficient (it creates a symlink instead of read/write files), and doesn't rely on external files to find the user accounts.

Code:
static int sysLv2FsLink(const char *oldpath, const char *newpath)
...

thanks for your ideas @aldostools !! indeed I think that your alternative with link() is nicer, and also skipping the dependency with the other file

I have built a new version with your code, the binary plugin.sprx is here:
https://www.mediafire.com/file/pfrbp5l9v58xkzi/HENplugin.zip/file

@Coro , I think this version should work fine with your setup, no matter if you have that LastCreatedUserId file or not. :)

If anyone else can test, let me know the results. I'll update the pull-request later to match the code discussed here
 
I'm sorry to repeat myself but in which directory should I put this "HENplugin.sprx" because I can't find the original anywhere on my SuperSlim console (under the HFW-4.88.1/HEN-3.0.3) ???
I searched all of the internal HD and couldn't find it.

Thank you in advance for your response @bucanero.

maybe I have an old HEN setup, so I'm not sure... if you couldn't find it on /dev_hdd0/ , have you tried looking in /dev_rewrite/ , or /dev_blind/ ? maybe there's a HEN folder there with the .sprx plugin.

You can also just upload it to dev_hdd0/plugins/ and update the boot_plugins.txt file, but in that case I think the plugin will end up running twice. (the original, then the alternate version)
 
maybe I have an old HEN setup, so I'm not sure... if you couldn't find it on /dev_hdd0/ , have you tried looking in /dev_rewrite/ , or /dev_blind/ ? maybe there's a HEN folder there with the .sprx plugin.
it should be at "/dev_hdd0/henplugin.sprx". if i understand correctly, that file will get overwritten by the sprx inside the PSSHEN.BIN when hen is enabled. it sould not run properly if you just copy over to hard drive. (AFAIK the sprx is meant to be deleted by hen after the sprx exits, but that does not happen.)
You can also just upload it to dev_hdd0/plugins/ and update the boot_plugins.txt file, but in that case I think the plugin will end up running twice. (the original, then the alternate version)
yes, two sprx would run if done that way.

i will try aldo's code if i have time later. thanks guys!
 
@bucanero @aldostools

the new code is working! i have a test build below (4.88 PS3HEN.BIN only). it will say "HEN 3.0.3 (actdat)" when enabled. (the auto-update on/off code was not included but auto-update is skipped.)

i had trouble starting "Goat Simulator" but i believe that was due to a dying hard drive. i installed another small game and it behaved normally.

@jcorrea can you test? or anybody else that wants to test, just please report if it works for you or not!
 

Attachments

@bucanero @aldostools

the new code is working! i have a test build below (4.88 PS3HEN.BIN only). it will say "HEN 3.0.3 (actdat)" when enabled. (the auto-update on/off code was not included but auto-update is skipped.)

i had trouble starting "Goat Simulator" but i believe that was due to a dying hard drive. i installed another small game and it behaved normally.

@jcorrea can you test? or anybody else that wants to test, just please report if it works for you or not!
I'll test it and report asap.
 

Similar threads

Back
Top