diff --git a/CHANGELOG.md b/CHANGELOG.md index 65f37bc50..c0525e923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file. - [#1904] NullPointerException on decompiler pool - [#1904] AS1/2 Simplify expressions breaks registers, functions - [#1904] AS1/2 Throw is an ExitItem to properly handle continues vs ifs -- AS3 direct editation - protected property resolving +- [#595] AS3 direct editation - protected property resolving - AS3 direct editation and decompiler share same AbcIndex ### Changed @@ -2755,6 +2755,7 @@ All notable changes to this project will be documented in this file. [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 [#1904]: https://www.free-decompiler.com/flash/issues/1904 +[#595]: https://www.free-decompiler.com/flash/issues/595 [#1898]: https://www.free-decompiler.com/flash/issues/1898 [#1511]: https://www.free-decompiler.com/flash/issues/1511 [#1765]: https://www.free-decompiler.com/flash/issues/1765 @@ -3265,7 +3266,6 @@ All notable changes to this project will be documented in this file. [#624]: https://www.free-decompiler.com/flash/issues/624 [#627]: https://www.free-decompiler.com/flash/issues/627 [#640]: https://www.free-decompiler.com/flash/issues/640 -[#595]: https://www.free-decompiler.com/flash/issues/595 [#592]: https://www.free-decompiler.com/flash/issues/592 [#585]: https://www.free-decompiler.com/flash/issues/585 [#578]: https://www.free-decompiler.com/flash/issues/578 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java index 5faf5c87b..a06af7ea4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -1721,6 +1721,7 @@ public class ABC implements Openable { getSwf().clearAbcListCache(); getSwf().clearScriptCache(); getMethodIndexing(); + getSwf().getAbcIndex().refreshAbc(this); } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java index 4713cfd80..c95144d03 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java @@ -85,6 +85,8 @@ public abstract class AVM2Item extends GraphTargetItem { } if (object.getThroughDuplicate() instanceof FindPropertyAVM2Item) { + //TODO: this might not be a good idea - #595, + //but removing this fails testNames test FindPropertyAVM2Item fp = (FindPropertyAVM2Item) object.getThroughDuplicate(); if (fp.propertyName instanceof FullMultinameAVM2Item) { propertyName = fp.propertyName; diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3DeobfuscatorTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3DeobfuscatorTest.java index 47895953a..fddd4e9eb 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3DeobfuscatorTest.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3DeobfuscatorTest.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.deobfuscation.AVM2DeobfuscatorGroupPa import com.jpexs.decompiler.flash.abc.avm2.deobfuscation.AVM2DeobfuscatorJumps; import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException; import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; +import com.jpexs.decompiler.flash.abc.avm2.parser.script.AbcIndexing; import com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScript3Parser; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.ConvertData; @@ -127,7 +128,9 @@ public class ActionScript3DeobfuscatorTest extends ActionScriptTestBase { public void setABC(ABC abc) { } }); - ActionScript3Parser par = new ActionScript3Parser(swf.getAbcIndex()); + AbcIndexing index = swf.getAbcIndex(); + index.addAbc(abc); + ActionScript3Parser par = new ActionScript3Parser(index); HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); par.addScript(str, "Test.as", 0, 0);