Dhaka Mobile

up one lever   Dhaka Mobile > Other Gsm/Mobile Related Forums > GSM Programming & Reverse Engineering

GSM Programming & Reverse Engineering Here you can post all Kind of GSM Programming and Reverse Engineering tools and Secrets.

Need forum moderator for managing this forum. Apply Here
Reply Post New Thread
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-19-2014, 20:33   #1 (permalink)
Administrator
 
Mentor's Avatar
 
Join Date: May 2013
Posts: 262
Status: Offline
Thanks: 625
Thanked 68 Times in 39 Posts
ALGO for zte unlock Here

hi to all :
algo for zte unlocking here :

PHP Code:
import hashlibgetoptsys

magic 
= [688950000000]


def usage():
    print 
"Options: -i*, --imei=*      IMEI of the device"
    
print ""
    
print "Example: zte-unlock.txt --imei=351234567891239"
    
print ""

def testIMEIChecksum(digits):
    
_sum 0
    alt 
False
    
for d in reversed(digits):
        
assert 0 <= <= 9
        
if alt:
            
*= 2
        
if 9:
            
-= 9
        _sum 
+= d
        alt 
not alt
    
return (_sum 10) == 0

def checkIMEI
(imei):
    
digits = []
    if 
len(imei) != 15:
        print 
"IMEI too short/long"
        
return False
    
for i in imei:
        
digits.append(int(i))
    if 
not testIMEIChecksum(digits):
        print 
"IMEI checksum invalid"
        
return False
    
return True

def getCode
(imei):
    
digits = []
    
nck ""
    
spck ""
    
crosssum 0
    
for i in imei[3:15]:
        
digits.append(int(i))
    for 
i in digits:
        
crosssum += i
    
for i in range(0,len(digits)):
        
code = (digits[i]*crosssum digits[11-i]*magic[i]) % 10
        nck 
+= "%d" code
        spck 
+= "%d" % ((code digits[11-i]) % 10)
    return (
nckspck)

def main():
    
info()
        try:   
                
optsargs getopt.getopt(sys.argv[1:], "hi:", ["help""imei="])
        
except getopt.GetoptErrorerr:
                print 
str(err# will print something like "option -a not recognized"
                
usage()
                
sys.exit(2)

    
imei ""
    
interactive False

        
for oa in opts:
                if 
o in ("-i""--imei"):
                        
imei a
                elif o in 
("-h""--help"):
                        
usage()
                        
sys.exit()

    if 
imei == "":
        
imei raw_input("Please enter the IMEI of the device:  ")
        
interactive True

    
if checkIMEI(imei):
        
nckspck getCode(imei)
        print 
""
        
print "Network Control Key (NCK):            " nck
        
print "Service Provider Control Key (SPCK):  " spck
        
print "done."

    
if interactive:
        
raw_input()
    
if 
__name__ == "__main__":
    
main() 

  Reply With Quote
Old 01-19-2014, 20:33   #2 (permalink)
Administrator
 
Mentor's Avatar
 
Join Date: May 2013
Posts: 262
Status: Offline
Thanks: 625
Thanked 68 Times in 39 Posts
here my code in c# (badly coded) u can optimize it by using functions !!

PHP Code:
bool a false;             //ZTE             //-----------------             if (comboBox2.SelectedIndex == 0)             {                 string imei = ""; char d = 'n'; int s1 = 0; int s2 = 0; int s3 = 0; int s = 0;                 string imei1 = ""; string stp1 = ""; string stp11 = ""; string stp2 = ""; string imei2 = "";                 string stp22 = ""; string stp222 = ""; string stp3 = ""; string NCK = ""; string SPCK = ""; string sp = "";                 string ml = "688950000000";                  imei = textBox1.Text;                 if (imei != "" & imei.Length == 15)                 {                     for (int i = 0; i < 15; i++)                     {                         d = imei[i];                         if (Char.IsDigit(d))                         {                             if (i > 2)                             {                                 s1 = s1 + (int)(Char.GetNumericValue(d));                                 imei1 = imei1 + d;                             }                         }                         else                         {                             MessageBox.Show(" Enter a valid imei");                             richTextBox1.Text = "Enter a valid imei";                             a = true; break;                         }                     }                     if (a == false)                     {                         //1st & 2nd steps                         for (int i = 0; i < 12; i++)                         {                             d = imei1[i];                             s2 = s1 * ((int)(Char.GetNumericValue(d)));                             s3 = 8 * ((int)(Char.GetNumericValue(d)));                             stp11 = s2.ToString(); stp22 = s3.ToString();                             stp1 = stp1 + stp11[(stp11.Length - 1)];                             stp222 = stp222 + stp22[(stp22.Length - 1)];                          }                         for (int i = 0; i < 12; i++)                         {                             stp2 = stp2 + stp222[(11 - i)];                         }                         //3rd step                         for (int i = 0; i < 12; i++)                         {                             s = (int)(char.GetNumericValue(stp1[i]) + Char.GetNumericValue(stp2[i])                                 + Char.GetNumericValue(ml[i]));                             stp3 = s.ToString();                             NCK = NCK + stp3[stp3.Length - 1];                         }                         //spck                         for (int i = 0; i < 12; i++)                         {                             imei2 = imei2 + imei1[(11 - i)];                             s1 = (int)(Char.GetNumericValue(imei2[i]) + Char.GetNumericValue(NCK[i]));                             sp = s1.ToString();                             SPCK = SPCK + sp[sp.Length - 1];                         }                         richTextBox1.Clear();                         richTextBox1.SelectionColor = Color.PowderBlue;                         richTextBox1.SelectedText = "ZTE NCK Calculator by ..::AnGeL25dZ::.."                             +'\n'+"******************"                             +'\n'+"imei: " + imei                              + '\n' + "NCK:  " + NCK                             + '\n' + "SPCK: " + SPCK                             + '\n' + "******************"                             +'\n'+"./ Done :-)";                                              }                  }                 else                 {                     MessageBox.Show(" Enter a valid imei");                     richTextBox1.Text = "Enter a valid imei";                 } 
  Reply With Quote
Reply Post New Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT +1. The time now is 17:43.


Copyright ©2013 Dhaka Mobile
Registered of vBulletin