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

View File

@@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file.
- Commandline replacing sound stream block ranges
- [#1625] Error log frame - Save all to file button
- [#2467] Show ImportAssets name/characterId in the title when there is only single one item
- [#2468] Option for `-dumpas2` CLI command to use export names (`-exportNames` option)
### Changed
- AS1/2 - Single DoAction tag inside frame is now displayed directly as frame node
@@ -3861,6 +3862,7 @@ Major version of SWF to XML export changed to 2.
[#2451]: https://www.free-decompiler.com/flash/issues/2451
[#1625]: https://www.free-decompiler.com/flash/issues/1625
[#2467]: https://www.free-decompiler.com/flash/issues/2467
[#2468]: https://www.free-decompiler.com/flash/issues/2468
[#2456]: https://www.free-decompiler.com/flash/issues/2456
[#2459]: https://www.free-decompiler.com/flash/issues/2459
[#2460]: https://www.free-decompiler.com/flash/issues/2460

View File

@@ -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);
}

View File

@@ -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.