Skip to content

Commit

Permalink
disabler
Browse files Browse the repository at this point in the history
  • Loading branch information
liuli committed May 26, 2021
1 parent 29b2d04 commit b678556
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,161 @@ package net.ccbluex.liquidbounce.features.module.modules.exploit

import net.ccbluex.liquidbounce.event.EventTarget
import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.event.UpdateEvent
import net.ccbluex.liquidbounce.event.WorldEvent
import net.ccbluex.liquidbounce.features.BoolValue
import net.ccbluex.liquidbounce.features.ListValue
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.ModuleCategory
import net.ccbluex.liquidbounce.features.module.ModuleInfo
import net.ccbluex.liquidbounce.utils.ClientUtils
import net.ccbluex.liquidbounce.utils.misc.RandomUtils
import net.minecraft.network.play.client.C00PacketKeepAlive
import net.minecraft.network.play.client.C0FPacketConfirmTransaction
import net.minecraft.network.play.client.*
import net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition
import net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook
import net.minecraft.network.play.server.S08PacketPlayerPosLook
import kotlin.math.roundToInt
import kotlin.math.sqrt

@ModuleInfo(name = "Disabler", description = "Disable anticheats", category = ModuleCategory.EXPLOIT)
class Disabler : Module() {
private val modeValue= ListValue("Mode",arrayOf("MinePlexCombat","OldHypixel"),"MinePlexCombat")
private val modeValue= ListValue("Mode",arrayOf("MinePlexCombat","OldHypixel","VerusCombat","VerusCombat2","VerusMovement"),"MinePlexCombat")
private val debug = BoolValue("Debug", true)
private var nextPass=false

private var verus2Stat=false
private var transPackets=mutableListOf<C0FPacketConfirmTransaction>()
private var currentTrans=0

override fun onEnable() {
nextPass=false
reset()
}

@EventTarget
fun onWorld(event: WorldEvent){
reset()
}

private fun reset(){
currentTrans=0
verus2Stat=false
transPackets.clear()
}

@EventTarget
fun onPacket(event: PacketEvent){
val packet=event.packet

when(modeValue.get().toLowerCase()){
"mineplexcombat" -> {
if (packet is C00PacketKeepAlive) {
nextPass=!nextPass
if(!nextPass){
event.cancelEvent()
ClientUtils.sendPacketNoEvent(C00PacketKeepAlive(packet.key-RandomUtils.nextInt(1000, 2147483647)))
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Packet C00")
}
}

"oldhypixel" -> {
if (packet is C0FPacketConfirmTransaction) {
if (packet.uid < 0 && packet.windowId == 0) {
event.cancelEvent()
mc.netHandler.addToSendQueue(C00PacketKeepAlive(packet.key-RandomUtils.nextInt(1000, 2147483647)))
if (!debug.get()) return
ClientUtils.displayChatMessage("[Disabler] Packet C00")
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Packet C0F")
}
}
}
"OldHypixel" -> {

"veruscombat" -> {
if (packet is C0FPacketConfirmTransaction) {
if (packet.uid < 0 && packet.windowId == 0) {
if(currentTrans > 0) event.cancelEvent()
currentTrans++
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Packet C0F (Trans=$currentTrans)")
} else if(packet is C0BPacketEntityAction) {
event.cancelEvent()
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Packet C0B")
}
}

"veruscombat2" -> {
if (packet is C0FPacketConfirmTransaction) {
if (!verus2Stat) {
transPackets.add(packet)
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Add Packet")
event.cancelEvent()
} else {
verus2Stat = false
}
}else if (packet is C00PacketKeepAlive) {
ClientUtils.sendPacketNoEvent(C00PacketKeepAlive(RandomUtils.nextInt(1, 2147483647)))
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Keep Alive")
event.cancelEvent()
}else if (packet is C03PacketPlayer) {
ClientUtils.sendPacketNoEvent(C0CPacketInput())
if (mc.thePlayer.ticksExisted % 15 == 0) {
packet.y += RandomUtils.nextInt(100, 1000)
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Packet C03")
}
}
}

"verusmove" -> {
if (mc.thePlayer != null && mc.thePlayer.ticksExisted == 0) transPackets.clear()
if (packet is C03PacketPlayer) {
// Set position to a valid block height (so Spoof NoFall works)
val yPos = (mc.thePlayer.posY / 0.015625).roundToInt() * 0.015625
mc.thePlayer.setPosition(mc.thePlayer.posX, yPos, mc.thePlayer.posZ)
if (mc.thePlayer.ticksExisted % 45 == 0) {
// Clip into ground and silently accept the teleport from the server. (This fucks with teleport compensation LOL)
ClientUtils.sendPacketNoEvent(C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true))
ClientUtils.sendPacketNoEvent(C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY - 11.725, mc.thePlayer.posZ, false))
ClientUtils.sendPacketNoEvent(C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true))
}
} else if (packet is S08PacketPlayerPosLook) {
val x = packet.x - mc.thePlayer.posX
val y = packet.y - mc.thePlayer.posY
val z = packet.z - mc.thePlayer.posZ
val diff = sqrt(x * x + y * y + z * z)
// Cancel the teleport, and silently accept it.
if (diff <= 8) {
event.cancelEvent()
if (!debug.get()) return
ClientUtils.displayChatMessage("[Disabler] Cancel C0F")
// LATEST verus ALWAYS expects a c06 within 30 seconds of a teleport if packets have been sent from the client after the teleport.
ClientUtils.sendPacketNoEvent(C06PacketPlayerPosLook(packet.x, packet.y, packet.z, packet.getYaw(), packet.getPitch(), true))
}
} else if (packet is C0FPacketConfirmTransaction) {
for (i in 0..3) {
// Make sure to dupe packets 4 times, since it will match up with the missing packets while keeping the anticheat disabled, in order to bypass ping spoof checks
// why the fuck do they not checked duped transactions? LMFAO
transPackets.add(packet)
}
event.cancelEvent()
}
}
}
}

@EventTarget
fun onUpdate(event: UpdateEvent){
when(modeValue.get().toLowerCase()){
"veruscombat2" -> {
mc.timer.timerSpeed = 0.6F
if (mc.thePlayer.ticksExisted % 50 == 0 && (transPackets.size - 1) > currentTrans) {
verus2Stat = true
ClientUtils.sendPacketNoEvent(transPackets[++currentTrans])
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Send Trans")
}
if (mc.thePlayer.ticksExisted % 500 == 0) {
transPackets.clear()
if (debug.get()) ClientUtils.displayAlert(" [Disabler] Clear Trans")
currentTrans = 0
}
}

"verusmove" -> {
// Partially drain the queue every 180 ticks (9 seconds), to prevent flagging Ping Spoof.
if (mc.thePlayer.ticksExisted % 180 == 0) {
// grab packets untill the queue size is 22 or less.
while (transPackets.size > 22) {
// grab 1 packet, send and then remove it from the queue
ClientUtils.sendPacketNoEvent(transPackets[0])
transPackets.removeAt(0)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void checkHud(){
public void printChatMessage(IChatComponent chatComponent) {
checkHud();
if(!hud.getChatCombineValue().get()) {
printChatMessageWithOptionalDeletion(chatComponent, this.line);
printChatMessageWithOptionalDeletion(chatComponent, 0);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.ccbluex.liquidbounce.event.PacketEvent;
import net.ccbluex.liquidbounce.features.special.proxy.ProxyManager;
import net.ccbluex.liquidbounce.features.special.proxy.ProxyOioChannelFactory;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.minecraft.network.EnumPacketDirection;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
Expand Down Expand Up @@ -49,11 +50,13 @@ private void read(ChannelHandlerContext context, Packet<?> packet, CallbackInfo

@Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true)
private void send(Packet<?> packet, CallbackInfo callback) {
final PacketEvent event = new PacketEvent(packet);
LiquidBounce.eventManager.callEvent(event);
if(!ClientUtils.handlePacket(packet)){
final PacketEvent event = new PacketEvent(packet);
LiquidBounce.eventManager.callEvent(event);

if(event.isCancelled())
callback.cancel();
if(event.isCancelled())
callback.cancel();
}
}

@Overwrite
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/net/ccbluex/liquidbounce/ui/click/ClickGui.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
package net.ccbluex.liquidbounce.ui.click

import net.minecraft.client.gui.GuiScreen
import org.lwjgl.opengl.GL11

open class ClickGui : GuiScreen() {
open val name=""
open val scale=1F

override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) {
GL11.glPushMatrix()

GL11.glScalef(scale,scale,scale)

render(width*scale.toInt(), height*scale.toInt(), mouseX, mouseY, partialTicks)

GL11.glPopMatrix()
}

open fun render(width: Int, height: Int, mouseX: Int, mouseY: Int, partialTicks: Float) {}

open fun load() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@ import net.ccbluex.liquidbounce.features.module.ModuleCategory
import net.ccbluex.liquidbounce.ui.click.utils.ClickGuiUtils
import net.ccbluex.liquidbounce.ui.font.Fonts
import net.ccbluex.liquidbounce.utils.MinecraftInstance
import org.lwjgl.opengl.GL11
import java.awt.Color

class ClickList(val category: ModuleCategory, var x: Int, var y: Int, var modules: List<Module>) : MinecraftInstance() {
var toggle=false

fun render(){
ClickGuiUtils.rainbowRect(x.toDouble(),y.toDouble(),x+100.0,y+20.0,255)
Fonts.fontBold40.drawString(category.displayName,x+6F,y+10F-(Fonts.fontBold40.height*0.5F), Color.WHITE.rgb)
GL11.glPushMatrix()
GL11.glTranslatef(x.toFloat(),y.toFloat(),0F)

ClickGuiUtils.rainbowRect(0.0,0.0,100.0,20.0,255)
Fonts.fontBold40.drawString(category.displayName,6F,10F-(Fonts.fontBold40.height*0.5F), Color.WHITE.rgb)

if(toggle) {
ClickGuiUtils.borderRect(0.0, 20.0, 100.0, 300.0)
}

ClickGuiUtils.borderRect(x.toDouble(),y+20.0,x+100.0,y+300.0)
GL11.glPopMatrix()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import net.ccbluex.liquidbounce.LiquidBounce
import net.ccbluex.liquidbounce.features.module.ModuleCategory
import net.ccbluex.liquidbounce.ui.click.ClickGui
import net.ccbluex.liquidbounce.ui.click.utils.ClickGuiUtils
import net.ccbluex.liquidbounce.utils.render.ColorUtils
import net.ccbluex.liquidbounce.utils.render.RenderUtils
import java.awt.Color

// arrow 🢒
class RainbowGui : ClickGui() {
Expand All @@ -16,17 +13,17 @@ class RainbowGui : ClickGui() {
val clickLists = ArrayList<ClickList>()

override fun load() {
var x=5
var y=5
ModuleCategory.values().forEach {
val clickList=ClickList(it,x,5,LiquidBounce.moduleManager.modules.filter { module -> module.category==it })
val clickList=ClickList(it,5,y,LiquidBounce.moduleManager.modules.filter { module -> module.category==it })

clickLists.add(clickList)

x+=110
y+=30
}
}

override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) {
override fun render(width: Int, height: Int, mouseX: Int, mouseY: Int, partialTicks: Float) {
var x = 0
while (x < (width+50)) {
var y = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ object ClickGuiUtils {
}

fun getColor(x: Double, y: Double, alpha: Int): Color {
return ColorUtils.rainbow(((x+1)*(y+1)).toLong()*10000L,alpha)
return ColorUtils.rainbow((x+1).toLong()*5000000L,alpha)
}
}
Loading

0 comments on commit b678556

Please sign in to comment.