How to build PS1 PKGs for PS3 (with HEN)

@Ronnie Sahlberg
I've build these before for my webman-classics-maker (see signature), anyway files attached, both are python 2.7 32bit and 64bit versions (.so and .pyd).

EDIT: If anyone knows how to port pkgcrypt C-modules from python 2.7 to 3.x I'd really appreciate your help!

Thanks, but I sorted it out already. For python3 version of pkgcrypt, see https://github.com/lephilousophe/PSL1GHT
That is the one I am using in pop-fe to create the PS3 packages. It is all python3.

I even have a GUI now :-) (well, for PS3, not for creating images for PSP/PS2/....)
https://www.psx-place.com/resources/pop-fe-a-utility-to-create-psx-classics-packages-for-ps3.1256/
 
@Ronnie Sahlberg
I've build these before for my webman-classics-maker (see signature), anyway files attached, both are python 2.7 32bit and 64bit versions (.so and .pyd).

EDIT: If anyone knows how to port pkgcrypt C-modules from python 2.7 to 3.x I'd really appreciate your help!

WOW, webman classics maker looks AWESOME. I will definitely download that and have a look at it.
If you need any code to create PSX Classics stuff, please feel free to borrow it from pop-fe.
It is python3 and has code to create multi-disc EBOOT-PBPs, it has code to convert the CDDA tracks and inject them into the EBOOT and it also have code to disable libcrypt on the discs that has it.

Other things that you might find useful, network filesystem support, both libsmb (smb2/3) as well as libnfs (nfsv3/4) are supported on PS3. This means if you want to access the data/games/packages from a NAS, you can use these two client libraries to do so.

If you use python3 on the PS3, you should be able to run https://github.com/sahlberg/scrambla
this is a very basic SMB2/3 fileserver written in python3. This could allow you to export the filesystems as a share ad then access them from windows/linux hosts. (is probably a LOT easier to get it running than porting samba. Samba is BIG and has a lot of dependencies. This one is tiny but has almost no external dependencies)

...end salespitch about my github repos ...
 
WOW, webman classics maker looks AWESOME. I will definitely download that and have a look at it.
If you need any code to create PSX Classics stuff, please feel free to borrow it from pop-fe.
It is python3 and has code to create multi-disc EBOOT-PBPs, it has code to convert the CDDA tracks and inject them into the EBOOT and it also have code to disable libcrypt on the discs that has it.

Other things that you might find useful, network filesystem support, both libsmb (smb2/3) as well as libnfs (nfsv3/4) are supported on PS3. This means if you want to access the data/games/packages from a NAS, you can use these two client libraries to do so.

If you use python3 on the PS3, you should be able to run https://github.com/sahlberg/scrambla
this is a very basic SMB2/3 fileserver written in python3. This could allow you to export the filesystems as a share ad then access them from windows/linux hosts. (is probably a LOT easier to get it running than porting samba. Samba is BIG and has a lot of dependencies. This one is tiny but has almost no external dependencies)

...end salespitch about my github repos ...
That's funny, I was just about to say the same thing to you: your stuff looks awesome!
Feel free to take anything you'd need (not that I think you would need anything when comparing your stuff with mine) my code is very rough to say at least.

Thanks for the info, I'm trying to make my application use the newly built pkgcrypt as we speak!

EDIT: it seems to not be recognized during import for some reason, could be some weird py2 vs 3 stuff I need to sort out
 
Last edited:
That's funny, I was just about to say the same thing to you: your stuff looks awesome!
Feel free to take anything you'd need (not that I think you would need anything when comparing your stuff with mine) my code is very rough to say at least.

Thanks for the info, I'm trying to make my application use the newly built pkgcrypt as we speak!

EDIT: it seems to not be recognized during import for some reason, could be some weird py2 vs 3 stuff I need to sort out

Sorry, should have mentioned, did you switch to the "use-python3" branch?
This is from the readme for pop-fe, with the instructions to build for windows (using mingw) :

cd PSL1GHT/tools/ps3py
git checkout origin/use-python3
make
cd ../../..
 
Sorry, should have mentioned, did you switch to the "use-python3" branch?
This is from the readme for pop-fe, with the instructions to build for windows (using mingw) :

cd PSL1GHT/tools/ps3py
git checkout origin/use-python3
make
cd ../../..

OK I'm one step closer :)
It seems like I forgot how to use the pkg.py or it has been vastly changed since the version I've based mine on, feel bad for asking but what arguments does pkg.py want in order to build a pkg?
 
https://github.com/sahlberg/pop-fe/blob/ebdc57d8fcd53fe9bed4ecab6091fdc78f0a0037/pop-fe.py#L771

game_id is 'sles12345'
subdir+game_id is the name of the directory you want to create a pkg from dest is package file
Excellent! I think my modded version of pkg.py might still work with some elbow grease.
If not it's good to have an example for the new script, really appreciate it!
I think I'm already halfway through porting this thing :)

EDIT: browsing more of your code makes me really want to overhaul a lot of my mine, good job man! :)
 
Last edited:
@Ronnie Sahlberg Progress update: I now have something ugly but functional, huge! :)

When tinkering with different 3.x python versions I realize that It needds a specific pkgcrypt for every minor version (at least in windows).
I wonder if there is a gentle way of handling this :confused3:

For linux I guess making the .so isn't a very big deal, for the .pyd on windows on the other hand you seem to need a lot of different M$ C++ build tools (I have an old laptop only for this since I can't remember what I setup to make it build, lol).
 
Last edited:
@Ronnie Sahlberg Progress update: I now have something ugly but functional, huge! :)

When tinkering with different 3.x python versions I realize that It needds a specific pkgcrypt for every minor version (at least in windows).
I wonder if there is a gentle way of handling this :confused3:

For linux I guess making the .so isn't a very big deal, for the .pyd on windows on the other hand you seem to need a lot of different M$ C++ build tools (I have an old laptop only for this since I can't remember what I setup to make it build, lol).

See the REAME for pop-fe for inspiration.
@Devildwarf has added the spec files and documentation how to build these into .EXE files.
Including building PKG.PY (and its modules) into an EXE. That one should run on any/all versions of windows.

Look for the part where it says:

pyinstaller PSL1GHT/tools/ps3py/pkg.py

that should be where it builds the EXE.
 
Last edited:
yeah if you want to just build a PKG exe with everything needed do (assuming you have python and Mingw64/msys2 installed)
Open a Mingw64 shell and copy and paste
Code:
git clone http://github.com/sahlberg/PSL1GHT
cd PSL1GHT/tools/ps3py
git checkout origin/use-python3
make
cd ../../..
pip install pyinstaller
pyinstaller PSL1GHT/tools/ps3py/pkg.py
This will build a exe with all dependancies in the folder (you could also try "--onefile" after thr pyinstaller command to make it build it into 1 exe but i don't recommend it until you are sure its working)
 
@Ronnie Sahlberg Progress update: I now have something ugly but functional, huge! :)

When tinkering with different 3.x python versions I realize that It needds a specific pkgcrypt for every minor version (at least in windows).
I wonder if there is a gentle way of handling this :confused3:

For linux I guess making the .so isn't a very big deal, for the .pyd on windows on the other hand you seem to need a lot of different M$ C++ build tools (I have an old laptop only for this since I can't remember what I setup to make it build, lol).

Since you are tinkering with building PS3 packages.
Have a look at this : https://github.com/sahlberg/pop-fe/blob/1f72decdd8551b08fcc6772b2ca705b78de09c91/pop-fe.py#L615
I just added support to take a WAVE/16bit/Stereo/44100Hz file and recode it into ATRAC3 and adding it to the package as SND0.AT3.
That way, when you highlight the package in the XMB it will play that audio just like official packages.
 
Since you are tinkering with building PS3 packages.
Have a look at this : https://github.com/sahlberg/pop-fe/blob/1f72decdd8551b08fcc6772b2ca705b78de09c91/pop-fe.py#L615
I just added support to take a WAVE/16bit/Stereo/44100Hz file and recode it into ATRAC3 and adding it to the package as SND0.AT3.
That way, when you highlight the package in the XMB it will play that audio just like official packages.

