From 39ac3f1d68ee446e873ef9a65f7950477f4d92f1 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 29 Jan 2016 20:38:24 -0500 Subject: [PATCH] ifnull --- .../deob/attributes/code/instructions/IfNull.java | 6 +++++- .../deob/deobfuscators/rename/MapStaticTest.java | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/IfNull.java b/src/main/java/net/runelite/deob/attributes/code/instructions/IfNull.java index 50885dfd86..748fd5835f 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/IfNull.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/IfNull.java @@ -33,6 +33,10 @@ public class IfNull extends If0 return true; } } + if (otherIc.getInstruction() instanceof IfNonNull) + { + return true; + } return false; } @@ -40,7 +44,7 @@ public class IfNull extends If0 @Override public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other) { - if (other.getInstruction() instanceof IfACmpNe) + if (other.getInstruction() instanceof IfACmpNe || other.getInstruction() instanceof IfNonNull) { super.mapOtherBranch(mapping, ctx, other); } diff --git a/src/test/java/net/runelite/deob/deobfuscators/rename/MapStaticTest.java b/src/test/java/net/runelite/deob/deobfuscators/rename/MapStaticTest.java index 5fe65f8e5f..064057cbca 100644 --- a/src/test/java/net/runelite/deob/deobfuscators/rename/MapStaticTest.java +++ b/src/test/java/net/runelite/deob/deobfuscators/rename/MapStaticTest.java @@ -36,6 +36,7 @@ public class MapStaticTest { "class29.method711", "class36.method742" }, { "class72.run", "class72.run" }, { "class64.vmethod3787", "class64.vmethod3664" }, + { "class207.method3965", "class207.method3846" }, }; // @Test @@ -80,8 +81,8 @@ public class MapStaticTest ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar")); ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar")); - Method m1 = group1.findClass("class64").findMethod("vmethod3787"); - Method m2 = group2.findClass("class64").findMethod("vmethod3664"); + Method m1 = group1.findClass("class207").findMethod("method3965"); + Method m2 = group2.findClass("class207").findMethod("method3846"); ParallelExecutorMapping mappings = MappingExecutorUtil.map(m1, m2); @@ -98,8 +99,8 @@ public class MapStaticTest ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar")); ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar")); - Method m1 = group1.findClass("class64").findMethod("vmethod3787"); - Method m2 = group2.findClass("class64").findMethod("vmethod3664"); + Method m1 = group1.findClass("class207").findMethod("method3965"); + Method m2 = group2.findClass("class207").findMethod("method3846"); HashMap all = new HashMap(); map(all, new HashSet(), m1, m2);