2012年6月4日月曜日

To calculate SPKC in zte phones as x760, etc

..:: For educational purpose ::..

I know how to calculate the SPCK in the ZTE cell following:
SFR 232, SFR 341, SFR 342, ORANGE Vegas, VODAFONE INDIE, X760, X761, X960, GX760, GX761, T-Mobile Vairy Touch
.


To calculate the SPCK in this cell, you take digits of IMEI number from 4 digit to 15.
The digits are reversed, put the remaining 12 digits and below the 12 digits of NCK. Then we sum digit by digit, and if it is greater than 10, put the digits on the right and BINGO!
as i show, any examples:
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::
-------------------------------
imei : 356 318020000001

reversed 12d: 100000020813 
NCK Code : 938950060489
SPCK Code : 038950080292


100000020813 reversed 12 latest imei digits (318020000001) 
938950060489 NCK code
038950080292 SPCK code
--------------------------------
--------------------------------
Phone Imei : 357 873022388655

NCK Code : 277338726619
SPCK Code : 723111946987


556883220378
277338726619 : NCK code
723111946987 : SPCK code
--------------------------------
--------------------------------
Phone Imei : 356 318024364560

NCK Code : 284172888404
SPCK Code : 249535208217

065463420813
284172888404 : NCK Code
249535208217 : SPCK Code
--------------------------------


Note: This algorithm was obtained by my Based on comparison of results of NCK and SPCK posts, do not in any other way...



To calculate the NCK all part of: 688950000000
 and the respective algorithm... 
 
 
 
so i think the algo is for exemple imey is: abcdefghijkl

so nck = a*(a+b+c+d+e+f+g+h+i+j+k+l), b*(a+b+c+d+e+f+g+h+i+j+k+l), 
n*(a+b+c+d+e+f+g+h+i+j+k+l), ..., l*(a+b+c+d+e+f+g+h+i+j+k+l)
n
 := int from [c..k]

Br
 
###NCK### ##latest 12 imei digits##

662350008866 100000003813 -> 3*(3+8+1+3+1)=48 , 8*(3+8+1+3+1)=128 , 1*(3+8+1+3+1)=16 , 3*(3+8+1+3+1)= 48 | 48+8 = 56 

462350008868 200000003812 -> 3*(3+8+1+2+2)=48 , 8*(3+8+1+2+2)=128 , 1*(3+8+1+2+2)=16 , 2*(3+8+1+2+2)= 32 | 32+6 = 38

262350008860 300000003811 -> 3*(3+8+1+1+3)=48 , 8*(3+8+1+1+3)=128 , 1*(3+8+1+1+3)=16 , 1*(3+8+1+1+3)= 16 | 16+4 = 20

062350008862 400000003810 -> 3*(3+8+1+0+4)=48 , 8*(3+8+1+0+4)=128 , 1*(3+8+1+0+4)=16 , 0*(3+8+1+0+4)= 0 | 0+2 = 2

562350001676 100000003814 -> 3*(3+8+1+4+1)=51 , 8*(3+8+1+4+1)=136 , 1*(3+8+1+4+1)=17 , 4*(3+8+1+4+1)= 68 | 68+8 = 76

462350004488 100000003815 -> 3*(3+8+1+5+1)=54 , 8*(3+8+1+5+1)=144 , 1*(3+8+1+5+1)=18 , 5*(3+8+1+5+1)= 90 | 90+8 = 98

362350007292 100000003816 -> 3*(3+8+1+6+1)=57 , 8*(3+8+1+6+1)=152 , 1*(3+8+1+6+1)=19 , 6*(3+8+1+6+1)=114 | 114+8 =122 

262350000008 100000003817 -> 3*(3+8+1+7+1)=60 , 8*(3+8+1+7+1)=160 , 1*(3+8+1+7+1)=20 , 7*(3+8+1+7+1)=140 | 140+8 =148

46235000
6622 250000003813 -> 3*(3+8+1+3+5+2)=66 , 8*(3+8+1+3+5+2)=166 , 1*(3+8+1+3+5+2)=22 | 22+0=22 , 3*(3+8+1+3+5+2)= 66 | 66+6 = 72
 

202350008884 740000003813 -> 3*(3+8+1+3+4+7)=78 , 8*(3+8+1+3+4+7)=208 , 1*(3+8+1+3+4+7)=26 | 26+2=28 , 3*(3+8+1+3+4+7)= 78 | 78+6 = 84

