AS1/2: using eval on invalid identifiers

This commit is contained in:
Jindra Petřík
2014-08-23 20:47:00 +02:00
parent cdfb0cf538
commit c8208c0360
3 changed files with 272 additions and 263 deletions

View File

@@ -175,18 +175,8 @@ public class Deobfuscation {
return null;
}
public String deobfuscateName(String s, boolean firstUppercase, String usageType, HashMap<String, String> namesMap, RenameType renameType, Map<String, String> selected) {
public static boolean isValidName(String s){
boolean isValid = true;
if (usageType == null) {
usageType = "name";
}
if (selected != null) {
if (selected.containsKey(s)) {
return selected.get(s);
}
}
if (Action.isReservedWord(s)) {
isValid = false;
}
@@ -206,6 +196,22 @@ public class Deobfuscation {
isValid = false;
}
}
return isValid;
}
public String deobfuscateName(String s, boolean firstUppercase, String usageType, HashMap<String, String> namesMap, RenameType renameType, Map<String, String> selected) {
boolean isValid = true;
if (usageType == null) {
usageType = "name";
}
if (selected != null) {
if (selected.containsKey(s)) {
return selected.get(s);
}
}
isValid = isValidName(s);
if (!isValid) {
if (namesMap.containsKey(s)) {
return namesMap.get(s);