#!/usr/bin/env python# -*- coding: utf-8 -*-importbinascii#Change it to Your IMEI, and pad zeroimeistr='3520710681329890'imei=bytearray(8)i=0whilei<16:imei[i/2]=int(imeistr[i+1])*16+int(imeistr[i])i=i+2print(binascii.hexlify(imei))table='\x16\xE5\xF4\xD1\xE8\x6A\x42\x00'result=bytearray(12)i=0whilei<8:result[i]=imei[i]^ord(table[i])i=i+1result[8]=0x74result[9]=0x79result[10]=(result[0]+result[2]+result[4]+result[6]+result[8])&0xFF;result[11]=(result[1]+result[3]+result[5]+result[7]+result[9])&0xFF;print(binascii.hexlify(result))padding='\xE9\x1A\x0B\x2E\x17\x95\xBD\x0F\x8B\x86\x53\x72'MP0B_001=result*2+padding*8print(binascii.hexlify(MP0B_001))withopen('MP0B_001','w')asf:f.write(MP0B_001)
MT6589 padding = '\x54\x5F\x90\xD0\xE0\xE1\x65\x4A\xAA\x74\xD3\xCE'
IMEI = 'C3 20 7B 0F 0D 3E 0D BD 55 8B AD B5' or 'C3 A2 4A 0F 1F 3D E9 4C AA 74 BF AE'