diff --git a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/EnableDebugging.java b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/EnableDebugging.java new file mode 100644 index 000000000..138d710a0 --- /dev/null +++ b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/EnableDebugging.java @@ -0,0 +1,81 @@ +package com.jpexs.decompiler.flash.cli.commands; + +import com.jpexs.decompiler.flash.cli.VersionProvider; +import com.jpexs.decompiler.flash.cli.commands.types.CompressionKind; +import com.jpexs.decompiler.flash.cli.commands.types.DeobfuscateLevel; +import com.jpexs.decompiler.flash.cli.commands.types.ImportObject; +import com.jpexs.decompiler.flash.cli.commands.types.ReplaceFormat; +import java.util.List; +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; +import picocli.CommandLine.Parameters; +import picocli.CommandLine.ParentCommand; +import picocli.CommandLine.ArgGroup; + +/** + * + * @author JPEXS + */ +@Command( + name = "enabledebugging", + mixinStandardHelpOptions = true, + versionProvider = VersionProvider.class, + header = "Enable debugging for SWF file", + optionListHeading = "%n@|bold,underline Options|@:%n", + parameterListHeading = "%n@|bold,underline Parameters|@:%n", + synopsisHeading = "@|bold,underline Usage|@:", + footerHeading = "%n@|bold,underline Examples|@:%n", + footer = { + "ffdec-cli enabledebugging input.swf output.swf", + "ffdec-cli enabledebugging --inject-as3 input.swf output.swf", + "ffdec-cli enabledebugging --inject-as3 --pcode input.swf output.swf", + "ffdec-cli enabledebugging --generate-swd input.swf output.swf", + }, + sortSynopsis = false +) +public class EnableDebugging implements Runnable { + + + + @Parameters( + index = "0", + paramLabel = "IN_FILE", + description = "Input file" + ) + String inFile; + + @Parameters( + index = "1", + paramLabel = "OUT_FILE", + description = "Output file" + ) + String outFile; + + @ArgGroup(exclusive = true) + InjectAs3OrGenerateSwd injectAs3OrGenerateSwd; + + @Option(names = "--pcode") + boolean pcode = false; + + static class InjectAs3OrGenerateSwd { + @Option( + names = "--inject-as3", + description = "Inject debugfile and debugline instructions into the code to match decompiled/pcode source.", + required = true + ) + boolean injectAs3; + + @Option( + names = "--generate-swd", + description = "Create SWD file needed for AS1/2 debugging. for , is generated", + required = true + ) + boolean generateSwd; + } + + @Override + public void run() { + + } +} diff --git a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java index 94b759975..66a377c43 100644 --- a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java +++ b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java @@ -53,7 +53,8 @@ import picocli.CommandLine.ScopeType; Remove.class, RemoveCharacter.class, Import.class, - Deobfuscate.class + Deobfuscate.class, + EnableDebugging.class }, descriptionHeading = "%n@|bold,underline Description|@:%n", optionListHeading = "%n@|bold,underline Options|@:%n",