about first 6 digits of (latest 12 imei digits) XXXXXX000000

if digits is: 1 then inverting digits is: 8
2 ...................... 6
3 ...................... 4
4 ...................... 2
5 ...................... 0
6 ...................... 8
7 ...................... 6
8 ...................... 4
9 ...................... 2
0 ...................... 0 


788950000008 100000000000
088950000006 200000000000
588950000004 300000000000
288950000002 400000000000
188950000000 500000000000
288950000008 600000000000
588950000006 700000000000
088950000004 800000000000
788950000002 900000000000
698950000080 010000000000
808950000088 110000000000
948950000068 120000000000
788950000008 100000000000
808950000088 110000000000
911950000888 111000000000
022350008888 111100000000
133400088888 111110000000
244516888888 111111000000
044950000228 149000000000
228532648028 645687000000
688950028604 852140000000
 
 
Of this imei: 123456789012347, only is important: 456789012347

1 ............... 8
2 ............... 6
3 ............... 4
4 ............... 2
5 ............... 0
6 ............... 8
7 ............... 6
8 ............... 4
9 ............... 2
0 ............... 0 

______246802

______987654 (first 6 digits reversed)
456789012347

4+5+6+7+8+9+0+1+2+3+4+7=56

0*56= 0 | 0+2=2
1*56=56 | 56+4=60
2*56=112 | 112+6=118
3*56=168 | 168+8=176
4*56=224 | 224+0=224
7*56=392 | 392+2=394
With my theory the NCK is: XXXXXX208644
 
how to calculate nck for zte phones such as x760.
This is based on the whole theory by 
elcapitel, i have only realized of one little step but most of the work was done by elcapitel, we must thank him for this wonderful research.
Let's begin explaining how it is done, but if you have read this whole thread you should know most of what i am going to explain here.
let's take the following imei (only important 12 digits are used)

000002 243814

our first step will be to sum all digits: 0+0+0+0+0+2+2+4+3+8+1+4=24
then we will calculate a line which is the result of our sum 24 by each digit of imei. 

0x24=0
0x24=0
0x24=0
0x24=0
0x24=0
2x24=48
2x24=48
4x24=96
3x24=72
8x24=192
1x24=24
4x24=48

this way we have:
000008 862246

now the second step is based on this chart:

Code:
1 ............... 8  2 ............... 6  3 ............... 4  4 ............... 2  5 ............... 0  6 ............... 8  7 ............... 6  8 ............... 4  9 ............... 2  0 ............... 0
but with a little trick, we have to tak our imei and split it in two halves like this:
000002 243814
and now based on the chart we have two make another line based on the digits in the chart which corresponds to the digits on the imei, and inverse the order. it sounds a little confusing but i know you will understand. so for our imei
000002 243814
we have:
284426 600000
pay attention to halves colors so you can understand it better. you can see, for instance, that for the number 2 you get number 6 and so on.

now third step is to use the following line:
688950 000000
which is the magic line you get when you calculate the nck with all 0 in imei.

if we put all three lines in order we get:
000008 862246
284426 600000
688950 000000
we can easily sum digit by digit, and in this case we get this:
862374 462246
which for our surprise will be the nck for the given imei.

so for imei 000002 243814 we get nck 862374 462246 i have tried we a couple of examples and the result is the same, don't have delphi here with me now but sure someone can code this algo and make more tests to see if everything is correct.

this is another test i did:
000012 243814 --> imei sum: 1+2+2+4+3+8+1+4=25
000050 005050 --> firs line
284426 680000 --> second line
688950 000000 --> third line
862326 685050 --> nck

once again thanks for all interested and specially to elcapitel
 for his hours dedicated to understand this.
Using our method you will get from imei 352353026840550 the following:

353026840550 --> sum=41
353026840550 --> first step 
000024860404 --> inverse using chart described, second step
688950000000 --> fixed line, third step
--------------
931990600954 --> nck

this was done manually, if we compare the nck with the one from VM_Hacker we can see it is the same, so yes, our method seems to be correct, hope you clear your doubts now, luck

 
 
In my opinion zte modems are not supported by imei calculator, need to be connected.

This algorithm is for this phones:

SFR 232, SFR 341, SFR 342, ORANGE Vegas, VODAFONE INDIE, X760, X761, X960, GX760, GX761, T-Mobile Vairy Touch.
and zte - G R230 tested by @powerbook 
here  thanks.

may work at other phones zte... 
 
 
 

