-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
ecf2d1a
commit 30ec0dc
Showing
6 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
13 changes: 13 additions & 0 deletions
13
src/main/java/anticope/rejects/mixin/HandshakeC2SPacketAccessor.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package anticope.rejects.mixin; | ||
|
||
import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(HandshakeC2SPacket.class) | ||
public interface HandshakeC2SPacketAccessor { | ||
@Mutable | ||
@Accessor | ||
void setAddress(String address); | ||
} |
69 changes: 69 additions & 0 deletions
69
src/main/java/anticope/rejects/modules/BungeeCordSpoof.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package anticope.rejects.modules; | ||
|
||
import anticope.rejects.MeteorRejectsAddon; | ||
import anticope.rejects.mixin.HandshakeC2SPacketAccessor; | ||
import com.google.gson.Gson; | ||
import com.mojang.authlib.properties.PropertyMap; | ||
import meteordevelopment.meteorclient.events.packets.PacketEvent; | ||
import meteordevelopment.meteorclient.settings.*; | ||
import meteordevelopment.meteorclient.systems.modules.Module; | ||
import meteordevelopment.meteorclient.utils.Utils; | ||
import meteordevelopment.orbit.EventHandler; | ||
import net.minecraft.network.NetworkState; | ||
import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; | ||
|
||
import java.util.List; | ||
|
||
public class BungeeCordSpoof extends Module { | ||
private final SettingGroup sgGeneral = settings.getDefaultGroup(); | ||
|
||
private static final Gson GSON = new Gson(); | ||
|
||
private final Setting<Boolean> whitelist = sgGeneral.add(new BoolSetting.Builder() | ||
.name("whitelist") | ||
.description("Use whitelist.") | ||
.defaultValue(false) | ||
.build() | ||
); | ||
|
||
private final Setting<List<String>> whitelistedServers = sgGeneral.add(new StringListSetting.Builder() | ||
.name("whitelisted-servers") | ||
.description("Will only work if you joined the servers above.") | ||
.visible(whitelist::get) | ||
.build() | ||
); | ||
|
||
private final Setting<Boolean> spoofProfile = sgGeneral.add(new BoolSetting.Builder() | ||
.name("spoof-profile") | ||
.description("Spoof account profile.") | ||
.defaultValue(false) | ||
.build() | ||
); | ||
|
||
private final Setting<String> forwardedIP = sgGeneral.add(new StringSetting.Builder() | ||
.name("forwarded-IP") | ||
.description("The forwarded IP address.") | ||
.defaultValue("127.0.0.1") | ||
.build() | ||
); | ||
|
||
public BungeeCordSpoof() { | ||
super(MeteorRejectsAddon.CATEGORY, "bungeeCord-spoof", "Let you join BungeeCord servers, useful when bypassing proxies."); | ||
runInMainMenu = true; | ||
} | ||
|
||
@EventHandler | ||
private void onPacketSend(PacketEvent.Send event) { | ||
if (event.packet instanceof HandshakeC2SPacket packet && packet.getIntendedState() == NetworkState.LOGIN) { | ||
if (whitelist.get() && !whitelistedServers.get().contains(Utils.getWorldName())) return; | ||
String address = packet.getAddress() + "\0" + forwardedIP + "\0" + mc.getSession().getUuid().replace("-", "") | ||
+ (spoofProfile.get() ? getProperty() : ""); | ||
((HandshakeC2SPacketAccessor) packet).setAddress(address); | ||
} | ||
} | ||
|
||
private String getProperty() { | ||
PropertyMap propertyMap = mc.getSession().getProfile().getProperties(); | ||
return "\0" + GSON.toJson(propertyMap.values().toArray()); | ||
} | ||
} |
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