PS3 Creating a PKG file that installs to any path (including flash)

Discussion in 'Tutorials & Guides' started by lmn7, Apr 7, 2019.

  1. 4
    1
    32
    Andres JG

    Andres JG Member

    Joined:
    Apr 9, 2019
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    32
    Gender:
    Male
    wua spectacular this program..!!! o_O
     
  2. 3,603
    5,997
    522
    aldostools

    aldostools Developer Developer

    Joined:
    Oct 30, 2014
    Messages:
    3,603
    Likes Received:
    5,997
    Trophy Points:
    522
    @lmn7 I've made some modifications to your pkg_custom.exe

    - It's slightly faster building the pkg (../../ is added at a more efficient place in the code)
    - Added display of package size in decimal and the number of files & folders
    - Added support for drag & drop a folder without a batch file.
    - If the parameter is not a folder, the file is extracted
    - Uses the default content_id if one is not provided
    - Added detection of default folder "custom" if the program runs without parameters (i.e. double click)
    - If the folder name is a content_id, it's used as content id of the pkg
    - Bug fix: Now extracts in the same folder (not 2 folders up due ../../)

    The source code with my modifications is included ;)
     

    Attached Files:

    Louis Garry, lmn7, Coro and 4 others like this.
  3. 636
    1,042
    222
    lmn7

    lmn7 Developer

    Joined:
    Oct 31, 2017
    Messages:
    636
    Likes Received:
    1,042
    Trophy Points:
    222
    Wow, great work! When I have some more time I'll see about fixing the extraction memory issue so the tool can extract large pkgs (I've already fixed the listing function). FYI your exe wrapper creates false positives for malware, I recompiled the source code with py2exe and had no issues. Thanks a lot for your contributions :)
     
    aldostools and Coro like this.
  4. 3,603
    5,997
    522
    aldostools

    aldostools Developer Developer

    Joined:
    Oct 30, 2014
    Messages:
    3,603
    Likes Received:
    5,997
    Trophy Points:
    522
    I used: pyinstaller.exe --onefile pkg_custom.py

    Find attached to this post the version "1.3 MOD"
    - It packs 2X or 3X faster (It doesn't calculate the qadigest for all the files, saving a lot of processing time)
    - Added a better icon.
    - The extract now is done in chunks of 100MB. It should fix the issue with large files (I didn't test this)
    - Changed the function getfiles (it should be slightly faster and should use less memory)

    I tested the pkg built without qadigest on Rebug 4.86 and it worked fine... not sure if HEN could have issues.
     

    Attached Files:

    Louis Garry, lmn7 and Coro like this.
  5. 636
    1,042
    222
    lmn7

    lmn7 Developer

    Joined:
    Oct 31, 2017
    Messages:
    636
    Likes Received:
    1,042
    Trophy Points:
    222
    Great stuff! I just checked and large PKG indexing and extraction is still broken due to both functions loading the whole pkg file into memory. That's really interesting about the QA digest, I assume the PS3 doesn't check it? I think I can remember having issues with that on HAN at some point, but it was a while ago now so I could be wrong.

    Edit: I see now that the qadigest is used as the key to encrypt the pkg. It should be fine.
     
    Last edited: Jul 1, 2020 at 1:36 AM
    aldostools likes this.
  6. 636
    1,042
    222
    lmn7

    lmn7 Developer

    Joined:
    Oct 31, 2017
    Messages:
    636
    Likes Received:
    1,042
    Trophy Points:
    222
    @aldostools Here's an update:

    - Fixed pkg file indexing
    - Fixed large pkg extraction (uses temporary file for extraction, it can possibly be updated to work in memory)
    - Added default pkg name when the tool is started without parameters

    I merged your fixes into the main tool so I removed the "MOD" in the version function. Feel free to make changes or check for bugs.
     

    Attached Files:

    Coro and aldostools like this.
  7. 3,603
    5,997
    522
    aldostools

    aldostools Developer Developer

    Joined:
    Oct 30, 2014
    Messages:
    3,603
    Likes Received:
    5,997
    Trophy Points:
    522
    Neat!! I made some new changes in version 1.4 ;)

    - The package is now created super fast...
    e.g. In my tests, creating a pkg containing the files of webman installer (on my i7 quad-core)
    ver 1.2: ~3 minutes 20 seconds
    ver 1.3: ~25 seconds
    ver 1.4: ~5 seconds (even faster than psn_package_npdrm: 10 seconds)
    - if PARAM.SFO is found in the initial folder, the package now is created as gameData
    - If USRDIR/EBOOT.BIN is found the PKG is created as gameExec (instead of gameData)
    - Otherwise the package is created as a custom package (theme)
     

    Attached Files:

    Last edited: Jul 1, 2020 at 11:51 PM
    lmn7 and Coro like this.
  8. 636
    1,042
    222
    lmn7

    lmn7 Developer

    Joined:
    Oct 31, 2017
    Messages:
    636
    Likes Received:
    1,042
    Trophy Points:
    222
    Awesome, this tool is really useful now. I just fixed some of my mistakes and uploaded this improved version to the OP. Thanks again for improving the script :)
     
    Coro and aldostools like this.

Share This Page