but with a little trick, we have to tak our imei and split it in two halves like this:
000002 243814
and now based on the chart we have two make another line based on the digits in the chart which corresponds to the digits on the imei, and inverse the order. it sounds a little confusing but i know you will understand. so for our imei
000002 243814
we have:
284426 600000
pay attention to halves colors so you can understand it better. you can see, for instance, that for the number 2 you get number 6
 and so on.

...

In step 2 is not needed 2 halves, this is just confusing.

Just take digits from right to left of IMEI_12, make table lookup
and write them from left to right.

Code:
            IMEI = 354249030017193           IMEI_12 = 249030017193                         <--  <--  IMEI_12 Reversed = 391710030942    === TABLE ==  INDEX: 0,1,2,3,4,5,6,7,8,9  VALUE: 0,8,6,4,2,0,8,6,4,2    INDEX = Digit of IMEI_12 Reversed    Table lookup:  3>4  9>2  ... so on    Result of step 2: 428680040226
 
 
 
Originally Posted by y3kt View Post
how to calculate nck for zte phones such as x760.
This is based on the whole theory by 
elcapitel, i have only realized of one little step but most of the work was done by elcapitel, we must thank him for this wonderful research.
Let's begin explaining how it is done, but if you have read this whole thread you should know most of what i am going to explain here.
let's take the following imei (only important 12 digits are used)


000002 243814

our first step will be to sum all digits: 0+0+0+0+0+2+2+4+3+8+1+4=24
then we will calculate a line which is the result of our sum 24
 by each digit of imei. 

0x
24=0
0x24=0
0x24=0
0x24=0
0x24=0
2x24=48
2x24=48
4x24=96
3x24=72
8x24=192
1x24=24
4x24=48

this way we have:
000008 862246

now the second step is based on this chart:


Code:
1 ............... 8  2 ............... 6  3 ............... 4  4 ............... 2  5 ............... 0  6 ............... 8  7 ............... 6  8 ............... 4  9 ............... 2  0 ............... 0
but with a little trick, we have to tak our imei and split it in two halves like this:
000002 243814
and now based on the chart we have two make another line based on the digits in the chart which corresponds to the digits on the imei, and inverse the order. it sounds a little confusing but i know you will understand. so for our imei
000002 243814
we have:
284426 600000
pay attention to halves colors so you can understand it better. you can see, for instance, that for the number 2 you get number 6
 and so on.

now third step is to use the following line:

688950 000000
which is the magic line you get when you calculate the nck with all 0 in imei.

if we put all three lines in order we get:

000008 862246
284426 600000
688950 000000
we can easily sum digit by digit, and in this case we get this:
862374 462246
which for our surprise will be the nck for the given imei.

so for imei 
000002 243814 we get nck 862374 462246
 i have tried we a couple of examples and the result is the same, don't have delphi here with me now but sure someone can code this algo and make more tests to see if everything is correct.

this is another test i did:

000012 243814 --> imei sum: 1+2+2+4+3+8+1+4=25
000050 005050 --> firs line
284426 680000 --> second line
688950 000000 --> third line
862326 685050
 --> nck

once again thanks for all interested and specially to 
elcapitel
 for his hours dedicated to understand this.

luck;
 
 
Quote:
Originally Posted by elcapitel View Post
now I started my work with these Alcatels:
S215, S218, S319, S320, S321, S520, S853, V670, S215, S218, S319, S320, S321, S520, S853, V670, V770, C700, C701, C707, C717, V770, C820, C825, C700, C701, C707, C717, V770, C820, C825, mandarina duck, Miss Sixty, Playbox, Elle N3

But :-$ 


br
elcapitel
Who said he's in need for numeric analyse 

here we go :

> IMEI: 000000000000000 > NCK: 0866469964 > NSCK: 0149012731
> IMEI: 111111111111119 > NCK: 3405327452 > NSCK: 0457320256
> IMEI: 222222222222228 > NCK: 2983603068 > NSCK: 2769514825
> IMEI: 333333333333337 > NCK: 3041549242 > NSCK: 0626763084
> IMEI: 444444444444446 > NCK: 4066527206 > NSCK: 3616578844
> IMEI: 555555555555558 > NCK: 1868189679 > NSCK: 4285142017
> IMEI: 666666666666667 > NCK: 1680483641 > NSCK: 0200030627
> IMEI: 777777777777776 > NCK: 3950562667 > NSCK: 1950282414
> IMEI: 888888888888885 > NCK: 4280459441 > NSCK: 2487011143
> IMEI: 999999999999994 > NCK: 3127419491 > NSCK: 2470213160

