#!/usr/bin/python
import sys, struct

## "LuCiFeR's First C++ Crackme" Keygen
## Made by Exorcist // 4f42cc19f786819342ba12bd475ccdc37a5ecf1d

name = raw_input("Please enter your name here:")
def generator(name):
        x = hex(len(name)*0x875cd*0x51eb851f)
        x1 = str(x)
        x2 = x1[:-8]
        x3 = hex(int(x2,16) >> 5)
        x4 = hex(int(x3,16)*0xfffffc90)
        x5 = float(int('0x'+x4[-8:],16))

        x6 = struct.pack('<d',x5)       #see https://docs.python.org/3/library/struct.html
        x7 = hex(struct.unpack('<Q',x6)[0])
        x8 = x7[-8:]
        x9 = struct.unpack('>i',x8.decode('hex'))[0]
        result = str(x9)+'-x019871'
        print "Serial is: "+result
generator(name)


###
https://docs.python.org/3/library/struct.html
http://stackoverflow.com/questions/28187880/how-to-convert-decimal-floating-point-to-64-bit-hexadecimal-using-ieee-754-float

