[TIP]How VPK file is working and how to make/edit it

Discussion in 'Tutorials & Guides' started by kozarovv, Aug 13, 2016.

  1. 7,284
    5,320
    847
    kozarovv

    kozarovv Super Moderator

    Joined:
    Nov 8, 2014
    Messages:
    7,284
    Likes Received:
    5,320
    Trophy Points:
    847
    Home Page:
    If you know what is henkaku, then you know what is a vpk file, for end-user is kind of windows .exe installer but used for vita/pstv. Is "Vita PacKage" that can be used on henkaku exploit. Is using param.sfo to obtain install location for extracted files. Superior to pkg file is that you can install it using public available homebrew on retail console. Inferior is that you can't force different locations than ux0:/app/ folder (for now, but is just case of homebrew installer developer to implement this). Also important feature is that vpk install is calling same function as pkg at the end of process, so when is installed app will be added to live area like psn game or app. No need to do anything more like cma transfer or rebuilding database. First I wanted to write tutorial how to make vpk using vita-pack-vpk.exe, but then i realized there is no reason to do that. You are dev so you need to know that basic, you are not a dev? Modding should be enough for you. Is not tutorial, is just tip for modders.

    vpk-logo-preloader.png


    1. Required files

    - 7-zip - http://www.7-zip.org/
    - SFO Editor - https://sites.google.com/site/theleecherman/sfoeditor (HxD also can do simplest job for you)
    - Template VPK file - Your choice, best if file have included all icons, backgrouds, etc. So you can just exchange them (http://www.psx-place.com/resources/categories/henkaku-homebrew.32/)

    2. Extracting param.sfo

    - Right click on VPK file and select open using...
    - Select 7-zip
    - Extract param.sfo from /sce_sys/ folder

    3. Editing param.sfo

    - Open SFO Editor
    - Click File, then select Load. And choose your param.sfo
    - Now you should see lot of parameters loaded into program. Don't mess with them too much, interesing for us is TITLE_ID - Folder where app will be installed, TITLE Name visible in info tab (triange, triangle on icon) STITLE - Name visible in livearea.
    - If you want just to add files or folders to existing homebrew without changing installation folder, eg. Roms for retroarch, you don't need to touch that
    - Main point is that what you write as a TITLE_ID parameter because vitashell (molecularshell) using this parameter as a installation location. eg TITLE_ID KOZA_ROVV - vpk file will be extracted/installed in to ux:/app/KOZA_ROVV/<files/folders here>


    4. Overwriting files into VPK

    - Now when you edited param.sfo (or not, and you just want to add files/folders). Go to VPK file you want to edit
    - Open it using 7-zip
    - Files that you will see (root of vpk archive) is file structure that will be extracted into directory specified in param.sfo title_id. So If you add files to root of archive then you will get them on vita in to ux:/app/<title_id>/<your files/folders>
    - Every file here can be exchanged, eboot.bin (main executable), param.sfo (if you want to change install location or remove blacklist for pstv (coming soon)). Icons, background, additional files. EVERYTHING.
    - Is just important to not exctract archive but operating on its window by drag'n'drop method
    - And of course when you adding files in case when you modded then you will be asked to overwrite them, hope is clear you need to answer yes :)

    5. That's all?

    - Yes your file is modified in "real-time" so just close 7-zip, but if you will be asked to save or overwrite vpk file (maybe on older 7-zip versions?) Then confirm overwriting.
    -Transfer vpk file like, install, have fun.

    6. Additional info

    - Most important files in VPK

    -example.vpk
    -- eboot.bin - Main executable, file that will be loaded first when launched from live area.
    - /sce_sys/
    -- param.sfo - For vpk script is file that inform where to install app, but is also used later on vita/pstv for some basics. You can read more here: http://www.vitadevwiki.com/index.php?title=System_File_Object_(SFO)_(PSF) File is taking care of displayed application name, version, data type, and that game/app can be launched on pstv. And many more.
    -- icon0.png
    -- pic0.png
    - /livearea/contents/
    -- bg0.png
    -- default_gate.png
    As you can see above are pic files that will be displayed in live area or during game/app start. But this location have one more file.
    -- template.xml more info will be added (my knowledge here is not too big), but for now i know that file is kind of instruction how app screen will be look in to live area:

    Template:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    
    <livearea style="a1" format-ver="01.00" content-rev="3">
    
        <livearea-background>
            <image>bg0.png</image>
        </livearea-background>
    
        <title color="#94bd5cff"/>
    
        <gate>
            <startup-image>default_gate.png</startup-image>
        </gate>
    
    </livearea>
    
    More: http://www.vitadevwiki.com/index.php?title=Template.xml

    - Licence file?

    I have no idea that henkaku in this case is using fixed key (looking that is, but i'm not smart enough to confirm that) or is generating something, but after install licence file for your TITLE_ID will be created in ux0:/licence/app/<game id used to install>/.

    Way of working that is simple (from user side..), after install custom file is generated to allow run app, but don't go happy too much. File is "whitelisted" by henkaku to allow launching homebrew. But you can't run backup this way, original game files have "hard coded" (going user friendly language here) original algorithms (similar to ps3 rap to rif) that generate licence using idps and psid and something more (not important here). Point is that, your homebrew, even with additional files will be allowed to run. Bravo to Molecular Team here!

    7. Will be added.

    - Nothing conctrete here, is 4:00am here, so probably some improvements/bug fixes will be added later.

    8. Important!

    Many users appreciates my ps3 knowledge here on psx-place, is not a secret that my teachers are reachable on psdeviki.com address. Now when Vita scene is growing up is time to give back what we can to contribute that database of knowledge. Please contribute to http://www.vitadevwiki.com/index.php?title=Main_Page in any possible way.

    Thanks goes to Molecular Team, LMAN, TheFlow, everyone involved into Vita scene. And many people that I forget to add :).
     
    Last edited: Aug 14, 2016
    barelynotlegal, ed89, Sdw100 and 5 others like this.
  2. 4,704
    2,045
    397
    atreyu187

    atreyu187 Wanna-BeTA Tester Moderator

    Joined:
    Sep 29, 2014
    Messages:
    4,704
    Likes Received:
    2,045
    Trophy Points:
    397
    Gender:
    Male
    Occupation:
    MCU/Sony Enthusiast!
    Location:
    127.0.0.1
    Home Page:
    Awesome write up man. You always bring quality work to the table without any cookiecutter BS just to the point with the facts and how to achieve your desired end results. Always love your write ups man I truly do its awesome to have you on our site/team. We have come a long way from the Dreamcast/PS1 days.
     
  3. 10,230
    3,962
    472
    pinky

    pinky Bitsiboo's Other Half Developer

    Joined:
    Mar 8, 2015
    Messages:
    10,230
    Likes Received:
    3,962
    Trophy Points:
    472
    Gender:
    Male
    Location:
    The Great Gig in the Sky
    @kozarovv , needs dev status if he doesn't already have it. he always makes knowledgeable posts.
     
    Sdw100, STLcardsWS, atreyu187 and 2 others like this.
  4. 7,284
    5,320
    847
    kozarovv

    kozarovv Super Moderator

    Joined:
    Nov 8, 2014
    Messages:
    7,284
    Likes Received:
    5,320
    Trophy Points:
    847
    Home Page:
    Thank you :)


    Thank you @pinky but more I learned, less i feel developer. They are far away from me in "doing this stuff".
     
    STLcardsWS, atreyu187 and pinky like this.
  5. 10,230
    3,962
    472
    pinky

    pinky Bitsiboo's Other Half Developer

    Joined:
    Mar 8, 2015
    Messages:
    10,230
    Likes Received:
    3,962
    Trophy Points:
    472
    Gender:
    Male
    Location:
    The Great Gig in the Sky
    well, I think that a developer is someone who expands upon their knowledge of a particular system. u've definitely learned a lot about the vita in a very short time.
     
  6. 158
    43
    57
    chronoss

    chronoss Member

    Joined:
    Aug 19, 2016
    Messages:
    158
    Likes Received:
    43
    Trophy Points:
    57
    Gender:
    Male
    anyone know how to replace the icon0.png ?
     
  7. 7,284
    5,320
    847
    kozarovv

    kozarovv Super Moderator

    Joined:
    Nov 8, 2014
    Messages:
    7,284
    Likes Received:
    5,320
    Trophy Points:
    847
    Home Page:
    Welcome on forum. Needed info is in point 4 of tutorial above. ;)

    PS. I edited your signature as we don't allow here for selling IDPS (and kV's) this including linking to sites that are doing this. Please read our forum rules, and enjoy our community. :)
    http://www.psx-place.com/threads/site-rules-guidelines.79/
     
    bitsbubba likes this.
  8. 158
    43
    57
    chronoss

    chronoss Member

    Joined:
    Aug 19, 2016
    Messages:
    158
    Likes Received:
    43
    Trophy Points:
    57
    Gender:
    Male
    ok, sorry for that :(
     
  9. 2
    0
    5
    timmeh

    timmeh Forum Noob

    Joined:
    Mar 22, 2019
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    I it possible to make a utorrent vpk app that works for ps vita?
     

Share This Page