A crackme Registration Algorithm

Source: Internet
Author: User

When I went around today, I accidentally found a crackme, so I tried it.
Install the sample first.



 

The figure shows the registration method of the user name and serial number.
Then we will decompile the apk to see the code.
In the code, run the following code:
Public void onCreate (Bundle paramBundle)
{
Super. onCreate (paramBundle );
SetContentView (2130903040 );
TelephonyManager localTelephonyManager = (TelephonyManager) getSystemService ("phone ");
String str1 = localTelephonyManager. getDeviceId ();
New TextView (this );
(TextView) findViewById (2131034112). setText ("HardwareID 01:" + str1 );
String str2 = localTelephonyManager. getSimSerialNumber ();
New TextView (this );
(TextView) findViewById (2131034113). setText ("HardwareID 02:" + str2 );
The ID1 and ID2 we see are generated by the IMEI and SIM card of the machine.
How do we generate a registration code?
In the figure, we can see that there are only two buttons, one for registration (we need to pay more attention to this button) and the other for (we don't need to pay attention to this button ).
Based on this idea, we can see in the decompiled code:
Private View. OnClickListener pulsarBoton = new View. OnClickListener ()
{
Public void onClick (View paramView)
{
String str1 = (EditText) HelloAndroid. this. findViewById (2131034116). getText (). toString ();
Int I = str1.length ();
String str2 = ""; www.2cto.com
String str3 = (EditText) HelloAndroid. this. findViewById (2131034118). getText (). toString ();
If (I <4 );
While (true)
{
Try
{
Toast. makeText (HelloAndroid. this. getApplicationContext (), "Min 4 chars", 1). show ();
Break label307;
Int k = str1.length ();
If (j> = k)
{
String str4 = String. valueOf (0x6B016 ^ Integer. parseInt (str2.substring (0, 5 )));
TelephonyManager localTelephonyManager = (TelephonyManager) HelloAndroid. this. getSystemService ("phone ");
String str5 = localTelephonyManager. getDeviceId ();
String str6 = localTelephonyManager. getSimSerialNumber ();
String str7 = str5.substring (0, 6 );
String str8 = str6.substring (0, 6 );
Long l = Integer. parseInt (str7) ^ Integer. parseInt (str8 );
If (! (Str4 + "-" + String. valueOf (l) + "-" + str7). equals (str3 ))
Break label291;
Toast. makeText (HelloAndroid. this. getApplicationContext (), "God boy", 1). show ();
}
}
Catch (Exception localException)
{
Toast. makeText (HelloAndroid. this. getApplicationContext (), "Another Error Ocurred :(", 1). show ();
}
Int m = str1.charAt (j );
Str2 = str2 + m;
J ++;
Continue;
Label291: Toast. makeText (HelloAndroid. this. getApplicationContext (), "Bad boy", 1). show ();
Label307: return;
Int j = 0;
}
If the registration code is correct, toast "God boy" and "Bad boy" if the registration code is correct ".
First, our registration name must meet four requirements.
From the code, we can see that the registration code is xxxx-xxxx.
First, let's take a look at the first part: The first part is composed of five characters in the ASCII character of the user name ^ 0x6B016. If the user name is crack, the registration code is 471868.
The second digit is the first 6 digits of the IMEI number ^ SIM card number, that is, the second digit of the registration code is 000000 ^ 890141 = 890141.
The third-digit registration code consists of the first 6 digits of the IMEI number 000000.
Then we registered the crack user name.
The registration code is 471868-890141-000000.
It's easy to write.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.