Last active
June 16, 2023 19:59
-
-
Save Zer0xFF/d94818f15e3e85b0b4d48000a4be1c73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import binascii | |
import hashlib | |
import hmac | |
import sys | |
def GetHash(GameID): | |
byte_key = binascii.unhexlify('AD62E37F905E06BC19593142281C112CEC0E7EC3E97EFDCAEFCDBAAFA6378D84') | |
hash = hmac.new(byte_key, 'np_%s' % GameID, digestmod=hashlib.sha256) | |
return hash.hexdigest() | |
def main(argc, argv) : | |
if argc < 2: | |
print('Usage : %s GameID [...]' % argv[0]) | |
return 1 | |
GameIDs = iter(argv) | |
next(GameIDs) | |
for GameID in GameIDs: | |
if len(GameID) != 9: | |
print('Invalid GameID: %s' % GameID) | |
continue | |
hash = GetHash(GameID) | |
print('GameID: %s' % GameID) | |
print(' Hash: %s' % hash) | |
print(' Update XML: https://gs-sec.ww.np.dl.playstation.net/plo/np/%s/%s/%s-ver.xml' % (GameID, hash, GameID)) | |
print('') | |
if __name__=='__main__': | |
sys.exit(main(len(sys.argv), sys.argv)) |
thanks update the script. (I've kept the binascii import as I prefer it this ya)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://pastebin.com/Y2mN1tRx I went ahead and cleaned it up a bit and standardized it to work with python 2 and 3 :)