mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-10 16:45:02 +00:00
- AS1 slash syntax support (decompilation, direct editation)
- AS1/2 Using eval, set functions on obfuscated names instead of §§ syntax where applicable
This commit is contained in:
@@ -238,6 +238,46 @@ public class IdentifiersDeobfuscation {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isValidSlashPath(String s, String... exceptions) {
|
||||
String[] slashParts = s.split("\\/");
|
||||
if (s.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
for (int p = 0; p < slashParts.length; p++) {
|
||||
String part = slashParts[p];
|
||||
if (p == 0 && part.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (part.isEmpty() && p < slashParts.length - 1) { // two slashesh xx//yy
|
||||
return false;
|
||||
}
|
||||
if ("..".equals(part)) {
|
||||
continue; //okay
|
||||
}
|
||||
if (!isValidName(false, part, exceptions)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isValidNameWithSlash(String s, String... exceptions) {
|
||||
if (s.contains(":")) {
|
||||
String pathVar[] = s.split(":");
|
||||
if (!isValidSlashPath(pathVar[0], exceptions)) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 1; i < pathVar.length; i++) {
|
||||
if (!isValidName(false, pathVar[i], exceptions)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return isValidName(false, s, exceptions);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isValidNameWithDot(boolean as3, String s, String... exceptions) {
|
||||
for (String e : exceptions) {
|
||||
if (e.equals(s)) {
|
||||
|
||||
Reference in New Issue
Block a user