import c4d
import hashlib
def licgen():
        
    sn1 = c4d.GeGetSerialInfo(c4d.SERIALINFO_CINEMA4D)
    sn2 = sn1['nr']
    snNr = sn2[-5:]
    digAuth = hashlib.sha224(snNr+"8a3e7ffb99de159312fa690c988de40e45ade78a57b61a992dad97db").hexdigest()
    digSer = hashlib.sha224(digAuth+"93664e868fa9cb1a5cd1ee6716507ed04e7b0967fde44d0827cffb3c").hexdigest()
    c4d.CallCommand(12305)
    c4d.CallCommand(13957)
    print '            Copy the serial and paste into the Auth Dialog:'
    print digSer

if __name__ == "__main__":
    licgen()