Search in sources :

Example 1 with CC_ClassWriter

use of codechicken.lib.asm.CC_ClassWriter in project Galacticraft by micdoodle8.

the class MCPDeobfuscationTransformer method transform.

@Override
public byte[] transform(String name, String transformedName, byte[] bytes) {
    if (name.equals("net.minecraftforge.fml.common.Loader")) {
        bytes = injectCallback(bytes);
        activated = true;
    }
    if (!activated || bytes == null) {
        return bytes;
    }
    ClassNode cnode = ASMHelper.createClassNode(bytes, ClassReader.EXPAND_FRAMES);
    ClassWriter cw = new CC_ClassWriter(0, true);
    run.remap(cnode, cw);
    return cw.toByteArray();
}
Also used : ClassNode(org.objectweb.asm.tree.ClassNode) CC_ClassWriter(codechicken.lib.asm.CC_ClassWriter) ClassWriter(org.objectweb.asm.ClassWriter) CC_ClassWriter(codechicken.lib.asm.CC_ClassWriter)

Aggregations

CC_ClassWriter (codechicken.lib.asm.CC_ClassWriter)1 ClassWriter (org.objectweb.asm.ClassWriter)1 ClassNode (org.objectweb.asm.tree.ClassNode)1