• PS3HEN is now supporting 4.93 Firmware

    View Official Release Post for additional information HERE
PS3HEN

PS3HEN PS3HEN - Official Release Thread (Homebrew Enabler for the PS3) v3.5.0 (4.93 support)

Np.[emoji6]

Do you remember where you provided me the code to detect the payload? if its hen or cfw, i couldn't find it

People was selecting the wrong version when installing my Pro Mod (I was using webman to detect the payload and display a notification and a lot of warning to select the right version, but people still was selecting CFW instead of HFW on HEN) , so i'm using a simple trick for it:

Code:
if (exists("/dev_flash/hen/PS3HEN.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"HEN jaibreak detected!");
        }
        else if (exists("/dev_flash/hen/HENPLUS.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"HEN Pro/Plus jaibreak detected!");
        }
        else if (exists("/dev_usb000/PS3HEN.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"USB HEN jaibreak detected!"");
        }
        else if (exists("/dev_usb001/PS3HEN.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"USB HEN jaibreak detected!"");
        }
        else
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/cfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"CFW jaibreak detected!");
        }

It's not ideal, but is doing the job, the only scenario that it can install the wrong version is if the cfw user have the bin in flash or in a usb device, at least now it avoid soft-bricks,
 
Last edited:
Do you remember where you provide me the code to detect the payload? if its hen or cfw, i couldn't find it

People was selecting the wrong version when installing my Pro Mod (I was using webman to detect the payload and display a notification and a lot of warning to select the right version, bit still people was selecting CFW instead of HFW in HEN) , so i'm using a simple trick for it:

Code:
if (exists("/dev_flash/hen/PS3HEN.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"HEN jaibreak detected!");
        }
        else if (exists("/dev_flash/hen/HENPLUS.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"HEN Pro/Plus jaibreak detected!");
        }
        else if (exists("/dev_usb000/PS3HEN.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"USB HEN jaibreak detected!"");
        }
        else if (exists("/dev_usb001/PS3HEN.BIN")==0)
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/hfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"USB HEN jaibreak detected!"");
        }
        else
        {
            sysLv2FsRename("/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/cfw","/dev_hdd0/game/PS34KPROX/USRDIR/apps/install/current");
            //Mess.Dialog(MSG_OK,"CFW jaibreak detected!");
        }

It's not ideal, but is doing the job, the only scenario that it can install the wrong version is if the cfw user have the bin in flash or in a usb device. ( i still made some screen warnings)
From the top of my head, uncompiled and untested! Something along those lines should do the trick..

Code:
bool is_hen(void){
system_call_1(8, 0x1337); 
return (int)0x1337 == (int)p1;
}

bool is_mamba(void){
system_call_1(8, 0x7fff); 
return (int)0x666 == (int)p1;
}

bool is_cobra(void){
system_call_1(8, 0x7000); 
return (unsigned int)p1>0 && (unsigned int)p1<0x80000000;
}

bool is_cfw(void){
system_call_1(6, 0x8000000000000000ULL); 
return (int)0 == (int)p1;
}

//
// Then in your code use an if clause like this 


if(is_hen()){
//HEN detected

}
else if(is_mamba()){
//MAMBA detected

}
else if(is_cobra()){
//Cobra detected

}
else if(is_cfw()){
//CFW detected

}
else{
//no CFW syscalls detected
//de facto unlikely to ever happen 
}
is_hen and is_mamba are totally reliable identification methods, is_cobra and is_cfw not entirely but it should work out I think.

Make sure to keep the order above when calling the Boolean functions, hen test first, mamba test second, cobra test third and cfw syscall test last...
 
Last edited:
From the top of my head, uncompiled and untested! Something along those lines should do the trick..

Code:
bool is_hen(void){
system_call_1(8, 0x1337);
return (int)0x1337 == (int)p1;
}

bool is_mamba(void){
system_call_1(8, 0x7fff);
return (int)0x666 == (int)p1;
}

bool is_cobra(void){
system_call_1(8, 0x7000);
return (unsigned int)p1>0 && (unsigned int)p1<0x80000000;
}

bool is_cfw(void){
system_call_1(6, 0x8000000000000000ULL);
return (int)0 == (int)p1;
}

//
// Then in your code use an if clause like this


if(is_hen()){
//HEN detected

}
else if(is_mamba()){
//MAMBA detected

}
else if(is_cobra()){
//Cobra detected

}
else if(is_cfw()){
//CFW detected

}
else{
//no CFW syscalls detected
//de facto unlikely to ever happen 
}
is_hen and is_mamba are totally reliable identification methods, is_cobra and is_cfw not entirely but it should work out I think.

Make sure to keep the order above when calling the Boolean functions, hen test first, mamba test second, cobra test third and cfw syscall test last...


Thank you so much :)
 
