Skip to content

Instantly share code, notes, and snippets.

@bisby
Created December 7, 2015 19:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bisby/6d25f1470b7dd2507ad3 to your computer and use it in GitHub Desktop.
Save bisby/6d25f1470b7dd2507ad3 to your computer and use it in GitHub Desktop.
import sys, binascii, string, re
import xml.etree.ElementTree
def decrypt(encoded):
key = 0x398e27fc50276a656065b0e525f4c06c04c61075286b8e7aeda59da9813b5dd6c80d2fb38068773fa59ba47c17ca6c6479015c1d5b8b8f6b9a
output = hex(key^(int(encoded, 16)))
binary_output = binascii.unhexlify(output[2:116]) # needed to drop the 0x at the beginning
return (binascii.b2a_qp(binary_output[0:40]), binascii.b2a_qp(binary_output[40:57]))
def main():
# Find file on your device at "/data/data/com.blizzard.bma/shared_prefs/com.blizzard.bma.AUTH_STORE.xml"
filename = "/home/yourname/backup/authstore.xml"
e = xml.etree.ElementTree.parse(filename).getroot()
serial = e.find('string').text
out = decrypt(serial)
print "Token: ", out[0]
print "Serial: ", out[1]
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment