Share list of bundler transformers

master
Graham 5 years ago
parent 135a2891d1
commit 27c0b997b9
  1. 17
      bundler/src/main/java/dev/openrs2/bundler/Bundler.java
  2. 40
      deob/src/main/java/dev/openrs2/deob/Deobfuscator.java

@ -0,0 +1,17 @@
package dev.openrs2.bundler;
import com.google.common.collect.ImmutableList;
import dev.openrs2.asm.transform.Transformer;
import dev.openrs2.bundler.transform.CachePathTransformer;
import dev.openrs2.bundler.transform.HostCheckTransformer;
import dev.openrs2.bundler.transform.MacResizeTransformer;
import dev.openrs2.bundler.transform.RightClickTransformer;
public final class Bundler {
public static final ImmutableList<Transformer> TRANSFORMERS = ImmutableList.of(
new CachePathTransformer(),
new HostCheckTransformer(),
new MacResizeTransformer(),
new RightClickTransformer()
);
}

@ -9,10 +9,7 @@ import com.google.common.collect.ImmutableList;
import dev.openrs2.asm.classpath.ClassPath; import dev.openrs2.asm.classpath.ClassPath;
import dev.openrs2.asm.classpath.Library; import dev.openrs2.asm.classpath.Library;
import dev.openrs2.asm.transform.Transformer; import dev.openrs2.asm.transform.Transformer;
import dev.openrs2.bundler.transform.CachePathTransformer; import dev.openrs2.bundler.Bundler;
import dev.openrs2.bundler.transform.HostCheckTransformer;
import dev.openrs2.bundler.transform.MacResizeTransformer;
import dev.openrs2.bundler.transform.RightClickTransformer;
import dev.openrs2.deob.remap.PrefixRemapper; import dev.openrs2.deob.remap.PrefixRemapper;
import dev.openrs2.deob.transform.AccessTransformer; import dev.openrs2.deob.transform.AccessTransformer;
import dev.openrs2.deob.transform.BitShiftTransformer; import dev.openrs2.deob.transform.BitShiftTransformer;
@ -34,25 +31,22 @@ import org.slf4j.LoggerFactory;
public final class Deobfuscator { public final class Deobfuscator {
private static final Logger logger = LoggerFactory.getLogger(Deobfuscator.class); private static final Logger logger = LoggerFactory.getLogger(Deobfuscator.class);
private static final ImmutableList<Transformer> TRANSFORMERS = ImmutableList.of( private static final ImmutableList<Transformer> TRANSFORMERS = ImmutableList.<Transformer>builder()
new OriginalNameTransformer(), .add(new OriginalNameTransformer())
new CachePathTransformer(), .addAll(Bundler.TRANSFORMERS)
new HostCheckTransformer(), .add(new OpaquePredicateTransformer())
new MacResizeTransformer(), .add(new ExceptionTracingTransformer())
new RightClickTransformer(), .add(new BitShiftTransformer())
new OpaquePredicateTransformer(), .add(new CounterTransformer())
new ExceptionTracingTransformer(), .add(new CanvasTransformer())
new BitShiftTransformer(), .add(new FieldOrderTransformer())
new CounterTransformer(), .add(new BitwiseOpTransformer())
new CanvasTransformer(), .add(new RemapTransformer())
new FieldOrderTransformer(), .add(new DummyArgTransformer())
new BitwiseOpTransformer(), .add(new DummyLocalTransformer())
new RemapTransformer(), .add(new UnusedArgTransformer())
new DummyArgTransformer(), .add(new AccessTransformer())
new DummyLocalTransformer(), .build();
new UnusedArgTransformer(),
new AccessTransformer()
);
public static void main(String[] args) throws IOException, AnalyzerException { public static void main(String[] args) throws IOException, AnalyzerException {
var deobfuscator = new Deobfuscator(Paths.get("nonfree/code"), Paths.get("nonfree/code/deob")); var deobfuscator = new Deobfuscator(Paths.get("nonfree/code"), Paths.get("nonfree/code/deob"));

Loading…
Cancel
Save