Joonie86 / COBRA-7.3

63 stars 31 forks source link

Bug in Cobra Porting 7.52+ error 80010006 #9

Closed Alexandersss closed 6 years ago

Alexandersss commented 6 years ago

I noticed a bug on all cobra versions from 752+ (this also happens on REBUG) When you disable syscall and apply an update to a game or download files from the PSTORE you get this error: 80010006 while installing them.

before going to check bug, you already have some idea of this?

aldostools commented 6 years ago

Could you check if the error still happens with Cobra 7.53 compiled with stage2/main.c from Cobra 7.51?

Alexandersss commented 6 years ago

Now check and let me know!

Alexandersss commented 6 years ago

Ok, the issue also reappears with main.c of 751. Could it be a problem due to the implementation of the Homebrew blocker on mappath? Even the controller loses synchronization .

aldostools commented 6 years ago

I don't think so... unless you're trying to update one of the blacklisted games ids.

To confirm your hypothesis, you can repeat the test but compiling with mappath.c from Cobra 7.51

Alexandersss commented 6 years ago

ok, the problem seems to be the homebrew blocker ... The Game updates now go and even the PStore Applications.

Joonie86 commented 6 years ago

To workaround the issue for now, can you add that blocked app on the whitelist see if that allows? @Alexandersss

Alexandersss commented 6 years ago

Apparently, it seems not work either by insert the ID in the whitelist of 'app or game.

Joonie86 commented 6 years ago

@Alexandersss Habib suggested try changing

int allow = !strncmp(gameid, "NP", 2) || !strncmp(gameid, "BL", 2) || !strncmp(gameid, "BC", 2) || !strncmp(gameid, "KOEI3", 5) || !strncmp(gameid, "KTGS3", 5) || !strncmp(gameid, "MRTC0", 5) || !strncmp(gameid, "ASIA0", 5) || !strncmp(gameid, "GUST0", 5) ; ;

to allow=1; in map_path.c

aldostools commented 6 years ago

^^ Notice that changing the code to allow=1; would break the feature.

Only the explicit blacklisted homebrews (multiMAN, psnpatch, dev_blind, etc) would be blocked. The other homebres (like IRISMAN, Movian, etc.) not hardcoded would be allowed to execute with the syscalls disabled unless the game id is included explicitly in /dev_hdd0/tmp/blacklist.cfg

Joonie86 commented 6 years ago

@aldostools The issue was blocking retail games and updates, not so sure why it caused it, I haven't tested it myself yet.

aldostools commented 6 years ago

IMO to solve the issue, the function must be debugged to show what is the exact condition that is blocking the retail games. Making random changes is not a good approach.

@Alexandersss What is the path in hdd0 of the game blocked? Is the game still blocked if the game id is added to /dev_hdd0/tmp/whitelist.cfg ?

Alexandersss commented 6 years ago

@aldostools Any game updates are blocked and PSTORE apps are not started. Yes, the error continues even though I insert it in whitelist.cfg. However with the fix it worked

There may be a conflict between psnpatch/SEN with the cobra (homebrew blocker) at the time of disabling syscall?

aldostools commented 6 years ago

It would be nice if you could add the following line after char *gameid = path0 + 15;:

DPRINTF("Game ID: %s \n", gameid);

Then using the debug version of cobra get the log. If I recall correctly, when a pkg file is installed, a temporary folder is created in /games and that folder could be causing the bug.

Alexandersss commented 6 years ago

I can do some test just come back from work.

Alexandersss commented 6 years ago

hmmm ... it does not seem to print anything on screen. I also tried with DPRINTF("Game ID = '%s'\n", gameid); but nothing appears.

aldostools commented 6 years ago

Could you try with this mappath.c? https://pastebin.com/NpDkkPbi

I only added the DPRINTF to line 328. If the code is executed, it should show the message in the PC's console.

Make sure that you copy the debug version of stage2.cex to dev_blind.

Joonie86 commented 6 years ago

@aldostools I think I found the issue, while installing npdrm pkgs, it unpacks to

such paths like

open_path /dev_hdd0/game/_INST_2017120306592300114719/USRDIR/music open_path /dev_hdd0/game/_INST_2017120306592300114719/USRDIR/music/cds open_path /dev_hdd0/game/_INST_2017120306592300114719/USRDIR/music/cds open_path /dev_hdd0/game/_INST_2017120306592300114719/USRDIR/music/music open_path /dev_hdd0/game/_INST_2017120306592300114719/USRDIR/music/music

and COBRA seems blocking it... because they are not in the whitelist..

I think it's better to disable whitelist, because cached paths are different for almost every game, depends on game engine and game devs' preferences..

aldostools commented 6 years ago

Yes, that is the temporary folder that I was referring in my post above. I didn't recall the exact name the system was using.

So adding "INST" to the whitelist comparison should fix this issue.

aldostools commented 6 years ago

*i mean INST with the underscores (the editor changed them to Italics). That prefix is constant.

Joonie86 commented 6 years ago

the issue is resolved by @aldostools 's suggestion to add INST in whitelist.