Want to Join Us ?

you'll be able to discuss, share and send private messages.

Minor update for ungpkg

Discussion in 'Homebrew' started by Rip Cord, Jan 9, 2015.

Share This Page

  1. Rip Cord

    Administrator Staff Member Admin Developer

    Ungpkg extracts files from game packages.

    During the extraction process, the npdrmv3 release of ungpkg terminates processing when it encounters a type 2 file like an edat. This unofficial minor update to ungpkg enables the processing of type 2 files.

    original:
    Code (Text):
    else if (flags == 1 || flags == 3)
    modified:
    Code (Text):
    else if (flags == 1 || flags == 3  || flags == 2)
    also added some console output, lists files as they are extracted.
    zip includes source code and compiled exe.
     

    Attached Files:

    storm shadow likes this.
  2. Rip Cord

    Administrator Staff Member Admin Developer

    just noticed that archive didn't include the msys dll's

    here's an archive with source, exe, dll's, ...

    since this is ps3tools program, place your gpkg key in the ps3tools key folder for your system.
     

    Attached Files:

    catalinnc and storm shadow like this.
  3. Rip Cord

    Administrator Staff Member Admin Developer

    replaced mmap, someone reported problem with mmap; also removed dependence on msys
    added option to extract only one file by name, someone said this would be a useful feature


    usage: ungpkg filename.pkg [directory]
    optional: directory; if not specified, content id is used

    to extract a single file: ungpkg filename.pkg x filename

    warning: used _splitpath to separate the filename from the path as it's stored in the pkg content list, it's windows specific and IIRC has problems with filenames with more than one "." so substitute your preferred alternative if necessary.
     

    Attached Files:

    jo3tomas, catalinnc and storm shadow like this.
  4. jo3tomas

    Well-Known Member Developer

    single file extraction - files with same file name (C00 demos for example have two PARAM.SFO)
    Code (Text):
    decrypting retail package...
    extracting PARAM.SFO...
    extracting PARAM.SFO...
    finished...
    first PARAM.SFO is overwritten

    regards
     
    Rip Cord likes this.
  5. Rip Cord

    Administrator Staff Member Admin Developer

    thanks for the heads up.
     
  6. Rip Cord

    Administrator Staff Member Admin Developer

    fixed.
    thanks for the suggestion to keep the directory structure.
    also added error catching to the ps3tools function memcpy_to_file

    thanks for the help
     

    Attached Files:

    jo3tomas and catalinnc like this.
  7. jo3tomas

    Well-Known Member Developer

    decryption error on Blacklight Tango Down pkg:
    Code (Text):
    http://ares.dl.playstation.net/cdn/UP4002/NPUB30224_00/DT8tRJ6S3o4PLGAeHCrIXijnh4YfG0PCaRjWqBhYVXAuMT0Q6LH66uluWvjwOWpBKiKmpeoBVDEwdl2OkMsd3fNEjO1R2yoCTt8O6.pkg
    Code (Text):
    decrypting retail package...
    error writing to file USRDIR/FOXGAME/MOVIES/LOGOSLEGALPS3.TXT
    and
    Code (Text):
    decrypting retail package...
    error writing to file USRDIR/Data/PS3/NOSAVEDDATA
    on Lemming pkg:
    Code (Text):
    http://zeus.dl.playstation.net/cdn/EP9000/NPEA00004_00/WAJg4R6u6sIE7qsm1jIQ9FuE0UX49aebo8g05wD3LryJl1uW2GcArc0Ph6TKuadaxRmtMNTynIU77oxuOjuljS5ye7bDaRUTlG2HJ.pkg

    and
    Code (Text):
    decrypting retail package...
    unknown flags: 00000009
    on Fret Nice pkg:
    Code (Text):
    http://zeus.dl.playstation.net/cdn/UP0325/NPUB30147_00/TNp3GonGw2jVpEeQ4MT4ThYfs3cl6nY6daOLY44S6TP18pgwCUn8UNvBJMtVt2XFKmPvYfs3ep2PqGgUGVKim8x95cb4bTuQEV8PI.pkg

    regards
     
    Last edited: Dec 10, 2015
    Rip Cord likes this.
  8. Rip Cord

    Administrator Staff Member Admin Developer

    thanks for the examples, makes it easy to find the problem.

    fix:
    1. "error writing to file" caused when writing to files with size of 0 bytes, added this to error catching:
    Code (C):

        if(!size) {
            fclose(fp);
            return;
        }
     
    2. extraction limited by file flags, added type 9 to list
    Code (C):

    else if (flags == 1 || flags == 3  || flags == 2 || flags==9)
     
     

    Attached Files:

    jo3tomas likes this.
  9. Rip Cord

    Administrator Staff Member Admin Developer

    when encountering undefined file flag, this version prints out filename and flag, but doesn't exit immediately. instead keeps extracting files.

    Should other flags be added to the screening conditional or should it be changed to only screen out directories?

    I guess everyone uses aldostools, anyway. It seemed appropriate to fix it though since everything is based on fai|0verf|ow's ps3tools.
     

    Attached Files:

    jo3tomas, storm shadow and catalinnc like this.
Top