Rename AddSubTransformer to NegativeLiteralTransformer

bzip2
Graham 5 years ago
parent f90b959210
commit 0b1d46eec4
  1. 4
      deob-ast/src/main/java/dev/openrs2/deob/ast/AstDeobfuscator.java
  2. 2
      deob-ast/src/main/java/dev/openrs2/deob/ast/transform/NegativeLiteralTransformer.java

@ -12,15 +12,15 @@ import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeS
import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver; import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver;
import com.github.javaparser.utils.SourceRoot; import com.github.javaparser.utils.SourceRoot;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.openrs2.deob.ast.transform.AddSubTransformer;
import dev.openrs2.deob.ast.transform.BinaryExprOrderTransformer; import dev.openrs2.deob.ast.transform.BinaryExprOrderTransformer;
import dev.openrs2.deob.ast.transform.ComplementTransformer; import dev.openrs2.deob.ast.transform.ComplementTransformer;
import dev.openrs2.deob.ast.transform.IfElseTransformer; import dev.openrs2.deob.ast.transform.IfElseTransformer;
import dev.openrs2.deob.ast.transform.NegativeLiteralTransformer;
import dev.openrs2.deob.ast.transform.Transformer; import dev.openrs2.deob.ast.transform.Transformer;
public final class AstDeobfuscator { public final class AstDeobfuscator {
private static final ImmutableList<Transformer> TRANSFORMERS = ImmutableList.of( private static final ImmutableList<Transformer> TRANSFORMERS = ImmutableList.of(
new AddSubTransformer(), new NegativeLiteralTransformer(),
new ComplementTransformer(), new ComplementTransformer(),
new IfElseTransformer(), new IfElseTransformer(),
new BinaryExprOrderTransformer() new BinaryExprOrderTransformer()

@ -6,7 +6,7 @@ import com.github.javaparser.ast.expr.IntegerLiteralExpr;
import com.github.javaparser.ast.expr.UnaryExpr; import com.github.javaparser.ast.expr.UnaryExpr;
import dev.openrs2.deob.ast.util.ExprUtils; import dev.openrs2.deob.ast.util.ExprUtils;
public final class AddSubTransformer extends Transformer { public final class NegativeLiteralTransformer extends Transformer {
private static Expression negate(Expression expr) { private static Expression negate(Expression expr) {
if (expr.isIntegerLiteralExpr()) { if (expr.isIntegerLiteralExpr()) {
return new IntegerLiteralExpr(-expr.asIntegerLiteralExpr().asInt()); return new IntegerLiteralExpr(-expr.asIntegerLiteralExpr().asInt());
Loading…
Cancel
Save