Esempio n. 1
0
def __saltFunction(string):
    result = ""
    # from classWithGo
    result += str(len(string)) + hashsum._md5hash(string + "stufff...")
    salt13 = str(len(string) * 13)  # from main.initialize
    salt2 = hashsum._md5hash(salt13 + str(len(salt13)) + str(len(string)))
    result += salt2
    characterSum = 0  # calc sum of byte codes in a string
    for i in range(0, len(string)):
        characterSum += (ord(string[i]) & 255)
    result += str(characterSum)
    return result
Esempio n. 2
0
def __saltFunction(string):
    result = ""
    # from classWithGo
    result += str(len(string)) + hashsum._md5hash(string + "stufff...")
    salt13 = str(len(string) * 13)  # from main.initialize
    salt2 = hashsum._md5hash(salt13 + str(len(salt13)) + str(len(string)))
    result += salt2
    characterSum = 0  # calc sum of byte codes in a string
    for i in range(0, len(string)):
        characterSum += (ord(string[i]) & 255)
    result += str(characterSum)
    return result
Esempio n. 3
0
 def calcSig(self,sessionKey, requestId, authKey):
     if hasattr(self,'sig') and isinstance(self.sig,dict) and \
        self.sig.has_key(str(requestId)):
         return hashsum._md5hash(self.sig[str(requestId)])
     with open("sig\\bin\\keys.txt",'wt') as f:
         f.write(" ".join([authKey,str(requestId),sessionKey]))
     cwd = os.getcwd()
     os.chdir("sig")
     subprocess.call(["Run.cmd"])
     os.chdir(cwd)
     with open("sig\\bin\\sig.txt",'rt') as f:
         data=f.read()
         self.sig=eval(data)
         return hashsum._md5hash(self.sig[str(requestId)])
     raise GameError("No sig for %s"%(" ".join([authKey, str(requestId), sessionKey])))
Esempio n. 4
0
 def calcSig(self, sessionKey, requestId, authKey):
     if hasattr(self,'sig') and isinstance(self.sig,dict) and \
        self.sig.has_key(str(requestId)):
         return hashsum._md5hash(self.sig[str(requestId)])
     with open("sig\\bin\\keys.txt", 'wt') as f:
         f.write(" ".join([authKey, str(requestId), sessionKey]))
     cwd = os.getcwd()
     os.chdir("sig")
     subprocess.call(["Run.cmd"])
     os.chdir(cwd)
     with open("sig\\bin\\sig.txt", 'rt') as f:
         data = f.read()
         self.sig = eval(data)
         return hashsum._md5hash(self.sig[str(requestId)])
     raise GameError(
         "No sig for %s" %
         (" ".join([authKey, str(requestId), sessionKey])))
Esempio n. 5
0
def calcAuth(requestId, authKey):
    auth = str(requestId) + authKey
    auth += __saltFunction(auth)
    sig = hashsum._md5hash(auth)
    return sig
Esempio n. 6
0
def calcSig(sessionKey, requestId, authKey):
    sig = sessionKey + str(requestId) + authKey
    sig += __saltFunction(sig)
    sig = hashsum._md5hash(sig)
    return sig
Esempio n. 7
0
def calcCRC(string):
    return hashsum._md5hash(string + __saltFunction(string))
Esempio n. 8
0
def calcAuth(requestId, authKey):
    auth = str(requestId) + authKey
    auth += __saltFunction(auth)
    sig = hashsum._md5hash(auth)
    return sig
Esempio n. 9
0
def calcSig(sessionKey, requestId, authKey):
    sig = sessionKey + str(requestId) + authKey
    sig += __saltFunction(sig)
    sig = hashsum._md5hash(sig)
    return sig
Esempio n. 10
0
def calcCRC(string):
    return hashsum._md5hash(string + __saltFunction(string))
Esempio n. 11
0
def calcSig(sessionKey, requestId, authKey):

    Sig = sessionKey + str(requestId) + authKey
    Sig += __saltFunction(Sig)
    Sig = hashsum._md5hash(Sig)
    return Sig
Esempio n. 12
0
def calcSig(sessionKey, requestId, authKey):

    Sig = sessionKey + str(requestId) + authKey
    Sig += __saltFunction(Sig)
    Sig = hashsum._md5hash(Sig)
    return Sig