Created
August 23, 2016 18:14
-
-
Save MrPowerGamerBR/a8528e94360721e29773617c63648bf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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