> IMEI: 000000000000000 > NCK: 0866469964 > NSCK: 0149012731
> IMEI: 000000000000018 > NCK: 3950306592 > NSCK: 1643415489
> IMEI: 000000000000109 > NCK: 3926207850 > NSCK: 2149915408
> IMEI: 000000000001008 > NCK: 0127043551 > NSCK: 1929354045
> IMEI: 000000000010009 > NCK: 4260265196 > NSCK: 2508607048
> IMEI: 000000000100008 > NCK: 3082603838 > NSCK: 3090381848
> IMEI: 000000001000009 > NCK: 1203485418 > NSCK: 0426454251
> IMEI: 000000010000008 > NCK: 1754832079 > NSCK: 4155728114
> IMEI: 000000100000009 > NCK: 2839051465 > NSCK: 2108580613
> IMEI: 000001000000008 > NCK: 1632960064 > NSCK: 1490753468
> IMEI: 000010000000009 > NCK: 2045763348 > NSCK: 3740543908
> IMEI: 000100000000008 > NCK: 3429918611 > NSCK: 2414674308
> IMEI: 001000000000009 > NCK: 1456571372 > NSCK: 0554018858
> IMEI: 010000000000008 > NCK: 2064949819 > NSCK: 4238345915
> IMEI: 100000000000009 > NCK: 0121385005 > NSCK: 1072813408

> IMEI: 100000000000017> NCK: 4112194941> NSCK: 4038083850
> IMEI: 110000000000114> NCK: 3558871110> NSCK: 4248952829
> IMEI: 111000000001111> NCK:
            0043596555      > NSCK: 1669388245
> IMEI: 111100000011118> NCK: 0971145228> NSCK: 1057624782
> IMEI: 111110000111115> NCK: 4062053646> NSCK: 1743259870
> IMEI: 111111001111112> NCK: 1291794816> NSCK: 0689693900
> IMEI: 111111111111119> NCK: 3405327452> NSCK: 0457320256

> IMEI: 000000000000018> NCK: 3950306592> NSCK: 1643415489
> IMEI: 000000000000117> NCK: 3103325403> NSCK: 0255046121
> IMEI: 000000000001115> NCK: 3502376068> NSCK: 2624049137
> IMEI: 000000000011114> NCK: 3409731000> NSCK: 0788396846
> IMEI: 000000000111112> NCK: 1579970192> NSCK: 3417071988
> IMEI: 000000001111111> NCK: 0979532992> NSCK: 2251377772
> IMEI: 000000011111119> NCK: 1476586733> NSCK: 4027057526
> IMEI: 000000111111118> NCK: 2203699528> NSCK: 3543777168
> IMEI: 000001111111116> NCK: 0429441232> NSCK: 2828062426
> IMEI: 000011111111115> NCK: 2027334960> NSCK: 2053765341
> IMEI: 000111111111113> NCK: 1420917304> NSCK: 1117189310
> IMEI: 001111111111112> NCK: 1097489168> NSCK: 0191604768
> IMEI: 011111111111110> NCK: 2565752458> NSCK: 2165448825
> IMEI: 111111111111119> NCK: 3405327452> NSCK: 0457320256

Alcatel C701, C717....

WBR
 
 
 
Originally Posted by y3kt View Post
Using our method you will get from imei 352353026840550 the following:

353026840550 --> sum=41
353026840550 --> first step 
000024860404 --> inverse using chart described, second step
688950000000
 --> fixed line, third step
--------------

931990600954
 --> nck

this was done manually, if we compare the nck with the one from VM_Hacker we can see it is the same, so yes, our method seems to be correct, hope you clear your doubts now, luck
you take line 1 in the picture case : 353026840550
then you take every digit and do it * 8 mod 10 ( multiply with 8 then take the last digit out ) like 3 * 8 = 24 mod 10 = 4 ... when you have done every digit you will get : 
404068420000 
reverse that and you will get : 000024860404

then you do something like :

var
calc :string;
begin
for i := 0 to 12 do 
calc := inttostr(line1[i] + line2[i] + line3[i] mod 10);
code := code + strtoint(calc);
end;
 
Originally Posted by mustipusti View Post
you take line 1 in the picture case : 353026840550
then you take every digit and do it * 8 mod 10 ( multiply with 8 then take the last digit out ) like 3 * 8 = 24 mod 10 = 4 ... when you have done every digit you will get : 
404068420000 
reverse that and you will get : 000024860404

