Added #2468 Option for -dumpas2 CLI command to use export names (-exportNames option)

This commit is contained in:
Jindra Petřík
2025-06-13 08:33:21 +02:00
parent 008856f4a1
commit 209f8ca593
3 changed files with 16 additions and 2 deletions
@@ -4382,6 +4382,16 @@ public class CommandLineArgumentParser {
}
private static void parseDumpAS2(Stack<String> args, String charset) {
if (args.isEmpty()) {
badArguments("dumpas2");
}
boolean useExportNames = false;
String exportNamesParam = args.pop();
if (exportNamesParam.toLowerCase(Locale.ENGLISH).equals("-exportnames")) {
useExportNames = true;
} else {
args.push(exportNamesParam);
}
if (args.isEmpty()) {
badArguments("dumpas2");
}
@@ -4389,7 +4399,7 @@ public class CommandLineArgumentParser {
try {
try (StdInAwareFileInputStream is = new StdInAwareFileInputStream(file)) {
SWF swf = new SWF(is, Configuration.parallelSpeedUp.get(), charset);
Map<String, ASMSource> asms = swf.getASMs(false);
Map<String, ASMSource> asms = swf.getASMs(useExportNames);
for (String as2 : asms.keySet()) {
System.out.println(as2);
}
@@ -46,8 +46,10 @@ alias /?
-dumpSWF <infile>
Dump list of SWF tags to console.
-dumpAS2 <infile>
-dumpAS2 [-exportNames] <infile>
Dump list of AS1/2 scripts to console.
Use -exportNames option to print names in export format
(used in -replace command etc.)
-dumpAS3 <infile>
Dump list of AS3 scripts to console.