Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(legacy): Added New Disablers #5195

Open
wants to merge 2 commits into
base: legacy
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit

import net.ccbluex.liquidbounce.config.boolean
import net.ccbluex.liquidbounce.config.int
import net.ccbluex.liquidbounce.config.text
import net.ccbluex.liquidbounce.config.*
import net.ccbluex.liquidbounce.event.*
import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.script.api.global.Chat
import net.ccbluex.liquidbounce.utils.client.ClientUtils.displayChatMessage
import net.ccbluex.liquidbounce.utils.client.PacketUtils.sendPacket
import net.ccbluex.liquidbounce.utils.client.chat
import net.ccbluex.liquidbounce.utils.extensions.isInLiquid
Expand All @@ -20,12 +20,15 @@ import net.ccbluex.liquidbounce.utils.inventory.InventoryUtils
import net.ccbluex.liquidbounce.utils.movement.MovementUtils.airTicks
import net.minecraft.init.Items
import net.minecraft.item.ItemStack
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement
import net.minecraft.network.play.client.C0BPacketEntityAction
import net.minecraft.network.play.client.C0FPacketConfirmTransaction
import net.minecraft.network.Packet
import net.minecraft.network.play.INetHandlerPlayClient
import net.minecraft.network.play.client.*
import net.minecraft.network.play.server.S07PacketRespawn
import net.minecraft.network.play.server.S08PacketPlayerPosLook
import net.minecraft.network.play.server.S32PacketConfirmTransaction
import java.util.concurrent.LinkedBlockingQueue
import net.minecraft.client.gui.inventory.GuiInventory
import net.minecraft.potion.Potion

object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
val startSprint by boolean("StartSprint", true)
Expand All @@ -41,26 +44,174 @@ object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
val verusCombat by boolean("VerusCombat", false)
val onlyCombat by boolean("OnlyCombat", true) { verusCombat }

val intaveFly by boolean("intaveFly", false)
private var shouldDelay = false
private val packets = LinkedBlockingQueue<Packet<INetHandlerPlayClient>>()

val noRotationDisabler by boolean("NoRotationDisabler", false)

val modifyModeValue by choices("Mode", arrayOf("ConvertNull", "Spoof", "Zero", "SpoofZero", "Negative", "OffsetYaw", "Invalid"), "NoRotationDisabler") { noRotationDisabler }
val offsetAmountValue by float("OffsetAmount", 6f, -180f.. 180f) { noRotationDisabler }

val basicDisabler by boolean("BasicDisabler", false)

val cancelC00Value by boolean("CancelC00", true) { basicDisabler }
val cancelC0FValue by boolean("CancelC0F", true) { basicDisabler }
val cancelC0AValue by boolean("CancelC0A", true) { basicDisabler }
val cancelC0BValue by boolean("CancelC0B", true) { basicDisabler }
val cancelC07Value by boolean("CancelC07", true) { basicDisabler }
val cancelC13Value by boolean("CancelC13", true) { basicDisabler }
val cancelC03Value by boolean("CancelC03", true) { basicDisabler }
val c03NoMoveValue by boolean("C03-NoMove", true) { basicDisabler }

private val hypixelMotion by boolean("HypixelMotion", false)
private val notWhenStarAvailable by boolean("NotWithStar", true) { hypixelMotion }

// Watchdog Motion
private val watchdogMotion by boolean("Watchdog Motion", false)
private val wdMode by choices("Game Mode", arrayOf("BW", "SW"), "SW") { watchdogMotion }

// Watchdog Inventory
private val watchdogInventory by boolean("Watchdog Inventory", false)

val spigotSpam by boolean("SpigotSpam", false)
val message by text("Message", "/skill") { spigotSpam }

private val debugValue by boolean("Debug", false)

private var transaction = false
var isOnCombat = false

private var flags = 0
private var execute = false
private var jump = false

//Watchdog Motion
private var wdDisabled = false
private var wdTestTicks = 0
private var offGroundTicks = 0

//Watchdog Inventory
private var c16 = false
private var c0d = false

private val hasStar
get() = InventoryUtils.findItem(36, 44, Items.nether_star) != null

