Poor local data verification for Online card games leads to serious damage to game balance online games becoming single-host

Source: Internet
Author: User

This bug can modify the game data of all android ios versions, and infinitely enhance itself to weaken the enemy. Using this bug, there is no difference in using this online game.
Local Data aes encryption, the following code does not provide network verification during the combat process. The main function of the code below is to decrypt the game data and modify it. After two encryption operations are completed, the game data file can be directly overwritten to achieve the goal of modifying the game at will,

from Crypto.Cipher import AESfrom Crypto import Randomimport osdef walk_dir(dirs):    for root,dirs, files in os.walk( dirs ):        for f in files:            file_path = os.path.join( root,f )            file_path='%s'%file_path            file_md5 = f                        if file_path.endswith('.s') or file_path.endswith('.c'):                encryptorDZM(file_path,file_path+'encry')                try:                    encryptorDZM(file_path,file_path+'encry')                except:                    print 'error at %s' % file_pathdef encryptorDZM(filein, fileout):    key = "2IG'csN3B:R)l*?roi*zlkjRikfZ/fax"    mode = AES.MODE_CBC    encryptor = AES.new(key, mode,'0000000000000000')    fhandle = open(filein,'rb')    cryptorbuffer  = fhandle.read()    fhandle.close()    decryptorbuffer = encryptor.decrypt(cryptorbuffer)    fwritehandle = open(fileout,'w+b')    fwritehandle.write(decryptorbuffer)    fwritehandle.close()def fuckDZM(filein, fileout):    key = "2IG'csN3B:R)l*?roi*zlkjRikfZ/fax"    mode = AES.MODE_CBC    encryptor = AES.new(key, mode,'0000000000000000')    fhandle = open(filein,'rb')    cryptorbuffer  = valueFuck(fhandle.read())    cryptorbuffer = valueFuck2(cryptorbuffer)    cryptorbuffer = valueFuck3(cryptorbuffer)    fhandle.close()    decryptorbuffer = encryptor.encrypt(cryptorbuffer)    fwritehandle = open(fileout,'wb')    fwritehandle.write(decryptorbuffer)    fwritehandle.close()def makefakestr(strin):    strout = ' 1'    while 1:        if len(strin) > len(strout):            strout = strout+' '            #makefakestr(strout)        else:            return stroutdef valueFuck3(buffervalue):    valueindex = buffervalue.index(r'"magic":')    print buffervalue[valueindex+len(r'"magic":'):].split(',')[0]    valuelist = buffervalue.split(r'"magic":')    fuckbuffer = buffervalue    for valuesig in valuelist:        #if len(valuesig.split(',')[0]) < 6:                    print r'"magic":'+valuesig.split(',')[0]        print r'"magic":'+makefakestr(valuesig.split(',')[0])        fuckbuffer =  fuckbuffer.replace(r'"magic":'+ valuesig.split(',')[0],r'"magic":'+makefakestr(valuesig.split(',')[0]))    print len(fuckbuffer)    print len(buffervalue)    return fuckbufferdef valueFuck2(buffervalue):    valueindex = buffervalue.index(r'"attack":')    print buffervalue[valueindex+len(r'"attack":'):].split(',')[0]    valuelist = buffervalue.split(r'"attack":')    fuckbuffer = buffervalue    for valuesig in valuelist:        #if len(valuesig.split(',')[0]) < 6:                    print r'"attack":'+valuesig.split(',')[0]        print r'"attack":'+makefakestr(valuesig.split(',')[0])        fuckbuffer =  fuckbuffer.replace(r'"attack":'+ valuesig.split(',')[0],r'"attack":'+makefakestr(valuesig.split(',')[0]))    print len(fuckbuffer)    print len(buffervalue)    return fuckbufferdef valueFuck(buffervalue):    valueindex = buffervalue.index(r'"health":')    print buffervalue[valueindex+len(r'"health":'):].split(',')[0]    valuelist = buffervalue.split(r'"health":')    fuckbuffer = buffervalue    for valuesig in valuelist:        #if len(valuesig.split(',')[0]) < 6:                    print r'"health":'+valuesig.split(',')[0]        print r'"health":'+makefakestr(valuesig.split(',')[0])        fuckbuffer =  fuckbuffer.replace(r'"health":'+ valuesig.split(',')[0],r'"health":'+makefakestr(valuesig.split(',')[0]))    print len(fuckbuffer)    print len(buffervalue)    return fuckbufferif __name__ == '__main__':     #valueFuck(open(r'E:\DZMipad\91_release.app\release\176\f3692980f34eb0438348faeaae0ae0c90094B0.cencry').read())    walk_dir(r'E:\DZMipad');    filefuck = open(r'E:\DZMipad\jianghu.txt')        for filename in filefuck:        infile = r'E:\DZMipad\release' + '\\' + filename.replace('/','\\')[:-1] + 'encry'        outfile = infile + '.fuck'        print infile        print outfile        #fuckDZM(infile,outfile)                try:            fuckDZM(infile,outfile)        except:            pass

 

  Solution:

Enhance network verification, and wish the big hole door better and better.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.