Advertising (This ad goes away for registered users. You can Login or Register)

Calculating title update download links with HMAC key

Open discussions on programming specifically for the PS Vita.
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
X-death
Posts: 86
Joined: Sun Nov 16, 2014 1:37 pm

Re: Calculating title update download links with HMAC key

Post by X-death »

reprep wrote:This means it is possible to create URL links for any game/app update .pkg with Game ID, right? So we can download the missing update .pkg files of PSM etc.?
Is it really possible ?
Even if the update flag is permanently set ?
Advertising
Playstation TV PSNOVA JAP 3.60 Henkaku
diesel701
Posts: 67
Joined: Wed Dec 19, 2012 11:13 am

Re: Calculating title update download links with HMAC key

Post by diesel701 »

Thanks for this app Proxima! :)

Anyway, the app made by cfwprophet need to lower the "unique" characters ;)
The one made from tomtomdu80 is working well, but if you want a better GUI, the cfwprophet version is very good: LINK.

Proxima, this tool can be used to find only update files or also the normal pkgs?
Thansk again!
Advertising
Proxima
Guru
Posts: 47
Joined: Mon Jan 03, 2011 2:38 pm

Re: Calculating title update download links with HMAC key

Post by Proxima »

diesel701 wrote:Thanks for this app Proxima! :)

Anyway, the app made by cfwprophet need to lower the "unique" characters ;)
The one made from tomtomdu80 is working well, but if you want a better GUI, the cfwprophet version is very good: LINK.

Proxima, this tool can be used to find only update files or also the normal pkgs?
Thansk again!
This is only for how the vita downloads updates, not original pkg files.
Luro02
Posts: 2
Joined: Sun Jul 30, 2017 10:17 am

Re: Calculating title update download links with HMAC key

Post by Luro02 »

Hey,

I am trying for nearly 5 hours now to get this dang hmac_sha256 function working but everything errors and I don't know what to do now.
Proxima's Link hasn't all Dependencies in the Repository and other Dependencies don't work.
Has somebody a working Source Code ? (maybe on Github)
I don't want a compiled Version because I am working on a bigger Project with NoNPDRM Dumps where I have to batch check for Updateds :D .....

Greetings Lucas
noname120
Developer
Posts: 777
Joined: Thu Oct 07, 2010 4:29 pm

Re: Calculating title update download links with HMAC key

Post by noname120 »

Last edited by noname120 on Thu Oct 19, 2017 7:46 am, edited 1 time in total.
Funny stuff
<yifanlu> I enjoy being loud and obnoxious
<yifanlu> rooting an android is like getting a hooker pregnant
<xerpi> I sometimes think I should leave all this stressing **** and be a farmer instead
mmozeiko
Posts: 1
Joined: Wed Oct 18, 2017 8:23 pm

Re: Calculating title update download links with HMAC key

Post by mmozeiko »

Luro02 wrote:Has somebody a working Source Code ? (maybe on Github)
Here's a Python script I wrote few days ago: https://gist.github.com/mmozeiko/4f868c ... b5a80da952
Examples:

Code: Select all

$ python get_update_pkg.py patch PCSB00786
Name: STF Ultra
Patch: http://gs.ww.np.dl.playstation.net/ppkg/np/PCSB00786/PCSB00786_T1/de17f818a05071b2/EP2003-PCSB00786_00-SUPERTIMEFORCEUL-A0102-V0100-5bd071fb2ba4d4718223a2ac7d621d81986b0248-PE.pkg
Version: 1.02
FW: 3.52
Size: 69046176

$ python get_update_pkg.py patch PCSE00491
None

