Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions legacyforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies {
jar {
exclude("cpw/mods/fml/relauncher/FMLInjectionData.class")
exclude("net/minecraftforge/fml/relauncher/FMLInjectionData.class")
exclude("cpw/mods/fml/relauncher/IClassTransformer.class")

manifest {
attributes([
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package cpw.mods.fml.relauncher;

public interface IClassTransformer
{
public byte[] transform(String name, byte[] bytes); // 1.4
public byte[] transform(String name, String transformedName, byte[] bytes); // 1.5
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.dogboy.serializationisbad.core.Patches;
import net.minecraft.launchwrapper.IClassTransformer;

public class SIBTransformer implements IClassTransformer {
public class SIBTransformerLaunchwrapper implements IClassTransformer {
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if (Patches.getPatchModuleForClass(transformedName) == null) return basicClass;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.dogboy.serializationisbad.legacyforge;

import cpw.mods.fml.relauncher.IClassTransformer;
import io.dogboy.serializationisbad.core.Patches;

public class SIBTransformerRelauncher implements IClassTransformer {
@Override
public byte[] transform(String name, byte[] bytes) {
return this.transform(null, name, bytes);
}

@Override
public byte[] transform(String name, String transformedName, byte[] bytes) {
if (Patches.getPatchModuleForClass(transformedName) == null) return bytes;

return Patches.patchClass(bytes, transformedName, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,23 @@ public SerializationIsBadCoreMod() {
SerializationIsBad.init(minecraftHome);
}

@Override
public String[] getLibraryRequestClass() {
return new String[0];
}

@Override
public String[] getASMTransformerClass() {
if (SerializationIsBad.isAgentActive()) return new String[0];

return new String[]{ SIBTransformer.class.getCanonicalName() };
// Check if we're in Forge Relauncher era (pre 1.6)
try {
Class.forName("cpw.mods.fml.relauncher.IClassTransformer");
return new String[] { SIBTransformerRelauncher.class.getCanonicalName() };
} catch (ClassNotFoundException ignored) {}

// Launchwrapper / LegacyLauncher
return new String[]{ SIBTransformerLaunchwrapper.class.getCanonicalName() };
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
*/
public interface IFMLLoadingPlugin
{
/**
* Return a list of classes that implement the ILibrarySet interface
*
* @return a list of classes that implement the ILibrarySet interface
*/
String[] getLibraryRequestClass();

/**
* Return a list of classes that implements the IClassTransformer interface
* @return a list of classes that implements the IClassTransformer interface
Expand Down
18 changes: 16 additions & 2 deletions serializationisbad.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,12 @@
"logisticspipes.network.packets.debuggui.DebugInfoUpdate",
"logisticspipes.network.packets.debuggui.DebugTargetResponse",
"logisticspipes.network.packets.debuggui.DebugTypePacket",
"logisticspipes.network.packets.routingdebug.RoutingUpdateTargetResponse"
"logisticspipes.network.packets.routingdebug.RoutingUpdateTargetResponse",
"logisticspipes.network.packets.GuiArgumentPacket"
],
"classAllowlist": [
"I"
],
"classAllowlist": [],
"packageAllowlist": [
"logisticspipes"
]
Expand Down Expand Up @@ -368,6 +371,17 @@
"packageAllowlist": [
"com.possible_triangle.brazier"
]
},
{
"classesToPatch": [
"com.thevoxelbox.voxelpacket.common.encoders.VoxelPacketEncoderObject"
],
"classAllowlist": [],
"packageAllowlist": [
"com.thevoxelbox.voxelmap",
"com.thevoxelbox.voxelpacket",
"com.thevoxelbox.voxelplayer"
]
}
],
"classAllowlist": [
Expand Down