then you do something like :

var
calc :string;
begin
for i := 0 to 12 do 
calc := inttostr(line1[i] + line2[i] + line3[i] mod 10);
code := code + strtoint(calc);
end;
Code:
  procedure TForm1.Button1Click(Sender: TObject);  var  s : string;  i : integer;  begin  edit2.Text :=  ReverseString(chart(Edit1.Text)) ;    end;    function TForm1.chart(numbers: string): string;  var  i, x : integer;  numeros : string;  NArray : array of integer;  begin    SetLength(NArray,length(numbers));    for I := 0 to length(numbers) - 1 do    begin     numeros:= copy(numbers,1,1);     Delete(numbers,1,1);     NArray[i] := StrToInt(numeros) * 8 mod 10;    end;      for x := 0 to length(NArray) - 1 do    Result := Result + IntToStr(Narray[x]);        end;
 
 
Originally Posted by elcapitel View Post
..:: For educational purpose ::..

I know how to calculate the SPCK in the ZTE cell following:
SFR 232, SFR 341, SFR 342, ORANGE Vegas, VODAFONE INDIE, X760, X761, X960, GX760, GX761, T-Mobile Vairy Touch
.


To calculate the SPCK in this cell, you take digits of IMEI number from 4 digit to 15.
The digits are reversed, put the remaining 12 digits and below the 12 digits of NCK. Then we sum digit by digit, and if it is greater than 10, put the digits on the right and BINGO!
as i show, any examples:
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::
-------------------------------
imei : 356 318020000001

reversed 12d: 100000020813 
NCK Code : 938950060489
SPCK Code : 038950080292



100000020813 reversed 12 latest imei digits (318020000001) 
938950060489 NCK code
038950080292 SPCK code
--------------------------------
--------------------------------
Phone Imei : 357 873022388655

NCK Code : 277338726619
SPCK Code : 723111946987


556883220378
277338726619 : NCK code

723111946987 : SPCK code
--------------------------------
--------------------------------
Phone Imei : 356 318024364560

NCK Code : 284172888404
SPCK Code : 249535208217

065463420813
284172888404 : NCK Code

249535208217 : SPCK Code
--------------------------------


Note: This algorithm was obtained by my Based on comparison of results of NCK and SPCK posts, do not in any other way...



To calculate the 
NCK all part of: 688950000000 and the respective algorithm..
 
 
 
 
 
import hashlib, getopt, sys

magic = [6, 8, 8, 9, 5, 0, 0, 0, 0, 0, 0, 0]

def info():
print "zte-unlock.py: calculates unlock codes for ZTE devices"
print "Based on the reverse engineering of elcapitel and y3kt"
print "Copyright (c) 2010 dogbert <dogber1@gmail.com>"
print ""

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

def testIMEIChecksum(digits):
_sum = 0
alt = False
for d in reversed(digits):
assert 0 <= d <= 9
if alt:
d *= 2
if d > 9:
d -= 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]*8 + magic[i]) % 10
nck += "%d" % code
spck += "%d" % ((code + digits[11-i]) % 10)
return (nck, spck)

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

imei = ""
interactive = False

for o, a 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):
nck, spck = 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()
 
 
 
 
writen by mchizan  #Thanks to elcapitel and friends...  magic='688950000000'  def shortImei(imei):  imei=imei[3:]  return imei  def sumImei(shortImei):  sumImei=0  for i in shortImei:  sumImei= sumImei+ int(i)  return sumImei  def mod(str1,num1):  line= ''  for i in str1:  d= int(i)*num1  line= line+(str(d))[-1:]  return line  def revImei(s):  sr=''  im=[]  for i in s:  im.append(i)  im.reverse()  for i in im:  sr=sr+i  return mod(sr, 8)  def figs(imei):  a=shortImei(imei)  b= sumImei(a)  c=mod(a,b) # initial code  d=revImei(a)  return c, d  def add(c, d):  y='' #initialize an empty string to hold values  e=magic # magic number to be added  for i in range(len(c)):  x=int(c[i])+int(d[i])+int(e[i])  y=y+str(x)[-1:] #only last digits to be picked  return y # final unlock code  def getcode(imei):  f,d=figs(imei)  nck= add(f, d)  return nck  print getcode('000000002243814') #add imei in the function getcode('imei')  #862374462246
 
 
 
 

0 件のコメント:

コメントを投稿