Dude, I love that!
This could be something in addition to when you build a webman-classics-maker pkg and want to add or override the already found SND0.AT3 (I'm using ftp to fetch binary chunks of data from the ISO-files off of the PS3 HDD, that data then reconstructs to an SND0.AT3). Again, awesome idé! You happen to mess around with the animated ICON1.PAM as well? That one is pretty cool!

EDIT: by the way, I dusted of my brain yesterday and realized an already made build-scripts for the pyinstaller using onefile, so the pyd is not a problem. Also a funny thing, several times when I browsed your code I reminds me of some of my own ideas, but much better implemented
 
Last edited:
You happen to mess around with the animated ICON1.PAM as well?
Not yet. I did not know that was a thing.

If it is a thing I might have to spend some time on it. My mission is not complete until pop-fe is more capable and easier to use that SONYs internal development tools for PS Classics.
That is my mission.

EDIT: also, stop using FTP. Use libsmb2 instead.
 
Not yet. I did not know that was a thing.

If it is a thing I might have to spend some time on it. My mission is not complete until pop-fe is more capable and easier to use that SONYs internal development tools for PS Classics.
That is my mission.

EDIT: also, stop using FTP. Use libsmb2 instead.

I was just about to ask about the libsmb2!
I'll definitely replace my ftp implementations for that one if possible :)
Dude, you'll love ICON1.PAM, those are sick!
 
@Ronnie Sahlberg attached is a webman-classics .pkg that I made quickly containing an ICON1.PAM of marvel vs capcom 3 if you want to see it in action on the xmb. Obviously it's not gonna start anything since the ISO it targets doesn't exist.
 

Attachments

Last edited:
Interesting, looks like the PAM is just a MPG file with 800 byte header added on (if you remove the first 800 in a hex edit it will load as a normal mpg file)
Acording to mediainfo its
Code:
Format                      : MPEG-PS
File size                   : 1.51 MiB
Duration                    : 13 s 226 ms
Overall bit rate mode       : Variable
Overall bit rate            : 960 kb/s

Video
ID                          : 224 (0xE0)
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : [email protected]
Format settings             : 2 Ref Frames
Format settings, CABAC      : No
Format settings, Reference  : 2 frames
Duration                    : 12 s 980 ms
Bit rate mode               : Variable
Bit rate                    : 941 kb/s
Width                       : 320 pixels
Height                      : 176 pixels
Display aspect ratio        : 16:9
Frame rate                  : 29.970 (30000/1001) FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.557
Stream size                 : 1.46 MiB (96%)
Color range                 : Limited
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709

Text
ID                          : 189 (0xBD)
Format                      : RLE
Format/Info                 : Run-length encoding
Duration                    : 13 s 226 ms
Delay relative to video     : -50 ms

Menu
Format                      : DVD-Video
 
Interesting, looks like the PAM is just a MPG file with 800 byte header added on (if you remove the first 800 in a hex edit it will load as a normal mpg file)
Acording to mediainfo its
Code:
Format                      : MPEG-PS
File size                   : 1.51 MiB
Duration                    : 13 s 226 ms
Overall bit rate mode       : Variable
Overall bit rate            : 960 kb/s

Video
ID                          : 224 (0xE0)
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : [email protected]
Format settings             : 2 Ref Frames
Format settings, CABAC      : No
Format settings, Reference  : 2 frames
Duration                    : 12 s 980 ms
Bit rate mode               : Variable
Bit rate                    : 941 kb/s
Width                       : 320 pixels
Height                      : 176 pixels
Display aspect ratio        : 16:9
Frame rate                  : 29.970 (30000/1001) FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.557
Stream size                 : 1.46 MiB (96%)
Color range                 : Limited
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709

Text
ID                          : 189 (0xBD)
Format                      : RLE
Format/Info                 : Run-length encoding
Duration                    : 13 s 226 ms
Delay relative to video     : -50 ms

Menu
Format                      : DVD-Video

That sound really nice!
I wonder if those 800 bytes are something static that one could just append to make it play (given that you have the correct resolution etc)

EIT: actually @Zoilus made a very nice video here about making a ICON1.PAM + what codecs to use etc
 
Last edited:

Similar threads

Back
Top