val onPacket = handler<PacketEvent> { event ->
val player = mc.thePlayer ?: return@handler
val packet = event.packet

// Basic Disabler
if (basicDisabler) {
when (packet) {
is C00PacketKeepAlive -> if (cancelC00Value) {
event.cancelEvent()
debugMessage("Cancel C00-KeepAlive")
}
is C0FPacketConfirmTransaction -> if (cancelC0FValue) {
event.cancelEvent()
debugMessage("Cancel C0F-Transaction")
}
is C0APacketAnimation -> if (cancelC0AValue) {
event.cancelEvent()
debugMessage("Cancel C0A-Swing")
}
is C0BPacketEntityAction -> if (cancelC0BValue) {
event.cancelEvent()
debugMessage("Cancel C0B-Action")
}
is C07PacketPlayerDigging -> if (cancelC07Value) {
event.cancelEvent()
debugMessage("Cancel C07-Digging")
}
is C13PacketPlayerAbilities -> if (cancelC13Value) {
event.cancelEvent()
debugMessage("Cancel C13-Abilities")
}
is C03PacketPlayer -> if (cancelC03Value && !(packet is C03PacketPlayer.C04PacketPlayerPosition || packet is C03PacketPlayer.C05PacketPlayerLook || packet is C03PacketPlayer.C06PacketPlayerPosLook)) {
if (c03NoMoveValue && player.isMoving) return@handler
event.cancelEvent()
debugMessage("Cancel C03-Flying")
}
}
}

// NoRotationDisabler
if (noRotationDisabler && packet is C03PacketPlayer) {

when (modifyModeValue) {
"ConvertNull" -> {
if (packet.isMoving) {
sendPacket(
C03PacketPlayer.C04PacketPlayerPosition(
packet.x,
packet.y,
packet.z,
packet.onGround
)
)
} else {
sendPacket(C03PacketPlayer(packet.onGround))
}
event.cancelEvent()
}

"Spoof" -> {
if (packet.getRotating()) {
packet.yaw = player.rotationYaw
packet.pitch = player.rotationPitch
}
}

"Zero" -> {
if (packet.getRotating()) {
packet.yaw = 0.0f
packet.pitch = 0.0f
}
}

"SpoofZero" -> {
if (packet.isMoving) {
sendPacket(
C03PacketPlayer.C06PacketPlayerPosLook(
packet.x,
packet.y,
packet.z,
0.0f,
0.0f,
packet.onGround
)
)
} else {
sendPacket(
C03PacketPlayer.C06PacketPlayerPosLook(
player.posX,
player.posY,
player.posZ,
0.0f,
0.0f,
packet.onGround
)
)
}
event.cancelEvent()
}

"Negative" -> {
if (packet.getRotating()) {
packet.yaw = -packet.yaw
packet.pitch = -packet.pitch
}
}

"OffsetYaw" -> {
if (packet.getRotating()) {
packet.yaw += offsetAmountValue
}
}
}
}
/**
* Working on Hypixel (Watchdog)
* Tested on: play.hypixel.net
Expand All @@ -84,6 +235,43 @@ object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
}
}

// Watchdog Motion
if (watchdogMotion) {
if (packet is S08PacketPlayerPosLook) {
if(wdTestTicks != -1)
wdTestTicks++
if (wdTestTicks >= 20) {
wdDisabled = false
wdTestTicks = -1
displayChatMessage("§aSuccessfully Disabled Watchdog. Enjoy lowhopping yay")
} else {
player.motionY = 0.0
player.motionZ = 0.0
player.motionX = 0.0
}
if (wdDisabled) {
displayChatMessage("§cDon't Move! Disabling Motion Checks")
}
}
}

// Watchdog Inventory
if(watchdogInventory){
if (packet is C16PacketClientStatus) {
if (c16) {
event.cancelEvent()
}
c16 = true
}

if (packet is C0DPacketCloseWindow) {
if (c0d) {
event.cancelEvent()
}
c0d = true
}
}

if (grimPlace) {
if (packet is C08PacketPlayerBlockPlacement && packet.placedBlockDirection in 0..5) {
event.cancelEvent()
Expand All @@ -104,6 +292,20 @@ object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
}
}

if (intaveFly) {
if (packet is S08PacketPlayerPosLook) {
if (player.capabilities.isFlying) {
shouldDelay = true
displayChatMessage("§cStart Canceling IntaveFly")
}
}

if (packet is S32PacketConfirmTransaction && shouldDelay) {
event.cancelEvent()
packets.add(packet as Packet<INetHandlerPlayClient>)
}
}

if (verusCombat) {
if (player.ticksExisted <= 20) {
isOnCombat = false
Expand Down Expand Up @@ -163,6 +365,24 @@ object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
}
player.setVelocity(0.0, 0.0, 0.0)
}


// Watchdog Motion
if (watchdogMotion) {
if (!checkCompass()) {
if (player.onGround && jump) {
jump = false
wdDisabled = true
player.jump()
} else if (wdTestTicks != -1 && wdDisabled && (wdMode == "SW" && offGroundTicks >= 3 || wdMode == "BW" && offGroundTicks >= 10)) {
if (offGroundTicks % 2 == 0) {
setRotation(floatArrayOf((player.rotationYaw - 10 + (Math.random() - 0.5) * 3).toFloat(), player.rotationPitch))
event.x += 0.095 + Math.random() / 100
}
stop(player)
}
}
}
}

val onUpdate = handler<UpdateEvent> {
Expand All @@ -174,6 +394,19 @@ object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
}
}

// Watchdog Inventory
if(watchdogInventory){
c16 = false
c0d = false
if (mc.currentScreen is GuiInventory) {
if (player.ticksExisted % (if(player.isPotionActive(Potion.moveSpeed)) 3 else 4) == 0) {
sendPacket(C0DPacketCloseWindow(),false)
} else if (player.ticksExisted % (if(player.isPotionActive(Potion.moveSpeed)) 3 else 4) == 1) {
sendPacket(C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT),false)
}
}
}

if (verusFly) {
if (!isOnCombat && !player.isDead) {
val pos = player.position.add(0, if (player.posY > 0) -255 else 255, 0) ?: return@handler
Expand Down Expand Up @@ -201,13 +434,47 @@ object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
}
}
}
if(!player.onGround){
offGroundTicks++
} else {
offGroundTicks = 0
}
}

fun debugMessage(str: String) {
if (debugValue) {
Chat.print("§f$str")
}
}
private fun stop(player: net.minecraft.client.entity.EntityPlayerSP) {
player.motionX = 0.0
player.motionY = 0.0
player.motionZ = 0.0
}
private fun setRotation(rotation: FloatArray) {
val player = mc.thePlayer ?: return
player.rotationYaw = rotation[0]
player.rotationPitch = rotation[1]
}

val onAttack = handler<AttackEvent> {
isOnCombat = true
}

val onWorld = handler<WorldEvent> {
wdDisabled = false
jump = true
wdTestTicks = 0
offGroundTicks = 0
isOnCombat = false
}
fun checkCompass(): Boolean {
for (i in 0..8) {
val stackInSlot = mc.thePlayer.inventory.getStackInSlot(i)
if (stackInSlot != null && stackInSlot.unlocalizedName.toLowerCase().contains("compass")) {
return true
}
}
return false
}
}
Loading