A script that extracts files from the Vita's firmware.
PsDev has released a new version of his 'Magic Reader for the Vita, adding extraction for the whole Header of PUP.
PS Vita Magic Reader by PsDev, is an useful shell script for those who want to investigate the PS Vita PUP files (Playstation Update Package). This script will give you some basic information about the package header, as well as extract the license file.
Well, he has released a new -minor- update, featuring extraction for the whole Vita Header of PUP.
A while back as a test I made Magic Reader v1 that extracted the Magic (SCEUF), the FW version and license.xml out of the Vita PUP. Well I just added a extraction for the whole Vita Header of PUP.
This script extracts the following:- Magic(SCEUF)
- PUP Version
- License
- Package Version
- Image Version
- File Count
- Header length
- Package length
- A Unknown bit of values 0x50 in length
- FileTable
- HashTable
- HeaderHash
Also later I'll add a FileTable extractor. which is determined by the FileCount.
This is the Linux Script:
Code:
SCRIPT:
#!/bin/bash
# PsDev 2012. this script extract the PUP magic.
#Edit from PsiColio lv1.self extractrion
#just extracts the header info from a vita pup, good for comparison kinda useless atm and most likely always.
# File names to extract from the PUP
Extract=( "Magic" "PUPVersion" "License.xml" "PackageVersion" "ImageVersion" "FileCount" "HeaderLength" "PakageLength" "UNKNOWN" "FileTable" "HashTable" "HeaderHash" )
#length starting from the offset and it ending in the offsets total length
length=( 0x8 0x10 0x724B4 0x8 0x8 0x8 0x8 0x8 0x50 0x20 0x40 0x20) #how many long the file is how much to copy, for example the Magic starts at 0x0 and the length is 0x8 bytes.
#offset of the Magic, Version and License
offset=( 0x0 0x9FF 0xC00 0x8 0x10 0x18 0x20 0x28 0x30 0x80 0x100 0x130 ) #where the file dump begins in the hex.
cont=0
printf "____________________________\n"
printf " PsDev \n"
printf " Magic Reader \n"
printf "____________________________ \n\n"
for file in "${Extract[@]}" #tells it for a file look in Extract = the the file names
do
printf "____________________________ \n"
printf " %s\n" "${file}" #file name
printf "____________________________ \n"
printf "offset= %s\n" "${offset[$cont]}" #tells offset of file
printf "length= %s\n" "${length[$cont]}" #tells total offset length of file
printf "%s\n" "${cont}"
dd if=$1 of=$file bs=1 obs=1 skip=$((${offset[$cont]})) count=$((${length[$cont]}))
cont=$(($cont+1)) # make sure the usage is "./Magic-reader.sh PSP2UPDAT.PUP"
done
And finally, here's how to use it:
- Make a new file named "Magic-reader.sh"
- Run "chmod +x Magic-reader.sh" to give to execution permissions
- Now in terminal run it. "./Magic-reader.sh PSP2UPDAT.PUP" It will output the three files in the folder/location the scripts located in.
You can also download the script from HERE.
NEWS SOURCE #1: Topic #12745 (via) Wololo's Blog
NEWS SOURCE #2: PS Vita Magic Reader 1.1 PSDev (via) PSX-Scene
Our thanks to 'Gauss' for this news item!