Я тут написал фкнкияю каторая проверяет IMEI номер на эго действительность! _imeistr - это указатель на строку с IMEI номером. На выходе если eax=1 (ПРАВЕЛЬНЫЙ) и eax=0 (НЕПРАВЕЛЬНЫЙ) Код (Text): CheckIMEI:;,_imeistr pushad mov edi,dword[esp+4+(8*4)] push 7 pop ecx ; ecx = 7 push 2 pop edx ; edx = 2 xor ebx,ebx mov eax,ebx @@: mov al,byte[edi] sub al,'0' add bl,al inc edi mov al,byte[edi] sub al,'0' mul dl aam add bl,al add bl,ah inc edi loop @B ;----- end loop ---- xchg eax,ebx xor edx,edx push 10 pop ecx div ecx sub ecx,edx and dword[esp+4+(8*4)],0 add ecx,'0' cmp cl,[edi] jne @F inc dword[esp+4+(8*4)] @@: popad mov eax,dword[esp+4] ret 4
2 yureckor: Каждый сотовый телефон имеет стой номер этот номер называется IMEI-Номер! 2 LocTb: А на кокой то странице был описан этот алгоритм, я его на асм перенёс! А какая у тебя инофрмация???
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.