Проверка IMEI

Тема в разделе "WASM.ASSEMBLER", создана пользователем Songoku, 14 фев 2005.

  1. Songoku

    Songoku Эдгар

    Публикаций:
    0
    Регистрация:
    1 мар 2003
    Сообщения:
    68
    Адрес:
    Belarus
    Я тут написал фкнкияю каторая проверяет IMEI номер на эго действительность!

    _imeistr - это указатель на строку с IMEI номером.

    На выходе если eax=1 (ПРАВЕЛЬНЫЙ) и eax=0 (НЕПРАВЕЛЬНЫЙ)


    Код (Text):
    1.  
    2. CheckIMEI:;,_imeistr
    3. pushad
    4. mov    edi,dword[esp+4+(8*4)]
    5. push   7
    6. pop    ecx     ; ecx = 7
    7. push   2
    8. pop    edx     ; edx = 2
    9. xor    ebx,ebx
    10. mov    eax,ebx
    11. @@:
    12. mov    al,byte[edi]
    13. sub    al,'0'
    14. add    bl,al
    15. inc    edi
    16. mov    al,byte[edi]
    17. sub    al,'0'
    18. mul    dl
    19. aam
    20. add    bl,al
    21. add    bl,ah
    22. inc    edi
    23. loop   @B
    24. ;----- end loop ----
    25. xchg   eax,ebx
    26. xor    edx,edx
    27. push   10
    28. pop    ecx
    29. div    ecx
    30. sub    ecx,edx
    31. and    dword[esp+4+(8*4)],0
    32. add    ecx,'0'
    33. cmp    cl,[edi]
    34. jne    @F
    35. inc    dword[esp+4+(8*4)]
    36. @@:
    37. popad
    38. mov    eax,dword[esp+4]
    39. ret    4                  
     
  2. yureckor

    yureckor New Member

    Публикаций:
    0
    Регистрация:
    25 фев 2004
    Сообщения:
    494
    Адрес:
    Russia
    А что это такое IMEI номер ?
     
  3. LocTb

    LocTb New Member

    Публикаций:
    0
    Регистрация:
    11 окт 2004
    Сообщения:
    54
    Songoku

    У меня другая информация. Откуда узнал?
     
  4. Songoku

    Songoku Эдгар

    Публикаций:
    0
    Регистрация:
    1 мар 2003
    Сообщения:
    68
    Адрес:
    Belarus
    2 yureckor: Каждый сотовый телефон имеет стой номер этот номер называется IMEI-Номер!



    2 LocTb: А на кокой то странице был описан этот алгоритм, я его на асм перенёс! А какая у тебя инофрмация???
     
  5. Zero Ice

    Zero Ice New Member

    Публикаций:
    0
    Регистрация:
    7 дек 2003
    Сообщения:
    61
    Не в тему особо, но может кто-нибудь знает как получить IMSI в 60s и в частности 6600?
     
  6. worker_

    worker_ New Member

    Публикаций:
    0
    Регистрация:
    15 фев 2005
    Сообщения:
    1
    yureckor

    LocTb

    не эта случайно



    Posted Aug 10, 2001

    Title: IMEI Number Validation



    http://forum.gsmhosting.com/vbb/showthread.php?t=5033



    IMEI in its full name is International Mobile Station Equipment Identity. It is a unique number composed of actually 16 digits and is divided into 4 elements:

    digits description

    01 - 06 TAC (Type approval code)

    07 - 08 FAC (Final Assembly Code)

    09 - 14 SNR (Serial Number - hardware, phone)

    15 - 16 SVN (Software Version Number)



    This 16-digits IMEI number is referred to as International Mobile Station Equipment Identity and Software Version (IMEISV).



    What we see when we check our phone's IMEI number (by entering *#06#) is the first 14 digits (TAC, FAC,SNR) and the last is the Check Digit (CD or CHK) which is check against a computation called the "Luhn check" against the 14 digits defined. And so, we get the 15-digits IMEI number.



    The IMEI provides the information about the presence of a specific mobile equipment in the network, disregarding whatever uses the subscriber makes with it.



    Its primary purpose is to provide measures against the use of stolen equipment or against the use of the equipment in the GSM system that can no longer be tolerated for technical reasons.



    It is harcoded into the mobile unit and should not be changed or tampered using physical, electrical, or software means.



    In checking for a valid IMEI, the last digit of the IMEI number determines if the whole IMEI number is valid or not.



    The last number of the IMEI is called the Check Digit and is defined using a formula called "Luhn formula", thus sometimes the last digit is called the Luhn Check Digit and does not necessarily always set to 0.



    This check digit is computed in three steps as follows:



    Given:

    14 most significant digits of the IMEISV without the SVN which are the 6-digit TAC, 2-digit FAC, and 6-digit SNR and are labelled as follows:

    TAC = D14 D13 ... D9 (with D9 the least significant digit of TAC);

    FAC = D8 D7 (with D7 the least significant digit of FAC); and

    SNR = D6 D5 ... D1 (with D1 the least significant digit of SNR).



    Example IMEI: 49015420323751? (ignore the last digit)



    FAC: 490154

    D14:4

    D13:9

    D12:0

    D11:1

    D10:5

    D09:4



    TAC: 20

    D08:2

    D07:0



    SNR: 323751

    D06:3

    D05:2

    D04:3

    D03:7

    D02:5

    D01:1



    CHK: ?



    Computation of CHK from the IMEI proceeds as follows:



    Step 1: Double the values of the odd labelled digits D1, D3, D5 ... D13 of the IMEI.

    .D14:4=4

    *D13:9x2=18

    .D12:0=0

    *D11:1x2=2

    .D10:5=5

    *D09:4x2=8

    .D08:2=2

    *D07:0x2=0

    .D06:3=3

    *D05:2x2=4

    .D04:3=3

    *D03:7x2=14

    .D02:5=5

    *D01:1x2=2



    Step 2: Add together the individual digits of all the seven numbers obtained in Step 1,

    1+8 + 2 + 8 + 0 + 4 + 1+4 + 2 = 30



    and then add this sum to the sum of all the even labelled digits D2, D4, D6 ... D14 of the IMEI.

    4 + 0 + 5 + 2 + 3 + 3 + 5 = 22



    The result is:

    30 + 22 = 52

    or

    4 + 1+8 + 0 + 2 + 5 + 8 + 2 + 0 + 3 + 4 + 3 + 1+4 + 5 + 2 = 52



    Step 3: If the number obtained in Step 2 ends in 0, then set CHK to be 0. If the number obtained in Step 2 does not end in 0, then set CHK to be that number subtracted from the next higher number which does end in 0.



    Since 52 ends in "2", CHK can't be set to "0". The next higher number that does end in "0" after 52 is 60, so we set:

    CHK = 60 - 52 = 8



    So the IMEI number is: 490154203237518 and it ends in 8.



    P.S. The IMEI number sampled above is fictios and does not reflect nor intended for an existing IMEI number.