Search in sources :

Example 1 with IllegalStateExceptions

use of net.runelite.deob.deobfuscators.IllegalStateExceptions in project runelite by runelite.

the class Deob method main.

public static void main(String[] args) throws IOException {
    if (args == null || args.length < 2) {
        System.err.println("Syntax: input_jar output_jar");
        System.exit(-1);
    }
    logger.info("Deobfuscator revision {}", DeobProperties.getRevision());
    Stopwatch stopwatch = Stopwatch.createStarted();
    ClassGroup group = JarUtil.loadJar(new File(args[0]));
    // remove except RuntimeException
    run(group, new RuntimeExceptions());
    run(group, new ControlFlowDeobfuscator());
    run(group, new RenameUnique());
    // remove unused methods - this leaves Code with no instructions,
    // which is not valid, so unused methods is run after
    run(group, new UnreachedCode());
    run(group, new UnusedMethods());
    // remove illegal state exceptions, frees up some parameters
    run(group, new IllegalStateExceptions());
    // remove constant logically dead parameters
    run(group, new ConstantParameter());
    // remove unhit blocks
    run(group, new UnreachedCode());
    run(group, new UnusedMethods());
    // remove unused parameters
    run(group, new UnusedParameters());
    // remove unused fields
    run(group, new UnusedFields());
    run(group, new FieldInliner());
    // order uses class name order for sorting fields/methods,
    // so run it before removing classes below
    run(group, new Order());
    run(group, new UnusedClass());
    runMath(group);
    run(group, new ExprArgOrder());
    run(group, new Lvt());
    run(group, new CastNull());
    run(group, new EnumDeobfuscator());
    new OpcodesTransformer().transform(group);
    // run(group, new PacketHandlerOrder());
    // run(group, new PacketWriteDeobfuscator());
    run(group, new MenuActionDeobfuscator());
    new GetPathTransformer().transform(group);
    new ClientErrorTransformer().transform(group);
    new ReflectionTransformer().transform(group);
    new MaxMemoryTransformer().transform(group);
    // new RuneliteBufferTransformer().transform(group);
    JarUtil.saveJar(group, new File(args[1]));
    stopwatch.stop();
    logger.info("Done in {}", stopwatch);
}
Also used : IllegalStateExceptions(net.runelite.deob.deobfuscators.IllegalStateExceptions) ClientErrorTransformer(net.runelite.deob.deobfuscators.transformers.ClientErrorTransformer) UnusedParameters(net.runelite.deob.deobfuscators.UnusedParameters) Stopwatch(com.google.common.base.Stopwatch) EnumDeobfuscator(net.runelite.deob.deobfuscators.EnumDeobfuscator) Lvt(net.runelite.deob.deobfuscators.Lvt) ConstantParameter(net.runelite.deob.deobfuscators.constparam.ConstantParameter) RenameUnique(net.runelite.deob.deobfuscators.RenameUnique) MaxMemoryTransformer(net.runelite.deob.deobfuscators.transformers.MaxMemoryTransformer) FieldInliner(net.runelite.deob.deobfuscators.FieldInliner) ExprArgOrder(net.runelite.deob.deobfuscators.exprargorder.ExprArgOrder) Order(net.runelite.deob.deobfuscators.Order) UnusedMethods(net.runelite.deob.deobfuscators.UnusedMethods) UnreachedCode(net.runelite.deob.deobfuscators.UnreachedCode) UnusedClass(net.runelite.deob.deobfuscators.UnusedClass) OpcodesTransformer(net.runelite.deob.deobfuscators.transformers.OpcodesTransformer) GetPathTransformer(net.runelite.deob.deobfuscators.transformers.GetPathTransformer) RuntimeExceptions(net.runelite.deob.deobfuscators.RuntimeExceptions) ControlFlowDeobfuscator(net.runelite.deob.deobfuscators.cfg.ControlFlowDeobfuscator) UnusedFields(net.runelite.deob.deobfuscators.UnusedFields) ClassGroup(net.runelite.asm.ClassGroup) CastNull(net.runelite.deob.deobfuscators.CastNull) MenuActionDeobfuscator(net.runelite.deob.deobfuscators.menuaction.MenuActionDeobfuscator) ExprArgOrder(net.runelite.deob.deobfuscators.exprargorder.ExprArgOrder) ReflectionTransformer(net.runelite.deob.deobfuscators.transformers.ReflectionTransformer) File(java.io.File)

Aggregations

Stopwatch (com.google.common.base.Stopwatch)1 File (java.io.File)1 ClassGroup (net.runelite.asm.ClassGroup)1 CastNull (net.runelite.deob.deobfuscators.CastNull)1 EnumDeobfuscator (net.runelite.deob.deobfuscators.EnumDeobfuscator)1 FieldInliner (net.runelite.deob.deobfuscators.FieldInliner)1 IllegalStateExceptions (net.runelite.deob.deobfuscators.IllegalStateExceptions)1 Lvt (net.runelite.deob.deobfuscators.Lvt)1 Order (net.runelite.deob.deobfuscators.Order)1 RenameUnique (net.runelite.deob.deobfuscators.RenameUnique)1 RuntimeExceptions (net.runelite.deob.deobfuscators.RuntimeExceptions)1 UnreachedCode (net.runelite.deob.deobfuscators.UnreachedCode)1 UnusedClass (net.runelite.deob.deobfuscators.UnusedClass)1 UnusedFields (net.runelite.deob.deobfuscators.UnusedFields)1 UnusedMethods (net.runelite.deob.deobfuscators.UnusedMethods)1 UnusedParameters (net.runelite.deob.deobfuscators.UnusedParameters)1 ControlFlowDeobfuscator (net.runelite.deob.deobfuscators.cfg.ControlFlowDeobfuscator)1 ConstantParameter (net.runelite.deob.deobfuscators.constparam.ConstantParameter)1 ExprArgOrder (net.runelite.deob.deobfuscators.exprargorder.ExprArgOrder)1 MenuActionDeobfuscator (net.runelite.deob.deobfuscators.menuaction.MenuActionDeobfuscator)1