$ python get_update_pkg.py latest PCSE00491
Name: Minecraft: PlayStation®Vita Edition
Patch: http://gs.ww.np.dl.playstation.net/ppkg/np/PCSE00491/PCSE00491_T56/6e9f5f7ad0e40815/UP4433-PCSE00491_00-MINECRAFTVIT0000-A0157-V0100-bb616dca2eb6637d4c388aca98ce16adb587c120-PE.pkg
Version: 1.57
FW: 3.65
Size: 964788064
Basically "patch TITLEID" will return info about latest patch that works on 3.60 or "None" if patch doesn't exist or requires 3.61+. "latest TITLEID" will return info about latest patch, including one that potentially requires 3.61+ fw version.
Luro02
Posts: 2
Joined: Sun Jul 30, 2017 10:17 am

Re: Calculating title update download links with HMAC key

Post by Luro02 »

Thanks a lot :)
TD2
Posts: 9
Joined: Sat Mar 24, 2018 9:06 pm

Re: Calculating title update download links with HMAC key

Post by TD2 »

Enhanced mmozeiko's Python script a little bit: https://gist.github.com/windsurfer1122/ ... df21d91a53

Enhancements:
  • When using the script in automated scripts then error messages on stdout can be harmful for further processing. Therefore implemented eprint() for error messages.
  • Some titles have new lines in their string. Therefore used replace() on name retrieval.
  • Added command "nps" to output TSV lines for NPS database including XML URL and SHA1.
  • Renamed "info" command to "xml" as it fits better and is easier to remember. Also fixed a crash in this routine when no update is available.
  • Allow to calculate hash with PSV key for any given value (currently SHA256, SHA1, MD5).
  • Display help whenever the parameters are not right.
Update 2018-03-26:
  • Added RIPEMD-160 for hashing
Other interesting links:
https://github.com/ajinabraham/python-h ... calculator
Last edited by TD2 on Mon Mar 26, 2018 8:18 pm, edited 4 times in total.
TD2
Posts: 9
Joined: Sat Mar 24, 2018 9:06 pm

Re: Calculating title update download links with HMAC key

Post by TD2 »

Btw does anyone know what the hashes in the update package URLs are?

Example URL:
http://gs.ww.np.dl.playstation.net/ppkg ... H00242_T6/650e9d8042dd5a01/HP0700-PCSH00242_00-GGGENESISPSVEN00-A0101-V0100-d20e9a97cca6e1082b6e6c2073411ba8181a52ac-PE.pkg
  • 650e9d8042dd5a01 (64-bit/16 chars) = ?
  • d20e9a97cca6e1082b6e6c2073411ba8181a52ac (160-bit/40 chars) = ?
