diff --git a/src/main/java/net/runelite/deob/execution/Execution.java b/src/main/java/net/runelite/deob/execution/Execution.java index 09a8de4402..fbce0073d3 100644 --- a/src/main/java/net/runelite/deob/execution/Execution.java +++ b/src/main/java/net/runelite/deob/execution/Execution.java @@ -38,7 +38,7 @@ public class Execution private MultiValueMap invokes = new MultiValueMap<>(); public MultiValueMap contexts = new MultiValueMap<>(); public boolean paused; - public boolean step = true; + public boolean step = false; public Execution(ClassGroup group) { @@ -107,7 +107,9 @@ public class Execution public Frame invoke(InstructionContext from, Method to) { - if(!step) return null;//THIS BREAKS THIS + if (step) // step executor + return null; + if (hasInvoked(from, to)) return null; diff --git a/src/main/java/net/runelite/deob/execution/Frame.java b/src/main/java/net/runelite/deob/execution/Frame.java index 3c15159ba0..841607b463 100644 --- a/src/main/java/net/runelite/deob/execution/Frame.java +++ b/src/main/java/net/runelite/deob/execution/Frame.java @@ -228,7 +228,7 @@ public class Frame /* jump */ } - if (!execution.step && oldCur instanceof MappableInstruction) + if (execution.step && oldCur instanceof MappableInstruction) { execution.paused = true; return; diff --git a/src/main/java/net/runelite/deob/execution/ParallellMappingExecutor.java b/src/main/java/net/runelite/deob/execution/ParallellMappingExecutor.java index 6e4474195d..e205fe6864 100644 --- a/src/main/java/net/runelite/deob/execution/ParallellMappingExecutor.java +++ b/src/main/java/net/runelite/deob/execution/ParallellMappingExecutor.java @@ -17,7 +17,7 @@ public class ParallellMappingExecutor p1 = p2 = null; - if (e.frames.isEmpty()) + if (e.frames.isEmpty() || e2.frames.isEmpty()) return false; Frame f1 = e.frames.get(0), f2 = e2.frames.get(0); diff --git a/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java b/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java index 19bd6fac5f..e6ec117d2d 100644 --- a/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java +++ b/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java @@ -3,7 +3,9 @@ package net.runelite.deob.deobfuscators.rename; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import net.runelite.deob.ClassGroup; import net.runelite.deob.Method; @@ -30,6 +32,31 @@ public class MapTest if (l1.size() != l2.size()) return false; + Map map1 = new HashMap<>(), + map2 = new HashMap<>(); + + for (int i = 0; i < l1.size(); ++i) + { + Instruction i1 = l1.get(i); + + Integer c = map1.get(i1.getClass()); + if (c == null) + map1.put(i1.getClass(), 1); + else + map1.put(i1.getClass(), c + 1); + } + + for (int i = 0; i < l2.size(); ++i) + { + Instruction i2 = l2.get(i); + + Integer c = map2.get(i2.getClass()); + if (c == null) + map2.put(i2.getClass(), 1); + else + map2.put(i2.getClass(), c + 1); + } + return true; } @@ -40,8 +67,8 @@ public class MapTest ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar")); Assert.assertTrue(isMappable( - group1.findClass("client").findMethod("init"), - group2.findClass("client").findMethod("init") + group1.findClass("class99").findMethod("method2220"), + group2.findClass("class99").findMethod("method2149") )); } @@ -53,12 +80,14 @@ public class MapTest Method m1 = group1.findClass("class99").findMethod("method2220"); Execution e = new Execution(group1); + e.step = true; Frame frame = new Frame(e, m1); frame.initialize(); e.frames.add(frame); Method m2 = group2.findClass("class99").findMethod("method2149"); Execution e2 = new Execution(group2); + e2.step = true; Frame frame2 = new Frame(e2, m2); frame2.initialize(); e2.frames.add(frame2);