GrimAnticheat / Grim

Fully async, multithreaded, predictive, open source, 3.01 reach, 1.005 timer, 0.01% speed, 99.99% antikb, "bypassable" 1.8-1.20 anticheat.
GNU General Public License v3.0
984 stars 278 forks source link

NoSlowEat Bypass at 1.12.2 #1343

Open Zamx114514 opened 5 months ago

Zamx114514 commented 5 months ago

Describe the bypass and how to replicate it

Use this source code to bypass running and eating in 1.12.2. I am Chinese and my expression is not very good. video:https://www.youtube.com/watch?v=u9FUMqqI7YQ

package net.ccbluex.liquidbounce.features.module.modules.movement

import net.ccbluex.liquidbounce.event. 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.injection.backend.unwrap import net.minecraft.block.Block import net.minecraft.inventory.ClickType import net.minecraft.item. import net.minecraft.network.Packet import net.minecraft.network.play.INetHandlerPlayClient import net.minecraft.network.play.client.CPacketClickWindow import net.minecraft.network.play.client.CPacketCloseWindow import net.minecraft.network.play.client.CPacketConfirmTransaction import net.minecraft.network.play.client.CPacketPlayerTryUseItem import net.minecraft.network.play.server.SPacketConfirmTransaction import net.minecraft.network.play.server.SPacketSetSlot import net.minecraft.network.play.server.SPacketWindowItems import java.util.*

@ModuleInfo(name = "NewHytNoSlow", description = " Fix!!! Only GrimAC at1.12.2", category = ModuleCategory.MOVEMENT) class NewHytNoSlow : Module() { private var packetBuf = LinkedList<Packet>() private var slow = false private var fuckjby = "你好反编译神 你妈炸了" override fun onEnable() { slow = false fuckjby = "FUCK YOU" }

override fun onDisable() {
    blink()
}

@EventTarget
fun onTick(event: TickEvent) {
    val stack = mc.thePlayer?.unwrap()?.activeItemStack ?: return
    if (stack == ItemStack.EMPTY) {
        blink()
    }
    if (slow) { 
        flush_inv()
    }
}

@EventTarget
fun onPacket(event: PacketEvent) {
    val pw = event.packet.unwrap()
    if (pw is CPacketPlayerTryUseItem) {
        val stack = mc.thePlayer?.unwrap()?.getHeldItem(pw.hand)?.item ?: return
        if (stack is ItemSword || stack is ItemFood || stack is ItemPotion || stack is ItemBucketMilk || stack is ItemBow || stack is ItemShield) {
            mc2.gameSettings.keyBindJump.pressed = true
            mc2.gameSettings.keyBindJump.pressed = false
            slow = true
            flush_inv()
            mc2.gameSettings.keyBindJump.pressed = true
            mc2.gameSettings.keyBindJump.pressed = false
        }
    }

    if (pw is SPacketWindowItems && pw.windowId == 0) {
        if ((mc.thePlayer?.unwrap()?.activeItemStack ?: ItemStack.EMPTY) != ItemStack.EMPTY) {
            packetBuf.add(pw)
            event.cancelEvent()
        }
        slow = false
    } else if (pw is SPacketSetSlot && (pw.windowId == 0 || pw.windowId == -1 || pw.windowId == -2) && (mc.thePlayer?.unwrap()?.activeItemStack ?: ItemStack.EMPTY) != ItemStack.EMPTY) {
        packetBuf.add(pw)
        event.cancelEvent()
    } else if (pw is SPacketConfirmTransaction && pw.windowId == 0 && pw.actionNumber != 19198.toShort() && slow) {
        val connection = mc.unwrap().connection ?: return
        connection.sendPacket(CPacketConfirmTransaction(0, 19198.toShort(), true))
    }
}

@EventTarget
fun onSlowDown(event: SlowDownEvent) {
    if (slow) {
        mc2.gameSettings.keyBindJump.pressed = true
        mc2.gameSettings.keyBindJump.pressed = false
        event.forward = 0f;  //修改这里即可绕过
        event.strafe = 0f;    //修改这里即可绕过
        mc2.gameSettings.keyBindJump.pressed = true
        mc2.gameSettings.keyBindJump.pressed = false
    } else {
        event.forward = 1f;
        event.strafe = 1f;
    }
}

fun blink() {
    val connection = mc.unwrap().connection ?: return
    for (i in packetBuf)
        i.processPacket(connection)
    packetBuf.clear()
}

fun flush_inv() {
    val connection = mc.unwrap().connection ?: return
    if (this.windowId == 0) {
        connection.sendPacket(CPacketClickWindow(0, 36, 0, ClickType.CLONE, ItemStack(Block.getBlockById(1)), 19198.toShort()))
    }
}

val windowId: Int
    get() {
        var id = 0
        if (mc.thePlayer != null && mc.thePlayer!!.openContainer != null) {
            id = mc.thePlayer!!.openContainer!!.windowId
        }
        return id
    }

}

Grim version

grimac-2.3.55

Server version

1.12.2

Plugins

grimac-2.3.55.jar

ManInMyVan commented 4 months ago

Looks like #1199

Margele commented 4 months ago

genshin impact

Dawn5ky commented 3 months ago

genshin impact

huzpsb commented 1 month ago

1091

ManInMyVan commented 1 month ago

1091

How? They never send a slot change