mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-12 17:08:23 +00:00
action deobfuscator improved again
This commit is contained in:
@@ -169,11 +169,10 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
if (result.constantPool != null) {
|
||||
newIstructionCount++;
|
||||
}
|
||||
if (!result.stack.isEmpty()) {
|
||||
newIstructionCount++;
|
||||
}
|
||||
|
||||
newIstructionCount += 2 * result.variables.size();
|
||||
newIstructionCount += result.stack.size();
|
||||
|
||||
newIstructionCount += 3 * result.variables.size(); /* 2x Push + Set or Define */
|
||||
|
||||
boolean allValueValid = true;
|
||||
for (Object value : result.variables.values()) {
|
||||
@@ -308,7 +307,8 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
}
|
||||
|
||||
String variableName = variableNameObj.getResult().toString();
|
||||
if (!localData.variables.containsKey(variableName) && !allowGetUninitializedVariables) {
|
||||
if (!localData.variables.containsKey(variableName)
|
||||
&& (!allowGetUninitializedVariables || !isFakeName(variableName))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -486,16 +486,8 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
if (action instanceof ActionDefineFunction) {
|
||||
ActionDefineFunction def = (ActionDefineFunction) action;
|
||||
if (def.paramNames.isEmpty()) {
|
||||
boolean isFakeName = true;
|
||||
for (char ch : def.functionName.toCharArray()) {
|
||||
if (ch > 31) {
|
||||
isFakeName = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// remove funcion only when the function name contains only non printable characters
|
||||
if (!isFakeName) {
|
||||
if (!isFakeName(def.functionName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -259,6 +259,17 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
return result;
|
||||
}
|
||||
|
||||
protected boolean isFakeName(String name) {
|
||||
boolean isFakeName = true;
|
||||
for (char ch : name.toCharArray()) {
|
||||
if (ch > 31) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ExecutionResult result) throws InterruptedException {
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
ActionLocalData localData = new ActionLocalData();
|
||||
|
||||
Reference in New Issue
Block a user