You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extend transformations when extracting variables #687
#683 added required components to extract transformed values. On a high level, new Boomerang queries are triggered to collect all required values and then corresponding operations are executed to determine the correct values. For example, consider the following statement:
KeyGenerator kg = KeyGenerator.getInstance("AES".replace("A", "D");
Boomerang transforms this statement to
varReplacer0 = "A"
varReplacer1 = "D";
s1 = "AES"
s2 = s1.replace(varReplacer0, varReplaver1)
kg = staticInvoke.<getInstance(s2)>
Since getInstace is part of a rule and depends on a constraint, the ExtractParameterAnalysis triggers a Boomerang query to extract the parameter s2. Since s2 is not a concrete value (i.e. a constant or new expression), it cannot extract the correct value directly. The transformation components extend this query by triggering new queries to compute relevant variables, performs the operation replace with the collected value, and returns the result as allocation site. In total, the following steps are done:
Trigger a Backward query Q(getInstace(s2), s2)
At s2 = s1.replace(varReplacer0, varReplaver1), trigger the queries Q(s2 = s1.replace(varReplacer0, varReplaver1), s1), Q(s2 = s1.replace(varReplacer0, varReplaver1), varReplacer0), and Q(s2 = s1.replace(varReplacer0, varReplaver1), varReplacer1).
With the extracted values s1, varReplacer0, and varReplacer1, perform the operation s1.replace(varReplacer0, varReplaver1), giving the result DES
Return the value DES as result for the original query Q(getInstace(s2), s2)
Currently, the transformations for Integer.parseInt, String.replace, String.toCharArray, String.getBytes, BigInteger.valueOf, Array.length, Hex.decode, String.toUpperCase, and String.toLowerCase are implemented.
Tasks:
Think of further transformations for Strings, Wrappers (e.g. Integer, Double) and other transformations like + or - for integers.
Activity
smeyer198 commentedon Feb 7, 2025
This commit added transformations for the constructors of class
java.math.BigInteger: