mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-28 20:10:44 +00:00
properly interrupt on timeout
This commit is contained in:
+7
-7
@@ -83,7 +83,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
private final int executionLimit = 30000;
|
||||
|
||||
@Override
|
||||
public void actionListParsed(ActionList actions, SWF swf) {
|
||||
public void actionListParsed(ActionList actions, SWF swf) throws InterruptedException {
|
||||
combinePushs(actions);
|
||||
Map<String, Object> fakeFunctions = getFakeFunctionResults(actions);
|
||||
removeUnreachableActions(actions);
|
||||
@@ -117,19 +117,19 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean rereadActionList(ActionList actions, SWF swf) {
|
||||
private boolean rereadActionList(ActionList actions, SWF swf) throws InterruptedException {
|
||||
byte[] actionBytes = Action.actionsToBytes(actions, true, SWF.DEFAULT_VERSION);
|
||||
try {
|
||||
SWFInputStream rri = new SWFInputStream(swf, actionBytes);
|
||||
ActionList newActions = ActionListReader.readActionList(new ArrayList<>(), rri, SWF.DEFAULT_VERSION, 0, actionBytes.length, "", -1);
|
||||
actions.setActions(newActions);
|
||||
} catch (IOException | InterruptedException ex) {
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(ActionDeobfuscator.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean removeObfuscationIfs(ActionList actions, Map<String, Object> fakeFunctions) {
|
||||
private boolean removeObfuscationIfs(ActionList actions, Map<String, Object> fakeFunctions) throws InterruptedException {
|
||||
if (actions.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
return cPool;
|
||||
}
|
||||
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ActionConstantPool constantPool, ExecutionResult result, Map<String, Object> fakeFunctions) {
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ActionConstantPool constantPool, ExecutionResult result, Map<String, Object> fakeFunctions) throws InterruptedException {
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
ActionLocalData localData = new ActionLocalData();
|
||||
FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack("");
|
||||
@@ -384,11 +384,11 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (EmptyStackException | TranslateException | InterruptedException ex) {
|
||||
} catch (EmptyStackException | TranslateException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, Object> getFakeFunctionResults(ActionList actions) {
|
||||
private Map<String, Object> getFakeFunctionResults(ActionList actions) throws InterruptedException {
|
||||
/*
|
||||
DefineFunction "fakeName" 0 {
|
||||
Push 1777
|
||||
|
||||
+4
-4
@@ -67,7 +67,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
private final int executionLimit = 30000;
|
||||
|
||||
@Override
|
||||
public void actionListParsed(ActionList actions, SWF swf) {
|
||||
public void actionListParsed(ActionList actions, SWF swf) throws InterruptedException {
|
||||
removeGetTimes(actions);
|
||||
removeObfuscationIfs(actions);
|
||||
}
|
||||
@@ -125,7 +125,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removeObfuscationIfs(ActionList actions) {
|
||||
private boolean removeObfuscationIfs(ActionList actions) throws InterruptedException {
|
||||
if (actions.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ExecutionResult result) {
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ExecutionResult result) throws InterruptedException {
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
ActionLocalData localData = new ActionLocalData();
|
||||
FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack("");
|
||||
@@ -361,7 +361,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
result.stack.addAll(stack);
|
||||
}
|
||||
}
|
||||
} catch (EmptyStackException | TranslateException | InterruptedException ex) {
|
||||
} catch (EmptyStackException | TranslateException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-12
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
@@ -27,8 +28,6 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SourceGenerator;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -44,15 +43,11 @@ public class FSCommandActionItem extends ActionItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("fscommand");
|
||||
writer.spaceBeforeCallParenthesies(1);
|
||||
writer.append("(");
|
||||
try {
|
||||
command.appendTo(writer, localData);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(FSCommandActionItem.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
command.appendTo(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user