This was hard to find. Seems to work better? Old code here was finding wildly irrelevant funcs. Just use the renamer code.
This commit is contained in:
@@ -30,47 +30,47 @@ public class Deob
|
||||
|
||||
ClassGroup group = JarUtil.loadJar(new File(args[0]));
|
||||
|
||||
// run(group, new RenameUnique());
|
||||
//
|
||||
// // remove except RuntimeException
|
||||
// run(group, new RuntimeExceptions());
|
||||
//
|
||||
// // remove unused methods
|
||||
// run(group, new UnreachedCode());
|
||||
// run(group, new UnusedMethods());
|
||||
//
|
||||
// // remove illegal state exceptions, frees up some parameters
|
||||
// run(group, new IllegalStateExceptions());
|
||||
//
|
||||
// // remove constant logically dead parameters
|
||||
// run(group, new ConstantParameter());
|
||||
//
|
||||
// // remove unhit blocks
|
||||
// run(group, new UnreachedCode());
|
||||
// run(group, new UnusedMethods());
|
||||
//
|
||||
// // remove unused parameters
|
||||
// run(group, new UnusedParameters());
|
||||
//
|
||||
// // remove unused fields
|
||||
// run(group, new UnusedFields());
|
||||
//
|
||||
// // remove unused methods, again?
|
||||
// run(group, new UnusedMethods());
|
||||
//
|
||||
//// run(group, new MethodInliner());
|
||||
//// run(group, new UnusedMethods()); // inliner might leave unused methods
|
||||
//
|
||||
//// // broken because rename was removed
|
||||
//// //run(group, new MethodMover());
|
||||
//
|
||||
// run(group, new FieldInliner());
|
||||
//
|
||||
//// // XXX this is broken because when moving clinit around, some fields can depend on other fields
|
||||
//// // (like multianewarray)
|
||||
//// //new FieldMover().run(group);
|
||||
//
|
||||
// run(group, new UnusedClass());
|
||||
run(group, new RenameUnique());
|
||||
|
||||
// remove except RuntimeException
|
||||
run(group, new RuntimeExceptions());
|
||||
|
||||
// remove unused methods
|
||||
run(group, new UnreachedCode());
|
||||
run(group, new UnusedMethods());
|
||||
|
||||
// remove illegal state exceptions, frees up some parameters
|
||||
run(group, new IllegalStateExceptions());
|
||||
|
||||
// remove constant logically dead parameters
|
||||
run(group, new ConstantParameter());
|
||||
|
||||
// remove unhit blocks
|
||||
run(group, new UnreachedCode());
|
||||
run(group, new UnusedMethods());
|
||||
|
||||
// remove unused parameters
|
||||
run(group, new UnusedParameters());
|
||||
|
||||
// remove unused fields
|
||||
run(group, new UnusedFields());
|
||||
|
||||
// remove unused methods, again?
|
||||
run(group, new UnusedMethods());
|
||||
|
||||
// run(group, new MethodInliner());
|
||||
// run(group, new UnusedMethods()); // inliner might leave unused methods
|
||||
|
||||
// // broken because rename was removed
|
||||
// //run(group, new MethodMover());
|
||||
|
||||
run(group, new FieldInliner());
|
||||
|
||||
// // XXX this is broken because when moving clinit around, some fields can depend on other fields
|
||||
// // (like multianewarray)
|
||||
// //new FieldMover().run(group);
|
||||
|
||||
run(group, new UnusedClass());
|
||||
|
||||
ModArith mod = new ModArith();
|
||||
mod.run(group);
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.List;
|
||||
import net.runelite.deob.Field;
|
||||
import net.runelite.deob.attributes.code.instruction.types.GetFieldInstruction;
|
||||
import net.runelite.deob.attributes.code.instruction.types.MappableInstruction;
|
||||
import net.runelite.deob.deobfuscators.Renamer;
|
||||
import net.runelite.deob.deobfuscators.rename.MappingExecutorUtil;
|
||||
import net.runelite.deob.deobfuscators.rename.ParallelExecutorMapping;
|
||||
import net.runelite.deob.execution.Execution;
|
||||
@@ -151,9 +152,9 @@ public class InvokeInterface extends Instruction implements InvokeInstruction
|
||||
return; // not our class
|
||||
|
||||
// look up this method in this class and anything that inherits from it
|
||||
List<net.runelite.deob.Method> list = new ArrayList<>();
|
||||
findMethodFromClass(list, otherClass);
|
||||
myMethods = list;
|
||||
//List<net.runelite.deob.Method> list = new ArrayList<>();
|
||||
//findMethodFromClass(list, otherClass);
|
||||
myMethods = Renamer.getVirutalMethods(otherClass.findMethod(method.getNameAndType()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import net.runelite.deob.Field;
|
||||
import net.runelite.deob.attributes.code.instruction.types.GetFieldInstruction;
|
||||
import net.runelite.deob.deobfuscators.Renamer;
|
||||
import net.runelite.deob.deobfuscators.rename.MappingExecutorUtil;
|
||||
import net.runelite.deob.deobfuscators.rename.ParallelExecutorMapping;
|
||||
import net.runelite.deob.execution.Execution;
|
||||
@@ -168,9 +169,15 @@ public class InvokeVirtual extends Instruction implements InvokeInstruction
|
||||
|
||||
// when I recompile classes I can see the class of invokevirtuals methods change, get all methods
|
||||
|
||||
List<net.runelite.deob.Method> list = new ArrayList<>();
|
||||
findMethodFromClass(new HashSet<>(), list, otherClass);
|
||||
myMethods = list;
|
||||
//List<net.runelite.deob.Method> list = new ArrayList<>();
|
||||
//findMethodFromClass(new HashSet<>(), list, otherClass);
|
||||
net.runelite.deob.Method m = otherClass.findMethodDeep(method.getNameAndType());
|
||||
if (m == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
myMethods = Renamer.getVirutalMethods(m);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user