Loading a PRX module suddenly gives me 8002013C on 3.40 OE

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
DickyDick
Posts: 29
Joined: Sat Aug 21, 2004 2:28 am

Loading a PRX module suddenly gives me 8002013C on 3.40 OE

Post by DickyDick »

Hi all,

I just upgraded my psp to 3.40 OE and suddenly a kernel mode PRX what could be loaded fine by my user mode PRX (inside a PBP) refuses to load and gives me a 8002013C error.

on 3.10 OE A' I did not have this problem...

Is something changed in the module loading business?

None of the binaries were changed, I only updated the OE firmware
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

0x8002013C is library not found.

Try this thread for a solution maybe: http://forums.ps2dev.org/viewtopic.php?t=7484
DickyDick
Posts: 29
Joined: Sat Aug 21, 2004 2:28 am

Post by DickyDick »

Thx for ur reply but I already know that thread :-). In fact it is the same PRX I want to load. (memodule.prx)

It's really weird that the module loaded fine in 3.10 OE A' (and worked) and only when I updated to 3.40 OE it did not. That with identical binary files.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

sony is removing little by little any user mode export from kernel access so maybe you need to rebuild it with the _driver libs
DickyDick
Posts: 29
Joined: Sat Aug 21, 2004 2:28 am

Post by DickyDick »

hmmm it's only linking 3 libs:
-lpspkernel -lpsplibc -lpspuser

are there driver versions of these?
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

DickyDick wrote:hmmm it's only linking 3 libs:
-lpspkernel -lpsplibc -lpspuser

are there driver versions of these?
it's linking them in the makefile or in the building process (as some libs are put by default thanks to build.mak import).
if it's the first check the build process probably you are importing some user mode functions.
you could even check psplink to see what imports you are using
DickyDick
Posts: 29
Joined: Sat Aug 21, 2004 2:28 am

Post by DickyDick »

So I need to find "non usermode counterparts" of these functions?


(listing from prxtool -f)
Imports:
Import 0, Name IoFileMgrForUser, Functions 1, Variables 0, flags 40010000
Functions:
0x42EC03AC [0x00008758] - IoFileMgrForUser_42EC03AC
Import 1, Name ModuleMgrForUser, Functions 1, Variables 0, flags 40010000
Functions:
0xD675EBB8 [0x00008760] - ModuleMgrForUser_D675EBB8
Import 2, Name SysMemUserForUser, Functions 4, Variables 0, flags 40000000
Functions:
0xA291F107 [0x00008768] - SysMemUserForUser_A291F107
0x237DBD4F [0x00008770] - SysMemUserForUser_237DBD4F
0xB6D61D02 [0x00008778] - SysMemUserForUser_B6D61D02
0x9D9A5BA1 [0x00008780] - SysMemUserForUser_9D9A5BA1
Import 3, Name ThreadManForUser, Functions 4, Variables 0, flags 40010000
Functions:
0x9ACE131E [0x00008788] - ThreadManForUser_9ACE131E
0x446D8DE6 [0x00008790] - ThreadManForUser_446D8DE6
0xF475845D [0x00008798] - ThreadManForUser_F475845D
0xAA73C935 [0x000087A0] - ThreadManForUser_AA73C935
Import 4, Name UtilsForUser, Functions 2, Variables 0, flags 40010000
Functions:
0x79D1C3FA [0x000087A8] - UtilsForUser_79D1C3FA
0xB435DEC5 [0x000087B0] - UtilsForUser_B435DEC5
Import 5, Name sceSysreg_driver, Functions 3, Variables 0, flags 00010000
Functions:
0xDE59DACB [0x000087B8] - sceSysreg_driver_DE59DACB
0x2DB0EB28 [0x000087C0] - sceSysreg_driver_2DB0EB28
0x44F6CDA7 [0x000087C8] - sceSysreg_driver_44F6CDA7
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

http://moonlight.lan.st/ check there if they correspond (some nids are still the same for kernel and user) you are file else yes you need the kernel counterpart
DickyDick
Posts: 29
Joined: Sat Aug 21, 2004 2:28 am

Post by DickyDick »

that site looks pretty outdated... but nevertheless thanks for your reply..

BTW.. Is there any working example/stuff where a KERNEL prx is loaded by a USER PRX (packed in PBP) on the new 3.40 OE firmware?
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

DickyDick wrote:BTW.. Is there any working example/stuff where a KERNEL prx is loaded by a USER PRX (packed in PBP) on the new 3.40 OE firmware?
I've got some sample apps which work at least on older 3.xx versions.
Will check them on 3.40 tonight.
Fanjita
Posts: 217
Joined: Wed Sep 28, 2005 9:31 am

Post by Fanjita »

I'm seeing a similar problem with piKey on 3.30/3.40OE.

At the moment I suspect it is the flags on the module import / export stubs, but haven't had time to investigate properly. I'm pretty sure it is not to do with import of any user mode imports from the system libraries.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
DickyDick
Posts: 29
Joined: Sat Aug 21, 2004 2:28 am

Post by DickyDick »

Hmmm...

If these flags are the issue, how com it only surfaces on firmware >= 3.3 ? Or is the loading/linkage process different from older firmwares?
Fanjita
Posts: 217
Joined: Wed Sep 28, 2005 9:31 am

Post by Fanjita »

They got more strict with user/kernel interaction as time went on. 3.30/3.40 seem to be extremely picky about trying to ensure that kernel code doesn't call into user mode functions. Security considerations, I guess.

Incidentally I have now managed to get 3 of the 4 piKey modules that were misbehaving to load on 3.40OE.

On one of them, changing the module attributes from 0x0800 to 0x1000 did the trick - I had changed to 0x0800 on the advice of another forum post about 3.40OE problems, but it turned out that that was bad advice, in this case at least.

Since that module was the one that was failing first, it had masked the failures in the other modules, which were much simpler. For those, it was simply a case of changing the makefile to use _driver versions of all the imported libs, as suggested earlier in this thread.

I still have one module that still fails, however, and I'm struggling to work out why. The error is still 8002013C, though I'm fairly confident that I've removed all the umode imports now.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
DickyDick
Posts: 29
Joined: Sat Aug 21, 2004 2:28 am

Post by DickyDick »

jockyw2001 wrote:
DickyDick wrote:BTW.. Is there any working example/stuff where a KERNEL prx is loaded by a USER PRX (packed in PBP) on the new 3.40 OE firmware?
I've got some sample apps which work at least on older 3.xx versions.
Will check them on 3.40 tonight.
And..? :-D
Post Reply