Related XML from http://gs-sec.ww.np.dl.playstation.net/ ... 42-ver.xml

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<titlepatch status="alive" titleid="PCSH00242">
	<tag name="PCSH00242_T6" signoff="true">
		<package version="01.01" size="14822736" sha1sum="C0CF71FA4BDECFF01B28C5E79215F8767655876D" url="http://gs.ww.np.dl.playstation.net/ppkg/np/PCSH00242/PCSH00242_T6/650e9d8042dd5a01/HP0700-PCSH00242_00-GGGENESISPSVEN00-A0101-V0100-d20e9a97cca6e1082b6e6c2073411ba8181a52ac-PE.pkg" psp2_system_ver="56688640" content_id="HP0700-PCSH00242_00-GGGENESISPSVEN00" type="cumulative"/>
		<package version="01.02" size="549112960" sha1sum="F2DA277AB73EF0FA4C17B05F120FBC1E1819B518" url="http://gs.ww.np.dl.playstation.net/ppkg/np/PCSH00242/PCSH00242_T6/650e9d8042dd5a01/HP0700-PCSH00242_00-GGGENESISPSVEN00-A0102-V0100-86eb73077a1dd120b1837fa904753243bec716b9-SP-PE.pkg" psp2_system_ver="56688640" content_id="HP0700-PCSH00242_00-GGGENESISPSVEN00" type="incremental"/>
		<package version="01.03" size="650214992" sha1sum="B7091F7220EA0D897CD7EA4E41A2502E683D7224" url="http://gs.ww.np.dl.playstation.net/ppkg/np/PCSH00242/PCSH00242_T6/650e9d8042dd5a01/HP0700-PCSH00242_00-GGGENESISPSVEN00-A0103-V0100-7960f36e030c038cc40c2fa13751de29fc4eca2b-SP-PE.pkg" psp2_system_ver="56688640" content_id="HP0700-PCSH00242_00-GGGENESISPSVEN00" type="incremental"/>
		<package version="01.04" size="517676576" sha1sum="573C829FAC96C57E59D34D04A902DC4DF4316BE8" url="http://gs.ww.np.dl.playstation.net/ppkg/np/PCSH00242/PCSH00242_T6/650e9d8042dd5a01/HP0700-PCSH00242_00-GGGENESISPSVEN00-A0104-V0101-9d9f74bcd23ff52a9e525bccaad93f5a86c5dfd9-SP-PE.pkg" psp2_system_ver="56688640" content_id="HP0700-PCSH00242_00-GGGENESISPSVEN00" type="incremental"/>
		<package version="01.05" size="518106736" sha1sum="A37D811D42C8D7CB579ABF959CBA760BE7B4E58B" url="http://gs.ww.np.dl.playstation.net/ppkg/np/PCSH00242/PCSH00242_T6/650e9d8042dd5a01/HP0700-PCSH00242_00-GGGENESISPSVEN00-A0105-V0100-29921d61b1c7cfbc6ca82891ad93cb1b4d09e793-SP-PE.pkg" psp2_system_ver="56688640" content_id="HP0700-PCSH00242_00-GGGENESISPSVEN00" type="incremental">
			<hybrid_package size="1719059920" sha1sum="265D55A2AEBC3E5DC88C258851209E6CC35DC0D5" url="http://gs.ww.np.dl.playstation.net/ppkg/np/PCSH00242/PCSH00242_T6/650e9d8042dd5a01/HP0700-PCSH00242_00-GGGENESISPSVEN00-A0105-V0100-48a0a8885540405c5879a358df82804b0dd0e1c7-PE.pkg" content_id="HP0700-PCSH00242_00-GGGENESISPSVEN00"/>
			<paramsfo>
				<title>SD GUNDAM G GENERATION GENESIS</title>
			</paramsfo>
			<changeinfo url="http://gs.ww.np.dl.playstation.net/ppkg/np/PCSH00242/PCSH00242_T6/0105/650e9d8042dd5a01/changeinfo.xml"/>
		</package>
	</tag>
</titlepatch>
The hashes are even changing for each new update.

Example:
PCSG00752 "Touhou Soujinengi V" (JP) Update V1.04 (FW 3.57) to Update V1.05 (FW 3.65)
h ttp://gs.ww.np.dl.playstation.net/ppkg/np/PCSG00752/PCSG00752_T8/30fe8ef0c2a765dd/JP0704-PCSG00752_00-ICHIGO00BOSE0007-A0104-V0100-2e29a36393d92a955daa8f3c444efb191acdb55e-PE.pkg
h ttp://gs.ww.np.dl.playstation.net/ppkg/np/PCSG00752/PCSG00752_T9/5a8c036dc7a6da9d/JP0704-PCSG00752_00-ICHIGO00BOSE0007-A0105-V0101-eb2ab78124f175a23cbd6a0bf6108eb5f3c6ff78-PE.pkg
raraslopcsw
Posts: 2
Joined: Tue Aug 20, 2019 9:22 am

Re: Calculating title update download links with HMAC key

Post by raraslopcsw »

ANU815 wrote: Mon Aug 31, 2015 2:56 am Not all of us are worrying about that pool game. Especially those of us stubbornly holding onto 3.18. If I interpret correctly, does this mean we may be able to update our games without updating firmware? Using these custom direct links and package manager?
all you would need to do is set up a router to search for a specific https connection, and reroute it to another site, or better yet, your own home server with the files you need.
Locked

Return to “Programming and Security”