diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/SWFDecompilerPlugin.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/SWFDecompilerPlugin.java index 825b1be5b..48accbfaa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/SWFDecompilerPlugin.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/SWFDecompilerPlugin.java @@ -52,6 +52,8 @@ public class SWFDecompilerPlugin { private static final List listeners = new ArrayList<>(); + public static String[] customParameters = new String[0]; + public static File getPluginsDir() { File pluginPath = null; diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 9d25db769..79121ee73 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -81,6 +81,7 @@ import com.jpexs.decompiler.flash.exporters.swf.SwfXmlExporter; import com.jpexs.decompiler.flash.gui.Main; import com.jpexs.decompiler.flash.gui.helpers.CheckResources; import com.jpexs.decompiler.flash.helpers.FileTextWriter; +import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin; import com.jpexs.decompiler.flash.importers.AS2ScriptImporter; import com.jpexs.decompiler.flash.importers.AS3ScriptImporter; import com.jpexs.decompiler.flash.importers.BinaryDataImporter; @@ -468,6 +469,11 @@ public class CommandLineArgumentParser { out.println(" ...WARNING: Injected/SWD script filenames may be different than from standard compiler"); } + if (filter == null || filter.equals("custom")) { + out.println(" " + (cnt++) + ") -custom []..."); + out.println(" ...Forwards all parameters after the -custom parameter to the plugins"); + } + printCmdLineUsageExamples(out, filter); } @@ -701,6 +707,8 @@ public class CommandLineArgumentParser { parseRemoveCharacter(args, true); } else if (command.equals("importscript")) { parseImportScript(args); + } else if (command.equals("importscript")) { + parseCustom(args); } else if (command.equals("as3compiler")) { ActionScript3Parser.compile(null /*?*/, args.pop(), args.pop(), 0, 0); } else if (nextParam.equals("--debugtool")) { @@ -2490,6 +2498,15 @@ public class CommandLineArgumentParser { } } + private static void parseCustom(Stack args) { + String[] customParameters = new String[args.size()]; + for (int i = 0; i < customParameters.length; i++) { + customParameters[i] = args.pop(); + } + + SWFDecompilerPlugin.customParameters = customParameters; + } + private static void replaceAS2PCode(String text, ASMSource src) throws IOException, InterruptedException { System.out.println("Replace AS1/2 PCode"); if (text.trim().startsWith(Helper.hexData)) {