hm
This commit is contained in:
@@ -43,6 +43,10 @@ public class IfICmpEq extends If
|
|||||||
if (isZero(s1) || isZero(s2))
|
if (isZero(s1) || isZero(s2))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (otherIc.getInstruction() instanceof IfICmpNe)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -50,7 +54,7 @@ public class IfICmpEq extends If
|
|||||||
@Override
|
@Override
|
||||||
public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other)
|
public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other)
|
||||||
{
|
{
|
||||||
if (other.getInstruction() instanceof IfNe)
|
if (other.getInstruction() instanceof IfNe || other.getInstruction() instanceof IfICmpNe)
|
||||||
{
|
{
|
||||||
super.mapOtherBranch(mapping, ctx, other);
|
super.mapOtherBranch(mapping, ctx, other);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package net.runelite.deob.attributes.code.instructions;
|
|||||||
import net.runelite.deob.attributes.code.InstructionType;
|
import net.runelite.deob.attributes.code.InstructionType;
|
||||||
import net.runelite.deob.attributes.code.Instructions;
|
import net.runelite.deob.attributes.code.Instructions;
|
||||||
import net.runelite.deob.attributes.code.instruction.types.PushConstantInstruction;
|
import net.runelite.deob.attributes.code.instruction.types.PushConstantInstruction;
|
||||||
|
import net.runelite.deob.deobfuscators.rename.ParallelExecutorMapping;
|
||||||
import net.runelite.deob.execution.InstructionContext;
|
import net.runelite.deob.execution.InstructionContext;
|
||||||
import net.runelite.deob.execution.StackContext;
|
import net.runelite.deob.execution.StackContext;
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ public class IfICmpNe extends If
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// check for other being ifne and this has a constant 0
|
// check for other being ifne and this has a constant 0
|
||||||
if (otherIc.getInstruction() instanceof IfNe)
|
if (otherIc.getInstruction() instanceof IfNe || otherIc.getInstruction() instanceof IfEq)
|
||||||
{
|
{
|
||||||
StackContext s1 = thisIc.getPops().get(0),
|
StackContext s1 = thisIc.getPops().get(0),
|
||||||
s2 = thisIc.getPops().get(1);
|
s2 = thisIc.getPops().get(1);
|
||||||
@@ -45,4 +46,17 @@ public class IfICmpNe extends If
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other)
|
||||||
|
{
|
||||||
|
if (other.getInstruction() instanceof IfEq)
|
||||||
|
{
|
||||||
|
super.mapOtherBranch(mapping, ctx, other);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
super.map(mapping, ctx, other);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class MapStaticTest
|
|||||||
{ "class72.run", "class72.run" },
|
{ "class72.run", "class72.run" },
|
||||||
{ "class64.vmethod3787", "class64.vmethod3664" },
|
{ "class64.vmethod3787", "class64.vmethod3664" },
|
||||||
{ "class207.method3965", "class207.method3846" },
|
{ "class207.method3965", "class207.method3846" },
|
||||||
|
{ "class183.method3685", "class183.method3560" },
|
||||||
};
|
};
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
@@ -81,8 +82,8 @@ public class MapStaticTest
|
|||||||
ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar"));
|
ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar"));
|
||||||
ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar"));
|
ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar"));
|
||||||
|
|
||||||
Method m1 = group1.findClass("class207").findMethod("method3965");
|
Method m1 = group1.findClass("class183").findMethod("method3685");
|
||||||
Method m2 = group2.findClass("class207").findMethod("method3846");
|
Method m2 = group2.findClass("class183").findMethod("method3560");
|
||||||
|
|
||||||
ParallelExecutorMapping mappings = MappingExecutorUtil.map(m1, m2);
|
ParallelExecutorMapping mappings = MappingExecutorUtil.map(m1, m2);
|
||||||
|
|
||||||
@@ -93,14 +94,18 @@ public class MapStaticTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean test;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDeep() throws IOException
|
public void testDeep() throws IOException
|
||||||
{
|
{
|
||||||
|
//test = true;
|
||||||
|
|
||||||
ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar"));
|
ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar"));
|
||||||
ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar"));
|
ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar"));
|
||||||
|
|
||||||
Method m1 = group1.findClass("class207").findMethod("method3965");
|
Method m1 = group1.findClass("class183").findMethod("method3685");
|
||||||
Method m2 = group2.findClass("class207").findMethod("method3846");
|
Method m2 = group2.findClass("class183").findMethod("method3560");
|
||||||
|
|
||||||
HashMap<Object, Object> all = new HashMap();
|
HashMap<Object, Object> all = new HashMap();
|
||||||
map(all, new HashSet(), m1, m2);
|
map(all, new HashSet(), m1, m2);
|
||||||
@@ -206,6 +211,8 @@ public class MapStaticTest
|
|||||||
catch (Throwable ex)
|
catch (Throwable ex)
|
||||||
{
|
{
|
||||||
System.err.println("Error mapping " + m1 + " to " + m2);
|
System.err.println("Error mapping " + m1 + " to " + m2);
|
||||||
|
if (test)
|
||||||
|
throw ex;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user