Last edited by a moderator:
From the top of my head, uncompiled and untested! Something along those lines should do the trick..

Code:
bool is_hen(void){
system_call_1(8, 0x1337);
return (int)0x1337 == (int)p1;
}

bool is_mamba(void){
system_call_1(8, 0x7fff);
return (int)0x666 == (int)p1;
}

bool is_cobra(void){
system_call_1(8, 0x7000);
return (unsigned int)p1>0 && (unsigned int)p1<0x80000000;
}

bool is_cfw(void){
system_call_1(6, 0x8000000000000000ULL);
return (int)0 == (int)p1;
}

//
// Then in your code use an if clause like this


if(is_hen()){
//HEN detected

}
else if(is_mamba()){
//MAMBA detected

}
else if(is_cobra()){
//Cobra detected

}
else if(is_cfw()){
//CFW detected

}
else{
//no CFW syscalls detected
//de facto unlikely to ever happen
}
is_hen and is_mamba are totally reliable identification methods, is_cobra and is_cfw not entirely but it should work out I think.

Make sure to keep the order above when calling the Boolean functions, hen test first, mamba test second, cobra test third and cfw syscall test last...

@bguerville I just implemented the code and it works partially.

it detected HEN, MAMBA and CFW (Kinda)

When Cobra is enabled it returns CFW detected!, when Cobra is disabled it returns Cobra Detected!
 
@bguerville I just implemented the code and it works partially.

it detected HEN, MAMBA and CFW (Kinda)

When Cobra is enabled it returns CFW detected!, when Cobra is disabled it returns Cobra Detected!
Hmm.. possible but without seeing the syscall return value in the is_cobra function, I cannot provide you with a quick fix.

I would have expected Cobra syscall 8 get_version to return a positively signed 32 bit integer, in other words a value between 1 and 0x7fffffff but I could be wrong about that, I haven't checked.
We could use another syscall 8 too I suppose.

Shame nobody ever added to Cobra an identification syscall 8 like in HEN and Mamba..
 
Last edited:
Hmm.. possible but without seeing the syscall return value in the is_cobra function, I cannot provide you with a quick fix.

I would have expected Cobra syscall 8 get_version to return a positively signed 32 bit integer, in other words a value between 1 and 0x7fffffff but I could be wrong about that, I haven't checked.
We could use another syscall 8 too I suppose;

If you have changes in your mind i can test it. For what i need is_hen and is_cfw are working perfecly, thank you so much @bguerville

Btw just in case you want to make some tests here is the src and the complied pkg that'll report the payload.

Shame nobody ever added to Cobra an identification syscall 8 like in HEN and Mamba..

Maybe @Evilnat can implement it in the next version.
 
Last edited by a moderator:
Maybe @Evilnat can implement it in the next version.
It's extremely easy to do, you can just lift the HEN code and tweak values BUT it's a bit late in the game, it would ONLY work on new Cobra releases, legacy support would still need to be addressed anyway.

I will try to check the source code of the get_version syscall 8, see if I can understand what's going on.

You could also add a line like this just before the return line in the is_cobra function:
DPRINTF("syscall 8 get_version: 0x%X",(unsigned int)p1);
And post the logged data you get with it.
 
