Advertisement
finalshare

CHECK

Apr 13th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.79 KB | None | 0 0
  1. import java.util.Arrays;
  2.  
  3. public class Check {
  4.     public static void main(String[] args) {
  5.         String flag="12312312";
  6.         System.out.println(Check.check(flag));
  7.     }
  8.     private static int[] f0a = new int[]{-1414812757, -842150451, -269488145, 305419896};
  9.     private static byte[] f1b = new byte[]{(byte) 99, (byte) 124, (byte) 101, (byte) -23, (byte) -114, (byte) 81, (byte) -47, (byte) -39, (byte) -102, (byte) 79, (byte) 22, (byte) 52, (byte) -39, (byte) -94, (byte) -66, (byte) -72, (byte) 101, (byte) -18, (byte) 73, (byte) -27, (byte) 53, (byte) -5, (byte) 46, (byte) -20, (byte) 97, (byte) 11, (byte) -56, (byte) 36, (byte) -19, (byte) -49, (byte) -112, (byte) -75};
  10.  
  11.     static byte[] m2a(byte[] bArr, int i, int[] iArr, int i2) {
  12.         int[] a = Check.m4a(bArr, i);
  13.         int i3 = a[0];
  14.         int i4 = a[1];
  15.         int i5 = 0;
  16.         int i6 = iArr[0];
  17.         int i7 = iArr[1];
  18.         int i8 = iArr[2];
  19.         int i9 = iArr[3];
  20.         for (int i10 = 0; i10 < i2; i10++) {
  21.             i5 -= 1640531527;
  22.             i3 += (((i4 << 4) + i6) ^ (i4 + i5)) ^ ((i4 >> 5) + i7);
  23.             i4 += (((i3 << 4) + i8) ^ (i3 + i5)) ^ ((i3 >> 5) + i9);
  24.         }
  25.         a[0] = i3;
  26.         a[1] = i4;
  27.         return Check.m3a(a, 0);
  28.     }
  29.  
  30.     private static int[] m4a(byte[] bArr, int i) {
  31.         int[] iArr = new int[(bArr.length >> 2)];
  32.         int i2 = 0;
  33.         while (i < bArr.length) {
  34.             iArr[i2] = ((Check.m0a(bArr[i + 3]) | (Check.m0a(bArr[i + 2]) << 8)) | (Check.m0a(bArr[i + 1]) << 16)) | (bArr[i] << 24);
  35.             i2++;
  36.             i += 4;
  37.         }
  38.         return iArr;
  39.     }
  40.  
  41.     private static byte[] m3a(int[] iArr, int i) {
  42.         byte[] bArr = new byte[(iArr.length << 2)];
  43.         int i2 = 0;
  44.         while (i < bArr.length) {
  45.             bArr[i + 3] = (byte) (iArr[i2] & 255);
  46.             bArr[i + 2] = (byte) ((iArr[i2] >> 8) & 255);
  47.             bArr[i + 1] = (byte) ((iArr[i2] >> 16) & 255);
  48.             bArr[i] = (byte) ((iArr[i2] >> 24) & 255);
  49.             i2++;
  50.             i += 4;
  51.         }
  52.         return bArr;
  53.     }
  54.  
  55.     private static int m0a(byte b) {
  56.         if (b < (byte) 0) {
  57.             return b + 256;
  58.         }
  59.         return b;
  60.     }
  61.  
  62.     public static byte[] m1a(byte[] bArr) {
  63.         int length = 8 - (bArr.length % 8);
  64.         byte obj[] = new byte[(bArr.length + length)];
  65.         obj[0] = (byte) length;
  66.         System.arraycopy(bArr, 0, obj, length, bArr.length);
  67.         byte obj2[] = new byte[obj.length];
  68.         for (length = 0; length < obj2.length; length += 8) {
  69.             System.arraycopy(Check.m2a(obj, length, f0a, 32), 0, obj2, length, 8);
  70.         }
  71.         return obj2;
  72.     }
  73.  
  74.     public static boolean check(String str) {
  75.         return Arrays.equals(Check.m1a(str.getBytes()), f1b);
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement