ifle <-> ifgt, work on all mapping test
This commit is contained in:
@@ -2,6 +2,8 @@ package net.runelite.deob.attributes.code.instructions;
|
||||
|
||||
import net.runelite.deob.attributes.code.InstructionType;
|
||||
import net.runelite.deob.attributes.code.Instructions;
|
||||
import net.runelite.deob.deobfuscators.rename.ParallelExecutorMapping;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
|
||||
public class IfLe extends If0
|
||||
{
|
||||
@@ -10,4 +12,30 @@ public class IfLe extends If0
|
||||
super(instructions, type, pc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
if (super.isSame(thisIc, otherIc))
|
||||
return true;
|
||||
|
||||
if (otherIc.getInstruction() instanceof IfGt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other)
|
||||
{
|
||||
if (other.getInstruction() instanceof IfGt)
|
||||
{
|
||||
super.mapOtherBranch(mapping, ctx, other);
|
||||
}
|
||||
else
|
||||
{
|
||||
super.map(mapping, ctx, other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.runelite.deob.Method;
|
||||
import net.runelite.deob.attributes.code.Instruction;
|
||||
import net.runelite.deob.attributes.code.instruction.types.InvokeInstruction;
|
||||
import net.runelite.deob.attributes.code.instruction.types.MappableInstruction;
|
||||
import net.runelite.deob.attributes.code.instructions.InvokeStatic;
|
||||
import net.runelite.deob.execution.Execution;
|
||||
import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
@@ -118,14 +119,12 @@ public class MappingExecutorUtil
|
||||
|
||||
if (className.startsWith("java/"))
|
||||
return false;
|
||||
// switch (className)
|
||||
// {
|
||||
// case "java/lang/String":
|
||||
//
|
||||
// }
|
||||
// if (m.getClassEntry().getName().equals("java/lang/String"))
|
||||
// return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isInlineable(Instruction i)
|
||||
{
|
||||
return i instanceof InvokeStatic && isMappable((InvokeStatic) i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
import net.runelite.deob.Method;
|
||||
import net.runelite.deob.attributes.code.instruction.types.ReturnInstruction;
|
||||
import net.runelite.deob.attributes.code.instructions.InvokeStatic;
|
||||
import net.runelite.deob.deobfuscators.rename.MappingExecutorUtil;
|
||||
|
||||
public class ParallellMappingExecutor
|
||||
{
|
||||
@@ -82,13 +83,13 @@ public class ParallellMappingExecutor
|
||||
return step();
|
||||
}
|
||||
|
||||
if (p1.getInstruction() instanceof InvokeStatic && !(p2.getInstruction() instanceof InvokeStatic))
|
||||
if (MappingExecutorUtil.isInlineable(p1.getInstruction()) && !MappingExecutorUtil.isInlineable(p2.getInstruction()))
|
||||
{
|
||||
f1 = stepInto(f1);
|
||||
f1 = popStack(f1);
|
||||
p1 = f1.getInstructions().get(f1.getInstructions().size() - 1);
|
||||
}
|
||||
else if (p2.getInstruction() instanceof InvokeStatic && !(p1.getInstruction() instanceof InvokeStatic))
|
||||
else if (MappingExecutorUtil.isInlineable(p2.getInstruction()) && !MappingExecutorUtil.isInlineable(p1.getInstruction()))
|
||||
{
|
||||
f2 = stepInto(f2);
|
||||
f2 = popStack(f2);
|
||||
|
||||
Reference in New Issue
Block a user