This can map some but not nearly enough. Main problem seems to be the order of the packet handlers is scrambled, as well as their ids.

Maybe try detecting/treating the packet handlers as separate "functions" and compare them by seeing if PME can run over both?
Maybe try hardening PME mapper to fail more easily (eg setfield of field of two different types, or invoke with wrong signatures?), and then try and brute force methods in general.
Can also map methods with unique signatures that are non static method<->method.
client clinit?
This commit is contained in:
Adam
2016-02-09 19:45:39 -05:00
parent 0662e74369
commit 2bfbe1f239
6 changed files with 69 additions and 25 deletions

View File

@@ -48,7 +48,7 @@ public class InvokeStatic extends Instruction implements InvokeInstruction
@Override
public String toString()
{
return "invokestatic " + method + " in " + this.getInstructions().getCode().getAttributes().getMethod();
return "invokestatic " + method + " in " + this.getInstructions().getCode().getAttributes().getMethod() + " at pc 0x" + Integer.toHexString(this.getPc());
}
@Override

View File

@@ -42,7 +42,7 @@ public class InvokeVirtual extends Instruction implements InvokeInstruction
@Override
public String toString()
{
return "invokevirtual " + method + " in " + this.getInstructions().getCode().getAttributes().getMethod();
return "invokevirtual " + method + " in " + this.getInstructions().getCode().getAttributes().getMethod() + " at pc 0x" + Integer.toHexString(this.getPc());
}
@Override

View File

@@ -117,6 +117,7 @@ public class MappingExecutorUtil
{
p1.getFrame().stop();
p2.getFrame().stop();
e.paused = e2.paused = false;
continue;
// if (!hit)
// {
@@ -168,7 +169,16 @@ public class MappingExecutorUtil
// continue;
}
mi1.map(mappings, p1, p2);
try
{
mi1.map(mappings, p1, p2);
}
catch (Throwable ex)
{
p1.getFrame().stop();
p2.getFrame().stop();
ex.printStackTrace();
}
e.paused = e2.paused = false;
}

View File

@@ -88,7 +88,7 @@ public class Execution
}
}
private boolean hasInvoked(InstructionContext from, Method to)
public boolean hasInvoked(InstructionContext from, Method to)
{
// this is wrong because the called of the method of from
// might be different, for building graph

View File

@@ -278,6 +278,7 @@ public class ParallellMappingExecutor
stepf1.otherStatic = stepf2;
stepf2.otherStatic = stepf1;
doubleStep.add(stepf1.getMethod());
System.out.println("STEP " + stepf1.getMethod() + " <-> " + stepf2.getMethod());
return step();
@@ -288,6 +289,7 @@ public class ParallellMappingExecutor
return true;
}
public static Set<Method> doubleStep = new HashSet();
public InstructionContext getP1()
{
@@ -332,6 +334,9 @@ public class ParallellMappingExecutor
if (isLoop(f))
return null;
if (e.hasInvoked(i, to))
return null;
//assert e.methods.contains(to) == false;
//e.methods.add(to);