It's extremely easy to do, you can just lift the HEN code and tweak values BUT it's a bit late in the game, it would ONLY work on new Cobra releases, legacy support would still need to be addressed anyway.

I will try to check the source code of the get_version syscall 8, see if I can understand what's going on.

You could also add a line like this just before the return line in the is_cobra function:
DPRINTF("syscall 8 get_version: 0x%X",(unsigned int)p1);
And post the logged data you get with it.

I don't think it is necessary another opcode to detect Cobra.
Cobra payload already has the opcode 0x7001 to get Cobra version : 0x0830 => 8.30
The opcodes 0x1337 and 0x7FFF are used to detect HEN and Mamba respectively.

If lv2syscall1(8, 0x1337) == 0x1337, then HEN is enabled
If lv2syscall1(8, 0x7FFF) == 0x666, then Mamba is enabled
If cobra_version == 0, a Cobra payload is not loaded
otherwise, Cobra is enabled
 
@LuanTeles

If Aldo is correct (and you should assume he is), then I think you should be able to replace the is_cobra function by this one:
Code:
bool is_cobra(void){
system_call_1(8, 0x7001);
return (unsigned int)p1>0 && (unsigned int)p1<0x80000000;
}
 
Last edited:
@aldostools @bguerville I'm afraid but it is still returning CFW detected!

Add the printf in is_cobra and post the output like I said earlier. In theory, if Cobra is loaded, the printf output should show 0x830 or whatever version you are using...

I suppose the function could also be changed to
Code:
unsigned int get_cobraversion(void){
system_call_1(8, 0x7001);
return (unsigned int)p1;
}

bool is_cobra(void){
unsigned int ver = get_cobraversion();
// Optional debug log 
//#if DEBUG
//DPRINTF("syscall 8 get_version2: 0x%X",ver);
//#endif
return ver>0 && ver<=0xffff;
}
 
Last edited:
The code above will return true on HEN and Mamba, because they are Cobra payloads too.

If the function needs to detect Cobra only, the function first should detect HEN or Mamba to return false.
 
The code above will return true on HEN and Mamba, because they are Cobra payloads too.

If the function needs to detect Cobra only, the function first should detect HEN or Mamba to return false.
Of course, I suppose the name of the function is a bit misleading, it gets used ONLY after HEN and Mamba detection functions have already been tried like I explained to Luan in a previous post.
Those are all untested snippets I made up to help him test his work, not reliable functions to be included as is in a release.
 
OK so, if anybody sees this, can you help me?? So I've got HEN now right, and it's pretty cool. But the problem is, I make videos, and I do it with OBS studio. Normally the capture device brings the ps3 audio in perfectly fine, and it still does now. The problem arises when I launch any homebrew application. The device returns nothing but high-pitched and very fast static. I have tested it a few times now, and I was right it's only apps installed through HEN. Does anyone know how to help me out?
 
Does using "Uninstall HEN" work the same as just reinstalling OFW? Or does it not remove things that reinstalling OFW would remove?

No. "Uninstall HEN" deletes all the HEN files installed, including the ones in /dev_flash and /dev_hdd0

Reinstall OFW replaces all the files in /dev_flash, but leaves the installed files in /dev_hdd0 (even when they cannot be accessed from XMB).

I recommend to first use "Uninstall HEN" and optionally reinstall OFW after the uninstallation.
 
Last edited:
ok, thanks for answering. I should get one myself I guess
At least on 4.84, hen does not appear to patch lv1 protection of lv2. I think restoring the original values in lv2 before your app exits can get around this limitation.

Only part of lv2 is protected though. I don't remember where the demarcation is exactly, but I believe syscall table and above is not protected. Well, patching there works ok on 4.84 anyway without restoring lv2.

Here is a link to a post with a simple app for dumping lv2 on 4.84 with hen. It uses copy_to_user and setvbuf() which seems faster than peek() and default system buffer:

https://www.psx-place.com/posts/365625/
 
Back
Top