Open MarkGaox opened 4 years ago
You can either use a named variable or an actual wildcard (e.g. _
) for this purpose
Then, in your validate
procedure, you can check based on this type of pattern that contains named or unnamed wildcard variable
e.g. if the actual output is:
virtualinvoke $r2.<java.io.PrintStream: void println(java.lang.String)>(r3)
it can match with user provided output:
virtualinvoke _.<java.io.PrintStream: void println(java.lang.String)>(_)
You might need to parse jimple statement somehow
Code:
String a = "abc"; String x = ""; if (x.equals("")) { a = "cba"; } System.out.println(a);
Output: virtualinvoke r1.<java.lang.String: boolean equals(java.lang.Object)>("") virtualinvoke $r2.<java.io.PrintStream: void println(java.lang.String)>(r3)
Question: How can users actually find r3?
Solution So Far: What I can think of is to let the user indicate a local variable in their example. ie,
<java.io.PrintStream: void println(java.lang.String)>(r)
Then we handle that case manually.