pspdev / prxtool

A simple tool to manipulate Sony PSP(tm) PRX files
Other
65 stars 27 forks source link

Magic value incorrect (not an ELF?) #7

Open tpimh opened 2 months ago

tpimh commented 2 months ago

Trying prxtool with various Sony modules (starting with 0x7E534345), always get the same output:

PRXTool v1.1 : (c) TyRaNiD 2k6
Built: Jul  9 2024 08:49:07
Error: Magic value incorrect (not an ELF?)
Error: Couldn't load prx file structures

Done

For example, audiocodec.prx or libatrac3plus.prx can be used. Not giving direct links to these files, but there's a list of UMD/PSN games from which these files can be legally obtained.

Is this tool not supposed to work with these prx modules?

artart78 commented 1 month ago

These binaries are encrypted, you can decrypt them using this tool: https://github.com/John-K/pspdecrypt

tpimh commented 1 month ago

I have now built pspdecrypt, but for every prx I try to decrypt, I get "Unknown input file format!" error. Am I supposed to use some extra options for successful prx decryption? Can't find anything related in the documentation.

tpimh commented 1 month ago

As discussed in Discord, pspdecrypt doesn't handle the ~SCE header.

There are two solutions:

  1. Remove the first header up to ~PSP header start: tail -c +65 libsmth.prx > libsmth-psp.prx
  2. Use a fork of pspdecrypt that does this automatically
sharkwouter commented 1 month ago

@tpimh If there are no issues with the fixed up implementation, we should probably merge those changes.

tpimh commented 1 month ago

prxtool is fine, pspdecrypt is the tool that needed fiddling. Of course, we can fork the original pspdecrypt to pspdev organization, then merge the changes from the fork that can skip the ~SCE header.

sharkwouter commented 1 month ago

Oh, fair. I think John is still active, though.