From 067ebb6f5d6bbde2713e2a881a398b17fe2109cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 10 Dec 2022 18:02:02 +0100 Subject: [PATCH] Fixed #1828 AS1/2 deobfuscation removing variable declarations --- CHANGELOG.md | 3 ++- .../deobfuscation/ActionDeobfuscator.java | 20 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 013935175..19d07d85f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ All notable changes to this project will be documented in this file. - Hide freetransform button in readonly mode - Maintain export name/class on imported tags - Classnames in PlaceObject +- [#1828] AS1/2 deobfuscation removing variable declarations ### Changed - Quick search needs minimum of 3 characters @@ -2729,6 +2730,7 @@ All notable changes to this project will be documented in this file. [#1181]: https://www.free-decompiler.com/flash/issues/1181 [#1897]: https://www.free-decompiler.com/flash/issues/1897 [#1006]: https://www.free-decompiler.com/flash/issues/1006 +[#1828]: https://www.free-decompiler.com/flash/issues/1828 [#1888]: https://www.free-decompiler.com/flash/issues/1888 [#1895]: https://www.free-decompiler.com/flash/issues/1895 [#1896]: https://www.free-decompiler.com/flash/issues/1896 @@ -2806,7 +2808,6 @@ All notable changes to this project will be documented in this file. [#1838]: https://www.free-decompiler.com/flash/issues/1838 [#1847]: https://www.free-decompiler.com/flash/issues/1847 [#1829]: https://www.free-decompiler.com/flash/issues/1829 -[#1828]: https://www.free-decompiler.com/flash/issues/1828 [#1771]: https://www.free-decompiler.com/flash/issues/1771 [#1695]: https://www.free-decompiler.com/flash/issues/1695 [#1752]: https://www.free-decompiler.com/flash/issues/1752 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java index 4b1c576d9..4e0498dd7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java @@ -107,16 +107,18 @@ public class ActionDeobfuscator extends SWFDecompilerAdapter { boolean changed = true; boolean useVariables = false; while (changed) { - changed = removeGetTimes(fastActions); - changed |= removeObfuscationIfs(fastActions, fakeFunctions, useVariables); - changed |= removeObfuscatedUnusedVariables(fastActions); - - actions.setActions(fastActions.toActionList()); - changed |= ActionListReader.fixConstantPools(null, actions); - if (!changed && !useVariables) { - useVariables = true; - changed = true; + while (changed) { + changed = removeGetTimes(fastActions); + changed |= removeObfuscationIfs(fastActions, fakeFunctions, useVariables); + actions.setActions(fastActions.toActionList()); + changed |= ActionListReader.fixConstantPools(null, actions); + if (!changed && !useVariables) { + useVariables = true; + changed = true; + } } + changed = removeObfuscatedUnusedVariables(fastActions); + actions.setActions(fastActions.toActionList()); } }