project: Deob add GraphicsObject transformer
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
package net.runelite.deob.deobfuscators.transformers;
|
||||||
|
|
||||||
|
import net.runelite.asm.ClassFile;
|
||||||
|
import net.runelite.asm.ClassGroup;
|
||||||
|
import net.runelite.asm.Method;
|
||||||
|
import net.runelite.asm.attributes.Code;
|
||||||
|
import net.runelite.asm.attributes.code.Instructions;
|
||||||
|
import net.runelite.asm.attributes.code.instructions.ALoad;
|
||||||
|
import net.runelite.asm.attributes.code.instructions.InvokeSpecial;
|
||||||
|
import net.runelite.asm.attributes.code.instructions.VReturn;
|
||||||
|
import net.runelite.asm.signature.Signature;
|
||||||
|
import net.runelite.deob.Transformer;
|
||||||
|
|
||||||
|
public class GraphicsObjectTransformer implements Transformer // robots in disguise
|
||||||
|
{
|
||||||
|
private static final String GRAPHICS_OBJECT = "GraphicsObject";
|
||||||
|
private static final String RENDERABLE = "Renderable";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void transform(ClassGroup group)
|
||||||
|
{
|
||||||
|
ClassFile graphicsObject = group.findClass(GRAPHICS_OBJECT);
|
||||||
|
ClassFile renderable = group.findClass(RENDERABLE);
|
||||||
|
|
||||||
|
graphicsObject.clearFinal();
|
||||||
|
|
||||||
|
Method initGraphicsObject = new Method(graphicsObject, "<init>", new Signature("()V"));
|
||||||
|
initGraphicsObject.setPublic();
|
||||||
|
|
||||||
|
final Code code = new Code(initGraphicsObject);
|
||||||
|
code.setMaxStack(1);
|
||||||
|
initGraphicsObject.setCode(code);
|
||||||
|
graphicsObject.addMethod(initGraphicsObject);
|
||||||
|
|
||||||
|
Instructions ins = code.getInstructions();
|
||||||
|
|
||||||
|
ins.addInstruction(new ALoad(ins, 0));
|
||||||
|
ins.addInstruction(new InvokeSpecial(ins, new net.runelite.asm.pool.Method(renderable.getPoolClass(), "<init>", new Signature("()V"))));
|
||||||
|
ins.addInstruction(new VReturn(ins));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,7 @@ import net.runelite.deob.deobfuscators.mapping.AnnotationIntegrityChecker;
|
|||||||
import net.runelite.deob.deobfuscators.mapping.AnnotationMapper;
|
import net.runelite.deob.deobfuscators.mapping.AnnotationMapper;
|
||||||
import net.runelite.deob.deobfuscators.mapping.Mapper;
|
import net.runelite.deob.deobfuscators.mapping.Mapper;
|
||||||
import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping;
|
import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping;
|
||||||
|
import net.runelite.deob.deobfuscators.transformers.GraphicsObjectTransformer;
|
||||||
import net.runelite.deob.deobfuscators.transformers.ScriptOpcodesTransformer;
|
import net.runelite.deob.deobfuscators.transformers.ScriptOpcodesTransformer;
|
||||||
import net.runelite.deob.util.JarUtil;
|
import net.runelite.deob.util.JarUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -78,6 +79,7 @@ public class UpdateMappings
|
|||||||
ad.run();
|
ad.run();
|
||||||
|
|
||||||
new ScriptOpcodesTransformer().transform(group2);
|
new ScriptOpcodesTransformer().transform(group2);
|
||||||
|
new GraphicsObjectTransformer().transform(group2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(File out) throws IOException
|
public void save(File out) throws IOException
|
||||||
|
|||||||
Reference in New Issue
Block a user