Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Security.Cryptography;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- namespace vHack.data
- {
- public static class Encode
- {
- static string url = "https://api.vhack.cc/v/4/";
- static string secret = "aeffI";
- static byte[] base64Alphabet = new byte[] { (byte)65, (byte)66, (byte)67, (byte)68, (byte)69, (byte)70, (byte)71, (byte)72, (byte)73, (byte)74, (byte)75, (byte)76, (byte)77, (byte)78, (byte)79, (byte)80, (byte)81, (byte)82, (byte)83, (byte)84, (byte)85, (byte)86, (byte)87, (byte)88, (byte)89, (byte)90, (byte)97, (byte)98, (byte)99, (byte)100, (byte)101, (byte)102, (byte)103, (byte)104, (byte)105, (byte)106, (byte)107, (byte)108, (byte)109, (byte)110, (byte)111, (byte)112, (byte)113, (byte)114, (byte)115, (byte)116, (byte)117, (byte)118, (byte)119, (byte)120, (byte)121, (byte)122, (byte)48, (byte)49, (byte)50, (byte)51, (byte)52, (byte)53, (byte)54, (byte)55, (byte)56, (byte)57, (byte)45, (byte)95 };
- private static byte[] m9179a(byte[] bArr, int i, int i2, byte[] bArr2, int i3, byte[] bArr3)
- {
- int i4 = 0;
- int i5 = (i2 > 1 ? (bArr[i + 1] << 24) >> 16 : 0) | (i2 > 0 ? (bArr[i] << 24) >> 8 : 0);
- if (i2 > 2)
- {
- i4 = (bArr[i + 2] << 24) >> 24;
- }
- i4 |= i5;
- switch (i2)
- {
- case 1 /*1*/:
- bArr2[i3] = bArr3[i4 >> 18];
- bArr2[i3 + 1] = bArr3[(i4 >> 12) & 63];
- bArr2[i3 + 2] = (byte)61;
- bArr2[i3 + 3] = (byte)61;
- break;
- case 2 /*2*/:
- bArr2[i3] = bArr3[i4 >> 18];
- bArr2[i3 + 1] = bArr3[(i4 >> 12) & 63];
- bArr2[i3 + 2] = bArr3[(i4 >> 6) & 63];
- bArr2[i3 + 3] = (byte)61;
- break;
- case 3 /*3*/:
- bArr2[i3] = bArr3[i4 >> 18];
- bArr2[i3 + 1] = bArr3[(i4 >> 12) & 63];
- bArr2[i3 + 2] = bArr3[(i4 >> 6) & 63];
- bArr2[i3 + 3] = bArr3[i4 & 63];
- break;
- }
- return bArr2;
- }
- public static string m9177a(byte[] bArr, int i, int i2, byte[] bArr2)
- {
- byte[] a = m9178a(bArr, i, i2, bArr2, 2147483647);
- int length = a.Length;
- while (length > 0 && a[length - 1] == 61)
- {
- length--;
- }
- return Encoding.UTF8.GetString(a, 0, length);
- }
- public static string m9175a(string str)
- {
- try
- {
- byte[] bytes = Encoding.UTF8.GetBytes(str);
- MD5 md5 = new MD5CryptoServiceProvider();
- byte[] result = md5.ComputeHash(bytes);
- StringBuilder stringBuilder = new StringBuilder();
- foreach (byte b in result)
- {
- string toHexString = (b & 255).ToString("x2");
- while (toHexString.Length < 2)
- {
- toHexString = "0" + toHexString;
- }
- stringBuilder.Append(toHexString);
- }
- return stringBuilder.ToString();
- }
- catch (Exception)
- {
- return "";
- }
- }
- public static byte[] m9178a(byte[] bArr, int i, int i2, byte[] bArr2, int i3)
- {
- int i4 = ((i2 + 2) / 3) * 4;
- byte[] bArr3 = new byte[(i4 + (i4 / i3))];
- int i5 = i2 - 2;
- int i6 = 0;
- int i7 = 0;
- int i8 = 0;
- while (i8 < i5)
- {
- i4 = (((bArr[i8 + i] << 24) >> 8) | ((bArr[(i8 + 1) + i] << 24) >> 16)) | ((bArr[(i8 + 2) + i] << 24) >> 24);
- bArr3[i7] = bArr2[i4 >> 18];
- bArr3[i7 + 1] = bArr2[(i4 >> 12) & 63];
- bArr3[i7 + 2] = bArr2[(i4 >> 6) & 63];
- bArr3[i7 + 3] = bArr2[i4 & 63];
- i4 = i6 + 4;
- if (i4 == i3)
- {
- bArr3[i7 + 4] = (byte)10;
- i7++;
- i4 = 0;
- }
- i8 += 3;
- i7 += 4;
- i6 = i4;
- }
- if (i8 < i2)
- {
- m9179a(bArr, i8 + i, i2 - i8, bArr3, i7, bArr2);
- if (i6 + 4 == i3)
- {
- bArr3[i7 + 4] = (byte)10;
- i7++;
- }
- i7 += 4;
- }
- return bArr3;
- }
- public static string m9176a(string pattern, string str2, string str3)
- {
- string[] splitstring = new string[] { "::::" };
- string[] split = pattern.Split(splitstring, StringSplitOptions.None);
- string[] split2 = str2.Split(splitstring, StringSplitOptions.None);
- long currentTimeMillis = (long)(getCurrentTimeMillis() / 1000);
- string str4 = "{";
- for (int i = 0; i < split.Length; i++)
- {
- str4 += "\"" + split[i] + "\":\"" + split2[i] + "\",";
- }
- str4 += "\"time\":\"" + currentTimeMillis + "\"}";
- byte[] bytes = Encoding.UTF8.GetBytes(str4);
- string a = m9177a(bytes, 0, bytes.Length, base64Alphabet);
- string a2 = m9175a(str4.Length + m9175a(currentTimeMillis + ""));
- string str5 = split2[0] + "" + m9175a(m9175a(split2[1]));
- str4 = m9175a(currentTimeMillis + "" + str4);
- byte[] bytes2 = Encoding.UTF8.GetBytes(a2);
- byte[] bytes3 = Encoding.UTF8.GetBytes(str5);
- byte[] bytes4 = Encoding.UTF8.GetBytes(str4);
- a2 = m9175a(secret + m9175a(m9175a(m9177a(bytes2, 0, bytes2.Length, base64Alphabet))));
- str5 = m9177a(bytes3, 0, bytes3.Length, base64Alphabet);
- str4 = m9175a(m9175a(a2 + m9175a(m9175a(str5) + m9177a(bytes4, 0, bytes4.Length, base64Alphabet))));
- return url + str3 + "?user=" + a + "&pass=" + str4;
- }
- public static double getCurrentTimeMillis()
- {
- DateTime Jan1970 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
- TimeSpan javaSpan = DateTime.UtcNow - Jan1970;
- return javaSpan.TotalMilliseconds;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement