Guest MDCFan Posted December 26, 2010 Report Posted December 26, 2010 (edited) Ok, so I was browsing 00Z3 ROM and found that there is a method to check unlock code which can also be used to calculate unlock codes. Cleaned up code with some comments is available here: http://pastebin.com/yy299wJZ EDIT: I've also attached a simple implementation in Python so all paranoid people can now be really sure their imei is not going to be sent anywhere :( EDIT2: Separate Python 2 and Python 3 versions. EDIT3: Added php, ruby and java functions to archive.blade_unlock.zip Edited May 24, 2011 by MDCFan
Guest isambard Posted December 26, 2010 Report Posted December 26, 2010 Ok, so I was browsing 00Z3 ROM and found that there is a method to check unlock code which can also be used to calculate unlock codes. Cleaned up code with some comments is available here: http://pastebin.com/WZZ6Q7fe EDIT: I've also attached a simple implementation in Python so all paranoid people can now be really sure their imei is not going to be sent anywhere :( i got the same algorithm, but the hard way. where did you locate it in the rom?
Guest MDCFan Posted December 26, 2010 Report Posted December 26, 2010 (edited) i got the same algorithm, but the hard way. where did you locate it in the rom? It was in com.android.phone.apk, Netlock class, although the code was somewhat less readable. Edited December 26, 2010 by MDCFan
Guest isambard Posted December 26, 2010 Report Posted December 26, 2010 It was in com.android.phone.apk, Netlock class, although the code was somewhat less readable. more readable than mine! i reversed it from dalvik opcodes! :(
Guest MDCFan Posted December 26, 2010 Report Posted December 26, 2010 (edited) more readable than mine! i reversed it from dalvik opcodes! ;) From same apk? :( Edited December 26, 2010 by MDCFan
Guest isambard Posted December 26, 2010 Report Posted December 26, 2010 (edited) From same apk? :( edit: i've located it now also in the ZTE Blade ROM in the phone APK. the algorithm is there as plain as day. i wonder if all android phones are as easy to unlock? i'm surprised they located it so high in the phone. Edited December 27, 2010 by isambard
Guest nonamer123 Posted January 10, 2011 Report Posted January 10, 2011 I hope its okay to copy your algorithm to my own litte program? (first its only for me, for learning java :D) And please help a noob like me ... I check the input for containing only digits and also having a length of 15, did i forgot something to check? Because in my program its possible to enter for example 222222222222222 as a "valid" imei ... but onlinegenerators throw me a "not valid imei" ... So how is a valid format for imei defined? :P
Guest catb Posted January 10, 2011 Report Posted January 10, 2011 So how is a valid format for imei defined? :D http://en.wikipedia.org/wiki/International...ware_Version.29
Guest zata Posted January 10, 2011 Report Posted January 10, 2011 I check the input for containing only digits and also having a length of 15, did i forgot something to check? Because in my program its possible to enter for example 222222222222222 as a "valid" imei ... but onlinegenerators throw me a "not valid imei" ... So how is a valid format for imei defined? :D http://en.wikipedia.org/wiki/International...ipment_Identity
Guest isambard Posted January 10, 2011 Report Posted January 10, 2011 (edited) I hope its okay to copy your algorithm to my own litte program? (first its only for me, for learning java :D) And please help a noob like me ... I check the input for containing only digits and also having a length of 15, did i forgot something to check? Because in my program its possible to enter for example 222222222222222 as a "valid" imei ... but onlinegenerators throw me a "not valid imei" ... So how is a valid format for imei defined? :P second hit in google: http://titus-herwin.blogspot.com/2009/08/m...i-checksum.html Edited January 10, 2011 by isambard
Guest nonamer123 Posted January 10, 2011 Report Posted January 10, 2011 Thx for that ... Didn´t read the article carefully enough :D So i will try to implement such a function in java :P Really really thanks for such a fast help B)
Guest Arr Too Posted January 10, 2011 Report Posted January 10, 2011 Java version of the IMEI check (Luhn) here.
Guest MDCFan Posted January 10, 2011 Report Posted January 10, 2011 I hope its okay to copy your algorithm to my own litte program? (first its only for me, for learning java :D) I don't restrict anyone using provided code.
Guest energy6uk Posted May 24, 2011 Report Posted May 24, 2011 Ok, so I was browsing 00Z3 ROM and found that there is a method to check unlock code which can also be used to calculate unlock codes. Cleaned up code with some comments is available here: http://pastebin.com/yy299wJZ EDIT: I've also attached a simple implementation in Python so all paranoid people can now be really sure their imei is not going to be sent anywhere :P EDIT2: Separate Python 2 and Python 3 versions. Any chance you could do this in PHP?
Guest MDCFan Posted May 24, 2011 Report Posted May 24, 2011 (edited) Any chance you could do this in PHP? http://pastebin.com/W1Le7hib Edited May 24, 2011 by MDCFan
Guest Grain Posted May 25, 2011 Report Posted May 25, 2011 Someone seems to have created an HTML/JavaScript version, too: http://pastebin.com/6VVtHV1r Just download it, open the file in the browser, there you go.
Guest am632 Posted May 10, 2012 Report Posted May 10, 2012 Hi, sorry to reply to such an old post but would it be possible to turn this into a batch file? I'm trying to learn as much as i can about phone unlocking but the only script im familiar with it autoit, and if i could see this as a working batch file it would help me understand how it works. thnks
Guest redhawkuk Posted May 21, 2012 Report Posted May 21, 2012 Batch files doesn't have many options for manipulating numbers and strings so it wouldn't be possible. While on the subject of script languages I've created a nck generator using mIRC script language. :) /unlock { if ($1 = $null) { echo -e IMEI is required | return } if ($len($1) != 15) { echo -e IMEI not valid size | return } var %nck var %hash = $md5($1) var %loop = 0 while (%loop < 16) { var %n = $calc($replace($mid(%hash,$calc(%loop + 1),1),a,10,b,11,c,12,d,13,e,14,f,15) * 16) %n = %n + $calc($replace($mid(%hash,$calc(%loop + 2),1),a,10,b,11,c,12,d,13,e,14,f,15)) %n = %n + $calc($replace($mid(%hash,$calc(%loop + 17),1),a,10,b,11,c,12,d,13,e,14,f,15) * 16) %n = %n + $calc($replace($mid(%hash,$calc(%loop + 18),1),a,10,b,11,c,12,d,13,e,14,f,15)) %nck = %nck $+ $left($calc(($and(%n , 255)) * 9 / 255),1) %loop = %loop + 2 } echo -e IMEI = $1 $+ , NCK = %nck } Richard S.
Guest redhawkuk Posted May 21, 2012 Report Posted May 21, 2012 (edited) The algorithm works something like this: -convert IMEI number into md5 hash this generates 16 bytes written in hexadecimal. -take the first 8 bytes and individually add them with the remaining sequence of 8 bytes. -apply bitwise AND 255 to each result and then * 9 / 255 to generate your 8 byte NCK code. Richard S. Edited May 22, 2012 by redhawkuk
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now