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

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

  1. 234
    52
    82
    Ps3_dev

    Ps3_dev Member

    Joined:
    Dec 20, 2017
    Messages:
    234
    Likes Received:
    52
    Trophy Points:
    82
    Gender:
    Male
    Thanks i will start testing it
     
  2. 1,900
    1,203
    297
    Louay

    Louay Senior Member

    Joined:
    Jan 23, 2017
    Messages:
    1,900
    Likes Received:
    1,203
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    College Student,GAMING,REPAIRING,XMB Modder
    Location:
    Tunisia
    Home Page:
    This is a video showing that my created PKG with lmn7 modified make_pkg_custom it works i take rco,wave,icons,gameboot,coldboot,epilisey warning,game sort by alphabet,game data sort by alphabet from my CFW to this HFW HAN Console with just one PKG that contains all modified RCO



    20190407_203321.jpg 20190407_203324.jpg 20190407_203329.jpg 20190407_203330.jpg 20190407_203335.jpg 20190407_203342.jpg 20190407_203348.jpg 20190407_203407.jpg Capture d’écran (1825).png Capture d’écran (1826).png Capture d’écran (1827).png 20190407_203321.jpg
     
  3. 13,052
    5,228
    647
    pinky

    pinky Retired Developer

    Joined:
    Mar 8, 2015
    Messages:
    13,052
    Likes Received:
    5,228
    Trophy Points:
    647
    Gender:
    Male
    Location:
    The Great Gig in the Sky
    does this create a LOGO.DAT like ForcedInstallTo? that's at least true with make_package_npdrm.
     
  4. 7
    0
    30
    PS3HANHELP

    PS3HANHELP Member

    Joined:
    Mar 21, 2019
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    30
    Gender:
    Male
    Would you like to put a mod in a game with this method ??
     
  5. 1,900
    1,203
    297
    Louay

    Louay Senior Member

    Joined:
    Jan 23, 2017
    Messages:
    1,900
    Likes Received:
    1,203
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    College Student,GAMING,REPAIRING,XMB Modder
    Location:
    Tunisia
    Home Page:
    ??? it already can be done by creating a pkg contains all the mod and the destination folder is /dev_hdd0/game/NPXX12345

    and you can't mod on OFW like in CFW i mean you can't use Mods that have sprx,eboot edits 90% of modded games use modified sprx and eboot and those can run only in CFW
     
    Last edited: Apr 7, 2019
    ntodek and DeViL303 like this.
  6. 1,900
    1,203
    297
    Louay

    Louay Senior Member

    Joined:
    Jan 23, 2017
    Messages:
    1,900
    Likes Received:
    1,203
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    College Student,GAMING,REPAIRING,XMB Modder
    Location:
    Tunisia
    Home Page:
    citra mulia likes this.
  7. 3,507
    5,827
    522
    aldostools

    aldostools Developer Developer

    Joined:
    Oct 30, 2014
    Messages:
    3,507
    Likes Received:
    5,827
    Trophy Points:
    522
    No. The default folder is PS3 root which can't be written ;)

    I love this tool @lmn7. It's really useful to update plugins. e.g. The following pkg installs sman and psnpatch at the same time.
    https://www.sendspace.com/file/pm64v9

    The following link is an experimental 'custom' folder to install webMAN MOD (just require reboot after install the pkg)...
    It's not very practical because the installer does more tasks, but it serves to document where the files & folders are installed.
    https://github.com/aldostools/webMAN-MOD/tree/master/_Projects_/updater/custom/dev_hdd0
     
    Last edited: Apr 7, 2019
    esc0rtd3w, pinky, lmn7 and 2 others like this.
  8. 627
    1,025
    222
    lmn7

    lmn7 Developer

    Joined:
    Oct 31, 2017
    Messages:
    627
    Likes Received:
    1,025
    Trophy Points:
    222
    Thank you, I'm really glad you're finding it useful.

    I now have large packages working by processing file data in chunks, the problem is that it's incredibly slow :(. It uses the old crypt function within the script. If anyone knows Python better than I do, could you please share your knowledge to get the pkgcrypt function working with chunks? I'm a total noob when it comes to Python but I'm so close to getting this working!

    Edit: Here is the crypt function (written in C) I am trying to get working with file chunks, the problem is that the data is only encrypted properly when passed as a whole.
    Code:
    #include <Python.h>
    
    static PyObject *sha1_callback = NULL;
    
    static void manipulate(uint8_t *key)
    {
       uint64_t temp = key[0x38] << 56|
          key[0x39] << 48|
          key[0x3a] << 40|
          key[0x3b] << 32|
          key[0x3c] << 24|
          key[0x3d] << 16|
          key[0x3e] <<  8|
          key[0x3f];
       temp++;
       key[0x38] = (temp >> 56) & 0xff;
       key[0x39] = (temp >> 48) & 0xff;
       key[0x3a] = (temp >> 40) & 0xff;
       key[0x3b] = (temp >> 32) & 0xff;
       key[0x3c] = (temp >> 24) & 0xff;
       key[0x3d] = (temp >> 16) & 0xff;
       key[0x3e] = (temp >>  8) & 0xff;
       key[0x3f] = (temp >>  0) & 0xff;
    }
    
    static PyObject* pkg_crypt(PyObject *self, PyObject *args)
    {
       uint8_t *key, *input, *ret;
       int key_length, input_length, length;
       int remaining, i, offset=0;
    
       PyObject *arglist;
       PyObject *result;
    
       if (!PyArg_ParseTuple(args, "s#s#i", &key, &key_length, &input, &input_length, &length))
          return NULL;
       ret       = malloc(length);
       remaining = length;
    
       while (remaining > 0)
       {
          int outHash_length;
          uint8_t *outHash;
          int bytes_to_dump = remaining;
          if (bytes_to_dump > 0x10)
             bytes_to_dump = 0x10;
    
          arglist = Py_BuildValue("(s#)", key, 0x40);
          result  = PyObject_CallObject(sha1_callback, arglist);
          Py_DECREF(arglist);
          if (!result)
             return NULL;
          if (!PyArg_Parse(result, "s#", &outHash, &outHash_length))
             return NULL;
    
          for(i = 0; i < bytes_to_dump; i++)
          {
             ret[offset] = outHash[i] ^ input[offset];
             offset++;
          }
          Py_DECREF(result);
          manipulate(key);
          remaining -= bytes_to_dump;
       }
    
       /* Return the encrypted data */
       PyObject *py_ret = Py_BuildValue("s#", ret, length);
       free(ret);
       return py_ret;
    }
    
    static PyObject *register_sha1_callback(PyObject *self, PyObject *args)
    {
       PyObject *result = NULL;
       PyObject *temp;
    
       if (PyArg_ParseTuple(args, "O:set_callback", &temp))
       {
          if (!PyCallable_Check(temp))
          {
             PyErr_SetString(PyExc_TypeError, "parameter must be callable");
             return NULL;
          }
          Py_XINCREF(temp);           /* Add a reference to new callback */
          Py_XDECREF(sha1_callback);  /* Dispose of previous callback */
          sha1_callback = temp;       /* Remember new callback */
                                      /* Boilerplate to return "None" */
          Py_INCREF(Py_None);
          result = Py_None;
       }
       return result;
    }
    
    static PyMethodDef cryptMethods[] = {
        {"pkgcrypt", pkg_crypt, METH_VARARGS, "C implementation of pkg.py's crypt function"},
        {"register_sha1_callback", register_sha1_callback, METH_VARARGS, "Register a callback to python's SHA1 function, so we don't have to bother with creating our own implementation."},
        {NULL, NULL, 0, NULL}
    };
    
    PyMODINIT_FUNC initpkgcrypt(void)
    {
       (void) Py_InitModule("pkgcrypt", cryptMethods);
    }
    
    
     
    Last edited: Apr 8, 2019
    aldostools and DeViL303 like this.
  9. 556
    863
    172
    ShaolinAssassin

    ShaolinAssassin Developer

    Joined:
    Dec 31, 2016
    Messages:
    556
    Likes Received:
    863
    Trophy Points:
    172
    Gender:
    Male
    Very nice. :)

    Funny enough, I could make a PKG with the DEX settings with your tool - while all others tools gave me an error and let 2 files out of the PKG when I tried.

    Sans-titre-1.png


    ***

    Very small contribution : a ready-to-use custom folder - with the folders structure to install all files that can be installed using PS3Xploit extra tools. Just put your file(s)s in the right folder(s).

    Files locations :

    Coldboot : custom\dev_blind\vsh\resource\coldboot_*.*
    Gameboot : custom\dev_blind\vsh\resource\custom_render_plugin.rco
    TTF-Fonts : custom\dev_blind\data\font\*.TTF
    TTF-Fonts (SONY-CC) : custom\dev_blind\data\font\SONY-CC\*.ttf
    RCO : custom\dev_blind\vsh\resource\*.rco
    SELF (Main VSH Module Directory) : custom\dev_blind\vsh\module\*.self
    SELF (PS1 Emulator) : custom\dev_blind\ps1emu\*.self
    SELF (PS2 Emulator) : custom\dev_blind\ps2emu\*.self
    SELF (PSP Emulator) : custom\dev_blind\pspemu\*.self
    SELF (BD Player) : custom\dev_blind\bdplayer\*.self
    SPRX (VSH Modules) :custom\dev_blind\vsh\module\*.sprx
    SPRX (Internal Library) : custom\dev_blind\sys\internal\*.sprx
    SPRX (External Library) : custom\dev_blind\sys\external\*.sprx
    SSL Cert :custom\dev_blind\data\cert\*.cer
    XMB Wave : custom\dev_blind\vsh\resource\qgl\lines.qrc
    XML (XMB Layout) : custom\dev_blind\vsh\resource\explore\xmb\*.xml

    CEX/DEX settings :

    custom\dev_blind\vsh\etc\index.dat
    custom\dev_blind\vsh\etc\version.txt
    custom\dev_blind\vsh\module\explore_category_game.sprx
    custom\dev_blind\vsh\module\explore_plugin.sprx
    custom\dev_blind\vsh\module\game_ext_plugin.sprx
    custom\dev_blind\vsh\module\nas_plugin.sprx
    custom\dev_blind\vsh\module\sysconf_plugin.sprx
    custom\dev_blind\vsh\resource\explore\xmb\category_game_tool2.xml
    custom\dev_blind\vsh\module\vsh.self
    custom\dev_blind\vsh\resource\sysconf_plugin.rco

    Not tested, but the result PKG is similar to @Louay's so it should work.
     

    Attached Files:

    Last edited: Apr 8, 2019
  10. 627
    1,025
    222
    lmn7

    lmn7 Developer

    Joined:
    Oct 31, 2017
    Messages:
    627
    Likes Received:
    1,025
    Trophy Points:
    222
    Nice one, very useful. I didn't think about the fact that we could use this to swap between CEX/DEX on OFW. Neat.

    If you want to fix the NPDRM error with psn_package_npdrm.exe, just put two NPDRM EBOOT files in the root package folder. They can be named anything as long as the file extension is kept.

    Don't ask me why this works, for some reason psn_package_npdrm.exe can only check and exclude two NPDRM files from the pkg. After that, it doesn't care anymore... LOL.
     
  11. 350
    108
    97
    ayassinsayed

    ayassinsayed Member

    Joined:
    Mar 16, 2018
    Messages:
    350
    Likes Received:
    108
    Trophy Points:
    97
    Gender:
    Male
    Good work , I hope some one to help us to update that python script , i test that script pefore and i found it fail when have large file and also stuck in divide into chunck hope to find some one expert in python!


    Sent from my iPhone using Tapatalk
     
  12. 350
    108
    97
    ayassinsayed

    ayassinsayed Member

    Joined:
    Mar 16, 2018
    Messages:
    350
    Likes Received:
    108
    Trophy Points:
    97
    Gender:
    Male
    Can you pm your moded files please to test it (pkg file)?


    Sent from my iPhone using Tapatalk
     
    Last edited: Apr 8, 2019
  13. 1,900
    1,203
    297
    Louay

    Louay Senior Member

    Joined:
    Jan 23, 2017
    Messages:
    1,900
    Likes Received:
    1,203
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    College Student,GAMING,REPAIRING,XMB Modder
    Location:
    Tunisia
    Home Page:
    Yup it should work as it similair like you will copy those files to dev_flash using ftp or multiman with usb after enable write permission to mount to dev_blind i will test your pkg also and reports back @ShaolinAssassin :)
     
    Last edited: Apr 8, 2019
    Niander466 and DeViL303 like this.
  14. 1,900
    1,203
    297
    Louay

    Louay Senior Member

    Joined:
    Jan 23, 2017
    Messages:
    1,900
    Likes Received:
    1,203
    Trophy Points:
    297
    Gender:
    Male
    Occupation:
    College Student,GAMING,REPAIRING,XMB Modder
    Location:
    Tunisia
    Home Page:
    I will upload to mega when i go back home cause i am study in university right now
     

    Attached Files:

    Niander466 and DeViL303 like this.
  15. 350
    108
    97
    ayassinsayed

    ayassinsayed Member

    Joined:
    Mar 16, 2018
    Messages:
    350
    Likes Received:
    108
    Trophy Points:
    97
    Gender:
    Male
    Did u make any progress to solve slow (Pkgcrypt) ? Could u share your mod script in python that u fix ( file data in chunks)?


    Sent from my iPhone using Tapatalk
     
    Niander466 likes this.
  16. 234
    52
    82
    Ps3_dev

    Ps3_dev Member

    Joined:
    Dec 20, 2017
    Messages:
    234
    Likes Received:
    52
    Trophy Points:
    82
    Gender:
    Male
    It not possible because /dev_hdd0 is ufs-filesystem and usb000 is fat16-filesystem

    I edited code of (mouting usb000 as flash3) to usb000 to hdd0 it working


    I checked ps3dev wiki it tells that hdd0 is ufs but hdd1 is fat so it is not possible to mount usb000as hdd0. But its is possible to mount usb000ashdd1
     
    Niander466 likes this.
  17. 343
    162
    72
    Niander466

    Niander466 Member

    Joined:
    Dec 23, 2017
    Messages:
    343
    Likes Received:
    162
    Trophy Points:
    72
    Gender:
    Male
    Occupation:
    Nurse
    Home Page:
    then would it work?
     
  18. 343
    162
    72
    Niander466

    Niander466 Member

    Joined:
    Dec 23, 2017
    Messages:
    343
    Likes Received:
    162
    Trophy Points:
    72
    Gender:
    Male
    Occupation:
    Nurse
    Home Page:
    Another doubt I have, please forgive me if I'm being a noob, but would it be possible to convert super slims to dex now? lol
     
  19. 627
    1,025
    222
    lmn7

    lmn7 Developer

    Joined:
    Oct 31, 2017
    Messages:
    627
    Likes Received:
    1,025
    Trophy Points:
    222
    I made some progress in the sense that I can now compile the crypt.c file, man that was a huge pain in the ass LOL. But I'm not very familiar with C to be honest, I never learned much about it. I don't know how to modify the code to process chunks instead of all of the data at once. If you know someone good in C, maybe you can show them the code and see what they can do ;)

    My edited Python script is not meant for personal use, it's just a POC to see if what I wanted could be done, and it can. I won't release it as is because it's terribly slow, but I am going to keep working on this.

    What kind of pkg are you making exactly, why is it so large? And how much RAM do you have installed?

    Yep, I already tested this, it will never work due to the file systems being different.
     
    DeViL303 and Niander466 like this.
  20. 8,605
    9,692
    797
    DeViL303

    DeViL303 Developer PSX-Place Supporter

    Joined:
    Jan 23, 2016
    Messages:
    8,605
    Likes Received:
    9,692
    Trophy Points:
    797
    Possible idea - Can your pkg overwrite a folder, with a file? Because if so, you could release a "Block Singstar" pkg that just install the "game" file to dev_hdd0/tmp/explore/ . not sure if it will will work though, in middle of other stuff, but its an idea for someone to check out
     

Share This Page