-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExplicit.java
337 lines (279 loc) · 11.8 KB
/
Explicit.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
package me.explicit;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.Base64;
import java.util.Iterator;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import me.explicit.color.ColorManager;
import me.explicit.command.commands.BindCommand;
import me.explicit.command.commands.ConfigCommand;
import me.explicit.command.commands.FriendCommand;
import me.explicit.command.commands.HelpCommand;
import me.explicit.command.commands.SettingsCommand;
import me.explicit.command.commands.ToggleCommand;
import me.explicit.config.ConfigManager;
import me.explicit.consolegui.ConsoleGUI;
import me.explicit.friends.FriendManager;
import me.explicit.module.Module;
import me.explicit.module.ModuleManager;
import me.explicit.net.NetHandler;
import me.explicit.settings.SettingsManager;
import me.explicit.ui.clickgui.ClickGUI;
import me.explicit.ui.hud.HUDRenderer;
import me.explicit.utils.Game;
import me.explicit.utils.VersionCheck;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.INetHandler;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent;
import org.lwjgl.input.Keyboard;
public class Explicit {
public static final String MODID;
public static final String NAME;
public static final String VERSION;
public static Explicit instance;
public ModuleManager mm;
public SettingsManager sm;
public ClickGUI clickGui;
public ColorManager cm;
public ConsoleGUI cg;
public HUDRenderer uiRenderer;
public ConfigManager configManager;
public FriendManager friendManager;
public static boolean destructed;
public static boolean consolegui;
private static final String[] lIIIIIIl;
private static String[] lIIIIIll;
public void onInit() {
VersionCheck versioncheck = new VersionCheck();
versioncheck.setName(Explicit.lIIIIIIl[0]);
versioncheck.start();
MinecraftForge.EVENT_BUS.register(this);
this.configManager = new ConfigManager();
this.sm = new SettingsManager();
this.mm = new ModuleManager();
this.clickGui = new ClickGUI();
this.cm = new ColorManager();
this.uiRenderer = new HUDRenderer();
ConfigManager.init();
this.friendManager = new FriendManager();
if (!Explicit.destructed) {
this.registerCommands();
}
this.cg = new ConsoleGUI();
this.cg.setName(Explicit.lIIIIIIl[1]);
this.cg.start();
}
public void registerCommands() {
ClientCommandHandler.instance.registerCommand(new FriendCommand());
ClientCommandHandler.instance.registerCommand(new ToggleCommand());
ClientCommandHandler.instance.registerCommand(new BindCommand());
ClientCommandHandler.instance.registerCommand(new ConfigCommand());
ClientCommandHandler.instance.registerCommand(new SettingsCommand());
ClientCommandHandler.instance.registerCommand(new HelpCommand());
}
public void onSelfDestruct() {
Minecraft.getMinecraft().currentScreen = null;
Iterator iterator = this.mm.modules.iterator();
while (iterator.hasNext()) {
Module module = (Module) iterator.next();
MinecraftForge.EVENT_BUS.unregister(module);
module.setToggledNoSave(false);
module.setName(Explicit.lIIIIIIl[2]);
module = null;
this.mm.modules.remove(module);
}
MinecraftForge.EVENT_BUS.unregister(this);
Explicit.consolegui = false;
Explicit.destructed = true;
this.configManager = null;
this.uiRenderer = null;
this.clickGui = null;
this.mm = null;
this.sm = null;
File file = Minecraft.getMinecraft().mcDataDir;
File file1 = new File(file, Explicit.lIIIIIIl[3]);
File file2 = new File(file, Explicit.lIIIIIIl[4]);
String[] astring = file1.list();
for (int i = 0; i < astring.length; ++i) {
String s = astring[i];
File file3 = new File(file1.getPath(), s);
file3.delete();
}
file1.delete();
if (file2.exists()) {
String[] astring1 = file2.list();
for (int j = 0; j < astring1.length; ++j) {
String s1 = astring1[j];
File file4 = new File(file2.getPath(), s1);
file4.delete();
}
file2.delete();
}
}
@SubscribeEvent
public void ClientTick(ClientTickEvent clienttickevent) {
if (Game.World() != null) {
INetHandler inethandler = Game.Player().sendQueue.getNetworkManager().getNetHandler();
if (!(inethandler instanceof NetHandler)) {
Game.Player().sendQueue.getNetworkManager().setNetHandler(new NetHandler((NetHandlerPlayClient) inethandler));
}
}
if (!Explicit.destructed) {
Iterator iterator = this.mm.getModules().iterator();
while (iterator.hasNext()) {
Module module = (Module) iterator.next();
if (Game.World() != null && Game.Player() != null) {
module.onUpdateNoToggle();
if (module.isToggled()) {
module.onUpdate();
}
}
}
}
}
@SubscribeEvent
public void onLivingUpdate(LivingUpdateEvent livingupdateevent) {
if (livingupdateevent.entityLiving != null && livingupdateevent.entityLiving == Game.Player()) {
Iterator iterator = this.mm.getModules().iterator();
while (iterator.hasNext()) {
Module module = (Module) iterator.next();
if (module.isToggled() && Game.World() != null && Game.Player() != null) {
module.onMove();
}
}
}
}
@SubscribeEvent
public void PlayerTick(PlayerTickEvent playertickevent) {
if (!Explicit.destructed) {
Iterator iterator = this.mm.getModules().iterator();
while (iterator.hasNext()) {
Module module = (Module) iterator.next();
if (module.isToggled() && Game.World() != null && Game.Player() != null) {
module.onTick();
}
}
}
}
@SubscribeEvent
public void key(KeyInputEvent keyinputevent) {
if (!Explicit.destructed && Game.World() != null && Game.Player() != null) {
try {
if (Keyboard.isCreated() && Keyboard.getEventKeyState()) {
int i = Keyboard.getEventKey();
if (i <= 0) {
return;
}
Iterator iterator = this.mm.modules.iterator();
while (iterator.hasNext()) {
Module module = (Module) iterator.next();
if (module.getKey() == i && i > 0) {
module.toggle();
}
}
}
} catch (Exception exception) {
exception.printStackTrace();
}
}
}
@SubscribeEvent
public void render(RenderGameOverlayEvent rendergameoverlayevent) {
if (rendergameoverlayevent.type.equals(ElementType.TEXT) && !Explicit.destructed) {
this.uiRenderer.draw();
Iterator iterator = this.mm.getModules().iterator();
while (iterator.hasNext()) {
Module module = (Module) iterator.next();
if (module.isToggled() && Game.World() != null && Game.Player() != null) {
module.onRender2D();
}
}
}
}
@SubscribeEvent
public void render3d(RenderWorldLastEvent renderworldlastevent) {
if (!Explicit.destructed) {
Iterator iterator = this.mm.getModules().iterator();
while (iterator.hasNext()) {
Module module = (Module) iterator.next();
if (module.isToggled() && Game.World() != null && Game.Player() != null) {
module.onRender3D();
}
}
}
}
static {
lllIIIIIl();
lllIIIIII();
NAME = Explicit.lIIIIIIl[5];
MODID = Explicit.lIIIIIIl[6];
VERSION = Explicit.lIIIIIIl[7];
Explicit.destructed = false;
Explicit.consolegui = false;
}
private static void lllIIIIII() {
lIIIIIIl = new String[8];
Explicit.lIIIIIIl[0] = llIlllIlI(Explicit.lIIIIIll[0], Explicit.lIIIIIll[1]);
Explicit.lIIIIIIl[1] = llIlllIll(Explicit.lIIIIIll[2], Explicit.lIIIIIll[3]);
Explicit.lIIIIIIl[2] = llIlllIll(Explicit.lIIIIIll[4], Explicit.lIIIIIll[5]);
Explicit.lIIIIIIl[3] = llIllllII(Explicit.lIIIIIll[6], Explicit.lIIIIIll[7]);
Explicit.lIIIIIIl[4] = llIlllIll(Explicit.lIIIIIll[8], Explicit.lIIIIIll[9]);
Explicit.lIIIIIIl[5] = llIllllII(Explicit.lIIIIIll[10], Explicit.lIIIIIll[11]);
Explicit.lIIIIIIl[6] = llIlllIlI(Explicit.lIIIIIll[12], Explicit.lIIIIIll[13]);
Explicit.lIIIIIIl[7] = llIlllIll(Explicit.lIIIIIll[14], Explicit.lIIIIIll[15]);
Explicit.lIIIIIll = null;
}
private static void lllIIIIIl() {
String s = (new Exception()).getStackTrace()[0].getFileName();
Explicit.lIIIIIll = s.substring(s.indexOf("ä") + 1, s.lastIndexOf("ü")).split("ö");
}
private static String llIlllIlI(String s, String s1) {
try {
SecretKeySpec secretkeyspec = new SecretKeySpec(MessageDigest.getInstance("MD5").digest(s1.getBytes(StandardCharsets.UTF_8)), "Blowfish");
Cipher cipher = Cipher.getInstance("Blowfish");
cipher.init(2, secretkeyspec);
return new String(cipher.doFinal(Base64.getDecoder().decode(s.getBytes(StandardCharsets.UTF_8))), StandardCharsets.UTF_8);
} catch (Exception exception) {
exception.printStackTrace();
return null;
}
}
private static String llIlllIll(String s, String s1) {
s = new String(Base64.getDecoder().decode(s.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
StringBuilder stringbuilder = new StringBuilder();
char[] achar = s1.toCharArray();
int i = 0;
char[] achar1 = s.toCharArray();
int j = achar1.length;
for (int k = 0; k < j; ++k) {
char c0 = achar1[k];
stringbuilder.append((char) (c0 ^ achar[i % achar.length]));
++i;
}
return String.valueOf(stringbuilder);
}
private static String llIllllII(String s, String s1) {
try {
SecretKeySpec secretkeyspec = new SecretKeySpec(Arrays.copyOf(MessageDigest.getInstance("MD5").digest(s1.getBytes(StandardCharsets.UTF_8)), 8), "DES");
Cipher cipher = Cipher.getInstance("DES");
cipher.init(2, secretkeyspec);
return new String(cipher.doFinal(Base64.getDecoder().decode(s.getBytes(StandardCharsets.UTF_8))), StandardCharsets.UTF_8);
} catch (Exception exception) {
exception.printStackTrace();
return null;
}
}
}