PS Vita News       Thread starter PSXHAX       6321       0

PSXHAX

Staff Member
Moderator
Contributor
Verified
To coincide with the official HENkaku developer guide, below is a tutorial on how to compile HENkaku homebrew for PS Vita / PSTV with P***3v3 by kozarovv as follows, to quote:

How to compile Vita/PSTV henkaku homebrew using P***3v3 Tutorial

Simple step by step tutorial to compile henkaku homebrew from available sources. Is not specially useful for devs, they know how to do this, tutorial is for most users that want to have newest available homebrew versions. Or even get not released projects to test them out. Is not only existing way for vita homebrew compilation, but this way have some advancement.

Files in P***3v3 allow you to compile also psl1ght PS3 projects (basically this was main point of P***3, vita *** is additional feature to have everything in one place), or even PS3 $DK projects if PS3 $DK are installed. So instructions should be universal for both platforms VITA/PSTV and PS3. Tutorial will be updated if needed.

Requirements:
Installation:
  • Go to https://github.com/zecoxao/P***3v3 and download needed files. To do that click on "Clone or Download" button and select download ZIP.
  • Extract downloaded file to root of C:\ drive (IMPORTANT THIS NEED TO BE SAME DRIVE THAT YOUR WINDOWS INSTALLATION FOLDER).
Your file tree should now look like
Code:
C:/P***3v3-master/miniGW
  • Rename folder P***3v3-master to P***3v3
  • Go in to C:\P***3v3\MinGW\msys\1.0\ and click on msys.bat This step will create folder with your username in C:\P***3v3\MinGW\msys\1.0\home
  • Close opened cmd window go to C:\P***3v3\MinGW\msys\1.0\ and send msys.bat to desktop (create shortcut)
  • Your setup is Done
Usage:
  • I split usage in to 2 different examples, but every developer is working in his own way so read carefully compilation readme files of project you want to compile because sometime additional steps are needed (vide retroarch).
Basics:
  • Your homebrew source code always going to
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your username>\<homebrew source code folder>
    
    eg. C:\P***3v3\MinGW\msys\1.0\home\psxplace\vitadump-master
  • After starting msys by desktop shortcut you are in
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your username>\
  • To navigate to homebrew folder you need to type cd <homebrew folder>. In some cases you need go deeper, because is important to be in same folder as vita makefile.
Examples:

Vitadump St4rk fork - https://github.com/St4rk/vitadump
  • Download zip file like in P***3v3, and extract into:
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your username>\
  • Now your folder structure should look like:
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your> username\vitadump-master\
  • Open msys using desktop shortcut and navigate to vitadump-master folder.
    Code:
    cd vitadump-master
  • type make, push enter and wait few seconds until compilation is done
    Code:
    make
  • Your vpk file is in
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your> username\vitadump-master\
DeSMune (xerpi edition) - https://github.com/xerpi/desmume-vita
  • Download zip file like in P***3v3, and extract into:
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your username>
  • Now your folder structure should look like:
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your> username\desmume-vita-master\
  • Open msys using desktop shortcut and navigate to desmume-vita-master\src\vita folder.
    Code:
    cd desmume-vita-master/src/vita
  • type make, push enter, and wait until compilation is done
    Code:
    make
  • Your vpk file is in
    Code:
    C:\P***3v3\MinGW\msys\1.0\home\<your> username\desmume-vita-master\
Compiling same project again:

If you want to compile same project but with some changes, etc. You need to remove every previously created files. In most cases is every file with .o extension (some devs using additional folder objs for that, then is simpler. Just remove that folder). You need also delete created vpk, eboot.bin, param.sfo, elf file, velf file. Everything that was created.

Other way, is to just make different folder or rename old one. So if you compiled vitadump then rename it to vitadump-master-old. Or just delete full folder and unzip again new one. Never owerwrite old files by new one (excluding cases when developer recommend this way on his readme).

Troubleshot:

Q: Everything is compiling but vpk file isn't created or i got error 53 or 57.
A: P***3v3 folder need to be in root of C:\ drive, if not you will not get vpk file.

Q: When i type cd desmume-vita-master\src\vita i get error that directory doesn't exist
A: You need to use unix like slash "/" So correct command is cd desmume-vita-master/src/vita

Thanks to:

zecoxao , xxyz, Yifan Lu, Davee, psxdev, Proxima, xerpi, curl team, estwald, everyone who contributed to P***3 project and all homebrew developers.

Note: I'm not developer, i'm just learning this for myself. And I want to share my knowledge now, that's all.

:arrow: How VPK file is working and how to make/edit it (follow-up by kozarovv)

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.

1. Required files
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
Code:
-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 :).

codecode.jpg


:arrow: Also from atreyu187 comes a related VPK guide on: How to Bypass FTP to Transfer VPK Files Faster

To quote: So here is what will be needed.
  • HENKaku exploited Vita/PSTV
  • USB/LAN cable is preferred to achieve maximum speeds but any network connection will work fine
  • CMA manager, qCMA is suggested but OpenCMA will work as well
  • A PSP or PS1 save file
  • molecularShell or Vitashell v0.91 is suggested
  • VPK to install
So for this guide I will be using Crash Team Racing save file. Partly just because Sony has blocked install of this game and I have bypassed that so in your face Sony. Let me play what I paid for and we will be installing my dump of Silent Hill Book of Memories. Anyhow here we go folks this is a really old trick for the Vita back in the heyday of CEF's like ARK & TNV.

Open your save data folder here is mine for example the X's will be replaced by your CMA account ID:
Code:
D:\PS Vita\PSAVEDATA\XXXXXXXXXXXXXXXX\SCUS94426
Now that we have this open we need to move the file(s) we want to transfer here. For example my backup of my cart is named:
Code:
Silent Hill Book of Memories (PCSE00011).VPK
Now We need to rename the file to ICON1.PNG, PIC1.PNG, PIC0.PNG for example or the CMA client will not transfer the data. Mine I renamed to ICON1.PNG as ICON0.PNG was already used. Once your file has been renamed refresh your CMA client database. Then head on over to your system and connect to CMA. Now we need to transfer over our save file containing our VPK's for install. Choose the game you chose to use in my case it was:
Code:
Crash Team Racing SCUS94426
Once the files have transferred and much faster then FTP especially if you were using the USb cable and a Vita or the LAN cable with the PSTV. Then open up molecularShell or VitaShell and navigate to your newly transferred save data found in the PSP EMU folder. Here is my example for you.
Code:
/ux0:/pspemu/PSP/SAVEDATA/SCUS94426
Now we are here lets highlight and rename the file back to its original name or whatever you want so long as the extension has been changed from PNG back to VPK. For example I renamed:
Code:
PIC1.PNG to Silent Hill Book of Memories (PCSE00011).VPK
Then move it out of the SAVEDATA folder to where you keep your VPK's but you can just install from here and delete after install.

I keep all mine in ux0:/_VPK as it will always be the first folder when accessing the partition. Once we have the file transferred and renamed simply install as you would any VPK file. Took me under 2min to transfer Silent Hill via this method at just over 1.2gb which certainly beats FTP.

Hope someone finds this useful till a better method comes along. It seems a bit winded but once you do it once it will only take a few seconds to do after that and you can transfer multiple VPK files so long as they are renamed:
Code:
PIC0.PNG PIC1.PNG PIC2.PNG or ICON0.PNG ICON1.PNG ICON2.PNG
But you get the point and I hope this helps the painful transfer process for some of you.

:arrow: Finally, from Death_Dealer comes a PS Vita VPK Bubble Creator with instructions below, as follows:

Download: VPK_Bubble_Creator.exe (7.65 MB)

This is a quick script i through together, it will extract from a games .VPK what the vita needs to create a bubble and pack that to a minimized .VPK . After the .VPK for bubble creation is installed you will see the game on the (SpringBoard/XMB, im not sure what to call it). You then get the rest of the files that have been extracted and FTP them over. This was tested with Dungeon Hunter alliance and i can confirm the method works.

My reason for making this was i only have a 1gb internal storage for my Vita and i was not able to copy the VPK over then install as the vpk extracted is a little over 1gb and compressed its around 500mbs.

Steps to running this tool,

1. Click the exe and Choose your .VPK

Note: After this process completes you will get a file and a folder.

The file will be the "VPK's name" + "-Create_Bubble.VPK", The folder will be the name of the VPK.

2. Connect your Vita through FTP and copy over the -Create_Bubble.VPK

3. Run the VPK on your Vita

4. Copy the contents of the created folder to "ux0:app/(GAMEID)"

5. Run the game :)

Just thought id throw this out there.. First tool of mine i have decided let loose upon the world :)

-Death_Dealer
 
Recent Articles
Dishonored: Definitive Edition 60 FPS Mod PS4 PKG by Wastelander121
Following their Batman: Arkham Knight Free Roam Mod Menu port, today @Wastelander121 (YouTube Channel) released on Twitter a Dishonored: Definitive Edition 60 FPS Mod PS4 PKG (CUSA-02230) for...
PS4 System Software / Firmware 6.72 Released, Don't Update!
Just over a month ago Sony released a PS4 OFW 6.71 Update followed by a few 6.80 Beta Updates for those in their PlayStation Preview Program, and today another PS4 System Software / Firmware 6.72...
PCSX-R Emulator PS4 Port Crash Bandicoot & Resident Evil PSOne Demos
Since the mGBA Emulator PS4 port and Yabause Sega Saturn Emulator PS4 port, PlayStation 4 homebrew developer Znullptr worked on a PCSXR (CodePlex Archive) PS4 port of the PlayStation emulator...
PS4 Puzzle Platformer Etherborn Shifts Onto PlayStation 4 Next Week
Last month we saw a MGS HD Remake made in Dreams on PlayStation 4, and in similar fashion comes an elegant leap in the gravity-puzzle genre... environmental puzzle platformer known as Etherborn...
Top