Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@SuppressWarnings("rawtypes")
public boolean isExploit(NbtCompound root) {
// Item
if (root.containsKey("SkullOwner")) {
NbtCompound skullOwner = root.getCompound("SkullOwner");
if (skullOwner.containsKey("Properties")) {
NbtCompound properties = skullOwner.getCompound("Properties");
if (properties.containsKey("textures")) {
NbtList<NbtBase> textures = properties.getList("textures");
for (NbtBase texture : textures.asCollection()) {
if (texture instanceof NbtCompound) {
if (!((NbtCompound) texture).containsKey("Signature")) {
// Check for value
if (((NbtCompound) texture).containsKey("Value")) {
// easy bypass. add to Value "==" and others symbols
if (((NbtCompound) texture).getString("Value").trim().length() > 0) {
return false;
}
}
root.remove("SkullOwner");
return true;
}
if (((NbtCompound) texture).containsKey("Signature")) {
NbtCompound text = (NbtCompound) texture;
if (text.getString("Signature").equals("")) {
root.remove("SkullOwner");
return true;
}
}
if (((NbtCompound) texture).containsKey("Value")) {
NbtCompound text = (NbtCompound) texture;
if (text.getString("Value").equals("")) {
root.remove("SkullOwner");
return true;
}
}
}
}
}
}
}
// Block
if (root.containsKey("Owner")) {
NbtCompound skullOwner = root.getCompound("Owner");
if (skullOwner.containsKey("Properties")) {
NbtCompound properties = skullOwner.getCompound("Properties");
if (properties.containsKey("textures")) {
NbtList<NbtBase> textures = properties.getList("textures");
for (NbtBase texture : textures.asCollection()) {
if (texture instanceof NbtCompound) {
if (!((NbtCompound) texture).containsKey("Signature")) {
if (((NbtCompound) texture).containsKey("Value")) {
if (((NbtCompound) texture).getString("Value").trim().length() > 0) {
return false;
}
}
root.remove("Owner");
return true;
}
if (((NbtCompound) texture).containsKey("Signature")) {
NbtCompound text = (NbtCompound) texture;
if (text.getString("Signature").equals("")) {
root.remove("Owner");
return true;
}
}
if (((NbtCompound) texture).containsKey("Value")) {
NbtCompound text = (NbtCompound) texture;
if (text.getString("Value").equals("")) {
root.remove("Owner");
return true;
}
}
}
}
}
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.