DJ VK писал(а): Мой Эсер держит карту с GPS 15 часов, но это андроид, итить...
DJ VK писал(а):Был бы это PC ассемблер, давно бы сломал это ограничение.
Адроидные прожки реверсятся достаточно хорошо. По крайней мере, там проще, чем с Ассемблером. Так что подсмотреть алгоритм проверки лицензии или чутка подправить код вполне возможно.
Вот, на скорую руку из версии, что в аттаче на прошлой странице, Signer.class:
- Код: Выделить всё
package org.vmax.geo;
import android.content.Context;
import java.security.KeyFactory;
import java.security.PublicKey;
import java.security.Signature;
import java.security.spec.X509EncodedKeySpec;
import java.util.zip.CRC32;
public final class Signer
{
private static final byte[] pubBlob = arrayOfByte;
static
{
byte[] arrayOfByte = new byte['¢'];
arrayOfByte[0] = 48;
arrayOfByte[1] = -127;
arrayOfByte[2] = -97;
arrayOfByte[3] = 48;
arrayOfByte[4] = 13;
arrayOfByte[5] = 6;
arrayOfByte[6] = 9;
arrayOfByte[7] = 42;
arrayOfByte[8] = -122;
arrayOfByte[9] = 72;
arrayOfByte[10] = -122;
arrayOfByte[11] = -9;
arrayOfByte[12] = 13;
arrayOfByte[13] = 1;
arrayOfByte[14] = 1;
arrayOfByte[15] = 1;
arrayOfByte[16] = 5;
arrayOfByte[18] = 3;
arrayOfByte[19] = -127;
arrayOfByte[20] = -115;
arrayOfByte[22] = 48;
arrayOfByte[23] = -127;
arrayOfByte[24] = -119;
arrayOfByte[25] = 2;
arrayOfByte[26] = -127;
arrayOfByte[27] = -127;
arrayOfByte[29] = -25;
arrayOfByte[30] = -127;
arrayOfByte[31] = 20;
arrayOfByte[32] = 12;
arrayOfByte[33] = -47;
arrayOfByte[34] = 81;
arrayOfByte[35] = -119;
arrayOfByte[36] = 81;
arrayOfByte[37] = -122;
arrayOfByte[38] = 123;
arrayOfByte[39] = 55;
arrayOfByte[40] = 98;
arrayOfByte[41] = 28;
arrayOfByte[42] = 55;
arrayOfByte[43] = -19;
arrayOfByte[44] = 33;
arrayOfByte[45] = 68;
arrayOfByte[46] = 84;
arrayOfByte[47] = -60;
arrayOfByte[48] = 2;
arrayOfByte[49] = -83;
arrayOfByte[50] = 106;
arrayOfByte[51] = 57;
arrayOfByte[52] = 19;
arrayOfByte[53] = 6;
arrayOfByte[54] = 95;
arrayOfByte[55] = 59;
arrayOfByte[56] = -105;
arrayOfByte[57] = -65;
arrayOfByte[58] = 83;
arrayOfByte[59] = -52;
arrayOfByte[60] = 106;
arrayOfByte[61] = 124;
arrayOfByte[62] = -60;
arrayOfByte[63] = 65;
arrayOfByte[64] = -44;
arrayOfByte[65] = 9;
arrayOfByte[66] = 54;
arrayOfByte[67] = -72;
arrayOfByte[68] = -82;
arrayOfByte[69] = -35;
arrayOfByte[70] = -68;
arrayOfByte[71] = 31;
arrayOfByte[72] = 106;
arrayOfByte[73] = -82;
arrayOfByte[74] = -67;
arrayOfByte[75] = -58;
arrayOfByte[76] = 77;
arrayOfByte[77] = -60;
arrayOfByte[78] = 94;
arrayOfByte[79] = 75;
arrayOfByte[80] = -42;
arrayOfByte[81] = 100;
arrayOfByte[82] = 12;
arrayOfByte[83] = -30;
arrayOfByte[84] = -116;
arrayOfByte[85] = -40;
arrayOfByte[86] = -26;
arrayOfByte[87] = -127;
arrayOfByte[88] = 86;
arrayOfByte[89] = 110;
arrayOfByte[90] = 58;
arrayOfByte[91] = -4;
arrayOfByte[92] = -91;
arrayOfByte[93] = -69;
arrayOfByte[94] = -41;
arrayOfByte[95] = -51;
arrayOfByte[96] = 89;
arrayOfByte[97] = 1;
arrayOfByte[98] = 79;
arrayOfByte[99] = -18;
arrayOfByte[100] = 31;
arrayOfByte[101] = -91;
arrayOfByte[102] = 49;
arrayOfByte[103] = 13;
arrayOfByte[104] = 9;
arrayOfByte[105] = -43;
arrayOfByte[106] = -114;
arrayOfByte[107] = 121;
arrayOfByte[108] = 126;
arrayOfByte[109] = 14;
arrayOfByte[110] = -70;
arrayOfByte[111] = -5;
arrayOfByte[112] = 53;
arrayOfByte[113] = 52;
arrayOfByte[114] = 42;
arrayOfByte[115] = 1;
arrayOfByte[116] = 81;
arrayOfByte[117] = -36;
arrayOfByte[118] = 124;
arrayOfByte[119] = -17;
arrayOfByte[120] = -127;
arrayOfByte[121] = 38;
arrayOfByte[122] = -43;
arrayOfByte[123] = -22;
arrayOfByte[124] = -64;
arrayOfByte[125] = 86;
arrayOfByte[126] = 94;
arrayOfByte[127] = -72;
arrayOfByte[''] = -114;
arrayOfByte[''] = 50;
arrayOfByte[''] = 46;
arrayOfByte[''] = -37;
arrayOfByte[''] = -6;
arrayOfByte['
'] = -103;
arrayOfByte[''] = -46;
arrayOfByte[''] = 45;
arrayOfByte[''] = 79;
arrayOfByte[''] = -40;
arrayOfByte[''] = 14;
arrayOfByte[''] = -118;
arrayOfByte[''] = 30;
arrayOfByte[''] = -93;
arrayOfByte[''] = -52;
arrayOfByte[''] = -101;
arrayOfByte[''] = -29;
arrayOfByte[''] = -72;
arrayOfByte[''] = -45;
arrayOfByte[''] = 14;
arrayOfByte[''] = -50;
arrayOfByte[''] = -9;
arrayOfByte[''] = 91;
arrayOfByte[''] = -114;
arrayOfByte[''] = -14;
arrayOfByte[''] = -34;
arrayOfByte[''] = -69;
arrayOfByte[''] = 49;
arrayOfByte[''] = -35;
arrayOfByte[''] = 2;
arrayOfByte[''] = 3;
arrayOfByte[''] = 1;
arrayOfByte['¡'] = 1;
}
static long blobCRC()
{
CRC32 localCRC32 = new CRC32();
localCRC32.update(pubBlob);
return localCRC32.getValue();
}
// ERROR //
private static final byte[] loadLicenseDat(Context paramContext)
{
// Byte code:
// 0: new 31 java/io/File
// 3: dup
// 4: new 31 java/io/File
// 7: dup
// 8: new 33 java/lang/StringBuilder
// 11: dup
// 12: aload_0
// 13: ldc 35
// 15: iconst_0
// 16: invokevirtual 41 android/content/Context:getSharedPreferences (Ljava/lang/String;I)Landroid/content/SharedPreferences;
// 19: ldc 43
// 21: ldc 45
// 23: invokeinterface 51 3 0
// 28: invokestatic 57 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String;
// 31: invokespecial 60 java/lang/StringBuilder:<init> (Ljava/lang/String;)V
// 34: ldc 62
// 36: invokevirtual 66 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 39: invokevirtual 70 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 42: invokespecial 71 java/io/File:<init> (Ljava/lang/String;)V
// 45: ldc 73
// 47: invokespecial 76 java/io/File:<init> (Ljava/io/File;Ljava/lang/String;)V
// 50: astore_1
// 51: aload_1
// 52: invokevirtual 80 java/io/File:exists ()Z
// 55: ifeq +120 -> 175
// 58: aconst_null
// 59: astore_2
// 60: new 82 java/io/BufferedReader
// 63: dup
// 64: new 84 java/io/InputStreamReader
// 67: dup
// 68: new 86 java/io/FileInputStream
// 71: dup
// 72: aload_1
// 73: invokespecial 89 java/io/FileInputStream:<init> (Ljava/io/File;)V
// 76: ldc 91
// 78: invokespecial 94 java/io/InputStreamReader:<init> (Ljava/io/InputStream;Ljava/lang/String;)V
// 81: invokespecial 97 java/io/BufferedReader:<init> (Ljava/io/Reader;)V
// 84: astore_3
// 85: new 33 java/lang/StringBuilder
// 88: dup
// 89: invokespecial 98 java/lang/StringBuilder:<init> ()V
// 92: astore 4
// 94: aload_3
// 95: invokevirtual 101 java/io/BufferedReader:readLine ()Ljava/lang/String;
// 98: astore 10
// 100: aload 10
// 102: ifnonnull +47 -> 149
// 105: aload 4
// 107: invokevirtual 70 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 110: astore 11
// 112: aload 11
// 114: invokevirtual 105 java/lang/String:length ()I
// 117: iconst_2
// 118: idiv
// 119: newarray byte
// 121: astore 12
// 123: iconst_0
// 124: istore 13
// 126: aload 12
// 128: arraylength
// 129: istore 14
// 131: iload 13
// 133: iload 14
// 135: if_icmplt +42 -> 177
// 138: aload_3
// 139: ifnull +7 -> 146
// 142: aload_3
// 143: invokevirtual 108 java/io/BufferedReader:close ()V
// 146: aload 12
// 148: areturn
// 149: aload 4
// 151: aload 10
// 153: invokevirtual 66 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 156: pop
// 157: goto -63 -> 94
// 160: astore 7
// 162: aload_3
// 163: astore 8
// 165: aload 8
// 167: ifnull +8 -> 175
// 170: aload 8
// 172: invokevirtual 108 java/io/BufferedReader:close ()V
// 175: aconst_null
// 176: areturn
// 177: aload 12
// 179: aload 12
// 181: arraylength
// 182: iconst_1
// 183: isub
// 184: iload 13
// 186: isub
// 187: aload 11
// 189: iload 13
// 191: iconst_2
// 192: imul
// 193: iconst_2
// 194: iload 13
// 196: iconst_2
// 197: imul
// 198: iadd
// 199: invokevirtual 112 java/lang/String:substring (II)Ljava/lang/String;
// 202: bipush 16
// 204: invokestatic 118 java/lang/Integer:parseInt (Ljava/lang/String;I)I
// 207: i2b
// 208: bastore
// 209: iinc 13 1
// 212: goto -86 -> 126
// 215: astore 5
// 217: aload_2
// 218: ifnull +7 -> 225
// 221: aload_2
// 222: invokevirtual 108 java/io/BufferedReader:close ()V
// 225: aload 5
// 227: athrow
// 228: astore 15
// 230: goto -84 -> 146
// 233: astore 9
// 235: goto -60 -> 175
// 238: astore 6
// 240: goto -15 -> 225
// 243: astore 5
// 245: aload_3
// 246: astore_2
// 247: goto -30 -> 217
// 250: astore 17
// 252: aconst_null
// 253: astore 8
// 255: goto -90 -> 165
//
// Exception table:
// from to target type
// 85 94 160 java/lang/Exception
// 94 100 160 java/lang/Exception
// 105 123 160 java/lang/Exception
// 126 131 160 java/lang/Exception
// 149 157 160 java/lang/Exception
// 177 209 160 java/lang/Exception
// 60 85 215 finally
// 142 146 228 java/lang/Exception
// 170 175 233 java/lang/Exception
// 221 225 238 java/lang/Exception
// 85 94 243 finally
// 94 100 243 finally
// 105 123 243 finally
// 126 131 243 finally
// 149 157 243 finally
// 177 209 243 finally
// 60 85 250 java/lang/Exception
}
static final boolean verify(Context paramContext, String paramString)
{
((byte[])null);
try
{
KeyFactory localKeyFactory = KeyFactory.getInstance("RSA");
blobCRC();
PublicKey localPublicKey = localKeyFactory.generatePublic(new X509EncodedKeySpec(pubBlob));
Signature localSignature = Signature.getInstance("MD5withRSA");
byte[] arrayOfByte1 = loadLicenseDat(paramContext);
String str = SASAndr.getSN(paramContext);
if ((arrayOfByte1 != null) && (str != null))
{
byte[] arrayOfByte2 = new byte[2 * str.length()];
for (int i = 0; ; i++)
{
if (i >= str.length())
{
localSignature.initVerify(localPublicKey);
localSignature.update(arrayOfByte2);
return localSignature.verify(arrayOfByte1);
}
arrayOfByte2[(i * 2)] = ((byte)(0xFF & str.charAt(i)));
arrayOfByte2[(1 + i * 2)] = ((byte)(0xFF & str.charAt(i) >> '\b'));
}
}
}
catch (Exception localException)
{
}
return false;
}
}