Update some paths in tests etc
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
package net.runelite.deob.deobfuscators;
|
package net.runelite.deob.deobfuscators.arithmetic;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import net.runelite.asm.ClassGroup;
|
import net.runelite.asm.ClassGroup;
|
||||||
import net.runelite.deob.deobfuscators.arithmetic.ModArith;
|
|
||||||
import net.runelite.deob.deobfuscators.arithmetic.MultiplicationDeobfuscator;
|
|
||||||
import net.runelite.deob.deobfuscators.arithmetic.MultiplyOneDeobfuscator;
|
|
||||||
import net.runelite.deob.deobfuscators.arithmetic.MultiplyZeroDeobfuscator;
|
|
||||||
import net.runelite.deob.util.JarUtil;
|
import net.runelite.deob.util.JarUtil;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -32,7 +28,7 @@ public class ModArithTest
|
|||||||
@After
|
@After
|
||||||
public void after() throws IOException
|
public void after() throws IOException
|
||||||
{
|
{
|
||||||
JarUtil.saveJar(group, folder.newFile());
|
JarUtil.saveJar(group, new File("d:/rs/07/adamout.jar"));//folder.newFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import org.junit.Test;
|
|||||||
public class AnnotationMapperTest
|
public class AnnotationMapperTest
|
||||||
{
|
{
|
||||||
private static final String JAR1 = "C:\\Users\\Adam\\.m2\\repository\\net\\runelite\\rs\\rs-client\\1.0-SNAPSHOT\\rs-client-1.0-SNAPSHOT.jar",
|
private static final String JAR1 = "C:\\Users\\Adam\\.m2\\repository\\net\\runelite\\rs\\rs-client\\1.0-SNAPSHOT\\rs-client-1.0-SNAPSHOT.jar",
|
||||||
JAR2 = "d:/rs/07/gamepack_v18_deobbed.jar",
|
JAR2 = "d:/rs/07/gamepack_v20_deobfuscated.jar",
|
||||||
OUT = "d:/rs/07/adamout.jar";
|
OUT = "d:/rs/07/adamout.jar";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -2,22 +2,60 @@ package net.runelite.deob.deobfuscators.rename;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import net.runelite.asm.ClassFile;
|
||||||
import net.runelite.asm.ClassGroup;
|
import net.runelite.asm.ClassGroup;
|
||||||
|
import net.runelite.asm.Field;
|
||||||
import net.runelite.asm.Method;
|
import net.runelite.asm.Method;
|
||||||
|
import net.runelite.asm.signature.Signature;
|
||||||
|
import static net.runelite.deob.deobfuscators.rename.MapStaticTest.print;
|
||||||
|
import static net.runelite.deob.deobfuscators.rename.MapStaticTest.summary;
|
||||||
import net.runelite.deob.util.JarUtil;
|
import net.runelite.deob.util.JarUtil;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class MapTest
|
public class MapTest
|
||||||
{
|
{
|
||||||
|
private static final String JAR1 = "C:\\Users\\Adam\\.m2\\repository\\net\\runelite\\rs\\rs-client\\1.0-SNAPSHOT\\rs-client-1.0-SNAPSHOT.jar",
|
||||||
|
JAR2 = "d:/rs/07/gamepack_v20_deobfuscated.jar";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() throws IOException
|
public void test2() throws IOException
|
||||||
{
|
{
|
||||||
ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar"));
|
ClassGroup group1 = JarUtil.loadJar(new File(JAR1));
|
||||||
ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar"));
|
ClassGroup group2 = JarUtil.loadJar(new File(JAR2));
|
||||||
|
|
||||||
Method m1 = group1.findClass("class99").findMethod("method2220");
|
Method m = group1.findClass("class106").findMethod("method2379");
|
||||||
Method m2 = group2.findClass("class99").findMethod("method2149");
|
Method m2 = group2.findClass("class9").findMethod("method125");
|
||||||
|
|
||||||
ParallelExecutorMapping mappings = MappingExecutorUtil.map(m1, m2);
|
ParallelExecutorMapping mappings = MappingExecutorUtil.map(m, m2);
|
||||||
|
System.out.println(mappings);
|
||||||
|
//System.out.println(mappings.get(group1.findClass("class209").findField("field3120")));
|
||||||
|
}
|
||||||
|
|
||||||
|
//@Test
|
||||||
|
public void test3() throws IOException
|
||||||
|
{
|
||||||
|
ClassGroup group1 = JarUtil.loadJar(new File(JAR1));
|
||||||
|
ClassGroup group2 = JarUtil.loadJar(new File(JAR2));
|
||||||
|
|
||||||
|
Mapper mapper = new Mapper(group1, group2);
|
||||||
|
mapper.run();
|
||||||
|
ParallelExecutorMapping mapping = mapper.getMapping();
|
||||||
|
|
||||||
|
Method m = group1.findClass("class120").findMethod("method2747");
|
||||||
|
|
||||||
|
System.out.println(m);
|
||||||
|
System.out.println(mapping.get(m));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Method> getMethodsOfSignature(ClassFile cf, Signature signature)
|
||||||
|
{
|
||||||
|
List<Method> l = new ArrayList<>();
|
||||||
|
for (Method m : cf.getMethods().getMethods())
|
||||||
|
if (m.getDescriptor().equals(signature) && !m.isStatic() && !m.getName().startsWith("<"))
|
||||||
|
l.add(m);
|
||||||
|
return l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import org.junit.Test;
|
|||||||
|
|
||||||
public class InjectTest
|
public class InjectTest
|
||||||
{
|
{
|
||||||
private static final File DEOBFUSCATED = new File("d:/rs/07/gamepack_v18_with_annotations.jar");
|
private static final File DEOBFUSCATED = new File("d:/rs/07/gamepack_v20_mapped.jar");
|
||||||
private static final File VANILLA = new File(InjectTest.class.getResource("/gamepack_v18.jar").getFile());
|
private static final File VANILLA = new File(InjectTest.class.getResource("/gamepack_v20.jar").getFile());
|
||||||
private static final File OUT = new File("d:/rs/07/adamout.jar");
|
private static final File OUT = new File("d:/rs/07/adamout.jar");
|
||||||
|
|
||||||
private ClassGroup deob, vanilla;
|
private ClassGroup deob, vanilla;
|
||||||
|
|||||||
Reference in New Issue
Block a user