diff --git a/CHANGELOG.md b/CHANGELOG.md index d4fdb3ad0..0aef17939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,30 @@ # Change Log All notable changes to this project will be documented in this file. +## [Unreleased] +### Added +- [#1449] Turkish translation by Osman ÖZ +- AS2 classes: maintain order of variables, and methods (place variables before methods) +- AS1/2: displaying script path in the error log when jump to invalid address +- AS1/2: Try..catch with Error types - decompilation and direct editation +- AS1/2: Properly handling of Flash7 scripts exported to Flash5/6 - ActionDefineFunction local registers + +### Changed +- AS1/2 direct editation - generated constantpool is sorted according to ActionPush position + +### Fixed +- Accessing font list on demand - prevents loading X11 on systems without UI +- Better AS2 class detection +- AS1/2 break statement decompilation in for..in loops +- AS2 direct editation - not generating Pop in class header ifs +- AS1/2 deobfuscation - ActionRandom fixed for nonpositive numbers +- AS1/2 switch statement detection - fixes of default section position +- AS1/2: break on the end of for..in loop +- AS1/2: Export selection dialog did not allow to select script export formats and/or export script at all +- AS3 P-code - HAS_OPTIONAL flag in AVM2 code displayed twice +- Turkish locale toLowerCase I problem fix - causing not loading main window at all +- [#1456] jsyntaxpane (code display/editor) fixed for Java 9/10 + ## [11.0.0] - 2018-01-17 ### Added - [#1240] AS search using multiple threads when parallel speedup is enabled @@ -2341,3 +2365,4 @@ All notable changes to this project will be documented in this file. [#1320]: https://www.free-decompiler.com/flash/issues/1320 [#1323]: https://www.free-decompiler.com/flash/issues/1323 [#27]: https://www.free-decompiler.com/flash/issues/27 +[#1449]: https://www.free-decompiler.com/flash/issues/1449 diff --git a/README.md b/README.md index 51b19ce1f..a850706cd 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ The application was made in Czech republic. * **Laurent LOUVET** - french translation * **MaGiC** - portugese translation * **martinkoza** - polish translation +* **Osman ÖZ** - turkish translation * **pepka** - ukrainian and dutch translation * **poxyran** - spanish translation * **realmaster42** - portugese-brasil translation diff --git a/TRANSLATIONS.md b/TRANSLATIONS.md index ae28a3cb1..9256edf1c 100644 --- a/TRANSLATIONS.md +++ b/TRANSLATIONS.md @@ -17,6 +17,7 @@ - Russian - Spanish - Swedish + - Turkish - Ukrainian ## New translation diff --git a/installer.nsi b/installer.nsi index 7fa252cf4..9df8adea5 100644 --- a/installer.nsi +++ b/installer.nsi @@ -368,6 +368,7 @@ var SMDir !insertmacro LANG_LOAD "Russian" !insertmacro LANG_LOAD "Spanish" !insertmacro LANG_LOAD "Swedish" + !insertmacro LANG_LOAD "Turkish" !insertmacro LANG_LOAD "Ukrainian" !insertmacro LANG_LOAD "Italian" diff --git a/lib/jsyntaxpane-0.9.5.jar b/lib/jsyntaxpane-0.9.5.jar index 656f583cf..2337f7427 100644 Binary files a/lib/jsyntaxpane-0.9.5.jar and b/lib/jsyntaxpane-0.9.5.jar differ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java index 50eecdd4f..6d6cced57 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java @@ -12,10 +12,13 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash; +import com.jpexs.decompiler.graph.Loop; import java.util.HashSet; +import java.util.List; /** * @@ -24,8 +27,10 @@ import java.util.HashSet; public class FinalProcessLocalData { public final HashSet temporaryRegisters; + public final List loops; - public FinalProcessLocalData() { + public FinalProcessLocalData(List loops) { temporaryRegisters = new HashSet<>(); + this.loops = loops; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 4c80da999..f6a249ee6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash; import SevenZip.Compression.LZMA.Decoder; @@ -348,6 +349,8 @@ public final class SWF implements SWFContainerItem, Timelined { private static final DecompilerPool decompilerPool = new DecompilerPool(); + public static final String AS2_PKG_PREFIX = "__Packages."; + public static List swfSignatures = Arrays.asList( "FWS", // Uncompressed Flash "CWS", // ZLib compressed Flash @@ -1708,8 +1711,9 @@ public final class SWF implements SWFContainerItem, Timelined { } private void getASMs(boolean exportFileNames, TreeItem treeItem, List nodesToExport, boolean exportAll, Map asmsToExport, String path) { - boolean exportNode = nodesToExport.contains(treeItem); TreeItem realItem = treeItem instanceof TagScript ? ((TagScript) treeItem).getTag() : treeItem; + boolean exportNode = nodesToExport.contains(treeItem) || nodesToExport.contains(realItem); + if (realItem instanceof ASMSource && (exportAll || exportNode)) { String npath = path; String exPath = path; @@ -1965,6 +1969,7 @@ public final class SWF implements SWFContainerItem, Timelined { } private static void getVariables(ConstantPool constantPool, BaseLocalData localData, TranslateStack stack, List output, ActionGraphSource code, int ip, List> variables, List functions, HashMap strings, List visited, HashMap usageTypes, String path) throws InterruptedException { + ActionLocalData aLocalData = (ActionLocalData) localData; boolean debugMode = false; while ((ip > -1) && ip < code.size()) { if (visited.contains(ip)) { @@ -2031,7 +2036,7 @@ public final class SWF implements SWFContainerItem, Timelined { ip = code.adr2pos(addr); addr += size; int nextip = code.adr2pos(addr); - getVariables(variables, functions, strings, usageTypes, new ActionGraphSource(code.getActions().subList(ip, nextip), code.version, new HashMap<>(), new HashMap<>(), new HashMap<>()), 0, path + (cntName == null ? "" : "/" + cntName)); + getVariables(aLocalData.insideDoInitAction, variables, functions, strings, usageTypes, new ActionGraphSource(path, aLocalData.insideDoInitAction, code.getActions().subList(ip, nextip), code.version, new HashMap<>(), new HashMap<>(), new HashMap<>()), 0, path + (cntName == null ? "" : "/" + cntName)); ip = nextip; } List> r = new ArrayList<>(); @@ -2122,39 +2127,40 @@ public final class SWF implements SWFContainerItem, Timelined { } } - private static void getVariables(List> variables, List functions, HashMap strings, HashMap usageTypes, ActionGraphSource code, int addr, String path) throws InterruptedException { - ActionLocalData localData = new ActionLocalData(); + private static void getVariables(boolean insideDoInitAction, List> variables, List functions, HashMap strings, HashMap usageTypes, ActionGraphSource code, int addr, String path) throws InterruptedException { + ActionLocalData localData = new ActionLocalData(insideDoInitAction); getVariables(null, localData, new TranslateStack(path), new ArrayList<>(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList<>(), usageTypes, path); } - private List> getVariables(List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes, ASMSource src, String path) throws InterruptedException { + private List> getVariables(boolean insideDefineFunction1, List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes, ASMSource src, String path) throws InterruptedException { List> ret = new ArrayList<>(); ActionList actions = src.getActions(); actionsMap.put(src, actions); - getVariables(variables, functions, strings, usageTypes, new ActionGraphSource(actions, version, new HashMap<>(), new HashMap<>(), new HashMap<>()), 0, path); + boolean insideDoInitAction = src instanceof DoInitActionTag; + getVariables(insideDoInitAction, variables, functions, strings, usageTypes, new ActionGraphSource(path, insideDoInitAction, actions, version, new HashMap<>(), new HashMap<>(), new HashMap<>()), 0, path); return ret; } - private void getVariables(Iterable tags, String path, List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes) throws InterruptedException { + private void getVariables(boolean insideDefineFunction1, Iterable tags, String path, List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes) throws InterruptedException { List processed = new ArrayList<>(); for (Tag t : tags) { String subPath = path + "/" + t.toString(); if (t instanceof ASMSource) { - addVariable((ASMSource) t, subPath, processed, variables, actionsMap, functions, strings, usageTypes); + addVariable(insideDefineFunction1, (ASMSource) t, subPath, processed, variables, actionsMap, functions, strings, usageTypes); } if (t instanceof ASMSourceContainer) { List processed2 = new ArrayList<>(); for (ASMSource asm : ((ASMSourceContainer) t).getSubItems()) { - addVariable(asm, subPath + "/" + asm.toString(), processed2, variables, actionsMap, functions, strings, usageTypes); + addVariable(insideDefineFunction1, asm, subPath + "/" + asm.toString(), processed2, variables, actionsMap, functions, strings, usageTypes); } } if (t instanceof DefineSpriteTag) { - getVariables(((DefineSpriteTag) t).getTags(), path + "/" + t.toString(), variables, actionsMap, functions, strings, usageTypes); + getVariables(insideDefineFunction1, ((DefineSpriteTag) t).getTags(), path + "/" + t.toString(), variables, actionsMap, functions, strings, usageTypes); } } } - private void addVariable(ASMSource asm, String path, List processed, List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes) throws InterruptedException { + private void addVariable(boolean insideDefineFunction1, ASMSource asm, String path, List processed, List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes) throws InterruptedException { int pos = 1; String infPath2 = path; while (processed.contains(infPath2)) { @@ -2163,7 +2169,7 @@ public final class SWF implements SWFContainerItem, Timelined { } processed.add(infPath2); informListeners("getVariables", infPath2); - getVariables(variables, actionsMap, functions, strings, usageTypes, asm, path); + getVariables(insideDefineFunction1, variables, actionsMap, functions, strings, usageTypes, asm, path); } public boolean as3StringConstantExists(String str) { @@ -2252,7 +2258,7 @@ public final class SWF implements SWFContainerItem, Timelined { HashMap usageTypes = new HashMap<>(); int ret = 0; - getVariables(getTags(), "", allVariableNames, actionsMap, allFunctions, allStrings, usageTypes); + getVariables(false, getTags(), "", allVariableNames, actionsMap, allFunctions, allStrings, usageTypes); informListeners("rename", ""); int fc = 0; for (MyEntry it : allVariableNames) { @@ -2275,10 +2281,9 @@ public final class SWF implements SWFContainerItem, Timelined { DoInitActionTag dia = (DoInitActionTag) t; String exportName = getExportName(dia.spriteId); exportName = exportName != null ? exportName : "_unk_"; - final String pkgPrefix = "__Packages."; String[] classNameParts = null; - if (exportName.startsWith(pkgPrefix)) { - String className = exportName.substring(pkgPrefix.length()); + if (exportName.startsWith(AS2_PKG_PREFIX)) { + String className = exportName.substring(AS2_PKG_PREFIX.length()); if (className.contains(".")) { classNameParts = className.split("\\."); } else { @@ -2288,7 +2293,7 @@ public final class SWF implements SWFContainerItem, Timelined { int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; List dec; try { - dec = Action.actionsToTree(dia.getActions(), version, staticOperation, ""/*FIXME*/); + dec = Action.actionsToTree(true /*Yes, inside doInitAction*/, dia.getActions(), version, staticOperation, ""/*FIXME*/); } catch (EmptyStackException ex) { continue; } @@ -2297,9 +2302,15 @@ public final class SWF implements SWFContainerItem, Timelined { if (it instanceof ClassActionItem) { ClassActionItem cti = (ClassActionItem) it; List methods = new ArrayList<>(); - methods.addAll(cti.functions); - methods.addAll(cti.staticFunctions); + List vars = new ArrayList<>(); + for (MyEntry trait : cti.traits) { + if (trait.getValue() instanceof FunctionActionItem) { + methods.add(trait.getValue()); + } else { + vars.add(trait.getValue()); + } + } for (GraphTargetItem gti : methods) { if (gti instanceof FunctionActionItem) { FunctionActionItem fun = (FunctionActionItem) gti; @@ -2314,13 +2325,6 @@ public final class SWF implements SWFContainerItem, Timelined { } } - List vars = new ArrayList<>(); - for (MyEntry item : cti.vars) { - vars.add(item.getKey()); - } - for (MyEntry item : cti.staticVars) { - vars.add(item.getKey()); - } for (GraphTargetItem gti : vars) { if (gti instanceof DirectValueActionItem) { DirectValueActionItem dvf = (DirectValueActionItem) gti; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index db9bad2a7..2600d6842 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2; import com.jpexs.decompiler.flash.EndOfStreamException; @@ -264,7 +265,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.clauses.DeclarationAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.clauses.ForEachInAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.clauses.ForInAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.parser.script.PropertyAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.AssignedValue; import com.jpexs.decompiler.flash.abc.types.ConvertData; @@ -1175,7 +1176,6 @@ public class AVM2Code implements Cloneable { writer.appendNoHilight("flag "); writer.hilightSpecial("HAS_OPTIONAL", HighlightSpecialType.FLAG_HAS_OPTIONAL); writer.newLine(); - writer.appendNoHilight("flag HAS_OPTIONAL").newLine(); } if (info.flagHas_paramnames()) { writer.appendNoHilight("flag "); @@ -2172,8 +2172,7 @@ public class AVM2Code implements Cloneable { ins.operands[j] = updater.updateOperandOffset(target, ins.operands[j]); } }*/ //Faster, but not so universal - { - if (ins.definition instanceof IfTypeIns) { + if (ins.definition instanceof IfTypeIns) { long target = ins.getTargetAddress(); try { ins.operands[0] = updater.updateOperandOffset(ins.getAddress(), target, ins.operands[0]); @@ -2181,7 +2180,6 @@ public class AVM2Code implements Cloneable { throw new ConvertException("Invalid offset (" + ins + ")", i); } } - } ins.setAddress(updater.updateInstructionOffset(ins.getAddress())); //Note: changing operands here does not change instruction byte length as offsets are always S24 (not variable length) } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java index 758f06c8f..8d0499b23 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.deobfuscation; import com.jpexs.decompiler.flash.BaseLocalData; @@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalTypeIn import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnValueIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ThrowIns; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.traits.Trait; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java index 99d0da6e8..a53ab1816 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.deobfuscation; import com.jpexs.decompiler.flash.BaseLocalData; @@ -30,7 +31,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnValueIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ThrowIns; import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.graph.Graph; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 5f07c9ba6..a9d054920 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.graph; import com.jpexs.decompiler.flash.BaseLocalData; @@ -571,8 +572,8 @@ public class AVM2Graph extends Graph { } @Override - protected void finalProcessAfter(List list, int level, FinalProcessLocalData localData) { - super.finalProcessAfter(list, level, localData); + protected void finalProcessAfter(List list, int level, FinalProcessLocalData localData, String path) { + super.finalProcessAfter(list, level, localData, path); for (int i = 0; i < list.size(); i++) { if (list.get(i) instanceof SetLocalAVM2Item) { SetLocalAVM2Item ri = (SetLocalAVM2Item) list.get(i); @@ -585,7 +586,7 @@ public class AVM2Graph extends Graph { } @Override - protected void finalProcess(List list, int level, FinalProcessLocalData localData) throws InterruptedException { + protected void finalProcess(List list, int level, FinalProcessLocalData localData, String path) throws InterruptedException { if (level == 0) { if (!list.isEmpty()) { @@ -702,7 +703,7 @@ public class AVM2Graph extends Graph { } } //Handle for loops at the end: - super.finalProcess(list, level, localData); + super.finalProcess(list, level, localData, path); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java index 935238674..a6bb038d5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.graph; import com.jpexs.decompiler.flash.BaseLocalData; @@ -21,7 +22,7 @@ import com.jpexs.decompiler.flash.abc.AVM2LocalData; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConvertOutput; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphPart; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index e8c59b02e..066712ffd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.instructions; import com.jpexs.decompiler.flash.abc.ABC; @@ -29,7 +30,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.IncLocalIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalTypeIns; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 9e3a06e4c..09b0239ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index c7becee79..fbb64fec9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SWC; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java index 1f18b8d90..2534c027f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java index 43b5b5715..fc65d41f0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java index 87e7c09f7..c91e506a7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions; import com.jpexs.decompiler.flash.abc.types.Multiname; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java index 46a4ad5a6..b03546135 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java index ca056fc58..c2cec4d21 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.types.Namespace; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java index 819697414..8c82b63f5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index f30291de5..0f06f88d4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java index b830c8d36..d52275288 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action; import com.jpexs.decompiler.flash.AppResources; @@ -20,9 +21,10 @@ import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.action.deobfuscation.ActionDeobfuscator; import com.jpexs.decompiler.flash.action.model.ActionItem; +import com.jpexs.decompiler.flash.action.model.CallMethodActionItem; import com.jpexs.decompiler.flash.action.model.ConstantPool; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.ExtendsActionItem; @@ -65,6 +67,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin; import com.jpexs.decompiler.flash.helpers.collections.MyEntry; +import com.jpexs.decompiler.flash.tags.DoInitActionTag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.graph.Graph; import com.jpexs.decompiler.graph.GraphSource; @@ -78,6 +81,7 @@ import com.jpexs.decompiler.graph.model.IfItem; import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.decompiler.graph.model.NotItem; import com.jpexs.decompiler.graph.model.PopItem; +import com.jpexs.decompiler.graph.model.PushItem; import com.jpexs.decompiler.graph.model.ScriptEndItem; import com.jpexs.helpers.ByteArrayRange; import com.jpexs.helpers.CancellableWorker; @@ -756,7 +760,7 @@ public abstract class Action implements GraphSourceItem { * @param path the value of path * @throws java.lang.InterruptedException */ - public void translate(GraphSourceItem lineStartIns, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartIns, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { } @Override @@ -832,8 +836,8 @@ public abstract class Action implements GraphSourceItem { return -1; } - public static List actionsToTree(List actions, int version, int staticOperation, String path) throws InterruptedException { - return actionsToTree(new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path); + public static List actionsToTree(boolean insideDoInitAction, List actions, int version, int staticOperation, String path) throws InterruptedException { + return actionsToTree(insideDoInitAction, new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path); } /** @@ -858,7 +862,8 @@ public abstract class Action implements GraphSourceItem { @Override public List call() throws Exception { int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; - List tree = actionsToTree(new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path); + boolean insideDoInitAction = (asm instanceof DoInitActionTag); + List tree = actionsToTree(insideDoInitAction, new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path); SWFDecompilerPlugin.fireActionTreeCreated(tree, swf); if (Configuration.autoDeobfuscate.get()) { new ActionDeobfuscator().actionTreeCreated(tree, swf); @@ -916,8 +921,8 @@ public abstract class Action implements GraphSourceItem { * @return List of treeItems * @throws java.lang.InterruptedException */ - public static List actionsToTree(HashMap regNames, HashMap variables, HashMap functions, List actions, int version, int staticOperation, String path) throws InterruptedException { - return ActionGraph.translateViaGraph(regNames, variables, functions, actions, version, staticOperation, path); + public static List actionsToTree(boolean insideDoInitAction, HashMap regNames, HashMap variables, HashMap functions, List actions, int version, int staticOperation, String path) throws InterruptedException { + return ActionGraph.translateViaGraph(insideDoInitAction, regNames, variables, functions, actions, version, staticOperation, path); } @Override @@ -929,7 +934,7 @@ public abstract class Action implements GraphSourceItem { } expectedSize += getStackPushCount(localData, stack);*/ - translate(aLocalData.lineStartAction, stack, output, aLocalData.regNames, aLocalData.variables, aLocalData.functions, staticOperation, path); + translate(aLocalData.insideDoInitAction, aLocalData.lineStartAction, stack, output, aLocalData.regNames, aLocalData.variables, aLocalData.functions, staticOperation, path); /*if (stack.size() != expectedSize && !(this instanceof ActionPushDuplicate)) { throw new Error("HONFIKA stack size mismatch"); }*/ @@ -965,11 +970,11 @@ public abstract class Action implements GraphSourceItem { this.ignored = ignored; } - public static List actionsPartToTree(Reference fi, HashMap registerNames, HashMap variables, HashMap functions, TranslateStack stack, List actions, int start, int end, int version, int staticOperation, String path) throws InterruptedException { + public static List actionsPartToTree(boolean insideDoInitAction, Reference fi, HashMap registerNames, HashMap variables, HashMap functions, TranslateStack stack, List actions, int start, int end, int version, int staticOperation, String path) throws InterruptedException { if (start < actions.size() && (end > 0) && (start > 0)) { logger.log(Level.FINE, "Entering {0}-{1}{2}", new Object[]{start, end, actions.size() > 0 ? (" (" + actions.get(start).toString() + " - " + actions.get(end == actions.size() ? end - 1 : end) + ")") : ""}); } - ActionLocalData localData = new ActionLocalData(registerNames, variables, functions); + ActionLocalData localData = new ActionLocalData(insideDoInitAction, registerNames, variables, functions); localData.lineStartAction = fi.getVal(); List output = new ArrayList<>(); int ip = start; @@ -1039,7 +1044,7 @@ public abstract class Action implements GraphSourceItem { } } } - out = ActionGraph.translateViaGraph(regNames, variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); + out = ActionGraph.translateViaGraph(insideDoInitAction, regNames, variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); } catch (OutOfMemoryError | TranslateException | StackOverflowError ex) { logger.log(Level.SEVERE, "Decompilation error in: " + path, ex); if (ex instanceof OutOfMemoryError) { @@ -1072,7 +1077,7 @@ public abstract class Action implements GraphSourceItem { if (actions.get(ip + 2) instanceof ActionNot) { if (actions.get(ip + 3) instanceof ActionIf) { ActionIf aif = (ActionIf) actions.get(ip + 3); - if (adr2ip(actions, ip2adr(actions, ip + 4) + aif.getJumpOffset()) == ip) { + if (adr2ip(actions, ip2adr(actions, ip + 3) + 5 + aif.getJumpOffset()) == ip) { ip += 4; continue; } @@ -1082,103 +1087,16 @@ public abstract class Action implements GraphSourceItem { } } - /*ActionJump && ActionIf removed*/ - /*if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) { - loopStart = ip + 1; - isForIn = true; - ip += 4; - action.translate(localData, stack, output); - EnumerateActionItem en = (EnumerateActionItem) stack.peek(); - inItem = en.object; - continue; - } else*/ /*if (action instanceof ActionTry) { - ActionTry atry = (ActionTry) action; - List tryCommands = ActionGraph.translateViaGraph(registerNames, variables, functions, atry.tryBody, version); - ActionItem catchName; - if (atry.catchInRegisterFlag) { - catchName = new DirectValueActionItem(atry, -1, new RegisterNumber(atry.catchRegister), new ArrayList<>()); - } else { - catchName = new DirectValueActionItem(atry, -1, atry.catchName, new ArrayList<>()); - } - List catchExceptions = new ArrayList(); - catchExceptions.add(catchName); - List> catchCommands = new ArrayList>(); - catchCommands.add(ActionGraph.translateViaGraph(registerNames, variables, functions, atry.catchBody, version)); - List finallyCommands = ActionGraph.translateViaGraph(registerNames, variables, functions, atry.finallyBody, version); - output.add(new TryActionItem(tryCommands, catchExceptions, catchCommands, finallyCommands)); - } else if (action instanceof ActionWith) { - ActionWith awith = (ActionWith) action; - List withCommands = ActionGraph.translateViaGraph(registerNames, variables, functions,new ArrayList() , version); //TODO:parse with actions - output.add(new WithActionItem(action, stack.pop(), withCommands)); - } else */ if (false) { - } /*if (action instanceof ActionStoreRegister) { - if ((ip + 1 <= end) && (actions.get(ip + 1) instanceof ActionPop)) { - action.translate(localData, stack, output); - stack.pop(); - ip++; - } else { - try { - action.translate(localData, stack, output); - } catch (Exception ex) { - // ignore - } - } - } */ /*else if (action instanceof ActionStrictEquals) { - if ((ip + 1 < actions.size()) && (actions.get(ip + 1) instanceof ActionIf)) { - List caseValues = new ArrayList(); - List> caseCommands = new ArrayList>(); - caseValues.add(stack.pop()); - ActionItem switchedObject = stack.pop(); - if (output.size() > 0) { - if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { - output.remove(output.size() - 1); - } - } - int caseStart = ip + 2; - List caseBodyIps = new ArrayList(); - long defaultAddr = 0; - caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip + 1)).getRef(version), version)); - ip++; - do { - ip++; - if ((actions.get(ip - 1) instanceof ActionStrictEquals) && (actions.get(ip) instanceof ActionIf)) { - caseValues.add(actionsToStackTree(registerNames, jumpsOrIfs, actions, constants, caseStart, ip - 2, version).pop()); - caseStart = ip + 1; - caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip)).getRef(version), version)); - if (actions.get(ip + 1) instanceof ActionJump) { - defaultAddr = ((ActionJump) actions.get(ip + 1)).getRef(version); - ip = adr2ip(actions, defaultAddr, version); - break; - } - } - } while (ip < end); - - for (int i = 0; i < caseBodyIps.size(); i++) { - int caseEnd = ip - 1; - if (i < caseBodyIps.size() - 1) { - caseEnd = caseBodyIps.get(i + 1) - 1; - } - caseCommands.add(actionsToTree(registerNames, unknownJumps, loopList, jumpsOrIfs, stack, constants, actions, caseBodyIps.get(i), caseEnd, version)); - } - output.add(new SwitchActionItem(action, defaultAddr, switchedObject, caseValues, caseCommands, null)); - continue; - } else { - action.translate(stack, constants, output, registerNames); - } - } */ else { - - if (action instanceof ActionStore) { - ActionStore store = (ActionStore) action; - store.setStore(actions.subList(ip + 1, ip + 1 + store.getStoreSize())); - ip = ip + 1 + store.getStoreSize() - 1/*ip++ will be next*/; - } - - action.translate(localData, stack, output, staticOperation, path); + if (action instanceof ActionStore) { + ActionStore store = (ActionStore) action; + store.setStore(actions.subList(ip + 1, ip + 1 + store.getStoreSize())); + ip = ip + 1 + store.getStoreSize() - 1/*ip++ will be next*/; } + action.translate(localData, stack, output, staticOperation, path); + ip++; } - //output = checkClass(output); logger.log(Level.FINE, "Leaving {0}-{1}", new Object[]{start, end}); return output; } @@ -1211,155 +1129,6 @@ public abstract class Action implements GraphSourceItem { return ti; } - public static List checkClass(List output) { - if (true) { - //return output; - } - List ret = new ArrayList<>(); - List functions = new ArrayList<>(); - List staticFunctions = new ArrayList<>(); - List> vars = new ArrayList<>(); - List> staticVars = new ArrayList<>(); - GraphTargetItem className; - GraphTargetItem extendsOp = null; - List implementsOp = new ArrayList<>(); - boolean ok = true; - int prevCount = 0; - for (GraphTargetItem t : output) { - if (t instanceof IfItem) { - IfItem it = (IfItem) t; - if (it.expression instanceof NotItem) { - NotItem nti = (NotItem) it.expression; - if ((nti.value instanceof GetMemberActionItem) || (nti.value instanceof GetVariableActionItem)) { - if (true) { //it.onFalse.isEmpty()){ //||(it.onFalse.get(0) instanceof UnsupportedActionItem)) { - if ((it.onTrue.size() == 1) && (it.onTrue.get(0) instanceof SetMemberActionItem) && (((SetMemberActionItem) it.onTrue.get(0)).value instanceof NewObjectActionItem)) { - // ignore - } else { - List parts = it.onTrue; - className = getWithoutGlobal(nti.value); - if (parts.size() >= 1) { - int ipos = 0; - - while ((parts.get(ipos) instanceof PopItem) || ((parts.get(ipos) instanceof IfItem) && ((((IfItem) parts.get(ipos)).onTrue.size() == 1) && (((IfItem) parts.get(ipos)).onTrue.get(0) instanceof SetMemberActionItem) && (((SetMemberActionItem) ((IfItem) parts.get(ipos)).onTrue.get(0)).value instanceof NewObjectActionItem)))) { - ipos++; - } - if (parts.get(ipos) instanceof ExtendsActionItem) { - ExtendsActionItem et = (ExtendsActionItem) parts.get(ipos); - extendsOp = getWithoutGlobal(et.superclass); - ipos++; - } - if (parts.get(ipos) instanceof StoreRegisterActionItem) { - StoreRegisterActionItem sr = (StoreRegisterActionItem) parts.get(ipos); - int instanceReg = sr.register.number; - if (sr.value instanceof GetMemberActionItem) { - GetMemberActionItem gm = (GetMemberActionItem) sr.value; - //gm.memberName should be "prototype" - if (gm.object instanceof TemporaryRegister) { - TemporaryRegister tm = (TemporaryRegister) gm.object; - int classReg = tm.getRegId(); - if (tm.value instanceof SetMemberActionItem) { - SetMemberActionItem sm = (SetMemberActionItem) tm.value; - if (sm.value instanceof StoreRegisterActionItem) { - sr = (StoreRegisterActionItem) sm.value; - if (sr.value instanceof FunctionActionItem) { - ((FunctionActionItem) (sr.value)).calculatedFunctionName = (className instanceof GetMemberActionItem) ? ((GetMemberActionItem) className).memberName : className; - functions.add((FunctionActionItem) sr.value); - - for (; ipos < parts.size(); ipos++) { - if (parts.get(ipos) instanceof ImplementsOpActionItem) { - ImplementsOpActionItem io = (ImplementsOpActionItem) parts.get(ipos); - implementsOp = io.superclasses; - continue; - } - if (parts.get(ipos) instanceof SetMemberActionItem) { - sm = (SetMemberActionItem) parts.get(ipos); - int rnum = -1; - if (sm.object instanceof DirectValueActionItem) { - DirectValueActionItem dv = (DirectValueActionItem) sm.object; - if (dv.value instanceof RegisterNumber) { - RegisterNumber rn = (RegisterNumber) dv.value; - rnum = rn.number; - } - } - if (sm.object instanceof TemporaryRegister) { - rnum = ((TemporaryRegister) sm.object).getRegId(); - } - if (rnum == instanceReg) { - if (sm.value instanceof FunctionActionItem) { - ((FunctionActionItem) sm.value).calculatedFunctionName = sm.objectName; - functions.add((FunctionActionItem) sm.value); - } else { - vars.add(new MyEntry<>(sm.objectName, sm.value)); - } - } else if (rnum == classReg) { - if (sm.value instanceof FunctionActionItem) { - ((FunctionActionItem) sm.value).calculatedFunctionName = sm.objectName; - staticFunctions.add((FunctionActionItem) sm.value); - } else { - staticVars.add(new MyEntry<>(sm.objectName, sm.value)); - } - } - - } - } - - } - - } - } - List output2 = new ArrayList<>(); - for (int i = 0; i < prevCount; i++) { - output2.add(output.get(i)); - } - output2.add(new ClassActionItem(className, extendsOp, implementsOp, null/*FIXME*/, functions, vars, staticFunctions, staticVars)); - return output2; - } - } - } else if (parts.get(ipos) instanceof SetMemberActionItem) { - SetMemberActionItem sm = (SetMemberActionItem) parts.get(0); - if (sm.value instanceof FunctionActionItem) { - FunctionActionItem f = (FunctionActionItem) sm.value; - if (f.actions.isEmpty()) { - if (parts.size() == 2) { - if (parts.get(1) instanceof ImplementsOpActionItem) { - ImplementsOpActionItem iot = (ImplementsOpActionItem) parts.get(1); - implementsOp = iot.superclasses; - } else { - //ok = false; - break; - } - } - List output2 = new ArrayList<>(); - for (int i = 0; i < prevCount; i++) { - output2.add(output.get(i)); - } - output2.add(new InterfaceActionItem(sm.objectName, implementsOp)); - return output2; - } - } - } - } - } - } else { - //ok = false; - } - } else { - ok = false; - } - } else { - ok = false; - } - } else if (!(t instanceof PopItem)) { - prevCount++; - //ok = false; - } - if (!ok) { - break; - } - } - return output; - } - @Override public boolean ignoredLoops() { return false; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionDefineFunctionPushRegistersCleaner.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionDefineFunctionPushRegistersCleaner.java new file mode 100644 index 000000000..ff2121c22 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionDefineFunctionPushRegistersCleaner.java @@ -0,0 +1,291 @@ +/* + * Copyright (C) 2010-2018 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action; + +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.action.swf4.ActionJump; +import com.jpexs.decompiler.flash.action.swf4.ActionPop; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; +import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; +import com.jpexs.decompiler.flash.action.swf5.ActionReturn; +import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; +import com.jpexs.decompiler.flash.ecma.Undefined; +import com.jpexs.decompiler.flash.helpers.SWFDecompilerAdapter; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +/** + * Cleaner for ActionDefineFunction push registers. From Flash 7 onwards, + * functions are stored as ActionDefineFunction2 with use up to 255 local + * registers. When exporting SWF to lower formats Flash5-Flash6 in Flash IDE + * (for example MX 2004), all ActionDefineFunction2 are replaced with + * ActionDefineFunction, and it also use local registers (4 of them are + * available). The code of ActionDefineFunction is also modified that it pushes + * all previous values of registers on the code start and pops them back on code + * exit or when return action shows up. All returns are replaced with jump to + * popping part. This makes code flow tangled and the decompiler cannot properly + * handle it. The cleaner will fix this mess. + * + * @author JPEXS + */ +public class ActionDefineFunctionPushRegistersCleaner extends SWFDecompilerAdapter { + + @Override + public void actionListParsed(ActionList actions, SWF swf) throws InterruptedException { + cleanActionDefineFunctions(actions); + } + + private void cleanActionDefineFunctions(ActionList actions) { + for (int i = actions.size() - 1; i >= 0; i--) { + Action action = actions.get(i); + if (action instanceof ActionDefineFunction) { + ActionDefineFunction def = (ActionDefineFunction) action; + + List sizes = def.getContainerSizes(); + long endAddress = action.getAddress() + def.getHeaderSize() + sizes.get(0); + int lastIndex = actions.getIndexByAddress(endAddress); + int startIndex = i + 1; + int count = lastIndex - startIndex; + cleanPushRegisters(actions, startIndex, count); + } + } + } + + /** + * + * @param code + * @param startIndex Index of first Action in DefineFunction body + * @param count Count of actions in DefineFunction + * @return + */ + private boolean cleanPushRegisters(ActionList code, int startIndex, int count) { + if (count == 0) { + return false; + } + + /* + ON BEGINNING: + Push register1 register2 normalval + */ + List pushedRegisters = new ArrayList<>(); + int pos = startIndex; + loopregs: + while (code.get(pos) instanceof ActionPush) { + ActionPush ap = (ActionPush) code.get(pos); + for (int i = 0; i < ap.values.size(); i++) { + if (ap.values.get(i) instanceof RegisterNumber) { + RegisterNumber rn = (RegisterNumber) ap.values.get(i); + pushedRegisters.add(rn.number); + } else { + break loopregs; + } + } + pos++; + if (pos >= code.size()) { + return false; + } + } + if (pushedRegisters.isEmpty()) { + return false; + } + + /* + ON FINISH: + + when function returns something: + StoreRegister 0 ;return value + Pop + StoreRegister 2 + Pop + StoreRegister 1 + Pop + Push register0 + Return + + when function does not return anything: + StoreRegister 2 + Pop + StoreRegister 1 + Pop + + when original function has some returns, but no return at the end of function: + Push undefined + locjump: StoreRegister 0 + Pop + ... + + */ + int returnReg = -1; + pos = startIndex + count - 1; + if (code.get(pos) instanceof ActionReturn) { + pos--; + if (pos < startIndex) { + return false; + } + if (!(code.get(pos) instanceof ActionPush)) { + return false; + } + ActionPush pu = (ActionPush) code.get(pos); + if (pu.values.size() != 1) { + return false; + } + if (!(pu.values.get(0) instanceof RegisterNumber)) { + return false; + } + RegisterNumber rn = (RegisterNumber) pu.values.get(0); + returnReg = rn.number; + pos--; + if (pos < startIndex) { + return false; + } + + } + for (int i = 0; i < pushedRegisters.size(); i++) { + if (!(code.get(pos) instanceof ActionPop)) { + return false; + } + pos--; + if (pos < startIndex) { + return false; + } + if (!(code.get(pos) instanceof ActionStoreRegister)) { + return false; + } + ActionStoreRegister asr = (ActionStoreRegister) code.get(pos); + int expectedReg = pushedRegisters.get(i); + if (asr.registerNumber != expectedReg) { + return false; + } + pos--; + if (pos < startIndex) { + return false; + } + } + + Set jumpsToReturnPositions = new TreeSet<>(new Comparator() { + @Override + public int compare(Integer o1, Integer o2) { + return o2 - o1; //biggest first + } + }); + + int posBeforeFinishPart; + Action actionBeforeFinishPart = null; + if (returnReg > -1) { + if (!(code.get(pos) instanceof ActionPop)) { + return false; + } + pos--; + if (pos < startIndex) { + return false; + } + if (!(code.get(pos) instanceof ActionStoreRegister)) { + return false; + } + ActionStoreRegister asr = (ActionStoreRegister) code.get(pos); + int expectedReg = returnReg; + if (asr.registerNumber != expectedReg) { + return false; + } + + Iterator ait = code.getReferencesFor(asr); + while (ait.hasNext()) { + Action a = ait.next(); + if (!(a instanceof ActionJump)) { + return false; + } + jumpsToReturnPositions.add(code.indexOf(a)); + } + pos--; + if (!(code.get(pos) instanceof ActionJump)) { + actionBeforeFinishPart = code.get(pos); + } + posBeforeFinishPart = pos; + } else { + posBeforeFinishPart = pos; + } + + //process code... + //replace jumps to return with returns + for (Integer jp : jumpsToReturnPositions) { + int index = jp; + code.removeAction(index); + code.addAction(index, new ActionReturn()); + } + + //previous action (not jump) also leads to finishpart, we might add return there aswell + if (returnReg > -1 && actionBeforeFinishPart != null) { + if ((actionBeforeFinishPart instanceof ActionPush) && ((ActionPush) actionBeforeFinishPart).values.size() == 1 && ((ActionPush) actionBeforeFinishPart).values.get(0) == Undefined.INSTANCE) { + //its return undefined, which is same as no return + code.removeAction(posBeforeFinishPart); + posBeforeFinishPart--; + count--; + } else if (actionBeforeFinishPart instanceof ActionReturn) { + //it was a jump that was replaced with Return + } else if (actionBeforeFinishPart instanceof ActionJump) { + //its jump to another location, we will not add return there + } else { //might be another returned value + posBeforeFinishPart++; + code.addAction(posBeforeFinishPart, new ActionReturn()); + count++; //action added, but not removed, we increase total count + } + } + + //remove finishPart + int removeStartIndex = posBeforeFinishPart + 1; + int removeCount = startIndex + count - removeStartIndex; + code.removeAction(removeStartIndex, removeCount); + + //remove pushes from beginning part + pos = startIndex; + int registersLeft = pushedRegisters.size(); + loopregs2: + while (code.get(pos) instanceof ActionPush) { + ActionPush currentPush = (ActionPush) code.get(pos); + + List currentPushedValues = currentPush.values; + List newPushedValues = new ArrayList<>(); + for (int i = 0; i < currentPushedValues.size(); i++) { + if (registersLeft > 0 && currentPushedValues.get(i) instanceof RegisterNumber) { + registersLeft--; + } else { + newPushedValues.add(currentPushedValues.get(i)); + } + } + if (newPushedValues.size() != currentPushedValues.size()) { + code.removeAction(pos); //remove that push + if (!newPushedValues.isEmpty()) { + ActionPush newPush = new ActionPush(newPushedValues.toArray()); + newPush.constantPool = currentPush.constantPool; + code.addAction(pos, newPush); //replace with different push + } else { + pos--; //action removed, but not added + } + } + if (registersLeft == 0) { //we removed all unwanted registers + break; + } + pos++; + } + return true; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java index dcab0b63b..1ce070baa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action; import com.jpexs.decompiler.flash.BaseLocalData; @@ -48,6 +49,7 @@ import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.decompiler.graph.model.BreakItem; import com.jpexs.decompiler.graph.model.ContinueItem; import com.jpexs.decompiler.graph.model.DefaultItem; +import com.jpexs.decompiler.graph.model.IfItem; import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.WhileItem; import java.util.ArrayList; @@ -62,26 +64,31 @@ import java.util.Set; */ public class ActionGraph extends Graph { - public ActionGraph(List code, HashMap registerNames, HashMap variables, HashMap functions, int version) { - super(new ActionGraphSource(code, version, registerNames, variables, functions), new ArrayList<>()); - //this.version = version; - /*heads = makeGraph(code, new ArrayList()); - for (GraphPart head : heads) { - fixGraph(head); - makeMulti(head, new ArrayList()); - }*/ + private boolean insideDoInitAction; + + public ActionGraph(String path, boolean insideDoInitAction, List code, HashMap registerNames, HashMap variables, HashMap functions, int version) { + super(new ActionGraphSource(path, insideDoInitAction, code, version, registerNames, variables, functions), new ArrayList<>()); + this.insideDoInitAction = insideDoInitAction; } - public static List translateViaGraph(HashMap registerNames, HashMap variables, HashMap functions, List code, int version, int staticOperation, String path) throws InterruptedException { + public boolean isInsideDoInitAction() { + return insideDoInitAction; + } - ActionGraph g = new ActionGraph(code, registerNames, variables, functions, version); - ActionLocalData localData = new ActionLocalData(registerNames); + @Override + protected void afterPopupateAllParts(Set allParts) { + + } + + public static List translateViaGraph(boolean insideDoInitAction, HashMap registerNames, HashMap variables, HashMap functions, List code, int version, int staticOperation, String path) throws InterruptedException { + ActionGraph g = new ActionGraph(path, insideDoInitAction, code, registerNames, variables, functions, version); + ActionLocalData localData = new ActionLocalData(insideDoInitAction, registerNames); g.init(localData); return g.translate(localData, staticOperation, path); } @Override - public void finalProcessStack(TranslateStack stack, List output) { + public void finalProcessStack(TranslateStack stack, List output, String path) { if (stack.size() > 0) { for (int i = stack.size() - 1; i >= 0; i--) { //System.err.println(stack.get(i)); @@ -96,11 +103,11 @@ public class ActionGraph extends Graph { } @Override - protected void finalProcess(List list, int level, FinalProcessLocalData localData) throws InterruptedException { - List ret = Action.checkClass(list); - if (ret != list) { - list.clear(); - list.addAll(ret); + protected void finalProcess(List list, int level, FinalProcessLocalData localData, String path) throws InterruptedException { + + if (insideDoInitAction) { + ActionScript2ClassDetector detector = new ActionScript2ClassDetector(); + detector.checkClass(list, path); } int targetStart; int targetEnd; @@ -161,34 +168,51 @@ public class ActionGraph extends Graph { } while (again); for (int t = 1/*not first*/; t < list.size(); t++) { GraphTargetItem it = list.get(t); + List checkedBody = null; + GraphTargetItem checkedCondition = null; + Loop checkedLoop = null; if (it instanceof WhileItem) { WhileItem wi = (WhileItem) it; - if ((!wi.commands.isEmpty()) && (wi.commands.get(0) instanceof SetTypeActionItem)) { - SetTypeActionItem sti = (SetTypeActionItem) wi.commands.get(0); - if (wi.expression.get(wi.expression.size() - 1) instanceof NeqActionItem) { - NeqActionItem ne = (NeqActionItem) wi.expression.get(wi.expression.size() - 1); - if (ne.rightSide instanceof DirectValueActionItem) { - DirectValueActionItem dv = (DirectValueActionItem) ne.rightSide; - if (dv.value == Null.INSTANCE) { - GraphTargetItem en = list.get(t - 1); - if (en instanceof EnumerateActionItem) { - EnumerateActionItem eti = (EnumerateActionItem) en; - list.remove(t); - wi.commands.remove(0); - list.add(t, new ForInActionItem(null, null, wi.loop, sti.getObject(), eti.object, wi.commands)); - list.remove(t - 1); - t--; + checkedBody = wi.commands; + checkedCondition = wi.expression.get(wi.expression.size() - 1); + checkedLoop = wi.loop; + } else if (it instanceof IfItem) { + IfItem ifi = (IfItem) it; + if (ifi.onFalse.isEmpty()) { + checkedBody = ifi.onTrue; + checkedCondition = ifi.expression; + checkedLoop = null; + } + } + if (checkedBody != null && (!checkedBody.isEmpty()) && (checkedBody.get(0) instanceof SetTypeActionItem)) { + SetTypeActionItem sti = (SetTypeActionItem) checkedBody.get(0); + if (checkedCondition instanceof NeqActionItem) { + NeqActionItem ne = (NeqActionItem) checkedCondition; + if (ne.rightSide instanceof DirectValueActionItem) { + DirectValueActionItem dv = (DirectValueActionItem) ne.rightSide; + if (dv.value == Null.INSTANCE) { + GraphTargetItem en = list.get(t - 1); + if (en instanceof EnumerateActionItem) { + EnumerateActionItem eti = (EnumerateActionItem) en; + list.remove(t); + checkedBody.remove(0); + if (checkedLoop == null) { + checkedLoop = new Loop(localData.loops.size(), null, null); + checkedBody.add(new BreakItem(null, null, checkedLoop.id)); } + list.add(t, new ForInActionItem(null, null, checkedLoop, sti.getObject(), eti.object, checkedBody)); + list.remove(t - 1); + t--; } - } + } } - } + } //Handle for loops at the end: - super.finalProcess(list, level, localData); + super.finalProcess(list, level, localData, path); } @@ -300,59 +324,102 @@ public class ActionGraph extends Graph { stack.push(set); } else { part = part.nextParts.get(1); - //caseBodyParts.add(part); GraphPart defaultPart = part; if (code.size() > defaultPart.start && code.get(defaultPart.start) instanceof ActionJump) { defaultPart = defaultPart.nextParts.get(0); } - GraphPart breakPart = getMostCommonPart(localData, caseBodyParts, loops); - - List caseValues = new ArrayList<>(); boolean hasDefault = false; - for (int i = 0; i < caseBodyParts.size(); i++) { - caseValues.add(caseValuesMap.get(i)); + /* + case 4: + case 5: + default: + trace("5 & def"); + ... + case 6: + + */ + //must go backwards to hit case 5, not case 4 + for (int i = caseBodyParts.size() - 1; i >= 0; i--) { if (caseBodyParts.get(i) == defaultPart) { - i++; - caseValuesMap.add(i, new DefaultItem()); - caseBodyParts.add(i, defaultPart); - caseValues.add(caseValuesMap.get(i)); + DefaultItem di = new DefaultItem(); + caseValuesMap.add(i + 1, di); + caseBodyParts.add(i + 1, defaultPart); hasDefault = true; + break; } } if (!hasDefault) { - //List stops = new ArrayList<>(); - //stops.addAll(caseBodyParts); - for (int i = 0; i < caseBodyParts.size(); i++) { - if (defaultPart.leadsTo(localData, this, code, caseBodyParts.get(i), loops)) { - caseValuesMap.add(i, new DefaultItem()); - caseBodyParts.add(i, defaultPart); - caseValues.add(i, caseValuesMap.get(i)); + /* + case 1: + trace("1"); + case 2: + trace("2"); //no break + default: + trace("def"); + ... + case 3: + */ + //must go backwards to hit case 2, not case 1 + for (int i = caseBodyParts.size() - 1; i >= 0; i--) { + if (caseBodyParts.get(i).leadsTo(localData, this, code, defaultPart, loops)) { + DefaultItem di = new DefaultItem(); + caseValuesMap.add(i + 1, di); + caseBodyParts.add(i + 1, defaultPart); hasDefault = true; break; } } } + if (!hasDefault) { - caseValuesMap.add(new DefaultItem()); - caseBodyParts.add(defaultPart); - caseValues.add(caseValuesMap.get(caseValuesMap.size() - 1)); + /* + case 1: + trace("1"); + break; + default: + trace("def"); //no break + case 2: + trace("2"); + */ + for (int i = 0; i < caseBodyParts.size(); i++) { + if (defaultPart.leadsTo(localData, this, code, caseBodyParts.get(i), loops)) { + DefaultItem di = new DefaultItem(); + caseValuesMap.add(i, di); + caseBodyParts.add(i, defaultPart); + hasDefault = true; + break; + } + } } - List> caseCommands = new ArrayList<>(); - GraphPart next; + if (!hasDefault) { + /* + case 1: + ... + case 2: + ... + default: + trace("def"); + */ + caseValuesMap.add(new DefaultItem()); + caseBodyParts.add(defaultPart); + } - next = breakPart; + GraphPart breakPart = getMostCommonPart(localData, caseBodyParts, loops); + List> caseCommands = new ArrayList<>(); + GraphPart next = breakPart; GraphTargetItem ti = checkLoop(next, stopPart, loops); + + //create switch as new loop break command detection to work currentLoop = new Loop(loops.size(), null, next); currentLoop.phase = 1; loops.add(currentLoop); - //switchLoc.getNextPartPath(new ArrayList()); List valuesMapping = new ArrayList<>(); List caseBodies = new ArrayList<>(); - for (int i = 0; i < caseValues.size(); i++) { + for (int i = 0; i < caseValuesMap.size(); i++) { GraphPart cur = caseBodyParts.get(i); if (!caseBodies.contains(cur)) { caseBodies.add(cur); @@ -360,45 +427,36 @@ public class ActionGraph extends Graph { valuesMapping.add(caseBodies.indexOf(cur)); } - /*List ignored = new ArrayList<>(); - for (Loop l : loops) { - ignored.add(l.loopContinue); - }*/ for (int i = 0; i < caseBodies.size(); i++) { - List cc = new ArrayList<>(); - GraphPart nextCase = null; - nextCase = next; + List currentCaseCommands = new ArrayList<>(); + GraphPart nextCase = next; if (next != null) { if (i < caseBodies.size() - 1) { if (!caseBodies.get(i).leadsTo(localData, this, code, caseBodies.get(i + 1), loops)) { - cc.add(new BreakItem(null, localData.lineStartInstruction, currentLoop.id)); + currentCaseCommands.add(new BreakItem(null, localData.lineStartInstruction, currentLoop.id)); } else { nextCase = caseBodies.get(i + 1); } } } List stopPart2x = new ArrayList<>(stopPart); - //stopPart2.add(nextCase); for (GraphPart b : caseBodies) { if (b != caseBodies.get(i)) { stopPart2x.add(b); } } - /*if (defaultPart != null) { - stopPart2x.add(defaultPart); - }*/ if (breakPart != null) { stopPart2x.add(breakPart); } - cc.addAll(0, printGraph(partCodes, partCodePos, localData, stack, allParts, null, caseBodies.get(i), stopPart2x, loops, staticOperation, path)); - if (cc.size() >= 2) { - if (cc.get(cc.size() - 1) instanceof BreakItem) { - if ((cc.get(cc.size() - 2) instanceof ContinueItem) || (cc.get(cc.size() - 2) instanceof BreakItem)) { - cc.remove(cc.size() - 1); + currentCaseCommands.addAll(0, printGraph(partCodes, partCodePos, localData, stack, allParts, null, caseBodies.get(i), stopPart2x, loops, staticOperation, path)); + if (currentCaseCommands.size() >= 2) { + if (currentCaseCommands.get(currentCaseCommands.size() - 1) instanceof BreakItem) { + if ((currentCaseCommands.get(currentCaseCommands.size() - 2) instanceof ContinueItem) || (currentCaseCommands.get(currentCaseCommands.size() - 2) instanceof BreakItem)) { + currentCaseCommands.remove(currentCaseCommands.size() - 1); } } } - caseCommands.add(cc); + caseCommands.add(currentCaseCommands); } //If the lastone is default empty and alone, remove it @@ -410,15 +468,16 @@ public class ActionGraph extends Graph { } if (lastc.isEmpty()) { int cnt2 = 0; - if (caseValues.get(caseValues.size() - 1) instanceof DefaultItem) { + if (caseValuesMap.get(caseValuesMap.size() - 1) instanceof DefaultItem) { for (int i = valuesMapping.size() - 1; i >= 0; i--) { if (valuesMapping.get(i) == caseCommands.size() - 1) { cnt2++; } } + + caseValuesMap.remove(caseValuesMap.size() - 1); + valuesMapping.remove(valuesMapping.size() - 1); if (cnt2 == 1) { - caseValues.remove(caseValues.size() - 1); - valuesMapping.remove(valuesMapping.size() - 1); caseCommands.remove(lastc); } } @@ -430,13 +489,12 @@ public class ActionGraph extends Graph { if (!lastc.isEmpty() && (lastc.get(lastc.size() - 1) instanceof BreakItem)) { BreakItem bi = (BreakItem) lastc.get(lastc.size() - 1); lastc.remove(lastc.size() - 1); - } } ret = new ArrayList<>(); ret.addAll(output); - SwitchItem sti = new SwitchItem(null, switchStartItem, currentLoop, switchedObject, caseValues, caseCommands, valuesMapping); + SwitchItem sti = new SwitchItem(null, switchStartItem, currentLoop, switchedObject, caseValuesMap, caseCommands, valuesMapping); ret.add(sti); currentLoop.phase = 2; if (next != null) { @@ -454,15 +512,15 @@ public class ActionGraph extends Graph { @Override protected int checkIp(int ip) { int oldIp = ip; - //return in for..in + //return/break in for..in GraphSourceItem action = code.get(ip); if ((action instanceof ActionPush) && (((ActionPush) action).values.size() == 1) && (((ActionPush) action).values.get(0) == Null.INSTANCE)) { - if (ip + 4 < code.size()) { + if (ip + 3 <= code.size()) { if ((code.get(ip + 1) instanceof ActionEquals) || (code.get(ip + 1) instanceof ActionEquals2)) { if (code.get(ip + 2) instanceof ActionNot) { if (code.get(ip + 3) instanceof ActionIf) { ActionIf aif = (ActionIf) code.get(ip + 3); - if (code.adr2pos(code.pos2adr(ip + 4) + aif.getJumpOffset()) == ip) { + if (code.adr2pos(code.pos2adr(ip + 3) + 5 /*IF numbytes*/ + aif.getJumpOffset()) == ip) { ip += 4; } } @@ -471,6 +529,9 @@ public class ActionGraph extends Graph { } } if (oldIp != ip) { + if (ip == code.size()) { //no next checkIp call since its after code size + return ip; + } return checkIp(ip); } return ip; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java index 75b5cf097..e1458a84b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java @@ -12,11 +12,12 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action; import com.jpexs.decompiler.flash.BaseLocalData; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.graph.GraphPart; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -45,16 +46,22 @@ public class ActionGraphSource extends GraphSource { private final HashMap functions; + private final boolean insideDoInitAction; + + private final String path; + public List getActions() { return actions; } - public ActionGraphSource(List actions, int version, HashMap registerNames, HashMap variables, HashMap functions) { + public ActionGraphSource(String path, boolean insideDoInitAction, List actions, int version, HashMap registerNames, HashMap variables, HashMap functions) { this.actions = actions; this.version = version; this.registerNames = registerNames; this.variables = variables; this.functions = functions; + this.insideDoInitAction = insideDoInitAction; + this.path = path; } @Override @@ -80,7 +87,7 @@ public class ActionGraphSource extends GraphSource { public List translatePart(GraphPart part, BaseLocalData localData, TranslateStack stack, int start, int end, int staticOperation, String path) throws InterruptedException { Reference fi = new Reference<>(localData.lineStartInstruction); - List r = Action.actionsPartToTree(fi, registerNames, variables, functions, stack, actions, start, end, version, staticOperation, path); + List r = Action.actionsPartToTree(this.insideDoInitAction, fi, registerNames, variables, functions, stack, actions, start, end, version, staticOperation, path); localData.lineStartInstruction = fi.getVal(); return r; } @@ -135,7 +142,7 @@ public class ActionGraphSource extends GraphSource { } //ret = adr2posInside(adr); if (ret == -1) { - Logger.getLogger(ActionGraphSource.class.getName()).log(Level.SEVERE, "Address loc" + Helper.formatAddress(adr) + " not found"); + Logger.getLogger(ActionGraphSource.class.getName()).log(Level.SEVERE, "{0} - address loc{1} not found", new Object[]{path, Helper.formatAddress(adr)}); /*System.err.println("Addr loc"+Helper.formatAddress(adr)+" not found"); int pos=0; for(long l:posCache){ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java index 1a9b7eaca..81855dd48 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action; import com.jpexs.decompiler.flash.DisassemblyListener; @@ -31,7 +32,11 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin; import com.jpexs.decompiler.graph.GraphSourceItemContainer; import com.jpexs.helpers.CancellableWorker; +import com.jpexs.helpers.Helper; import com.jpexs.helpers.stat.Statistics; +import com.jpexs.helpers.utf8.Utf8Helper; +import java.io.ByteArrayInputStream; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -163,6 +168,15 @@ public class ActionListReader { } } + //TODO: This cleaner needs to be executed only before actual decompilation, not when disassembly only + try { + new ActionDefineFunctionPushRegistersCleaner().actionListParsed(actions, sis.getSwf()); + } catch (ThreadDeath | InterruptedException ex) { + throw ex; + } catch (Throwable ex) { + logger.log(Level.SEVERE, "Cleaning push registers in ActionDefineFunction failed: " + path, ex); + } + return actions; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionLocalData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionLocalData.java index f6b34f8b1..8471cef69 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionLocalData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionLocalData.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action; import com.jpexs.decompiler.flash.BaseLocalData; @@ -34,21 +35,26 @@ public class ActionLocalData extends BaseLocalData { public GraphSourceItem lineStartAction; - public ActionLocalData() { + public boolean insideDoInitAction; + + public ActionLocalData(boolean insideDoInitAction) { regNames = new HashMap<>(); variables = new HashMap<>(); functions = new HashMap<>(); + this.insideDoInitAction = insideDoInitAction; } - public ActionLocalData(HashMap regNames) { + public ActionLocalData(boolean insideDoInitAction, HashMap regNames) { this.regNames = regNames; variables = new HashMap<>(); functions = new HashMap<>(); + this.insideDoInitAction = insideDoInitAction; } - public ActionLocalData(HashMap regNames, HashMap variables, HashMap functions) { + public ActionLocalData(boolean insideDoInitAction, HashMap regNames, HashMap variables, HashMap functions) { this.regNames = regNames; this.variables = variables; this.functions = functions; + this.insideDoInitAction = insideDoInitAction; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScript2ClassDetector.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScript2ClassDetector.java new file mode 100644 index 000000000..1c2481b81 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScript2ClassDetector.java @@ -0,0 +1,738 @@ +/* + * Copyright (C) 2010-2018 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action; + +import com.jpexs.decompiler.flash.action.model.CallFunctionActionItem; +import com.jpexs.helpers.Reference; +import com.jpexs.decompiler.flash.action.model.CallMethodActionItem; +import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; +import com.jpexs.decompiler.flash.action.model.ExtendsActionItem; +import com.jpexs.decompiler.flash.action.model.FunctionActionItem; +import com.jpexs.decompiler.flash.action.model.GetMemberActionItem; +import com.jpexs.decompiler.flash.action.model.GetVariableActionItem; +import com.jpexs.decompiler.flash.action.model.ImplementsOpActionItem; +import com.jpexs.decompiler.flash.action.model.NewMethodActionItem; +import com.jpexs.decompiler.flash.action.model.NewObjectActionItem; +import com.jpexs.decompiler.flash.action.model.SetMemberActionItem; +import com.jpexs.decompiler.flash.action.model.SetVariableActionItem; +import com.jpexs.decompiler.flash.action.model.StoreRegisterActionItem; +import com.jpexs.decompiler.flash.action.model.TemporaryRegister; +import com.jpexs.decompiler.flash.action.model.clauses.ClassActionItem; +import com.jpexs.decompiler.flash.action.model.clauses.InterfaceActionItem; +import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.ecma.Null; +import com.jpexs.decompiler.flash.helpers.collections.MyEntry; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.IfItem; +import com.jpexs.decompiler.graph.model.NotItem; +import com.jpexs.decompiler.graph.model.PopItem; +import com.jpexs.decompiler.graph.model.PushItem; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author JPEXS + */ +public class ActionScript2ClassDetector { + + private static final Logger logger = Logger.getLogger(ActionScript2ClassDetector.class.getName()); + + private class AssertException extends Exception { + + private final String condition; + + public AssertException(String condition) { + super(condition); + this.condition = condition; + } + + public String getCondition() { + return condition; + } + + } + + /** + * Checks whether an item is direct submember of path. a.b.c.d is submember + * of a.b.c, x.y.z is not submember of x, + * + * @param item + * @param objectPath + * @param newPathItem New submember name + * @return + */ + private boolean isMemberOfPath(GraphTargetItem item, List objectPath, Reference newPathItem) { + List path = getMembersPath(item); + if (path == null) { + return false; + } + if (path.size() != objectPath.size() + 1) { + return false; + } + for (int i = 0; i < objectPath.size(); i++) { + if (!path.get(i).equals(objectPath.get(i))) { + return false; + } + } + newPathItem.setVal(path.get(path.size() - 1)); + return true; + } + + /** + * Gets path of variable and its getMembers: a.b.c.d => [a,b,c,d] + * + * @param item + * @return List of path or null if not members path + */ + private List getMembersPath(GraphTargetItem item) { + List ret = new ArrayList<>(); + while (item instanceof GetMemberActionItem) { + GetMemberActionItem mem = (GetMemberActionItem) item; + if (!(mem.memberName instanceof DirectValueActionItem)) { + return null; + } + DirectValueActionItem dv = ((DirectValueActionItem) mem.memberName); + if (!dv.isString()) { + return null; + } + ret.add(0, dv.getAsString()); + item = mem.object; + } + if (!(item instanceof GetVariableActionItem)) { + return null; + } + GetVariableActionItem gv = (GetVariableActionItem) item; + if (!(gv.name instanceof DirectValueActionItem)) { + return null; + } + DirectValueActionItem dv = ((DirectValueActionItem) gv.name); + if (!dv.isString()) { + return null; + } + String varName = dv.getAsString(); + ret.add(0, varName); + return ret; + } + + private GraphTargetItem setMemberToGetMember(GraphTargetItem item) { + if (item instanceof SetMemberActionItem) { + return new GetMemberActionItem(null, null, ((SetMemberActionItem) item).object, ((SetMemberActionItem) item).objectName); + } else if (item instanceof SetVariableActionItem) { + return new GetVariableActionItem(null, null, ((SetVariableActionItem) item).name); + } + return null; + } + + private GraphTargetItem newToGetMember(GraphTargetItem nobj) throws AssertException { + if (nobj instanceof NewMethodActionItem) { + NewMethodActionItem nm = (NewMethodActionItem) nobj; + return new GetMemberActionItem(nobj.getSrc(), nobj.getLineStartItem(), nm.scriptObject, nm.methodName); + } else if (nobj instanceof NewObjectActionItem) { + NewObjectActionItem no = (NewObjectActionItem) nobj; + return new GetVariableActionItem(nobj.getSrc(), nobj.getLineStartItem(), no.objectName); + } + throw new AssertException("NewMethod or NewObject expected"); + } + + private List getSetMembersPath(GraphTargetItem item) { + if (item instanceof SetVariableActionItem) { + SetVariableActionItem sv = (SetVariableActionItem) item; + if (!(sv.name instanceof DirectValueActionItem)) { + return null; + } + DirectValueActionItem nDv = (DirectValueActionItem) sv.name; + if (!nDv.isString()) { + return null; + } + List ret = new ArrayList<>(); + ret.add(nDv.getAsString()); + return ret; + } else if (item instanceof SetMemberActionItem) { + SetMemberActionItem sm = (SetMemberActionItem) item; + if (!(sm.objectName instanceof DirectValueActionItem)) { + return null; + } + DirectValueActionItem onDv = (DirectValueActionItem) sm.objectName; + if (!onDv.isString()) { + return null; + } + String currentMemberName = onDv.getAsString(); + List path = getMembersPath(sm.object); + if (path == null) { + return null; + } + path.add(currentMemberName); + return path; + } else { + return null; + } + } + + /** + * Get register id or -1 if not found + * + * @param item + * @return + */ + private int getAsRegisterNum(GraphTargetItem item, String assertName) throws AssertException { + if (item instanceof DirectValueActionItem) { + DirectValueActionItem dv = (DirectValueActionItem) item; + if (dv.value instanceof RegisterNumber) { + RegisterNumber rn = (RegisterNumber) dv.value; + return rn.number; + } + } + if (item instanceof TemporaryRegister) { + TemporaryRegister tr = (TemporaryRegister) item; + return tr.getRegId(); + } + throw new AssertException("not a register - " + assertName); + } + + /*private boolean isInstanceRegister(GraphTargetItem item, Reference instanceReg, Reference classReg,Reference extracted, String assertName) throws AssertException { + if (item instanceof DirectValueActionItem) { + DirectValueActionItem dv = (DirectValueActionItem) item; + if (dv.value instanceof RegisterNumber) { + RegisterNumber rn = (RegisterNumber) dv.value; + if (rn.number == instanceReg.getVal()) { + return true; + } else if (rn.number == classReg.getVal()) { + return false; + }else{ + throw new AssertException(assertName + " - unknown register"); + } + } + } + if (item instanceof TemporaryRegister) { + TemporaryRegister tr = (TemporaryRegister) item; + if (!"prototype".equals(getAsString(gm.memberName, "memberName"))) { + throw new AssertException("memberName not \"prototype\""); + } + return tr.getRegId(); + } + } + */ + private static GraphTargetItem getWithoutGlobal(GraphTargetItem ti) { + GraphTargetItem t = ti; + if (!(t instanceof GetMemberActionItem)) { + return ti; + } + GetMemberActionItem lastMember = null; + while (((GetMemberActionItem) t).object instanceof GetMemberActionItem) { + lastMember = (GetMemberActionItem) t; + t = ((GetMemberActionItem) t).object; + } + if (((GetMemberActionItem) t).object instanceof GetVariableActionItem) { + GetVariableActionItem v = (GetVariableActionItem) ((GetMemberActionItem) t).object; + if (v.name instanceof DirectValueActionItem) { + if (((DirectValueActionItem) v.name).value instanceof String) { + if (((DirectValueActionItem) v.name).value.equals("_global")) { + GetVariableActionItem gvt = new GetVariableActionItem(null, null, ((GetMemberActionItem) t).memberName); + if (lastMember == null) { + return gvt; + } else { + lastMember.object = gvt; + } + } + } + } + } + return ti; + } + + private String getAsString(GraphTargetItem item, String itemName) throws AssertException { + if (!(item instanceof DirectValueActionItem)) { + throw new AssertException(itemName + " not DirectValue"); + } + DirectValueActionItem mnDv = (DirectValueActionItem) item; + if (!mnDv.isString()) { + throw new AssertException(itemName + " not string"); + } + return mnDv.getAsString(); + } + + private boolean checkClassContent(List parts, int partsPos, int commandsStartPos, int commandsEndPos, List commands, List classNamePath, String scriptPath) { + + try { + GraphTargetItem item = parts.get(partsPos); + GraphTargetItem extendsOp = null; + List implementsOp = new ArrayList<>(); + if (item instanceof ExtendsActionItem) { + ExtendsActionItem et = (ExtendsActionItem) parts.get(partsPos); + extendsOp = getWithoutGlobal(et.superclass); + partsPos++; + item = parts.get(partsPos); + } + int instanceReg = -1; + int classReg = -1; + GraphTargetItem classNameTargetPath = null; + GraphTargetItem constructor = null; + if (item instanceof StoreRegisterActionItem) { + StoreRegisterActionItem sr = (StoreRegisterActionItem) item; + instanceReg = sr.register.number; + if (sr.value instanceof GetMemberActionItem) { + GetMemberActionItem gm = (GetMemberActionItem) sr.value; + if (gm.object instanceof TemporaryRegister) { + TemporaryRegister treg = (TemporaryRegister) gm.object; + classReg = treg.getRegId(); + if (!"prototype".equals(getAsString(gm.memberName, "memberName"))) { + throw new AssertException("memberName not \"prototype\""); + } + if ((treg.value instanceof SetMemberActionItem) || (treg.value instanceof SetVariableActionItem)) { + List path = getSetMembersPath(treg.value); + if (path == null || path.isEmpty()) { + throw new AssertException("Cannot detect class - tempreg value is not a path"); + } + //remove _global if it's there - happens for classes in global package + if ("_global".equals(path.get(0))) { + path.remove(0); + } + if (classNamePath.equals(path)) { + //can start with _global for classes on top level + classNameTargetPath = getWithoutGlobal(setMemberToGetMember(treg.value)); + + //treg.value.value is the value being set - treg.value is setmember ot setvariable + if (!(treg.value.value instanceof StoreRegisterActionItem)) { + throw new AssertException("Constructor expected to be in storeregister"); + } + if (!(treg.value.value.value instanceof FunctionActionItem)) { + throw new AssertException("Constructor expected as functionitem"); + } + constructor = treg.value.value.value; + } else { + throw new AssertException("temporaryreg value does not match class path"); + } + } else { + throw new AssertException("temporaryreg value not setmember/setvariable"); + } + } else { + throw new AssertException("Getmember does not have TemporaryRegister as object"); + } + } else { + throw new AssertException("Not Getmember in StoreRegister"); + } + partsPos++; + } + List> traits = new ArrayList<>(); + List traitsStatic = new ArrayList<>(); + loopsetmembers: + for (; partsPos < parts.size(); partsPos++) { + item = parts.get(partsPos); + if (item instanceof PushItem) { //push is optional + PushItem pi = (PushItem) item; + item = pi.value; + } + if (item instanceof SetMemberActionItem) { + SetMemberActionItem sm = (SetMemberActionItem) item; + GraphTargetItem regValue; + int currentRegId = -1; + if (sm.object instanceof TemporaryRegister) { + TemporaryRegister tempReg = (TemporaryRegister) sm.object; + currentRegId = tempReg.getRegId(); + regValue = tempReg.value; + } else if ((sm.object instanceof DirectValueActionItem) && (((DirectValueActionItem) sm.object).value instanceof RegisterNumber)) { + DirectValueActionItem dv = (DirectValueActionItem) sm.object; + RegisterNumber rn = ((RegisterNumber) dv.value); + currentRegId = rn.number; + regValue = dv.computedRegValue; + } else { + //might be an interface + List path = getSetMembersPath(item); + if (path == null || path.isEmpty()) { + throw new AssertException("invalid setmember"); + } + //remove _global if it's there - happens for classes in global package + if ("_global".equals(path.get(0))) { + path.remove(0); + } + if (!path.equals(classNamePath)) { + throw new AssertException("wrong path in setmember"); + } + GraphTargetItem interfaceClass = getWithoutGlobal(setMemberToGetMember(item)); + if (!(sm.value instanceof FunctionActionItem)) { + throw new AssertException("not a function in setmember"); + } + FunctionActionItem f = (FunctionActionItem) sm.value; + if (!"".equals(f.functionName)) { + throw new AssertException("not unnamed func in setmember"); + } + if (!f.actions.isEmpty()) { + throw new AssertException("not empty function in setmember"); + } + if (!f.paramNames.isEmpty()) { + throw new AssertException("not empty params for function in setmember"); + } + partsPos++; + for (; partsPos < parts.size(); partsPos++) { + item = parts.get(partsPos); + if (item instanceof ImplementsOpActionItem) { + if (!implementsOp.isEmpty()) { + throw new AssertException("multiple implementsAction"); + } + ImplementsOpActionItem io = (ImplementsOpActionItem) item; + implementsOp = io.superclasses; + } else { + throw new AssertException("unknown iface item: " + item.getClass().getSimpleName()); + } + } + + InterfaceActionItem ifsItem = new InterfaceActionItem(interfaceClass, implementsOp); + for (int k = commandsStartPos; k <= commandsEndPos; k++) { + commands.remove(commandsStartPos); + } + commands.add(commandsStartPos, ifsItem); + + //remove §§pop after, if it's there + if (commandsStartPos + 1 < commands.size()) { + if (commands.get(commandsStartPos + 1) instanceof PopItem) { + commands.remove(commandsStartPos + 1); + } + } + + // goto next line and check next classes + return true; + } + //it was register .. continue class detection + if (currentRegId != instanceReg && currentRegId != classReg) { + if (!(regValue instanceof SetMemberActionItem)) { + throw new AssertException("temp register do not contain setmember"); + } + SetMemberActionItem sm2 = (SetMemberActionItem) regValue; + GraphTargetItem pathSource; + boolean isPrototype; + if ("prototype".equals(getAsString(sm2.objectName, "objectName"))) { + pathSource = sm2.object; + isPrototype = true; + } else { + pathSource = setMemberToGetMember(sm2); + isPrototype = false; + } + List memPath = getMembersPath(pathSource); + if (memPath == null) { + throw new AssertException("Invalid pathsource"); + } + if (!classNamePath.equals(memPath)) { + throw new AssertException("Invalid path of setmember:" + String.join(".", memPath)); + } + classNameTargetPath = pathSource; + if (!(sm2.value instanceof StoreRegisterActionItem)) { + throw new AssertException("Not storeregister"); + } + StoreRegisterActionItem sr = (StoreRegisterActionItem) sm2.value; + if (sr.register.number != currentRegId) { + throw new AssertException("Invalid storeregister"); + } + if (isPrototype && ((sr.value instanceof NewMethodActionItem) || (sr.value instanceof NewObjectActionItem))) { + extendsOp = newToGetMember(sr.value); + instanceReg = currentRegId; + } else if (!isPrototype && (sr.value instanceof FunctionActionItem)) { //constructor + constructor = sr.value; + classReg = currentRegId; + } else { + throw new AssertException("invalid storeregister value: " + sr.value.getClass().getSimpleName()); + } + } + + MyEntry trait = new MyEntry<>(sm.objectName, sm.value); + if (sm.value instanceof FunctionActionItem) { + FunctionActionItem f = (FunctionActionItem) sm.value; + f.calculatedFunctionName = sm.objectName; + } + traits.add(trait); + if (currentRegId == instanceReg) { + traitsStatic.add(false); + } else if (currentRegId == classReg) { + traitsStatic.add(true); + } + } else if (item instanceof ImplementsOpActionItem) { + ImplementsOpActionItem iot = (ImplementsOpActionItem) item; + implementsOp = iot.superclasses; + } else if (item instanceof CallMethodActionItem) { + CallMethodActionItem cm = (CallMethodActionItem) item; + String pushMethodName = getAsString(cm.methodName, "push methodName"); + if ("addProperty".equals(pushMethodName)) { + int rnumObject = getAsRegisterNum(cm.scriptObject, "addProperty not on register"); + if ((rnumObject != instanceReg) && (rnumObject != classReg)) { + throw new AssertException("unexpected addProperty object register " + rnumObject); + } + + if (cm.arguments.size() != 3) { + throw new AssertException("invalid number of arguments to addProperty: " + cm.arguments.size()); + } + GraphTargetItem propertyName = cm.arguments.get(0); + GraphTargetItem propertyGetter = cm.arguments.get(1); + GraphTargetItem propertySetter = cm.arguments.get(2); + String propertyNameStr = getAsString(propertyName, "propertyName"); + if (propertyGetter instanceof GetMemberActionItem) { + int regId = getAsRegisterNum(((GetMemberActionItem) propertyGetter).object, "getter member not register"); + if (rnumObject != regId) { + throw new AssertException("getter register does not match property register " + regId + " <=> " + rnumObject); + } + String getterNameStr = getAsString(((GetMemberActionItem) propertyGetter).memberName, "getter memberName"); + if (!(getterNameStr.equals("__get__" + propertyNameStr))) { + throw new AssertException("getter does not match property name"); + } + //TODO: handle getter HERE + + } else if (propertyGetter instanceof FunctionActionItem) { + FunctionActionItem getterFunc = (FunctionActionItem) propertyGetter; + if (!(getterFunc.actions.isEmpty() && getterFunc.functionName.isEmpty() && ((FunctionActionItem) propertyGetter).paramNames.isEmpty())) { + throw new AssertException("unexpected getter value for property " + propertyNameStr); + } + //we got empty getter + } else { + throw new AssertException("unexpected getter value for property " + propertyNameStr + ": " + propertyGetter.getClass().getSimpleName()); + } + + if (propertySetter instanceof GetMemberActionItem) { + int regId = getAsRegisterNum(((GetMemberActionItem) propertySetter).object, "setter member"); + if (rnumObject != regId) { + throw new AssertException("setter register does not match property register " + regId + " <=> " + rnumObject); + } + String setterNameStr = getAsString(((GetMemberActionItem) propertySetter).memberName, "setter memberNAme"); + if (!(setterNameStr.equals("__set__" + propertyNameStr))) { + throw new AssertException("setter does not match property name"); + } + //TODO: handle setter HERE + } else if (propertySetter instanceof FunctionActionItem) { + FunctionActionItem setterFunc = (FunctionActionItem) propertySetter; + if (!(setterFunc.actions.isEmpty() && setterFunc.functionName.isEmpty() && ((FunctionActionItem) propertySetter).paramNames.isEmpty())) { + throw new AssertException("unexpected getter value for property " + propertyNameStr); + } + //we got empty setter + } else { + throw new AssertException("unexpected setter value for property " + propertyNameStr + ": " + propertySetter.getClass().getSimpleName()); + } + + } else { + throw new AssertException("unknown push method name: " + pushMethodName); + } + } else if (item instanceof CallFunctionActionItem) { + CallFunctionActionItem cf = (CallFunctionActionItem) item; + String funName = getAsString(cf.functionName, "pushitem function name"); + if (funName.equals("ASSetPropFlags")) { + //it should be ASSetPropFlags(a.b.c.D.prototype,null,1) as it sets prototype to hidden + //see http://www.ryanjuckett.com/programming/how-to-use-assetpropflags-in-actionscript-2-0/ + if (cf.arguments.size() != 3) { + throw new AssertException("Invalid number of arguments to ASSetPropFlags:" + cf.arguments.size() + ", 3 expected"); + } + GraphTargetItem obj = cf.arguments.get(0); + GraphTargetItem props = cf.arguments.get(1); + GraphTargetItem flags = cf.arguments.get(2); + if ((obj instanceof DirectValueActionItem) && (((DirectValueActionItem) obj).value instanceof RegisterNumber)) { + RegisterNumber rn = (RegisterNumber) ((DirectValueActionItem) obj).value; + if (rn.number != instanceReg) { + throw new AssertException("ASSetPropFlags not on instanceReg"); + } + } else { + List path = getMembersPath(obj); + if (path != null && !path.isEmpty() && "_global".equals(path.get(0))) { //For classes in toplevel package, there's _global in path + path.remove(0); //remove that _global + } + List classPathWithPrototype = new ArrayList<>(); + classPathWithPrototype.addAll(classNamePath); + classPathWithPrototype.add("prototype"); + if (!classPathWithPrototype.equals(path)) { + throw new AssertException("ASSetPropFlags not on prototype"); + } + } + if (!((props instanceof DirectValueActionItem) && (((DirectValueActionItem) props).value == Null.INSTANCE))) { + throw new AssertException("ASSetPropFlags properties param not null"); + } + if (!((flags instanceof DirectValueActionItem) && (((DirectValueActionItem) flags).value == (Long) 1L))) { + throw new AssertException("ASSetPropFlags flags not set to 1"); + } + } else { + throw new AssertException("unknown pushitem function call " + funName); + } + } else { + throw new AssertException("unknown item - " + item.getClass().getSimpleName()); + } + } + + if (constructor != null) { //constructor should be there always, but just in calse + //add constructor as trait + traitsStatic.add(0, false); + DirectValueActionItem classBaseName = new DirectValueActionItem(classNamePath.get(classNamePath.size() - 1)); + ((FunctionActionItem) constructor).calculatedFunctionName = classBaseName; + traits.add(0, new MyEntry<>(classBaseName, constructor)); + } else { + throw new AssertException("No constructor found"); + } + + ClassActionItem clsItem = new ClassActionItem(classNameTargetPath, extendsOp, implementsOp, traits, traitsStatic); + for (int k = commandsStartPos; k <= commandsEndPos; k++) { + commands.remove(commandsStartPos); + } + commands.add(commandsStartPos, clsItem); + + //remove §§pop after, if it's there + if (commandsStartPos + 1 < commands.size()) { + if (commands.get(commandsStartPos + 1) instanceof PopItem) { + commands.remove(commandsStartPos + 1); + } + } + + // goto next line and check next classes + return true; + } catch (AssertException ex) { + logger.log(Level.WARNING, "{0}: Cannot detect class - {1}", new Object[]{scriptPath, ex.getCondition()}); + } + return false; + } + + private boolean checkIfVariants(List commands, int pos, String scriptPath) { + + + /* + Variant 1: + + if(!_global.a) + { + _global.a = new Object(); + } + §§pop(); + if(!_global.a.b) + { + _global.a.b = new Object(); + } + §§pop(); + if(!_global.a.b.c) + { + _global.a.b.c = new Object(); + } + §§pop(); + if(!_global.a.b.c.D) + { + ..class_content... + } + §§pop(); + */ + List pathToSearchVariant1 = new ArrayList<>(); + pathToSearchVariant1.add("_global"); + + check_variant1: + for (int checkPos = pos; checkPos < commands.size(); checkPos++) { + GraphTargetItem t = commands.get(checkPos); + if (t instanceof IfItem) { + IfItem ifItem = (IfItem) t; + if (ifItem.expression instanceof NotItem) { + NotItem nti = (NotItem) ifItem.expression; + GraphTargetItem condType = nti.value; + Reference newMemberNameRef = new Reference<>(""); + + if (isMemberOfPath(condType, pathToSearchVariant1, newMemberNameRef)) { + pathToSearchVariant1.add(newMemberNameRef.getVal()); + + //_global.a.b.c = new Object(); + if ((ifItem.onTrue.size() == 1) && (ifItem.onTrue.get(0) instanceof SetMemberActionItem) && (((SetMemberActionItem) ifItem.onTrue.get(0)).value instanceof NewObjectActionItem)) { + //skip §§pop item if its there right after if + if (checkPos + 1 < commands.size()) { + GraphTargetItem tnext = commands.get(checkPos + 1); + if (tnext instanceof PopItem) { + checkPos++; + } + } + continue check_variant1; + } + List classPath = pathToSearchVariant1; + classPath.remove(0); //remove _global + if (this.checkClassContent(ifItem.onTrue, 0, pos, checkPos, commands, classPath, scriptPath)) { + return true; + } else { + break check_variant1; + } + } else { + break check_variant1; + } + } else { + break check_variant1; //not an if ! + } + } else { + break check_variant1; //not an if + } + } //check_variant1 + + /* + + Variant 2: + + if(!a.b.c.D) + { + if(!a) + { + _global.a = new Object(); + } + if(!a.b) + { + _global.a.b = new Object(); + } + if(!a.b.c) + { + _global.a.b.c = new Object(); + } + ..class_content.. + } + */ + List variant2CurrentPath = new ArrayList<>(); + check_variant2: + if (commands.get(pos) instanceof IfItem) { + IfItem ifItem = (IfItem) commands.get(pos); + if (ifItem.expression instanceof NotItem) { + NotItem nti = (NotItem) ifItem.expression; + List memPath = getMembersPath(nti.value); + if (memPath == null) { + break check_variant2; + } + if (ifItem.onTrue.size() < memPath.size()) { + break check_variant2; + } + variant2CurrentPath.clear(); + List parts = ifItem.onTrue; + int checkPos = 0; + for (; checkPos < memPath.size() - 1; checkPos++) { + variant2CurrentPath.add(memPath.get(checkPos)); + if (!(parts.get(checkPos) instanceof IfItem)) { + break check_variant2; + } + IfItem ifItem2 = (IfItem) parts.get(checkPos); + if (ifItem2.expression instanceof NotItem) { + NotItem nti2 = (NotItem) ifItem2.expression; + List if2Path = getMembersPath(nti2.value); + if (!variant2CurrentPath.equals(if2Path)) { + break check_variant2; + } + } + } + if (checkClassContent(parts, checkPos, pos, pos, commands, memPath, scriptPath)) { + return true; + } + } + }//check_variant2 + + return false; + } + + public void checkClass(List commands, String scriptPath) { + for (int pos = 0; pos < commands.size(); pos++) { + checkIfVariants(commands, pos, scriptPath); + } + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScriptObject.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScriptObject.java index 91806c2a3..b9f4d0bdd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScriptObject.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionScriptObject.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action; +import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.ecma.Undefined; import java.util.ArrayList; import java.util.HashMap; @@ -181,6 +183,6 @@ public class ActionScriptObject implements Cloneable { } } } - return null; + return Undefined.INSTANCE; } } 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 ab21d6aea..5a2a67f4f 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 @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.deobfuscation; import com.jpexs.decompiler.flash.IdentifiersDeobfuscation; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionFSCommand2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionFSCommand2.java index dbb40a3de..74999df6e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionFSCommand2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionFSCommand2.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.flashlite; import com.jpexs.decompiler.flash.BaseLocalData; @@ -42,7 +43,7 @@ public class ActionFSCommand2 extends Action { } @Override - public void translate(GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { long numArgs = popLong(stack); GraphTargetItem command = stack.pop(); List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java index b95732252..a83f6bbc8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.flashlite; import com.jpexs.decompiler.flash.SWFInputStream; @@ -73,7 +74,7 @@ public class ActionStrictMode extends Action { } @Override - public void translate(GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new StrictModeActionItem(this, lineStartItem, mode)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java index d8eb4989e..227756a0b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.IdentifiersDeobfuscation; @@ -303,7 +304,7 @@ public class FunctionActionItem extends ActionItem { needsFun2 = true; } if (localData.inMethod) { - needsFun2 = true; + //needsFun2 = true; } if (localData.inFunction > 1) { needsFun2 = true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java index fd0c7aa28..15c4261cc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -41,7 +42,11 @@ public class RandomNumberActionItem extends ActionItem { } public static Integer getResult(Object maximum) { - return rnd.nextInt(EcmaScript.toInt32(maximum)); + int maximumInt = EcmaScript.toInt32(maximum); + if (maximumInt <= 0) { + return 0; + } + return rnd.nextInt(maximumInt); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java index 7054278c8..3743d3c84 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.clauses; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -44,56 +45,39 @@ import java.util.Set; */ public class ClassActionItem extends ActionItem implements Block { - public List functions; - - public List staticFunctions; - public GraphTargetItem extendsOp; public List implementsOp; public GraphTargetItem className; - public GraphTargetItem constructor; - - public List> vars; - - public List> staticVars; + //public GraphTargetItem constructor; + public List> traits; + public List traitsStatic; public Set uninitializedVars; @Override public List> getSubs() { List> ret = new ArrayList<>(); - if (functions != null) { - ret.add(functions); - } - if (staticFunctions != null) { - ret.add(staticFunctions); - } + //? is this needed for traits ? return ret; } - public ClassActionItem(GraphTargetItem className, GraphTargetItem extendsOp, List implementsOp, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) { + public ClassActionItem(GraphTargetItem className, GraphTargetItem extendsOp, List implementsOp, List> traits, List traitsStatic) { super(null, null, NOPRECEDENCE); this.className = className; - this.functions = functions; - this.vars = vars; + this.traits = traits; + this.traitsStatic = traitsStatic; this.extendsOp = extendsOp; this.implementsOp = implementsOp; - this.staticFunctions = staticFunctions; - this.staticVars = staticVars; - this.constructor = constructor; + //this.constructor = constructor; - List allFunc = new ArrayList<>(functions); - if (constructor != null) { - allFunc.add(constructor); - } this.uninitializedVars = new HashSet<>(); List allUsages = new ArrayList<>(); - for (GraphTargetItem it : allFunc) { - if (it instanceof FunctionActionItem) { - FunctionActionItem f = (FunctionActionItem) it; + for (MyEntry it : traits) { + if (it.getValue() instanceof FunctionActionItem) { + FunctionActionItem f = (FunctionActionItem) it.getValue(); detectUnitializedVars(f.actions, allUsages); } } @@ -102,7 +86,7 @@ public class ClassActionItem extends ActionItem implements Block { allMembers.add(it.toStringNoQuotes(LocalData.empty)); } uninitializedVars.addAll(allMembers); - for (MyEntry v : vars) { + for (MyEntry v : traits) { String s = v.getKey().toStringNoQuotes(LocalData.empty); if (uninitializedVars.contains(s)) { uninitializedVars.remove(s); @@ -176,38 +160,49 @@ public class ClassActionItem extends ActionItem implements Block { } writer.startBlock(); - if (constructor != null) { + /*if (constructor != null) { constructor.toString(writer, localData).newLine(); - } + }*/ + for (int pass = 1; pass <= 2; pass++) { + looptraits: + for (int i = 0; i < traits.size(); i++) { + MyEntry item = traits.get(i); - for (MyEntry item : vars) { - writer.append("var "); - item.getKey().toStringNoQuotes(writer, localData); - writer.append(" = "); - item.getValue().toString(writer, localData); - writer.append(";").newLine(); + switch (pass) { + //pass 1: add variables + case 1: + if (item.getValue() instanceof FunctionActionItem) { //ignore methods + continue looptraits; + } + break; + //pass 2: add methods + case 2: + if (!(item.getValue() instanceof FunctionActionItem)) { //ignore nonmethods + continue looptraits; + } + break; + + } + + if (traitsStatic.get(i)) { + writer.append("static "); + } + if (item.getValue() instanceof FunctionActionItem) { + item.getValue().toString(writer, localData).newLine(); + } else { + writer.append("var "); + item.getKey().toStringNoQuotes(writer, localData); + writer.append(" = "); + item.getValue().toString(writer, localData); + writer.append(";").newLine(); + } + } } for (String v : uninitializedVars) { writer.append("var "); writer.append(v); writer.append(";").newLine(); } - for (MyEntry item : staticVars) { - writer.append("static var "); - item.getKey().toStringNoQuotes(writer, localData); - writer.append(" = "); - item.getValue().toString(writer, localData); - writer.append(";").newLine(); - } - - for (GraphTargetItem f : functions) { - f.toString(writer, localData).newLine(); - } - for (GraphTargetItem f : staticFunctions) { - writer.append("static "); - f.toString(writer, localData).newLine(); - } - writer.endBlock(); writer.endClass(); return writer; @@ -230,7 +225,7 @@ public class ClassActionItem extends ActionItem implements Block { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; SourceGeneratorLocalData localData2 = Helper.deepCopy(localData); asGenerator.setInMethod(localData2, true); - ret.addAll(asGenerator.generateTraits(localData2, false, className, extendsOp, implementsOp, constructor, functions, vars, staticFunctions, staticVars)); + ret.addAll(asGenerator.generateTraits(localData2, false, className, extendsOp, implementsOp, traits, traitsStatic)); return ret; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java index ad2e4bf53..921dfc9d3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.clauses; import com.jpexs.decompiler.flash.SWF; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java index 02e26e81b..48cd7ba49 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.clauses; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -20,6 +21,7 @@ import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.flash.helpers.collections.MyEntry; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -72,7 +74,7 @@ public class InterfaceActionItem extends ActionItem { public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { List ret = new ArrayList<>(); ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; - ret.addAll(asGenerator.generateTraits(localData, true, name, null, superInterfaces, null, null, null, null, null)); + ret.addAll(asGenerator.generateTraits(localData, true, name, null, superInterfaces, new ArrayList>(), new ArrayList<>())); return ret; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java index 42dcc5ddb..fa6fc486c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.clauses; import com.jpexs.decompiler.flash.SWF; @@ -20,9 +21,21 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.model.ConstantPool; +import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; +import com.jpexs.decompiler.flash.action.swf4.ActionIf; import com.jpexs.decompiler.flash.action.swf4.ActionJump; +import com.jpexs.decompiler.flash.action.swf4.ActionPop; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; +import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.action.swf5.ActionDefineLocal; +import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; +import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate; +import com.jpexs.decompiler.flash.action.swf5.ActionStackSwap; +import com.jpexs.decompiler.flash.action.swf7.ActionCastOp; +import com.jpexs.decompiler.flash.action.swf7.ActionThrow; import com.jpexs.decompiler.flash.action.swf7.ActionTry; +import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.Block; import com.jpexs.decompiler.graph.CompilationException; @@ -33,6 +46,8 @@ import com.jpexs.decompiler.graph.model.ContinueItem; import com.jpexs.decompiler.graph.model.LocalData; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @@ -42,7 +57,9 @@ public class TryActionItem extends ActionItem implements Block { public List tryCommands; - public List catchExceptions; + public List catchExceptionNames; + + public List catchExceptionTypes; public List> catchCommands; @@ -61,10 +78,11 @@ public class TryActionItem extends ActionItem implements Block { return ret; } - public TryActionItem(List tryCommands, List catchExceptions, List> catchCommands, List finallyCommands) { + public TryActionItem(List tryCommands, List catchExceptionNames, List catchExceptionTypes, List> catchCommands, List finallyCommands) { super(null, null, NOPRECEDENCE); this.tryCommands = tryCommands; - this.catchExceptions = catchExceptions; + this.catchExceptionNames = catchExceptionNames; + this.catchExceptionTypes = catchExceptionTypes; this.catchCommands = catchCommands; this.finallyCommands = finallyCommands; } @@ -73,19 +91,23 @@ public class TryActionItem extends ActionItem implements Block { public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("try"); appendBlock(null, writer, localData, tryCommands); - for (int e = 0; e < catchExceptions.size(); e++) { + for (int e = 0; e < catchExceptionNames.size(); e++) { writer.newLine(); writer.append("catch"); if (writer.getFormatting().spaceBeforeParenthesesCatchParentheses) { writer.append(" "); } writer.append("("); - catchExceptions.get(e).toStringNoQuotes(writer, localData); + catchExceptionNames.get(e).toStringNoQuotes(writer, localData); + if (catchExceptionTypes.get(e) != null) { + writer.append(":"); + catchExceptionTypes.get(e).toStringNoQuotes(writer, localData); + } writer.append(")"); List commands = catchCommands.get(e); appendBlock(null, writer, localData, commands); } - if (catchExceptions.isEmpty() || finallyCommands.size() > 0) { + if (catchExceptionNames.isEmpty() || finallyCommands.size() > 0) { writer.newLine(); writer.append("finally"); appendBlock(null, writer, localData, finallyCommands); @@ -140,15 +162,82 @@ public class TryActionItem extends ActionItem implements Block { List finallyCommandsA = finallyCommands == null ? null : asGenerator.toActionList(asGenerator.generate(localData, finallyCommands)); List catchCommandsA = null; String catchName = null; - if (catchExceptions != null) { - if (!catchExceptions.isEmpty()) { - catchName = catchExceptions.get(0).toStringNoQuotes(LocalData.create(new ConstantPool(asGenerator.getConstantPool()))); - } - - } int catchSize = 0; + int catchRegister = 0; + boolean catchInRegisterFlag = false; if (catchCommands != null && !catchCommands.isEmpty()) { - catchCommandsA = asGenerator.toActionList(asGenerator.generate(localData, catchCommands.get(0))); + + List fullCatchBody = new ArrayList<>(); + + if (catchExceptionNames.size() == 1 && catchExceptionTypes.get(0) == null) { //catch everything without any type + GraphTargetItem ename = catchExceptionNames.get(0); + if (ename instanceof DirectValueActionItem) { + catchName = ((DirectValueActionItem) ename).getAsString(); + } else { + Logger.getLogger(TryActionItem.class.getName()).log(Level.SEVERE, "Invalid catchName, string expected"); + } + catchInRegisterFlag = false; + fullCatchBody = GraphTargetItem.toSourceMerge(localData, generator, catchCommands.get(0)); + } else { + catchInRegisterFlag = true; + catchRegister = asGenerator.getTempRegister(localData); + boolean allCatched = false; + for (int i = catchExceptionNames.size() - 1; i >= 0; i--) { + GraphTargetItem etype = catchExceptionTypes.get(i); + if (etype == null) { + allCatched = true; + break; + } + } + + if (!allCatched) { + fullCatchBody.addAll(0, GraphTargetItem.toSourceMerge(localData, generator, + new ActionPush(new RegisterNumber(catchRegister)), + new ActionThrow() + )); + } + + for (int i = catchExceptionNames.size() - 1; i >= 0; i--) { + GraphTargetItem ename = catchExceptionNames.get(i); + GraphTargetItem etype = catchExceptionTypes.get(i); + List ebody = catchCommands.get(i); + if (etype == null) { + fullCatchBody.addAll(0, GraphTargetItem.toSourceMerge(localData, generator, + new DirectValueActionItem(new RegisterNumber(catchRegister)), + ename, + new ActionStackSwap(), + new ActionDefineLocal(), + ebody + )); + } else { + List ifBody = GraphTargetItem.toSourceMerge(localData, generator, + ename, + new ActionStackSwap(), + new ActionDefineLocal(), + ebody); + fullCatchBody.add(0, new ActionPop()); + int toFinishSize = Action.actionsToBytes(asGenerator.toActionList(fullCatchBody), false, SWF.DEFAULT_VERSION).length; + ActionJump finishJump = new ActionJump(toFinishSize); + ifBody.add(finishJump); + List ifBodyA = asGenerator.toActionList(ifBody); + int ifBodySize = Action.actionsToBytes(ifBodyA, false, SWF.DEFAULT_VERSION).length; + fullCatchBody.addAll(0, ifBody); + fullCatchBody.addAll(0, + GraphTargetItem.toSourceMerge(localData, generator, + etype, + new ActionPush(new RegisterNumber(catchRegister)), + new ActionCastOp(), + new ActionPushDuplicate(), + new ActionPush(Null.INSTANCE), + new ActionEquals2(), + new ActionIf(ifBodySize) + )); + + } + } + asGenerator.releaseTempRegister(localData, catchRegister); + } + catchCommandsA = asGenerator.toActionList(fullCatchBody); catchSize = Action.actionsToBytes(catchCommandsA, false, SWF.DEFAULT_VERSION).length; tryCommandsA.add(new ActionJump(catchSize)); } @@ -157,7 +246,7 @@ public class TryActionItem extends ActionItem implements Block { finallySize = Action.actionsToBytes(finallyCommandsA, false, SWF.DEFAULT_VERSION).length; } int trySize = Action.actionsToBytes(tryCommandsA, false, SWF.DEFAULT_VERSION).length; - ret.add(new ActionTry(false, finallyCommands != null, catchCommands != null, catchName, 0, trySize, catchSize, finallySize, SWF.DEFAULT_VERSION)); + ret.add(new ActionTry(catchInRegisterFlag, finallyCommands != null, catchCommands != null, catchName, catchRegister, trySize, catchSize, finallySize, SWF.DEFAULT_VERSION)); ret.addAll(tryCommandsA); if (catchCommandsA != null) { ret.addAll(catchCommandsA); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java index e464e50a6..9e506a13a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.parser.script; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -119,6 +120,7 @@ import com.jpexs.decompiler.flash.action.model.operations.SubtractActionItem; import com.jpexs.decompiler.flash.action.model.operations.URShiftActionItem; import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.swf4.ActionIf; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool; import com.jpexs.decompiler.flash.ecma.Null; @@ -338,11 +340,8 @@ public class ActionScript2Parser { globalClassTypeStr.addAll(nameStr);*/ ParsedSymbol s; - FunctionActionItem constr = null; - List staticFunctions = new ArrayList<>(); - List> staticVars = new ArrayList<>(); - List instanceFunctions = new ArrayList<>(); - List> vars = new ArrayList<>(); + List> traits = new ArrayList<>(); + List traitsStatic = new ArrayList<>(); String classNameStr = ""; if (nameStr instanceof GetMemberActionItem) { @@ -373,16 +372,21 @@ public class ActionScript2Parser { expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolGroup.GLOBALFUNC); String fname = s.value.toString(); if (fname.equals(classNameStr)) { //constructor - constr = (function(!isInterface, "", true, variables, functions)); - } else if (!isInterface) { + //actually there's no difference, it's instance trait + } + if (!isInterface) { if (isStatic) { FunctionActionItem ft = function(!isInterface, "", true, variables, functions); ft.calculatedFunctionName = pushConst(fname); - staticFunctions.add(ft); + //staticFunctions.add(ft); + traits.add(new MyEntry<>(ft.calculatedFunctionName, ft)); + traitsStatic.add(true); } else { FunctionActionItem ft = function(!isInterface, "", true, variables, functions); ft.calculatedFunctionName = pushConst(fname); - instanceFunctions.add(ft); + //instanceFunctions.add(ft); + traits.add(new MyEntry<>(ft.calculatedFunctionName, ft)); + traitsStatic.add(false); } } break; @@ -396,11 +400,8 @@ public class ActionScript2Parser { s = lex(); } if (s.type == SymbolType.ASSIGN) { - if (isStatic) { - staticVars.add(new MyEntry<>(pushConst(ident), expression(false, false, true, variables, functions))); - } else { - vars.add(new MyEntry<>(pushConst(ident), expression(false, false, true, variables, functions))); - } + traits.add(new MyEntry<>(pushConst(ident), expression(false, false, true, variables, functions))); + traitsStatic.add(isStatic); s = lex(); } if (s.type != SymbolType.SEMICOLON) { @@ -417,7 +418,7 @@ public class ActionScript2Parser { if (isInterface) { return new InterfaceActionItem(nameStr, implementsStr); } else { - return new ClassActionItem(nameStr, extendsStr, implementsStr, constr, instanceFunctions, vars, staticFunctions, staticVars); + return new ClassActionItem(nameStr, extendsStr, implementsStr, traits, traitsStatic); } } @@ -1151,14 +1152,25 @@ public class ActionScript2Parser { s = lex(); boolean found = false; List> catchCommands = null; - List catchExceptions = new ArrayList<>(); - if (s.type == SymbolType.CATCH) { + List catchExceptionNames = new ArrayList<>(); + List catchExceptionTypes = new ArrayList<>(); + + while (s.type == SymbolType.CATCH) { expectedType(SymbolType.PARENT_OPEN); s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.STRING); - catchExceptions.add(pushConst((String) s.value)); + catchExceptionNames.add(pushConst((String) s.value)); + s = lex(); + if (s.type == SymbolType.COLON) { + catchExceptionTypes.add(type(variables)); + } else { + catchExceptionTypes.add(null); + lexer.pushback(s); + } expectedType(SymbolType.PARENT_CLOSE); - catchCommands = new ArrayList<>(); + if (catchCommands == null) { + catchCommands = new ArrayList<>(); + } List cc = new ArrayList<>(); cc.add(command(inFunction, inMethod, forinlevel, true, variables, functions)); catchCommands.add(cc); @@ -1176,7 +1188,7 @@ public class ActionScript2Parser { expected(s, lexer.yyline(), SymbolType.CATCH, SymbolType.FINALLY); } lexer.pushback(s); - ret = new TryActionItem(tryCommands, catchExceptions, catchCommands, finallyCommands); + ret = new TryActionItem(tryCommands, catchExceptionNames, catchExceptionTypes, catchCommands, finallyCommands); break; case THROW: ret = new ThrowActionItem(null, null, expression(inFunction, inMethod, true, variables, functions)); @@ -1872,12 +1884,58 @@ public class ActionScript2Parser { return retTree; } - public List actionsFromTree(List tree, List constantPool) throws CompilationException { + private List generateActionList(List tree, List constantPool) throws CompilationException { ActionSourceGenerator gen = new ActionSourceGenerator(swfVersion, constantPool); + SourceGeneratorLocalData localData = new SourceGeneratorLocalData(new HashMap<>(), 0, Boolean.FALSE, 0); + return gen.generate(localData, tree); + } + + private List actionsFromTree(List tree, List constantPool, boolean doOrder) throws CompilationException, NeedsGenerateAgainException { List ret = new ArrayList<>(); - SourceGeneratorLocalData localData = new SourceGeneratorLocalData( - new HashMap<>(), 0, Boolean.FALSE, 0); - List srcList = gen.generate(localData, tree); + + List srcList = generateActionList(tree, constantPool); + + if (doOrder) { + List orderedConstantPool = new ArrayList<>(); + boolean canChangeInPlace; + int lastIndex = constantPool.size() - 1; + if (lastIndex <= ActionPush.MAX_CONSTANT_INDEX_TYPE8) { + //can change constant indices as ActionPush contains always 1 byte per constant + canChangeInPlace = true; + } else { + //variable number bytes per ActionPush constant, + //must generate again to make relative offsets in jumps work + canChangeInPlace = false; + } + + //create ordered constant pool, update constantindices when we can changeinplace + for (GraphSourceItem src : srcList) { + if (src instanceof ActionPush) { + ActionPush ap = (ActionPush) src; + for (int i = 0; i < ap.values.size(); i++) { + Object val = ap.values.get(i); + if (val instanceof ConstantIndex) { + ConstantIndex ci = (ConstantIndex) val; + String cval = constantPool.get(ci.index); + int orderedIndex = orderedConstantPool.indexOf(cval); + if (orderedIndex == -1) { + orderedIndex = orderedConstantPool.size(); + orderedConstantPool.add(cval); + } + if (canChangeInPlace) { + //Do NOT change ci.index directly - it may be cloned from other location + ap.values.set(i, new ConstantIndex(orderedIndex)); + } + } + } + } + } + if (!canChangeInPlace) { + //generate again, as number of bytes per ActionPush can change + throw new NeedsGenerateAgainException(orderedConstantPool); + } + constantPool = orderedConstantPool; + } for (GraphSourceItem s : srcList) { if (s instanceof Action) { ret.add((Action) s); @@ -1888,9 +1946,21 @@ public class ActionScript2Parser { } public List actionsFromString(String s) throws ActionParseException, IOException, CompilationException { - List constantPool = new ArrayList<>(); - List tree = treeFromString(s, constantPool); - return actionsFromTree(tree, constantPool); + try { + List constantPool = new ArrayList<>(); + List tree = treeFromString(s, constantPool); + return actionsFromTree(tree, constantPool, true); + } catch (NeedsGenerateAgainException nga) { + //Can happen when constantpool needs reordering and number of constants > 256 + try { + List newConstantPool = nga.getNewConstantPool(); + List tree = treeFromString(s, newConstantPool); + return actionsFromTree(tree, newConstantPool, false /*do not order again*/); + } catch (NeedsGenerateAgainException ex) { + //should not happen as doOrder parameter is set to false + return new ArrayList<>(); + } + } } private void versionRequired(ParsedSymbol s, int min) throws ActionParseException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index d35b086cb..5f2d04bf5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.parser.script; import com.jpexs.decompiler.flash.SWF; @@ -655,7 +656,7 @@ public class ActionSourceGenerator implements SourceGenerator { return new ActionPush(new ConstantIndex(index)); } - public List generateTraits(SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) throws CompilationException { + public List generateTraits(SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, List> traits, List traitsStatic) throws CompilationException { List extendsStr = getVarParts(extendsVal); List ret = new ArrayList<>(); List nameStr = getVarParts(name); @@ -668,7 +669,7 @@ public class ActionSourceGenerator implements SourceGenerator { } List val = new ArrayList<>(); - val.add(new ActionPush((Long) 0L)); + val.add(new ActionPush((Double) 0.0)); val.add(pushConst("Object")); val.add(new ActionNewObject()); notBody.addAll(typeToActions(globalClassTypeStr, val)); @@ -677,12 +678,26 @@ public class ActionSourceGenerator implements SourceGenerator { ret.add(new ActionNot()); ret.add(new ActionIf(Action.actionsToBytes(notBody, false, SWF.DEFAULT_VERSION).length)); ret.addAll(notBody); + ret.add(new ActionPop()); } List ifbody = new ArrayList<>(); List globalClassTypeStr = new ArrayList<>(); globalClassTypeStr.add("_global"); globalClassTypeStr.addAll(nameStr); + String constructorName = nameStr.get(nameStr.size() - 1); //com.jpexs.MyClass => MyClass + GraphTargetItem constructor = null; + int constructorIndex = -1; + for (int t = 0; t < traits.size(); t++) { + MyEntry en = traits.get(t); + if (en.getValue() instanceof FunctionActionItem) { + if (constructorName.equals(getName(en.getKey()))) { + constructorIndex = t; + constructor = en.getValue(); + break; + } + } + } ParsedSymbol s = null; List constr = new ArrayList<>(); @@ -692,45 +707,40 @@ public class ActionSourceGenerator implements SourceGenerator { if (!isInterface) { val.add(new ActionStoreRegister(1)); } - constr.addAll(typeToActions(globalClassTypeStr, val)); + constr.addAll(typeToActions(nameStr, val)); } else { constr.addAll(toActionList(((FunctionActionItem) constructor).toSource(localData, this))); constr.add(new ActionStoreRegister(1)); - constr = (typeToActions(globalClassTypeStr, constr)); + constr = (typeToActions(nameStr, constr)); } if (!isInterface) { - for (GraphTargetItem f : staticFunctions) { - FunctionActionItem fi = (FunctionActionItem) f; - ifbody.add(new ActionPush(new RegisterNumber(1/*static*/))); - ifbody.add(new ActionPush(getName(fi.calculatedFunctionName))); - ifbody.addAll(toActionList(fi.toSource(localData, this))); - ifbody.add(new ActionSetMember()); - } - for (GraphTargetItem f : functions) { - FunctionActionItem fi = (FunctionActionItem) f; - ifbody.add(new ActionPush(new RegisterNumber(2/*instance*/))); - ifbody.add(new ActionPush(getName(fi.calculatedFunctionName))); - ifbody.addAll(toActionList(fi.toSource(localData, this))); - ifbody.add(new ActionSetMember()); - } - for (MyEntry en : staticVars) { - ifbody.add(new ActionPush(new RegisterNumber(1/*static*/))); - ifbody.add(new ActionPush(getName(en.getKey()))); - ifbody.addAll(toActionList(en.getValue().toSource(localData, this))); - ifbody.add(new ActionSetMember()); - } - for (MyEntry en : vars) { - ifbody.add(new ActionPush(new RegisterNumber(2/*instance*/))); - ifbody.add(new ActionPush(getName(en.getKey()))); - ifbody.addAll(toActionList(en.getValue().toSource(localData, this))); - ifbody.add(new ActionSetMember()); + for (int pass = 1; pass <= 2; pass++) { //two passes, methods first, then variables + for (int t = 0; t < traits.size(); t++) { + if (constructorIndex == t) { //constructor already handled + continue; + } + MyEntry en = traits.get(t); + boolean isFunc = (en.getValue() instanceof FunctionActionItem); + if (pass == 1 && isFunc) { //Add methods in first pass + FunctionActionItem fi = (FunctionActionItem) en.getValue(); + ifbody.add(new ActionPush(new RegisterNumber(traitsStatic.get(t) ? 1 : 2))); + ifbody.add(pushConst(getName(en.getKey()))); + ifbody.addAll(toActionList(fi.toSource(localData, this))); + ifbody.add(new ActionSetMember()); + } else if (pass == 2 && !isFunc) { //add variables in second pass + ifbody.add(new ActionPush(new RegisterNumber(traitsStatic.get(t) ? 1 : 2))); + ifbody.add(pushConst(getName(en.getKey()))); + ifbody.addAll(toActionList(en.getValue().toSource(localData, this))); + ifbody.add(new ActionSetMember()); + } + } } } if (!isInterface) { ifbody.add(new ActionPush((Long) 1L)); ifbody.add(new ActionPush(Null.INSTANCE)); - ifbody.addAll(typeToActions(globalClassTypeStr, null)); + ifbody.addAll(typeToActions(nameStr, null)); ifbody.add(pushConst("prototype")); ifbody.add(new ActionGetMember()); ifbody.add(new ActionPush((Long) 3L)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/NeedsGenerateAgainException.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/NeedsGenerateAgainException.java new file mode 100644 index 000000000..fcd5d9de5 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/NeedsGenerateAgainException.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2010-2018 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action.parser.script; + +import java.util.List; + +/** + * + * @author JPEXS + */ +public class NeedsGenerateAgainException extends Exception { + + private List newConstantPool; + + public NeedsGenerateAgainException(List newConstantPool) { + this.newConstantPool = newConstantPool; + } + + public List getNewConstantPool() { + return newConstantPool; + } + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java index 3370359dd..550898b50 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.special; import com.jpexs.decompiler.flash.action.Action; @@ -52,7 +53,7 @@ public class ActionEnd extends Action { } @Override - public void translate(GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { //output.add(new SimpleActionTreeItem(this, "end()")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionNop.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionNop.java index 59a5c083b..a44569044 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionNop.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionNop.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.special; import com.jpexs.decompiler.flash.action.Action; @@ -48,7 +49,7 @@ public class ActionNop extends Action { } @Override - public void translate(GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { //output.add(new SimpleActionTreeItem(this, "nop();")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionUnknown.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionUnknown.java index 6e3a2fe91..8e1947052 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionUnknown.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/special/ActionUnknown.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.special; import com.jpexs.decompiler.flash.action.LocalDataArea; @@ -45,6 +46,6 @@ public class ActionUnknown extends ActionNop { } @Override - public void translate(GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java index b9dcba8b4..4402a9f05 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java @@ -97,7 +97,7 @@ public class ActionGetURL extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { String fsCommandPrefix = "FSCommand:"; if (urlString.startsWith(fsCommandPrefix) && targetString.isEmpty()) { String command = urlString.substring(fsCommandPrefix.length()); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java index f86543b67..3a29e2329 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java @@ -86,7 +86,7 @@ public class ActionGoToLabel extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new GotoLabelActionItem(this, lineStartAction, label)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java index 302ea900c..87007a465 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java @@ -82,7 +82,7 @@ public class ActionGotoFrame extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new GotoFrameActionItem(this, lineStartAction, frame)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionNextFrame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionNextFrame.java index 7ef52294f..54e5c4c97 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionNextFrame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionNextFrame.java @@ -53,7 +53,7 @@ public class ActionNextFrame extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new NextFrameActionItem(this, lineStartAction)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPlay.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPlay.java index 2d71f642e..17ac6f266 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPlay.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPlay.java @@ -52,7 +52,7 @@ public class ActionPlay extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { if (!output.isEmpty() && (output.get(output.size() - 1) instanceof GotoFrameActionItem)) { GotoFrameActionItem gta = (GotoFrameActionItem) output.remove(output.size() - 1); output.add(new GotoFrame2ActionItem(this, lineStartAction, new DirectValueActionItem(gta.frame + 1), false, true, 0)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPrevFrame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPrevFrame.java index 1bd9a2d30..bea471769 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPrevFrame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionPrevFrame.java @@ -53,7 +53,7 @@ public class ActionPrevFrame extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new PrevFrameActionItem(this, lineStartAction)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java index 02ca3e1d1..2f17d6a9d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java @@ -90,7 +90,7 @@ public class ActionSetTarget extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new SetTargetActionItem(this, lineStartAction, targetName)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStop.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStop.java index a8f69f163..2e8a38461 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStop.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStop.java @@ -49,7 +49,7 @@ public class ActionStop extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new StopActionItem(this, lineStartAction)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStopSounds.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStopSounds.java index 9e7dd352c..d9268e653 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStopSounds.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionStopSounds.java @@ -48,7 +48,7 @@ public class ActionStopSounds extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new StopAllSoundsActionItem(this, lineStartAction)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionToggleQuality.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionToggleQuality.java index 7b654e8d9..343848280 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionToggleQuality.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionToggleQuality.java @@ -48,7 +48,7 @@ public class ActionToggleQuality extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new ToggleHighQualityActionItem(this, lineStartAction)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java index fc02ddf83..deb356b04 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf3; import com.jpexs.decompiler.flash.SWF; @@ -99,9 +100,9 @@ public class ActionWaitForFrame extends Action implements ActionStore { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { GraphTargetItem frameTi = new DirectValueActionItem(null, null, 0, new Long(frame), new ArrayList<>()); - List body = ActionGraph.translateViaGraph(regNames, variables, functions, skipped, SWF.DEFAULT_VERSION, staticOperation, path); + List body = ActionGraph.translateViaGraph(insideDoInitAction, regNames, variables, functions, skipped, SWF.DEFAULT_VERSION, staticOperation, path); output.add(new IfFrameLoadedActionItem(frameTi, body, this, lineStartAction)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java index ed444160a..ef754c664 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -53,7 +54,7 @@ public class ActionAdd extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new AddActionItem(this, lineStartAction, b, a, false)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java index 97b0c7a4f..42e1813b3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java @@ -53,7 +53,7 @@ public class ActionAnd extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new AndActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java index 767bf3823..e968b2e8f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java @@ -53,7 +53,7 @@ public class ActionAsciiToChar extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new AsciiToCharActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java index 00ae17ac6..0e15e05bb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java @@ -58,7 +58,7 @@ public class ActionCall extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new CallActionItem(this, lineStartAction, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java index 0d29c72dc..a6b643b20 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java @@ -53,7 +53,7 @@ public class ActionCharToAscii extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new CharToAsciiActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java index 76649d7ec..5b2a63575 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -21,6 +22,7 @@ import com.jpexs.decompiler.flash.action.ActionScriptObject; import com.jpexs.decompiler.flash.action.LocalDataArea; import com.jpexs.decompiler.flash.action.model.CloneSpriteActionItem; import com.jpexs.decompiler.flash.ecma.EcmaScript; +import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.types.annotations.SWFVersion; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -53,13 +55,16 @@ public class ActionCloneSprite extends Action { int depth = EcmaScript.toInt32(lda.stack.pop()); String source = EcmaScript.toString(lda.stack.pop()); String target = EcmaScript.toString(lda.stack.pop()); - lda.stage.setMember(target, ((ActionScriptObject) lda.stage.getMember(source)).clone()); - lda.stage.addToDisplayList(depth, lda.stage.getMember(target)); + Object clonedMember = lda.stage.getMember(source); + if (clonedMember != Undefined.INSTANCE) { + lda.stage.setMember(target, ((ActionScriptObject) clonedMember).clone()); + lda.stage.addToDisplayList(depth, lda.stage.getMember(target)); + } return true; } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem depth = stack.pop(); GraphTargetItem source = stack.pop(); GraphTargetItem target = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java index f9a8a28fb..668d4b9c2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java @@ -53,7 +53,7 @@ public class ActionDivide extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new DivideActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEndDrag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEndDrag.java index 275fd6eb7..def6d7280 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEndDrag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEndDrag.java @@ -52,7 +52,7 @@ public class ActionEndDrag extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { output.add(new StopDragActionItem(this, lineStartAction)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java index b6812c6bb..66a7af3df 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java @@ -53,7 +53,7 @@ public class ActionEquals extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new EqActionItem(this, lineStartAction, b, a, false)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java index cfb03654e..82043030e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java @@ -64,7 +64,7 @@ public class ActionGetProperty extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem index = stack.pop(); GraphTargetItem target = stack.pop(); int indexInt = 0; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java index fd50fb310..53c89e2ce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java @@ -49,7 +49,7 @@ public class ActionGetTime extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { stack.push(new GetTimeActionItem(this, lineStartAction)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java index 61dc5ce2e..82a8a8053 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java @@ -124,7 +124,7 @@ public class ActionGetURL2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem targetString = stack.pop(); GraphTargetItem urlString = stack.pop(); Integer num = null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java index 156ac352e..a958fe498 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java @@ -64,7 +64,7 @@ public class ActionGetVariable extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem name = stack.pop(); String nameStr; if (name instanceof DirectValueActionItem) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java index b3bdb3f33..8b9e40d66 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java @@ -143,7 +143,7 @@ public class ActionGotoFrame2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem frame = stack.pop(); output.add(new GotoFrame2ActionItem(this, lineStartAction, frame, sceneBiasFlag, playFlag, sceneBias)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java index 762e6fe8b..bb736f67e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java @@ -53,7 +53,7 @@ public class ActionLess extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new LtActionItem(this, lineStartAction, b, a, false)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java index f43e712f2..1a9f3b179 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java @@ -53,7 +53,7 @@ public class ActionMBAsciiToChar extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new MBAsciiToCharActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java index f1d07eb2b..ecef9ab58 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java @@ -53,7 +53,7 @@ public class ActionMBCharToAscii extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new MBCharToAsciiActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java index cf371db1b..9ff7864cf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java @@ -53,7 +53,7 @@ public class ActionMBStringExtract extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem count = stack.pop(); GraphTargetItem index = stack.pop(); GraphTargetItem value = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java index d4683b027..84e6df110 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java @@ -53,7 +53,7 @@ public class ActionMBStringLength extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new MBStringLengthActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java index b8649ac3e..e86acdae7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java @@ -53,7 +53,7 @@ public class ActionMultiply extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new MultiplyActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java index 012c80cca..52d8161c4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java @@ -53,7 +53,7 @@ public class ActionNot extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(a.invert(this)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java index 7292018fb..4eff80e10 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java @@ -53,7 +53,7 @@ public class ActionOr extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new OrActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java index 9f0181b2f..0fa744297 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java @@ -52,7 +52,7 @@ public class ActionPop extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem val = stack.pop(); output.add(val); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index 8c9d813c6..bcf989921 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -62,6 +63,12 @@ public class ActionPush extends Action { public List constantPool; + /** + * Maximum constant index for storing in type 8, greater indices must be + * stored in type 9 + */ + public static final int MAX_CONSTANT_INDEX_TYPE8 = 255; + public ActionPush(int actionLength, SWFInputStream sis, int version) throws IOException { super(0x96, actionLength); int type; @@ -151,7 +158,7 @@ public class ActionPush extends Action { } } else if (o instanceof ConstantIndex) { int cIndex = ((ConstantIndex) o).index; - if (cIndex < 256) { + if (cIndex <= MAX_CONSTANT_INDEX_TYPE8) { sos.writeUI8(8); sos.writeUI8(cIndex); } else { @@ -382,7 +389,7 @@ public class ActionPush extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { int pos = 0; for (Object o : values) { if (o instanceof ConstantIndex) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java index f2f40dff6..4ead65188 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java @@ -53,7 +53,7 @@ public class ActionRandomNumber extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem maximum = stack.pop(); stack.push(new RandomNumberActionItem(this, lineStartAction, maximum)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java index 9c23e3036..80106f46b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java @@ -55,7 +55,7 @@ public class ActionRemoveSprite extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem target = stack.pop(); output.add(new RemoveSpriteActionItem(this, lineStartAction, target)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java index 14cc36af2..ce3a26c6f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java @@ -70,7 +70,7 @@ public class ActionSetProperty extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop().getThroughDuplicate(); GraphTargetItem index = stack.pop().getThroughDuplicate(); GraphTargetItem target = stack.pop().getThroughDuplicate(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java index 7f1cf51c7..a34cd1937 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java @@ -54,7 +54,7 @@ public class ActionSetTarget2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem target = stack.pop(); output.add(new SetTarget2ActionItem(this, lineStartAction, target)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java index c4c564b35..4c421da6c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java @@ -68,7 +68,7 @@ public class ActionSetVariable extends Action implements StoreTypeAction { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop().getThroughDuplicate(); GraphTargetItem name = stack.pop(); String nameStr; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStartDrag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStartDrag.java index 244fcb91e..39cd5a110 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStartDrag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStartDrag.java @@ -54,7 +54,7 @@ public class ActionStartDrag extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem target = stack.pop(); GraphTargetItem lockCenter = stack.pop(); GraphTargetItem constrain = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java index a79979a4a..16dd9d740 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java @@ -53,7 +53,7 @@ public class ActionStringAdd extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new StringAddActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java index a3697a2fe..7c2443d9a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java @@ -53,7 +53,7 @@ public class ActionStringEquals extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new StringEqActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java index 3bb04a3c9..eb8d71683 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java @@ -53,7 +53,7 @@ public class ActionStringExtract extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem count = stack.pop(); GraphTargetItem index = stack.pop(); GraphTargetItem value = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java index 1cd5a5fae..83e3b08c2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java @@ -53,7 +53,7 @@ public class ActionStringLength extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new StringLengthActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java index 8afefbbdd..fbfa1c193 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java @@ -53,7 +53,7 @@ public class ActionStringLess extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new StringLtActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java index b87655fd0..f1b64d9b2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java @@ -53,7 +53,7 @@ public class ActionSubtract extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new SubtractActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java index 1869b66bc..80ab50aca 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java @@ -53,7 +53,7 @@ public class ActionToInteger extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new ToIntegerActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java index db2d95695..65e4bc53b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java @@ -53,7 +53,7 @@ public class ActionTrace extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop(); output.add(new TraceActionItem(this, lineStartAction, value)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java index 19649085b..ab6de28dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -145,9 +146,9 @@ public class ActionWaitForFrame2 extends Action implements ActionStore { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { GraphTargetItem frame = stack.pop(); - List body = ActionGraph.translateViaGraph(regNames, variables, functions, skipped, SWF.DEFAULT_VERSION, staticOperation, path); + List body = ActionGraph.translateViaGraph(insideDoInitAction, regNames, variables, functions, skipped, SWF.DEFAULT_VERSION, staticOperation, path); output.add(new IfFrameLoadedActionItem(frame, body, this, lineStartAction)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java index 323e9329e..3145db61b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java @@ -53,7 +53,7 @@ public class ActionAdd2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new AddActionItem(this, lineStartAction, b, a, true)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java index 987f39c9a..cc4332ac5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java @@ -53,7 +53,7 @@ public class ActionBitAnd extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new BitAndActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java index f8a9b739c..cc23921b3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java @@ -53,7 +53,7 @@ public class ActionBitLShift extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new LShiftActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java index 8d2d38b3f..54976f587 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java @@ -53,7 +53,7 @@ public class ActionBitOr extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new BitOrActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java index 6f79e7e39..b0565ddc9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java @@ -53,7 +53,7 @@ public class ActionBitRShift extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new RShiftActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java index 89232d503..78bee5c3f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java @@ -53,7 +53,7 @@ public class ActionBitURShift extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new URShiftActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java index 14ff4d69c..0eb5a9d32 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java @@ -53,7 +53,7 @@ public class ActionBitXor extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new BitXorActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java index 8067b3aba..0c0da6a54 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java @@ -66,7 +66,7 @@ public class ActionCallFunction extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem functionName = stack.pop(); long numArgs = popLong(stack); List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java index 80f603fe9..87e2836da 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java @@ -75,7 +75,7 @@ public class ActionCallMethod extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem methodName = stack.pop(); GraphTargetItem scriptObject = stack.pop(); long numArgs = popLong(stack); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java index 44642fb99..fd2918da9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java @@ -117,6 +117,6 @@ public class ActionConstantPool extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java index 9daf13bd0..1e25fd189 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java @@ -53,7 +53,7 @@ public class ActionDecrement extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new DecrementActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index 1f3ed7e2d..a38fb42da 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -159,7 +159,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java index cf192dfa7..485ab6684 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java @@ -57,7 +57,7 @@ public class ActionDefineLocal extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop(); GraphTargetItem name = stack.pop(); String nameStr; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java index 776b6de1b..e3b7dbfc5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java @@ -45,7 +45,7 @@ public class ActionDefineLocal2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem name = stack.pop(); output.add(new DefineLocalActionItem(this, lineStartAction, name, null)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete.java index 473758f01..dad1a29b3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete.java @@ -54,7 +54,7 @@ public class ActionDelete extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem propertyName = stack.pop(); GraphTargetItem object = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java index 1c0db8f26..4be8b52b2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java @@ -60,7 +60,7 @@ public class ActionDelete2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem propertyName = stack.pop(); stack.push(new DeleteActionItem(this, lineStartAction, null, propertyName)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java index 8b2fe3f4b..3d6cca063 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java @@ -65,7 +65,7 @@ public class ActionEnumerate extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); //stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); output.add(new EnumerateActionItem(this, lineStartAction, object)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java index 094fe0c34..810e99987 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java @@ -53,7 +53,7 @@ public class ActionEquals2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new EqActionItem(this, lineStartAction, b, a, true)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java index 5b20f7ead..50adab2d0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java @@ -62,7 +62,7 @@ public class ActionGetMember extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem memberName = stack.pop(); GraphTargetItem object = stack.pop(); stack.push(new GetMemberActionItem(this, lineStartAction, object, memberName)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java index ddd4a7d93..350d4d90d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java @@ -53,7 +53,7 @@ public class ActionIncrement extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); stack.push(new IncrementActionItem(this, lineStartAction, a)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java index 1c7aaf3aa..2bb0937b1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java @@ -60,7 +60,7 @@ public class ActionInitArray extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { long numArgs = popLong(stack); List args = new ArrayList<>(); for (int l = 0; l < numArgs; l++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java index ee1c753eb..0c3341ab7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java @@ -67,7 +67,7 @@ public class ActionInitObject extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { long numArgs = popLong(stack); List values = new ArrayList<>(); List names = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java index 999fabcc9..299497df6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java @@ -53,7 +53,7 @@ public class ActionLess2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new LtActionItem(this, lineStartAction, b, a, true)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java index 16ad75989..7141d82c1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java @@ -53,7 +53,7 @@ public class ActionModulo extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new ModuloActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java index 4bed79a9d..6c292fe4c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java @@ -71,7 +71,7 @@ public class ActionNewMethod extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem methodName = stack.pop(); GraphTargetItem scriptObject = stack.pop(); long numArgs = popLong(stack); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java index 9fa26f2c9..49719646e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java @@ -71,7 +71,7 @@ public class ActionNewObject extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem objectName = stack.pop(); long numArgs = popLong(stack); List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java index 1a1d9a102..390a9c5a4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java @@ -54,7 +54,7 @@ public class ActionPushDuplicate extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.peek(); stack.push(new DuplicateItem(this, lineStartAction, value)); value.getMoreSrc().add(new GraphSourceItemPos(this, 0)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java index 4fd6f6bcd..f246c96d9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java @@ -55,7 +55,7 @@ public class ActionReturn extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop(); output.add(new ReturnActionItem(this, lineStartAction, value)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java index f0c8c5e1f..dff7fe2d4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java @@ -69,7 +69,7 @@ public class ActionSetMember extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop().getThroughDuplicate(); GraphTargetItem memberName = stack.pop(); GraphTargetItem object = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java index c230e9670..43283c664 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java @@ -56,7 +56,7 @@ public class ActionStackSwap extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(a); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java index 90fb74831..b5195953a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java @@ -97,7 +97,7 @@ public class ActionStoreRegister extends Action implements StoreTypeAction { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop(); RegisterNumber rn = new RegisterNumber(registerNumber); if (regNames.containsKey(registerNumber)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java index ee7034bfc..718f1f6e1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java @@ -62,7 +62,7 @@ public class ActionTargetPath extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); stack.push(new TargetPathActionItem(this, lineStartAction, object)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java index 52f610b92..e90b5e3f0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java @@ -53,7 +53,7 @@ public class ActionToNumber extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); stack.push(new ToNumberActionItem(this, lineStartAction, object)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java index e01e80d5d..5b5c443ac 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java @@ -53,7 +53,7 @@ public class ActionToString extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); stack.push(new ToStringActionItem(this, lineStartAction, object)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java index 4401b0ee6..e4b30b5ab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java @@ -53,7 +53,7 @@ public class ActionTypeOf extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); stack.push(new TypeOfActionItem(this, lineStartAction, object)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java index 036c74e41..fbe390b23 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java @@ -45,7 +45,7 @@ public class ActionEnumerate2 extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); output.add(new EnumerateActionItem(this, lineStartAction, object)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java index 536583eec..4e144f418 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java @@ -53,7 +53,7 @@ public class ActionGreater extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new GtActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java index fd0e4a119..3795bb7fd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java @@ -84,7 +84,7 @@ public class ActionInstanceOf extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new InstanceOfActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java index 8b057623e..276a7ce8b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java @@ -53,7 +53,7 @@ public class ActionStrictEquals extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new StrictEqActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java index ac1c0ad25..e03d9629f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java @@ -53,7 +53,7 @@ public class ActionStringGreater extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); GraphTargetItem b = stack.pop(); stack.push(new StringGtActionItem(this, lineStartAction, b, a)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java index 9cf211127..410490cbb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java @@ -63,7 +63,7 @@ public class ActionCastOp extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); GraphTargetItem constructor = stack.pop(); stack.push(new CastOpActionItem(this, lineStartAction, constructor, object)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index 1c09685b8..5a1650cf6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -267,7 +267,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java index 7da091b9f..a333563b1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java @@ -63,7 +63,7 @@ public class ActionExtends extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem superclass = stack.pop(); GraphTargetItem subclass = stack.pop(); output.add(new ExtendsActionItem(this, lineStartAction, subclass, superclass)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java index 2cd6aaaf9..454cb3ef2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java @@ -67,7 +67,7 @@ public class ActionImplementsOp extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem subclass = stack.pop(); long inCount = popLong(stack); List superclasses = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionThrow.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionThrow.java index d6698729a..b6c159324 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionThrow.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionThrow.java @@ -49,7 +49,7 @@ public class ActionThrow extends Action { } @Override - public void translate(GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + public void translate(boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); output.add(new ThrowActionItem(this, lineStartAction, object)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java index f5cdc4667..f10f44463 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf7; import com.jpexs.decompiler.flash.SWFInputStream; @@ -21,12 +22,16 @@ import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.ActionList; import com.jpexs.decompiler.flash.action.LocalDataArea; import com.jpexs.decompiler.flash.action.model.ActionItem; +import com.jpexs.decompiler.flash.action.model.CastOpActionItem; +import com.jpexs.decompiler.flash.action.model.DefineLocalActionItem; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; +import com.jpexs.decompiler.flash.action.model.ThrowActionItem; import com.jpexs.decompiler.flash.action.model.clauses.TryActionItem; import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParsedSymbol; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.types.annotations.Reserved; import com.jpexs.decompiler.flash.types.annotations.SWFVersion; @@ -34,6 +39,9 @@ import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphSourceItemContainer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.IfItem; +import com.jpexs.decompiler.graph.model.PopItem; +import com.jpexs.decompiler.graph.model.PushItem; import com.jpexs.helpers.Helper; import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; @@ -274,23 +282,89 @@ public class ActionTry extends Action implements GraphSourceItemContainer { @Override public void translateContainer(List> contents, GraphSourceItem lineStartItem, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions) { List tryCommands = contents.get(0); - ActionItem catchName; - if (catchInRegisterFlag) { - catchName = new DirectValueActionItem(this, lineStartItem, -1, new RegisterNumber(this.catchRegister), new ArrayList<>()); - } else { - catchName = new DirectValueActionItem(this, lineStartItem, -1, this.catchName, new ArrayList<>()); - } - List catchExceptions = new ArrayList<>(); - if (catchBlockFlag) { - catchExceptions.add(catchName); - } + + List catchExceptionNames = new ArrayList<>(); + List catchExceptionTypes = new ArrayList<>(); List> catchCommands = new ArrayList<>(); + if (catchBlockFlag) { - catchCommands.add(contents.get(1)); + List body = contents.get(1); + if (catchInRegisterFlag) { + //catchName = new DirectValueActionItem(this, lineStartItem, -1, new RegisterNumber(this.catchRegister), new ArrayList<>()); + if (body.size() >= 2) { + int pos = 0; + loopex: + while (body.get(pos) instanceof PushItem) { + PushItem pi = (PushItem) body.get(pos); + if (pi.value instanceof CastOpActionItem) { + CastOpActionItem co = (CastOpActionItem) pi.value; + if ((co.object instanceof DirectValueActionItem) && (((DirectValueActionItem) co.object).value instanceof RegisterNumber)) { + RegisterNumber rn = (RegisterNumber) ((DirectValueActionItem) co.object).value; + if (rn.number == catchRegister) { + catchExceptionTypes.add(co.constructor); + if (body.get(pos + 1) instanceof IfItem) { + IfItem ifi = (IfItem) body.get(pos + 1); + if (!ifi.onTrue.isEmpty()) { + if (ifi.onTrue.get(0) instanceof DefineLocalActionItem) { + DefineLocalActionItem dl = (DefineLocalActionItem) ifi.onTrue.get(0); + catchExceptionNames.add(dl.name); + List catchBody = new ArrayList<>(ifi.onTrue); + catchBody.remove(0); + catchCommands.add(catchBody); + if (!ifi.onFalse.isEmpty()) { + if (ifi.onFalse.get(0) instanceof PopItem) { + pos = 1; + body = ifi.onFalse; + continue loopex; + } else { + break; + } + } else { + break; + } + /*if (body.size() == pos + 4) { + if (body.get(pos + 2) instanceof PopItem) { + if (body.get(pos + 3) instanceof ThrowActionItem) { + ThrowActionItem ta = (ThrowActionItem) body.get(pos + 3); + if (ta.value instanceof DirectValueActionItem) { + if (((DirectValueActionItem) ta.value).value instanceof RegisterNumber) { + RegisterNumber rn2 = (RegisterNumber) ((DirectValueActionItem) ta.value).value; + if (rn2.number == catchRegister) { + break; + } + } + } + } + } + }else{ + + }*/ + } + } + } + } + } + + } + } + if (body.get(pos) instanceof DefineLocalActionItem) { + DefineLocalActionItem dl = (DefineLocalActionItem) body.get(pos); + catchExceptionNames.add(dl.name); + catchExceptionTypes.add(null); + List catchBody = new ArrayList<>(body); + catchBody.remove(0); //pop + catchBody.remove(0); //definelocal + catchCommands.add(catchBody); + } + } + } else { + catchExceptionNames.add(new DirectValueActionItem(this, lineStartItem, -1, this.catchName, new ArrayList<>())); + catchExceptionTypes.add(null); + catchCommands.add(body); + } } List finallyCommands = contents.get(2); - output.add(new TryActionItem(tryCommands, catchExceptions, catchCommands, finallyCommands)); - + output.add(new TryActionItem(tryCommands, catchExceptionNames, catchExceptionTypes, catchCommands, finallyCommands)); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java index 1b9e054be..6fc936f59 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.helpers.collections; +import java.io.Serializable; import java.util.Map.Entry; import java.util.Objects; @@ -24,7 +26,7 @@ import java.util.Objects; * @param Value * @author JPEXS */ -public class MyEntry implements Entry { +public class MyEntry implements Entry, Serializable { private final K key; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/AppResources_tr.properties b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/AppResources_tr.properties new file mode 100644 index 000000000..9870d6c52 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/AppResources_tr.properties @@ -0,0 +1,42 @@ +# Copyright (C) 2010-2016 JPEXS, All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3.0 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. + +decompilationError = Ayr\u0131\u015ft\u0131rma hatas\u0131 +decompilationError.timeout = Zamana\u015f\u0131m\u0131na ({0}) ula\u015f\u0131ld\u0131 +decompilationError.timeout.description = Zamana\u015f\u0131m\u0131 nedeniyle ayr\u0131\u015ft\u0131r\u0131lmad\u0131 +decompilationError.obfuscated = Kod \u015fa\u015f\u0131rtabilir +decompilationError.errorType = Hata t\u00fcr\u00fc +decompilationError.error.description = Hata nedeniyle ayr\u0131\u015ft\u0131r\u0131lmad\u0131 +decompilationError.actionCount = Eylem say\u0131s\u0131: +decompilationError.instructionCount = Talimat say\u0131s\u0131: + +decompilation.skipped = Ayr\u0131\u015ft\u0131rma atland\u0131 +decompilation.unsupported = Decompiler taraf\u0131ndan desteklenmiyor +decompilerMark = ayr\u0131\u015ft\u0131r\u0131c\u0131 i\u015fareti + +#example: 1 hour and 2 minutes +timeFormat.and = ve +timeFormat.hour = saat +timeFormat.hours = saatler +timeFormat.minute = dakika +timeFormat.minutes = dakikalar +timeFormat.second = saniye +timeFormat.seconds = saniyeler + +fontNotFound = ID =% fontId% olan yaz\u0131 tipi bulunamad\u0131. + +trait.scriptinitializer = komut ba\u015flat\u0131c\u0131s\u0131 +trait.instanceinitializer = \u00f6rnek ba\u015flat\u0131c\u0131 +trait.classinitializer = s\u0131n\u0131f ba\u015flat\u0131c\u0131 \ No newline at end of file diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3_tr.properties b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3_tr.properties new file mode 100644 index 000000000..5ce74ea88 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3_tr.properties @@ -0,0 +1,1461 @@ +# Copyright (C) 2010-2016 JPEXS, All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3.0 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. + +#String for whole list generation +ui.list.heading = AVM2 \u00d6\u011fretim listesi +ui.list.pageTitle = AVM2 \u00d6\u011fretim listesi +ui.list.documentTitle = AVM2 \u00d6\u011fretim listesi +ui.list.pageDescription = T\u00fcm bilinen ActionScript 3 - AVM2 komutlar\u0131n\u0131 i\u015flenen ve y\u0131\u011f\u0131n de\u011ferleriyle listeleme + +#various strings in UI: +ui.unknown = ??? +ui.stack = Y\u0131\u011f\u0131n:\u0020 +ui.stack.before = ...,\u0020 +ui.stack.before.empty = ... +ui.stack.to = \u0020\u279e\u0020 +ui.flags = Bayraklar:\u0020 +ui.description = A\u00e7\u0131klama:\u0020 +ui.filter.hide = Saklamak:\u0020 +ui.filter.byname = \u0130sme g\u00f6re ara:\u0020 +ui.filter.order = Taraf\u0131ndan sipari\u015f:\u0020 +ui.filter.order.code = kod +ui.filter.order.name = isim + + +#----------------------- Flags of the instructions +instructionFlag.undocumented = Belgesi olmayan +instructionFlag.unknownStack = Bilinmeyen y\u0131\u011f\u0131n +instructionFlag.es4NumericsMinor = ES4 rakamlar\u0131 (ABC minor 17) +instructionFlag.floatMajor = Y\u00fczen de\u011ferler (ABC major 47) +instructionFlag.unknownOperands = Bilinmeyen i\u015flenenler +instructionFlag.noFlashPlayer = Standart Flash Player'da de\u011fil +instructionFlag.deprecated = Kullan\u0131mdan kald\u0131r\u0131lan +instructionFlag.domainMemory = Etki alan\u0131 bellek i\u015flemi + +#----------------------- Operand types +operandType.multinameIndex = \u00c7ok isimli dizin +operandType.multinameIndex.description = Dizin i\u00e7ine \u00e7ok isimli sabit havuz +operandType.multinameIndex.name = multinameIndex +operandType.multinameIndex.uiName = \u00e7ok isimli + +operandType.argCount = Ba\u011f\u0131ms\u0131z de\u011fi\u015fken say\u0131s\u0131 +operandType.argCount.description = A\u015fa\u011f\u0131daki arg\u00fcmanlar say\u0131s\u0131 +operandType.argCount.name = argCount +operandType.argCount.uiName = uint + + +operandType.methodIndex = Y\u00f6ntem dizini +operandType.methodIndex.description = ABC y\u00f6ntem dizini +operandType.methodIndex.name = methodIndex +operandType.methodIndex.uiName = methodIndex + +operandType.stringIndex = Dizgi dizini +operandType.stringIndex.description = Dize de\u011ferleri sabit havuzuna dizin +operandType.stringIndex.name = stringIndex +operandType.stringIndex.uiName = Dize + + +operandType.debugType = Hata ay\u0131klama t\u00fcr\u00fc +operandType.debugType.description = Hata ay\u0131klama bilgileri t\u00fcr\u00fc. \u015eu anda yaln\u0131zca 1 de\u011feri kullan\u0131l\u0131r. +operandType.debugType.name = debugType +operandType.debugType.uiName = debugType + + +operandType.registerIndex = Kay\u0131t endeksi +operandType.registerIndex.description = Yerel bir kay\u0131t endeksi (0-255) +operandType.registerIndex.name = registerIndex +operandType.registerIndex.uiName = uint + +operandType.linenum = Sat\u0131r numaras\u0131 +operandType.linenum.description = Dosya sat\u0131r\u0131 numaras\u0131 +operandType.linenum.name = sat\u0131r numaras\u0131 +operandType.linenum.uiName = sat\u0131r numaras\u0131 + + +#similar as registerIndex, but U30 instead of U8 +operandType.localRegIndex = Kay\u0131t dizini +operandType.localRegIndex.description = Yerel bir kay\u0131t dizini +operandType.localRegIndex.name = localRegIndex +operandType.localRegIndex.uiName = uint + + +operandType.slotIndex = Yuva endeksi +operandType.slotIndex.description = Nesnenin \u00fczerindeki yuvan\u0131n dizini +operandType.slotIndex.name = slotIndex +operandType.slotIndex.uiName = slotIndex + +operandType.scopeIndex = Kapsam y\u0131\u011f\u0131n dizini +operandType.scopeIndex.description = Kapsam y\u0131\u011f\u0131ndaki dizin +operandType.scopeIndex.name = scopeIndex +operandType.scopeIndex.uiName = scopeIndex + +operandType.offset = Uzakl\u0131k +operandType.offset.description = Di\u011fer konuma uzakl\u0131k +operandType.offset.name = uzakl\u0131k +operandType.offset.uiName = labelName + +operandType.exceptionIndex = \u00d6zel durum dizini +operandType.exceptionIndex.description = Ge\u00e7erli y\u00f6ntem bilgisindeki istisna dizini +operandType.exceptionIndex.name = exceptionIndex +operandType.exceptionIndex.uiName = exceptionIndex + + +operandType.classIndex = S\u0131n\u0131f endeksi +operandType.classIndex.description = ABC s\u0131n\u0131f dizini +operandType.classIndex.name = classIndex +operandType.classIndex.uiName = classIndex + +operandType.intIndex = \u0130nt dizini +operandType.intIndex.description = Tamsay\u0131 de\u011ferlerine sabit havuz dizini +operandType.intIndex.name = intIndex +operandType.intIndex.uiName = int + +operandType.uintIndex = UInt dizini +operandType.uintIndex.description = \u0130mzas\u0131z tamsay\u0131 de\u011ferleri sabit havuz dizini +operandType.uintIndex.name = uintIndex +operandType.uintIndex.uiName = uint + + +operandType.doubleIndex = \u00c7ift dizin +operandType.doubleIndex.description = \u00c7ift duyarl\u0131 kayan nokta de\u011ferlerine sabit havuz dizini +operandType.doubleIndex.name = doubleIndex +operandType.doubleIndex.uiName = \u00e7ift + +operandType.decimalIndex = Ondal\u0131k indeks +operandType.decimalIndex.description = Ondal\u0131k de\u011ferlere sabit havuz dizini (128 bit kayan nokta) +operandType.decimalIndex.name = decimalIndex +operandType.decimalIndex.uiName = ondal\u0131k + +operandType.caseBaseoffset = Temel ofset +operandType.caseBaseoffset.description = Hi\u00e7bir de\u011fer e\u015fle\u015fmedi\u011finde tetiklenen arama anahtar\u0131n\u0131n taban ofseti +operandType.caseBaseoffset.name = ofset +operandType.caseBaseoffset.uiName = labelName + +operandType.numberContext = Say\u0131 ba\u011flam\u0131 (ES4) +operandType.numberContext.description = Context of calculations when using EcmaScript 4 numerics (ABC minorVersion 17).\nBits 0-2 type,3-5 rounding type, 6-12 precision.\nType: 0=number,1=decimal,2=double,3=int,4=uint\nRounding: 0=ceiling,1=up,2=half_up,3=half_even,4=half_down,5=down,6=floor\nPrecision:0-34 +operandType.numberContext.name = numberContext +operandType.numberContext.uiName = uint + +operandType.dispatchId = G\u00f6nderim kimli\u011fi +operandType.dispatchId.description = Metod g\u00f6ndericisinin kimli\u011fi +operandType.dispatchId.name = dispatchId +operandType.dispatchId.uiName = uint + +operandType.floatIndex = Yayma dizini +operandType.floatIndex.description = Yayma de\u011ferleri sabit havuz dizini +operandType.floatIndex.name = floatIndex +operandType.floatIndex.uiName = yayma + +operandType.float4Index = Float4 dizini +operandType.float4Index.description = Float4 de\u011ferlerine sabit havuzdaki dizin +operandType.float4Index.name = float4Index +operandType.float4Index.uiName = float4 + +operandType.namespaceIndex = \u0130simlik dizini +operandType.namespaceIndex = Ad alan\u0131 sabit havuz dizini +operandType.namespaceIndex.name = namespaceIndex +operandType.namespaceIndex.uiName = isim + + +#----------------------- Instructions + +instruction.bkpt.shortDescription = Kesme noktas\u0131 +instruction.bkpt.description = Hata ay\u0131klama s\u0131ras\u0131nda kesme noktas\u0131 +instruction.bkpt.stackBefore = +instruction.bkpt.stackAfter = +instruction.bkpt.operands = + +instruction.nop.shortDescription = \u0130\u015flem yok +instruction.nop.description = Hi\u00e7 bir\u015fey yapm\u0131yor +instruction.nop.stackBefore = +instruction.nop.stackAfter = +instruction.nop.operands = + +instruction.throw.shortDescription = \u0130stisna atmak +instruction.throw.description = Pops de\u011feri y\u0131\u011f\u0131n kapal\u0131 ve atar +instruction.throw.stackBefore = de\u011fer +instruction.throw.stackAfter = +instruction.throw.operands = + +instruction.getsuper.shortDescription = \u00dcst s\u0131n\u0131f m\u00fclk\u00fcn\u00fc al\u0131n +instruction.getsuper.description = +instruction.getsuper.stackBefore = obj, [ns], [isim] +instruction.getsuper.stackAfter = de\u011fer +instruction.getsuper.operands = parentClassMultiname + +instruction.setsuper.shortDescription = \u00dcst s\u0131n\u0131f m\u00fclk\u00fcn\u00fc ayarla +instruction.setsuper.description = +instruction.setsuper.stackBefore = obj, [ns], [isim], de\u011fer +instruction.setsuper.stackAfter = +instruction.setsuper.operands = parentClassMultiname + +instruction.dxns.shortDescription = Varsay\u0131lan XML ad alan\u0131n\u0131 ayarla +instruction.dxns.description = +instruction.dxns.stackBefore = +instruction.dxns.stackAfter = +instruction.dxns.operands = uriString + +instruction.dxnslate.shortDescription = Varsay\u0131lan XML ad alan\u0131n\u0131 \u00e7al\u0131\u015fma zaman\u0131nda ayarla +instruction.dxnslate.description = +instruction.dxnslate.stackBefore = uriValue +instruction.dxnslate.stackAfter = +instruction.dxnslate.operands = + +instruction.kill.shortDescription = Yerel kayd\u0131 \u00f6ld\u00fcr +instruction.kill.description = +instruction.kill.stackBefore = +instruction.kill.stackAfter = +instruction.kill.operands = killedRegister + +instruction.label.shortDescription = Bir \u015fubenin hedefi +instruction.label.description = Bu, takip eden \u015fubenin hedefi sadece bir i\u015faret +instruction.label.stackBefore = +instruction.label.stackAfter = +instruction.label.operands = + +instruction.lf32x4.shortDescription = 32 baytl\u0131k float4 y\u00fckle +instruction.lf32x4.description = +instruction.lf32x4.stackBefore = adres +instruction.lf32x4.stackAfter = float4Value +instruction.lf32x4.operands = + +instruction.sf32x4.shortDescription = Ma\u011faza 32 bit float4 +instruction.sf32x4.description = +instruction.sf32x4.stackBefore = float4Value, adres +instruction.sf32x4.stackAfter = +instruction.sf32x4.operands = + +instruction.ifnlt.shortDescription = \u015eube a\u015fa\u011f\u0131da de\u011filse +instruction.ifnlt.description = +instruction.ifnlt.stackBefore = deger1, de\u011fer2 +instruction.ifnlt.stackAfter = +instruction.ifnlt.operands = branchTarget + +instruction.ifnle.shortDescription = Daha d\u00fc\u015f\u00fck veya e\u015fit de\u011filse \u015fube +instruction.ifnle.description = +instruction.ifnle.stackBefore = deger1, de\u011fer2 +instruction.ifnle.stackAfter = +instruction.ifnle.operands = branchTarget + +instruction.ifngt.shortDescription = \u015eube daha b\u00fcy\u00fck de\u011filse +instruction.ifngt.description = +instruction.ifngt.stackBefore = deger1, de\u011fer2 +instruction.ifngt.stackAfter = +instruction.ifngt.operands = branchTarget + +instruction.ifnge.shortDescription = \u015eube b\u00fcy\u00fck de\u011filse e\u015fit +instruction.ifnge.description = +instruction.ifnge.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifnge.stackAfter = +instruction.ifnge.operands = branchTarget + +instruction.jump.shortDescription = Konuma atla +instruction.jump.description = +instruction.jump.stackBefore = +instruction.jump.stackAfter = +instruction.jump.operands = konum + +instruction.iftrue.shortDescription = \u015eube do\u011fruysa +instruction.iftrue.description = +instruction.iftrue.stackBefore = de\u011fer +instruction.iftrue.stackAfter = +instruction.iftrue.operands = branchTarget + +instruction.iffalse.shortDescription = \u015eube sahte +instruction.iffalse.description = +instruction.iffalse.stackBefore = de\u011fer +instruction.iffalse.stackAfter = +instruction.iffalse.operands = branchTarget + +instruction.ifeq.shortDescription = \u015eube e\u015fitse +instruction.ifeq.description = +instruction.ifeq.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifeq.stackAfter = +instruction.ifeq.operands = branchTarget + +instruction.ifne.shortDescription = \u015eube e\u015fit de\u011filse +instruction.ifne.description = +instruction.ifne.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifne.stackAfter = +instruction.ifne.operands = branchTarget + +instruction.iflt.shortDescription = \u015eube alt\u0131ndaysa +instruction.iflt.description = +instruction.iflt.stackBefore = de\u011fer1, de\u011fer2 +instruction.iflt.stackAfter = +instruction.iflt.operands = branchTarget + +instruction.ifle.shortDescription = \u015eube daha d\u00fc\u015f\u00fck veya e\u015fitse +instruction.ifle.description = +instruction.ifle.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifle.stackAfter = +instruction.ifle.operands = branchTarget + +instruction.ifgt.shortDescription = \u015eube e\u011fer b\u00fcy\u00fckse +instruction.ifgt.description = +instruction.ifgt.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifgt.stackAfter = +instruction.ifgt.operands = branchTarget + +instruction.ifge.shortDescription = \u015eube e\u011fer b\u00fcy\u00fck veya e\u015fitse +instruction.ifge.description = +instruction.ifge.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifge.stackAfter = +instruction.ifge.operands = branchTarget + +instruction.ifstricteq.shortDescription = \u015eube s\u0131k\u0131 e\u015fitse +instruction.ifstricteq.description = +instruction.ifstricteq.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifstricteq.stackAfter = +instruction.ifstricteq.operands = branchTarget + +instruction.ifstrictne.shortDescription = \u015eube e\u015fit de\u011filse +instruction.ifstrictne.description = +instruction.ifstrictne.stackBefore = de\u011fer1, de\u011fer2 +instruction.ifstrictne.stackAfter = +instruction.ifstrictne.operands = branchTarget + +instruction.lookupswitch.shortDescription = \u015eube baz\u0131nda dizin +instruction.lookupswitch.description = +instruction.lookupswitch.stackBefore = dizin +instruction.lookupswitch.stackAfter = +instruction.lookupswitch.operands = defaultTarget, caseCount, case0Target, case1Target, ... + +instruction.pushwith.shortDescription = Kapsam y\u0131\u011f\u0131n\u0131 \u00fczerine itin +instruction.pushwith.description = +instruction.pushwith.stackBefore = withScope +instruction.pushwith.stackAfter = +instruction.pushwith.operands = + +instruction.popscope.shortDescription = Kapsam y\u0131\u011f\u0131n\u0131ndan pop ve de\u011feri sil +instruction.popscope.description = +instruction.popscope.stackBefore = +instruction.popscope.stackAfter = +instruction.popscope.operands = + +instruction.nextname.shortDescription = Bir sonraki m\u00fclk\u00fcn ismini \u00f6\u011frenin +instruction.nextname.description = +instruction.nextname.stackBefore = obj, dizin +instruction.nextname.stackAfter = isim +instruction.nextname.operands = + +instruction.hasnext.shortDescription = Nesnenin daha fazla \u00f6zelli\u011fi var m\u0131 kontrol edin +instruction.hasnext.description = +instruction.hasnext.stackBefore = obj, currentIndex +instruction.hasnext.stackAfter = nextIndex +instruction.hasnext.operands = + +instruction.pushnull.shortDescription = \u0130ste\u011fe ba\u011fl\u0131 bo\u015f de\u011feri it +instruction.pushnull.description = +instruction.pushnull.stackBefore = +instruction.pushnull.stackAfter = bo\u015f +instruction.pushnull.operands = + +instruction.pushundefined.shortDescription = Tan\u0131ms\u0131z de\u011feri y\u0131\u011f\u0131na it +instruction.pushundefined.description = +instruction.pushundefined.stackBefore = +instruction.pushundefined.stackAfter = tan\u0131ms\u0131z +instruction.pushundefined.operands = + +instruction.pushfloat.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde yayma de\u011ferini it +instruction.pushfloat.description = +instruction.pushfloat.stackBefore = +instruction.pushfloat.stackAfter = floatValue +instruction.pushfloat.operands = yayma + +instruction.nextvalue.shortDescription = Bir sonraki m\u00fclk\u00fcn de\u011ferini al +instruction.nextvalue.description = +instruction.nextvalue.stackBefore = obj, index +instruction.nextvalue.stackAfter = de\u011fer +instruction.nextvalue.operands = + +instruction.pushbyte.shortDescription = Y\u0131\u011f\u0131n de\u011ferini y\u0131\u011f\u0131na it +instruction.pushbyte.description = +instruction.pushbyte.stackBefore = +instruction.pushbyte.stackAfter = byteValue +instruction.pushbyte.operands = de\u011fer + +instruction.pushshort.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde k\u0131sa de\u011feri it +instruction.pushshort.description = +instruction.pushshort.stackBefore = +instruction.pushshort.stackAfter = shortValue +instruction.pushshort.operands = de\u011fer + +instruction.pushtrue.shortDescription = Y\u0131\u011f\u0131nda do\u011fru itin +instruction.pushtrue.description = +instruction.pushtrue.stackBefore = +instruction.pushtrue.stackAfter = do\u011fru +instruction.pushtrue.operands = + +instruction.pushfalse.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde yanl\u0131\u015f itme +instruction.pushfalse.description = +instruction.pushfalse.stackBefore = +instruction.pushfalse.stackAfter = yanl\u0131\u015f +instruction.pushfalse.operands = + +instruction.pushnan.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde NaN de\u011ferini itin +instruction.pushnan.description = +instruction.pushnan.stackBefore = +instruction.pushnan.stackAfter = NaN +instruction.pushnan.operands = + +instruction.pop.shortDescription = Y\u0131\u011f\u0131ndan en \u00fcst de\u011feri +instruction.pop.description = +instruction.pop.stackBefore = de\u011fer +instruction.pop.stackAfter = +instruction.pop.operands = + +instruction.dup.shortDescription = Y\u0131\u011f\u0131n\u0131 y\u0131\u011f\u0131n \u00fczerinde \u00e7o\u011falt +instruction.dup.description = +instruction.dup.stackBefore = de\u011fer +instruction.dup.stackAfter = de\u011fer, de\u011fer +instruction.dup.operands = + +instruction.swap.shortDescription = Y\u0131\u011f\u0131n \u00fcst\u00fcnde iki de\u011fer de\u011fi\u015ftir +instruction.swap.description = +instruction.swap.stackBefore = de\u011fer1, de\u011fer2 +instruction.swap.stackAfter = de\u011fer2, de\u011fer1 +instruction.swap.operands = + +instruction.pushstring.shortDescription = Dize de\u011ferini y\u0131\u011f\u0131na it +instruction.pushstring.description = +instruction.pushstring.stackBefore = +instruction.pushstring.stackAfter = stringValue +instruction.pushstring.operands = de\u011fer + +instruction.pushint.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde tam say\u0131 de\u011ferini itin +instruction.pushint.description = +instruction.pushint.stackBefore = +instruction.pushint.stackAfter = intValue +instruction.pushint.operands = de\u011fer + +instruction.pushuint.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde i\u015faretsiz tamsay\u0131 de\u011ferini itin +instruction.pushuint.description = +instruction.pushuint.stackBefore = +instruction.pushuint.stackAfter = uintValue +instruction.pushuint.operands = de\u011fer + +instruction.pushdouble.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde \u00e7ift duyarl\u0131kl\u0131 de\u011feri bast\u0131r +instruction.pushdouble.description = +instruction.pushdouble.stackBefore = +instruction.pushdouble.stackAfter = doubleValue +instruction.pushdouble.operands = de\u011fer + +instruction.pushscope.shortDescription = Nesneyi kapsam y\u0131\u011f\u0131n\u0131 \u00fczerine it +instruction.pushscope.description = +instruction.pushscope.stackBefore = obj +instruction.pushscope.stackAfter = +instruction.pushscope.operands = + +instruction.pushnamespace.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde ad alan\u0131 it +instruction.pushnamespace.description = +instruction.pushnamespace.stackBefore = +instruction.pushnamespace.stackAfter = ad alan\u0131 +instruction.pushnamespace.operands = de\u011fer + +instruction.hasnext2.shortDescription = Nesnenin daha fazla \u00f6zelli\u011fi var m\u0131 kontrol edin (kay\u0131t baz\u0131nda) +instruction.hasnext2.description = +instruction.hasnext2.stackBefore = +instruction.hasnext2.stackAfter = boolValue +instruction.hasnext2.operands = objectReg, indexReg + +instruction.pushdecimal.shortDescription = \u0130stifte ondal\u0131k de\u011feri itin +instruction.pushdecimal.description = +instruction.pushdecimal.stackBefore = +instruction.pushdecimal.stackAfter = decimalValue +instruction.pushdecimal.operands = de\u011fer + +#Undocumented: +instruction.pushdnan.shortDescription = \u0130stifte ondal\u0131k NaN de\u011ferini itin +instruction.pushdnan.description = +#instruction.pushdnan.stackBefore = +#instruction.pushdnan.stackAfter = +instruction.pushdnan.operands = + +instruction.li8.shortDescription = 8 bayt tam say\u0131 de\u011feri y\u00fckle +instruction.li8.description = +instruction.li8.stackBefore = adres +instruction.li8.stackAfter = int8Value +instruction.li8.operands = + +instruction.li16.shortDescription = 16 bayt tam say\u0131 de\u011feri y\u00fckle +instruction.li16.description = +instruction.li16.stackBefore = adres +instruction.li16.stackAfter = int16Value +instruction.li16.operands = + +instruction.li32.shortDescription = 32 bayt tam say\u0131 de\u011feri y\u00fckle +instruction.li32.description = +instruction.li32.stackBefore = adres +instruction.li32.stackAfter = int32Value +instruction.li32.operands = + +instruction.lf32.shortDescription = 32 baytl\u0131k y\u00fczen de\u011feri y\u00fckle +instruction.lf32.description = +instruction.lf32.stackBefore = adres +instruction.lf32.stackAfter = float32Value +instruction.lf32.operands = + +instruction.lf64.shortDescription = 64 baytl\u0131k y\u00fczen de\u011feri y\u00fckle +instruction.lf64.description = +instruction.lf64.stackBefore = adres +instruction.lf64.stackAfter = float64Value +instruction.lf64.operands = + +instruction.si8.shortDescription = 8 bayt tam say\u0131 de\u011ferini sakla +instruction.si8.description = +instruction.si8.stackBefore = de\u011fer, adres +instruction.si8.stackAfter = +instruction.si8.operands = + +instruction.si16.shortDescription = 16 bayt tam say\u0131 de\u011ferini sakla +instruction.si16.description = +instruction.si16.stackBefore = de\u011fer, adres +instruction.si16.stackAfter = +instruction.si16.operands = + +instruction.si32.shortDescription = 32 bayt tam say\u0131 de\u011ferini sakla +instruction.si32.description = +instruction.si32.stackBefore = de\u011fer, adres +instruction.si32.stackAfter = +instruction.si32.operands = + +instruction.sf32.shortDescription = 32 baytl\u0131k y\u00fczen de\u011feri sakla +instruction.sf32.description = +instruction.sf32.stackBefore = de\u011fer, adres +instruction.sf32.stackAfter = +instruction.sf32.operands = + +instruction.sf64.shortDescription = 64 bitlik y\u00fczen de\u011feri sakla +instruction.sf64.description = +instruction.sf64.stackBefore = de\u011fer, adres +instruction.sf64.stackAfter = +instruction.sf64.operands = + +instruction.newfunction.shortDescription = Yeni i\u015flev nesnesi olu\u015ftur +instruction.newfunction.description = +instruction.newfunction.stackBefore = +instruction.newfunction.stackAfter = i\u015flev +instruction.newfunction.operands = y\u00f6ntem + +instruction.call.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde \u00e7a\u011fr\u0131 i\u015flevi +instruction.call.description = +instruction.call.stackBefore = i\u015flev, bu, arg1, ..., argN +instruction.call.stackAfter = de\u011fer +instruction.call.operands = argCount + +instruction.construct.shortDescription = Y\u0131\u011f\u0131n \u00fczerinde kurucu i\u015flevini \u00e7a\u011f\u0131r +instruction.construct.description = +instruction.construct.stackBefore = i\u015flev, arg1, ..., argN +instruction.construct.stackAfter = de\u011fer +instruction.construct.operands = argCount + +instruction.callmethod.shortDescription = Nesnenin metodunu g\u00f6nderim kimli\u011fi ile \u00e7a\u011f\u0131r +instruction.callmethod.description = +instruction.callmethod.stackBefore = bu, arg1, ..., argN +instruction.callmethod.stackAfter = de\u011fer +instruction.callmethod.operands = method, argCount + +instruction.callstatic.shortDescription = ABC dosyas\u0131ndaki y\u00f6ntem kimli\u011fi taraf\u0131ndan \u00e7a\u011fr\u0131 y\u00f6ntemi +instruction.callstatic.description = +instruction.callstatic.stackBefore = bu, arg1, ..., argN +instruction.callstatic.stackAfter = de\u011fer +instruction.callstatic.operands = y\u00f6ntem, argCount + +instruction.callsuper.shortDescription = \u00dcst s\u0131n\u0131fta \u00e7a\u011fr\u0131 y\u00f6ntemi +instruction.callsuper.description = +instruction.callsuper.stackBefore = obj, [ns], [isim], arg1, ..., argN +instruction.callsuper.stackAfter = de\u011fer +instruction.callsuper.operands = methodName, argCount + +instruction.callproperty.shortDescription = Arama \u00f6zelli\u011fi +instruction.callproperty.description = +instruction.callproperty.stackBefore = obj, [ns], [isim], arg1, ..., argN +instruction.callproperty.stackAfter = de\u011fer +instruction.callproperty.operands = \u00f6zellik, argCount + +instruction.returnvoid.shortDescription = Bir y\u00f6ntemden d\u00f6nmek +instruction.returnvoid.description = +instruction.returnvoid.stackBefore = +instruction.returnvoid.stackAfter = +instruction.returnvoid.operands = + +instruction.returnvalue.shortDescription = Bir y\u00f6ntemin d\u00f6n\u00fc\u015f de\u011feri +instruction.returnvalue.description = +instruction.returnvalue.stackBefore = de\u011fer +instruction.returnvalue.stackAfter = +instruction.returnvalue.operands = + +instruction.constructsuper.shortDescription = Bir nesnenin \u00fcst yap\u0131c\u0131 \u00e7a\u011fr\u0131s\u0131 +instruction.constructsuper.description = +instruction.constructsuper.stackBefore = obj, arg1, ..., argN +instruction.constructsuper.stackAfter = +instruction.constructsuper.operands = argCount + +instruction.constructprop.shortDescription = Nesnenin \u00f6zelliklerini olu\u015ftur +instruction.constructprop.description = +instruction.constructprop.stackBefore = obj, [ns], [name], arg1, ..., argN +instruction.constructprop.stackAfter = de\u011fer +instruction.constructprop.operands = \u00f6zellik, argCount + +#Undocumented: +instruction.callsuperid.shortDescription = S\u00fcper kimli\u011fi ara +instruction.callsuperid.description = +#instruction.callsuperid.stackBefore = +#instruction.callsuperid.stackAfter = +#instruction.callsuperid.operands = + +instruction.callproplex.shortDescription = Bu \u00f6zelli\u011fi bo\u015f olarak \u00e7a\u011f\u0131r\u0131n +instruction.callproplex.description = +instruction.callproplex.stackBefore = obj, [ns], [name], arg1, ..., argN +instruction.callproplex.stackAfter = de\u011fer +instruction.callproplex.operands = \u00f6zellik, argCount + +#Undocumented: +instruction.callinterface.shortDescription = Arama arabirimi +instruction.callinterface.description = +#instruction.callinterface.stackBefore = +#instruction.callinterface.stackAfter = +instruction.callinterface.operands = aray\u00fczey, argCount + + +instruction.callsupervoid.shortDescription = \u00dcst s\u0131n\u0131f\u0131n y\u00f6ntemini \u00e7a\u011f\u0131r\u0131n, d\u00f6n\u00fc\u015f de\u011ferini at\u0131n +instruction.callsupervoid.description = +instruction.callsupervoid.stackBefore = obj, [ns], [name], arg1, ..., argN +instruction.callsupervoid.stackAfter = +instruction.callsupervoid.operands = methodName, argCount + + +instruction.callpropvoid.shortDescription = Arama \u00f6zelli\u011fi, d\u00f6n\u00fc\u015f de\u011feri at\u0131n +instruction.callpropvoid.description = +instruction.callpropvoid.stackBefore = obj, [ns], [name], arg1, ..., argN +instruction.callpropvoid.stackAfter = +instruction.callpropvoid.operands = \u00f6zellik, argCount + +instruction.sxi1.shortDescription = \u0130\u015faret 1 bayt de\u011feri 32 bayt'e kadar uzat +instruction.sxi1.description = +instruction.sxi1.stackBefore = de\u011fer +instruction.sxi1.stackAfter = valueExtended +instruction.sxi1.operands = + +instruction.sxi8.shortDescription = \u0130\u015faret, 8 bitlik de\u011feri 32 bit'e \u00e7\u0131kar\u0131r +instruction.sxi8.description = +instruction.sxi8.stackBefore = de\u011fer +instruction.sxi8.stackAfter = valueExtended +instruction.sxi8.operands = + +instruction.sxi16.shortDescription = \u0130\u015faret 16 bayt de\u011ferini 32 bayt'e \u00e7\u0131kartt\u0131 +instruction.sxi16.description = +instruction.sxi16.stackBefore = de\u011fer +instruction.sxi16.stackAfter = valueExtended +instruction.sxi16.operands = + +instruction.applytype.shortDescription = T\u00fcr parametrelerini uygula +instruction.applytype.description = Temel t\u00fcr\u00fcne parametre tipleri uygulay\u0131n. \u00d6rne\u011fin, Vector \u00e7al\u0131\u015fma zaman\u0131nda \u00e7\u00f6z\u00fcmlendi\u011finde. Dize parametredir, Vekt\u00f6r temel s\u0131n\u0131ft\u0131r. +instruction.applytype.stackBefore = baseType, typeParam1, ..., typeParamN +instruction.applytype.stackAfter = baseType +instruction.applytype.operands = typeParamCount + +instruction.pushfloat4.shortDescription = Y\u0131\u011f\u0131ndaki float4 de\u011ferini itin +instruction.pushfloat4.description = +instruction.pushfloat4.stackBefore = +instruction.pushfloat4.stackAfter = float4Value +instruction.pushfloat4.operands = float4 + +instruction.newobject.shortDescription = Yeni nesne olu\u015fturur +instruction.newobject.description = +instruction.newobject.stackBefore = name1, de\u011fer1, ad2, de\u011fer2, ..., adN, de\u011ferN +instruction.newobject.stackAfter = newObject +instruction.newobject.operands = propertyCount + +instruction.newarray.shortDescription = Yeni dizi olu\u015fturur +instruction.newarray.description = +instruction.newarray.stackBefore = de\u011fer1, de\u011fer2, ..., de\u011ferN +instruction.newarray.stackAfter = newArray +instruction.newarray.operands = valueCount + +instruction.newactivation.shortDescription = Yeni etkinle\u015ftirme nesnesi olu\u015fturur +instruction.newactivation.description = +instruction.newactivation.stackBefore = +instruction.newactivation.stackAfter = newActivation +instruction.newactivation.operands = + +instruction.newclass.shortDescription = Yeni s\u0131n\u0131f olu\u015fturur +instruction.newclass.description = +instruction.newclass.stackBefore = baseType +instruction.newclass.stackAfter = newClass +instruction.newclass.operands = s\u0131n\u0131f + +instruction.getdescendants.shortDescription = Soylar\u0131 al +instruction.getdescendants.description = +instruction.getdescendants.stackBefore = obj, [ns], [isim] +instruction.getdescendants.stackAfter = de\u011fer +instruction.getdescendants.operands = i\u015flenen1 + +instruction.newcatch.shortDescription = Yeni kapsam\u0131 yakala olu\u015ftur +instruction.newcatch.description = +instruction.newcatch.stackBefore = +instruction.newcatch.stackAfter = catchScope +instruction.newcatch.operands = istisna + +#Undocumented: +instruction.deldescendants.shortDescription = Soylar\u0131 sil +instruction.deldescendants.description = +#instruction.deldescendants.stackBefore = +#instruction.deldescendants.stackAfter = +instruction.deldescendants.operands = + +#Undocumented: +instruction.findpropglobal.shortDescription = Global kapsamda m\u00fclk arama +instruction.findpropglobal.description = +instruction.findpropglobal.stackBefore = [ns], [name] +instruction.findpropglobal.stackAfter = obj +instruction.findpropglobal.operands = \u00f6zellik + +instruction.findpropstrict.shortDescription = Kapsam y\u0131\u011f\u0131n\u0131nda arama \u00f6zelli\u011fi, bulunamad\u0131\u011f\u0131nda hata +instruction.findpropstrict.description = +instruction.findpropstrict.stackBefore = [ns], [name] +instruction.findpropstrict.stackAfter = obj +instruction.findpropstrict.operands = \u00f6zellik + +instruction.findproperty.shortDescription = Kapsam y\u0131\u011f\u0131n\u0131nda arama \u00f6zelli\u011fi, bulunamad\u0131\u011f\u0131nda \u00fcst nesne +instruction.findproperty.description = +instruction.findproperty.stackBefore = [ns], [name] +instruction.findproperty.stackAfter = obj +instruction.findproperty.operands = \u00f6zellik + +#Undocumented: +instruction.finddef.shortDescription = Komut dosyas\u0131 d\u00fczeyi tan\u0131m\u0131 ara +instruction.finddef.description = +instruction.finddef.stackBefore = [ns], [name] +instruction.finddef.stackAfter = obj +instruction.finddef.operands = \u00f6zellik + +instruction.getlex.shortDescription = M\u00fclk bulmak ve almak +instruction.getlex.description = +instruction.getlex.stackBefore = +instruction.getlex.stackAfter = obj +instruction.getlex.operands = \u00f6zellik + +instruction.setproperty.shortDescription = \u00d6zellik +instruction.setproperty.description = +instruction.setproperty.stackBefore = obj, [ns], [name], value +instruction.setproperty.stackAfter = +instruction.setproperty.operands = \u00f6zellik + +instruction.getlocal.shortDescription = Yerel kay\u0131t de\u011feri al\u0131n +instruction.getlocal.description = +instruction.getlocal.stackBefore = +instruction.getlocal.stackAfter = de\u011fer +instruction.getlocal.operands = localRegIndex + +instruction.setlocal.shortDescription = Yerel kay\u0131t de\u011ferini ayarla +instruction.setlocal.description = +instruction.setlocal.stackBefore = de\u011fer +instruction.setlocal.stackAfter = +instruction.setlocal.operands = localRegIndex + +instruction.getglobalscope.shortDescription = K\u00fcresel kapsam\u0131 getir +instruction.getglobalscope.description = +instruction.getglobalscope.stackBefore = +instruction.getglobalscope.stackAfter = obj +instruction.getglobalscope.operands = + +instruction.getscopeobject.shortDescription = Kapsam nesnesi al +instruction.getscopeobject.description = +instruction.getscopeobject.stackBefore = +instruction.getscopeobject.stackAfter = obj +instruction.getscopeobject.operands = scopeIndex + +instruction.getproperty.shortDescription = M\u00fclk edin +instruction.getproperty.description = +instruction.getproperty.stackBefore = obj, [ns], [name] +instruction.getproperty.stackAfter = de\u011fer +instruction.getproperty.operands = \u00f6zellik + +instruction.getouterscope.shortDescription = T\u00fcm d\u00fczeylerde kapsam nesnesi al\u0131n +instruction.getouterscope.description = +instruction.getouterscope.stackBefore = +instruction.getouterscope.stackAfter = obj +instruction.getouterscope.operands = allLevelScopeIndex + +instruction.initproperty.shortDescription = M\u00fclk ba\u015flat +instruction.initproperty.description = +instruction.initproperty.stackBefore = obj, [ns], [isim], de\u011fer +instruction.initproperty.stackAfter = +instruction.initproperty.operands = \u00f6zellik + +#Undocumented: +instruction.setpropertylate.shortDescription = Set \u00f6zelli\u011fi (y\u0131\u011f\u0131n\u0131 temel al\u0131r) +instruction.setpropertylate.description = +#instruction.setpropertylate.stackBefore = +#instruction.setpropertylate.stackAfter = +#instruction.setpropertylate.operands = + +instruction.deleteproperty.shortDescription = M\u00fclk\u00fc sil +instruction.deleteproperty.description = +instruction.deleteproperty.stackBefore = obj, [ns], [isim] +instruction.deleteproperty.stackAfter = boolResult +instruction.deleteproperty.operands = \u00f6zellik + +#Undocumented: +instruction.deletepropertylate.shortDescription = M\u00fclk\u00fc sil (y\u0131\u011f\u0131n\u0131 temel al\u0131r) +instruction.deletepropertylate.description = +#instruction.deletepropertylate.stackBefore = +#instruction.deletepropertylate.stackAfter = +instruction.deletepropertylate.operands = + +instruction.getslot.shortDescription = Bir alan\u0131n de\u011ferini al +instruction.getslot.description = +instruction.getslot.stackBefore = obj +instruction.getslot.stackAfter = de\u011fer +instruction.getslot.operands = slotIndex + +instruction.setslot.shortDescription = Bir yuvan\u0131n de\u011ferini ayarla +instruction.setslot.description = +instruction.setslot.stackBefore = obj, de\u011fer +instruction.setslot.stackAfter = +instruction.setslot.operands = slotIndex + +instruction.getglobalslot.shortDescription = Genel kapsamdaki alan\u0131n de\u011ferini al +instruction.getglobalslot.description = +instruction.getglobalslot.stackBefore = +instruction.getglobalslot.stackAfter = de\u011fer +instruction.getglobalslot.operands = slotIndex + +instruction.setglobalslot.shortDescription = Yuvan\u0131n global kapsamdaki de\u011ferini ayarlay\u0131n +instruction.setglobalslot.description = +instruction.setglobalslot.stackBefore = de\u011fer +instruction.setglobalslot.stackAfter = +instruction.setglobalslot.operands = slotIndex + +instruction.convert_s.shortDescription = De\u011feri dizede d\u00f6n\u00fc\u015ft\u00fcr +instruction.convert_s.description = +instruction.convert_s.stackBefore = de\u011fer +instruction.convert_s.stackAfter = stringValue +instruction.convert_s.operands = + +instruction.esc_xelem.shortDescription = XML \u00f6\u011fesi \u00e7\u0131k\u0131\u015f +instruction.esc_xelem.description = +instruction.esc_xelem.stackBefore = de\u011fer +instruction.esc_xelem.stackAfter = stringValue +instruction.esc_xelem.operands = + +instruction.esc_xattr.shortDescription = XML \u00f6zniteli\u011fini \u00e7\u0131k\u0131\u015f +instruction.esc_xattr.description = +instruction.esc_xattr.stackBefore = de\u011fer +instruction.esc_xattr.stackAfter = stringValue +instruction.esc_xattr.operands = + +instruction.convert_i.shortDescription = De\u011feri tamsay\u0131ya \u00e7evir +instruction.convert_i.description = +instruction.convert_i.stackBefore = de\u011fer +instruction.convert_i.stackAfter = intValue +instruction.convert_i.operands = + +instruction.convert_u.shortDescription = De\u011feri i\u015faretsiz tamsay\u0131ya \u00e7evir +instruction.convert_u.description = +instruction.convert_u.stackBefore = de\u011fer +instruction.convert_u.stackAfter = uintValue +instruction.convert_u.operands = + +instruction.convert_d.shortDescription = De\u011feri \u00e7ift olarak d\u00f6n\u00fc\u015ft\u00fcr +instruction.convert_d.description = +instruction.convert_d.stackBefore = de\u011fer +instruction.convert_d.stackAfter = doubleValue +instruction.convert_d.operands = + +instruction.convert_b.shortDescription = De\u011feri boole de\u011ferine \u00e7evir +instruction.convert_b.description = +instruction.convert_b.stackBefore = de\u011fer +instruction.convert_b.stackAfter = booleanValue +instruction.convert_b.operands = + +instruction.convert_o.shortDescription = De\u011feri nesneye d\u00f6n\u00fc\u015ft\u00fcr +instruction.convert_o.description = +instruction.convert_o.stackBefore = de\u011fer +instruction.convert_o.stackAfter = de\u011fer +instruction.convert_o.operands = + +instruction.checkfilter.shortDescription = Nesnenin filtre i\u015flemine tabi olabilece\u011fini kontrol edin +instruction.checkfilter.description = +instruction.checkfilter.stackBefore = de\u011fer +instruction.checkfilter.stackAfter = de\u011fer +instruction.checkfilter.operands = + +instruction.convert_m.shortDescription = De\u011feri ondal\u0131k say\u0131ya \u00e7evir +instruction.convert_m.description = +instruction.convert_m.stackBefore = de\u011fer +instruction.convert_m.stackAfter = decimalValue +instruction.convert_m.operands = + +instruction.convert_m_p.shortDescription = Say\u0131 ba\u011flam\u0131yla ondal\u0131k de\u011fere d\u00f6n\u00fc\u015ft\u00fcrme +instruction.convert_m_p.description = +instruction.convert_m_p.stackBefore = de\u011fer +instruction.convert_m_p.stackAfter = decimalValue +instruction.convert_m_p.operands = numberContext + +instruction.convert_f.shortDescription = De\u011feri float'a d\u00f6n\u00fc\u015ft\u00fcr +instruction.convert_f.description = +instruction.convert_f.stackBefore = de\u011fer +instruction.convert_f.stackAfter = floatValue +instruction.convert_f.operands = + +instruction.convert_f4.shortDescription = De\u011feri float4'e d\u00f6n\u00fc\u015ft\u00fcr +instruction.convert_f4.description = +instruction.convert_f4.stackBefore = de\u011fer +instruction.convert_f4.stackAfter = float4Value +instruction.convert_f4.operands = + +instruction.coerce.shortDescription = Belirtilen t\u00fcre \u00e7arpma de\u011feri +instruction.coerce.description = +instruction.coerce.stackBefore = de\u011fer +instruction.coerce.stackAfter = coercedValue +instruction.coerce.operands = tip + +instruction.coerce_b.shortDescription = Boole de\u011ferini kuvvetlendir +instruction.coerce_b.description = +instruction.coerce_b.stackBefore = de\u011fer +instruction.coerce_b.stackAfter = booleanValue +instruction.coerce_b.operands = +instruction.coerce_b.deprecated = Bunun yerine convert_b kullan\u0131n + +instruction.coerce_a.shortDescription = Her t\u00fcre kuantum de\u011feri +instruction.coerce_a.description = +instruction.coerce_a.stackBefore = de\u011fer +instruction.coerce_a.stackAfter = de\u011fer +instruction.coerce_a.operands = + +instruction.coerce_i.shortDescription = Say\u0131y\u0131 tamsay\u0131ya \u00e7arpar +instruction.coerce_i.description = +instruction.coerce_i.stackBefore = de\u011fer +instruction.coerce_i.stackAfter = intValue +instruction.coerce_i.operands = +instruction.coerce_i.deprecated = Bunun yerine convert_i kullan\u0131n + +instruction.coerce_d.shortDescription = \u00c7ift kat kuvvet de\u011feri +instruction.coerce_d.description = +instruction.coerce_d.stackBefore = de\u011fer +instruction.coerce_d.stackAfter = doubleValue +instruction.coerce_d.operands = +instruction.coerce_d.deprecated = Bunun yerine convert_d kullan\u0131n + +instruction.coerce_s.shortDescription = Dizeye kuvvet katmak +instruction.coerce_s.description = +instruction.coerce_s.stackBefore = de\u011fer +instruction.coerce_s.stackAfter = stringValue +instruction.coerce_s.operands = + +instruction.astype.shortDescription = Ayn\u0131 de\u011feri d\u00f6nd\u00fcr\u00fcr veya belirtilmemi\u015fse bo\u015f olur +instruction.astype.description = +instruction.astype.stackBefore = de\u011fer +instruction.astype.stackAfter = de\u011fer +instruction.astype.operands = tip +instruction.astypelate.shortDescription = Ayn\u0131 de\u011feri d\u00f6nd\u00fcr\u00fcr veya belirtilmemi\u015fse bo\u015f olur (y\u0131\u011f\u0131n tabanl\u0131) +instruction.astypelate.description = +instruction.astypelate.stackBefore = de\u011fer, tip +instruction.astypelate.stackAfter = de\u011fer +instruction.astypelate.operands = + +instruction.coerce_u.shortDescription = \u0130\u015faretsiz tamsay\u0131ya kuvvet de\u011feri koy +instruction.coerce_u.description = +instruction.coerce_u.stackBefore = de\u011fer +instruction.coerce_u.stackAfter = uintValue +instruction.coerce_u.operands = + +instruction.coerce_o.shortDescription = Nesne i\u00e7in de\u011feri zorla +instruction.coerce_o.description = +instruction.coerce_o.stackBefore = de\u011fer +instruction.coerce_o.stackAfter = de\u011fer +instruction.coerce_o.operands = + +instruction.negate_p.shortDescription = Say\u0131 ba\u011flam\u0131n\u0131 kullanarak de\u011feri negatifle\u015ftir +instruction.negate_p.description = +instruction.negate_p.stackBefore = de\u011fer +instruction.negate_p.stackAfter = -de\u011fer +instruction.negate_p.operands = operand1 + +instruction.negate.shortDescription = De\u011feri olumsuz +instruction.negate.description = +instruction.negate.stackBefore = de\u011fer +instruction.negate.stackAfter = -de\u011fer +instruction.negate.operands = + +instruction.increment.shortDescription = Artma de\u011feri +instruction.increment.description = +instruction.increment.stackBefore = de\u011fer +instruction.increment.stackAfter = incrementedValue +instruction.increment.operands = + +instruction.inclocal.shortDescription = Yerel kayd\u0131 art\u0131r\u0131n +instruction.inclocal.description = +instruction.inclocal.stackBefore = +instruction.inclocal.stackAfter = +instruction.inclocal.operands = localRegister + +instruction.decrement.shortDescription = Azaltma de\u011feri +instruction.decrement.description = +instruction.decrement.stackBefore = de\u011fer +instruction.decrement.stackAfter = decrementedValue +instruction.decrement.operands = + +instruction.declocal.shortDescription = Yerel kayd\u0131 d\u00fc\u015f\u00fcrmek +instruction.declocal.description = +instruction.declocal.stackBefore = +instruction.declocal.stackAfter = +instruction.declocal.operands = localRegister + +instruction.typeof.shortDescription = De\u011fer t\u00fcr\u00fcn\u00fcn ad\u0131n\u0131 \u00f6\u011frenin +instruction.typeof.description = +instruction.typeof.stackBefore = de\u011fer +instruction.typeof.stackAfter = typeName +instruction.typeof.operands = + +instruction.not.shortDescription = Boolean reddetmek +instruction.not.description = +instruction.not.stackBefore = de\u011fer +instruction.not.stackAfter = !de\u011fer +instruction.not.operands = + +instruction.bitnot.shortDescription = Bitwise olarak reddetmek +instruction.bitnot.description = +instruction.bitnot.stackBefore = de\u011fer +instruction.bitnot.stackAfter = ~de\u011fer +instruction.bitnot.operands = + +#Undocumented: +instruction.concat.shortDescription = Art arda Ekle +instruction.concat.description = +#instruction.concat.stackBefore = +#instruction.concat.stackAfter = +#instruction.concat.operands = + +#Undocumented: +instruction.add_d.shortDescription = Add_d +instruction.add_d.description = +#instruction.add_d.stackBefore = +#instruction.add_d.stackAfter = +#instruction.add_d.operands = + +instruction.increment_p.shortDescription = Say\u0131 i\u00e7eri\u011fini kullanarak art\u0131m de\u011feri +instruction.increment_p.description = +instruction.increment_p.stackBefore = de\u011fer +instruction.increment_p.stackAfter = incrementedValue +instruction.increment_p.operands = numberContext + +instruction.inclocal_p.shortDescription = Numara ba\u011flam\u0131n\u0131 kullanarak yerel kayd\u0131 artt\u0131rma +instruction.inclocal_p.description = +instruction.inclocal_p.stackBefore = +instruction.inclocal_p.stackAfter = +instruction.inclocal_p.operands = numberContext, localRegister + +instruction.decrement_p.shortDescription = Say\u0131 ba\u011flam\u0131n\u0131 kullanarak de\u011feri d\u00fc\u015f\u00fcrme +instruction.decrement_p.description = +instruction.decrement_p.stackBefore = de\u011fer +instruction.decrement_p.stackAfter = decrementedValue +instruction.decrement_p.operands = numberContext + +instruction.declocal_p.shortDescription = Numara ba\u011flam\u0131n\u0131 kullanarak yerel kayd\u0131 d\u00fc\u015f\u00fcrme +instruction.declocal_p.description = +instruction.declocal_p.stackBefore = +instruction.declocal_p.stackAfter = +instruction.declocal_p.operands = numberContext, localRegister + +instruction.add.shortDescription = \u0130ki de\u011fer ekle +instruction.add.description = +instruction.add.stackBefore = de\u011fer1, de\u011fer2 +instruction.add.stackAfter = de\u011fer3 +instruction.add.operands = + +instruction.subtract.shortDescription = \u0130ki de\u011feri \u00e7\u0131kar +instruction.subtract.description = +instruction.subtract.stackBefore = de\u011fer1, de\u011fer2 +instruction.subtract.stackAfter = de\u011fer3 +instruction.subtract.operands = + +instruction.multiply.shortDescription = \u0130ki de\u011feri \u00e7arp\u0131n +instruction.multiply.description = +instruction.multiply.stackBefore = de\u011fer1, de\u011fer2 +instruction.multiply.stackAfter = de\u011fer3 +instruction.multiply.operands = + +instruction.divide.shortDescription = \u0130ki de\u011feri b\u00f6l +instruction.divide.description = +instruction.divide.stackBefore = de\u011fer1, de\u011fer2 +instruction.divide.stackAfter = de\u011fer3 +instruction.divide.operands = + +instruction.modulo.shortDescription = Modulo iki de\u011feri b\u00f6ler +instruction.modulo.description = +instruction.modulo.stackBefore = de\u011fer1, de\u011fer2 +instruction.modulo.stackAfter = de\u011fer3 +instruction.modulo.operands = + +instruction.lshift.shortDescription = Bitsel sola kayd\u0131rma +instruction.lshift.description = +instruction.lshift.stackBefore = de\u011fer1, de\u011fer2 +instruction.lshift.stackAfter = de\u011fer3 +instruction.lshift.operands = + +instruction.rshift.shortDescription = Bitsel sa\u011fa kayd\u0131rma +instruction.rshift.description = +instruction.rshift.stackBefore = de\u011fer1, de\u011fer2 +instruction.rshift.stackAfter = de\u011fer3 +instruction.rshift.operands = + +instruction.urshift.shortDescription = Bitsel i\u015faretsiz sa\u011fa kayd\u0131rma +instruction.urshift.description = +instruction.urshift.stackBefore = de\u011fer1, de\u011fer2 +instruction.urshift.stackAfter = de\u011fer3 +instruction.urshift.operands = + +instruction.bitand.shortDescription = Bitsel ve +instruction.bitand.description = +instruction.bitand.stackBefore = de\u011fer1, de\u011fer2 +instruction.bitand.stackAfter = de\u011fer3 +instruction.bitand.operands = + +instruction.bitor.shortDescription = Bitsel veya +instruction.bitor.description = +instruction.bitor.stackBefore = de\u011fer1, de\u011fer2 +instruction.bitor.stackAfter = de\u011fer3 +instruction.bitor.operands = + +instruction.bitxor.shortDescription = Bitsel xor +instruction.bitxor.description = +instruction.bitxor.stackBefore = de\u011fer1, de\u011fer2 +instruction.bitxor.stackAfter = de\u011fer3 +instruction.bitxor.operands = + +instruction.equals.shortDescription = \u0130ki de\u011feri kar\u015f\u0131la\u015ft\u0131r\u0131n +instruction.equals.description = +instruction.equals.stackBefore = de\u011fer1, de\u011fer2 +instruction.equals.stackAfter = booleanResult +instruction.equals.operands = + +instruction.strictequals.shortDescription = S\u0131k\u0131 iki de\u011fer kar\u015f\u0131la\u015ft\u0131r +instruction.strictequals.description = +instruction.strictequals.stackBefore = de\u011fer1, de\u011fer2 +instruction.strictequals.stackAfter = booleanResult +instruction.strictequals.operands = + +instruction.lessthan.shortDescription = Bu de\u011ferin di\u011fer de\u011ferden d\u00fc\u015f\u00fck olup olmad\u0131\u011f\u0131n\u0131 kontrol edin +instruction.lessthan.description = +instruction.lessthan.stackBefore = de\u011fer1, de\u011fer2 +instruction.lessthan.stackAfter = booleanResult +instruction.lessthan.operands = + +instruction.lessequals.shortDescription = Bu de\u011ferin di\u011fer de\u011ferden daha az veya e\u015fit oldu\u011funu kontrol edin +instruction.lessequals.description = +instruction.lessequals.stackBefore = de\u011fer1, de\u011fer2 +instruction.lessequals.stackAfter = booleanResult +instruction.lessequals.operands = booleanResult + +instruction.greaterthan.shortDescription = Bu de\u011ferin di\u011fer de\u011ferden b\u00fcy\u00fck veya e\u015fit oldu\u011funu kontrol edin +instruction.greaterthan.description = +instruction.greaterthan.stackBefore = de\u011fer1, de\u011fer2 +instruction.greaterthan.stackAfter = booleanResult +instruction.greaterthan.operands = + +instruction.greaterequals.shortDescription = Bu de\u011ferin di\u011fer de\u011ferden b\u00fcy\u00fck veya e\u015fit oldu\u011funu kontrol edin +instruction.greaterequals.description = +instruction.greaterequals.stackBefore = de\u011fer1, de\u011fer2 +instruction.greaterequals.stackAfter = booleanResult +instruction.greaterequals.operands = + +instruction.instanceof.shortDescription = Nesnenin prototip zincirinde var olup olmad\u0131\u011f\u0131n\u0131 kontrol edin +instruction.instanceof.description = +instruction.instanceof.stackBefore = value, type +instruction.instanceof.stackAfter = booleanResult +instruction.instanceof.operands = + +instruction.istype.shortDescription = Nesnenin belirtilen t\u00fcrde oldu\u011funu kontrol edin +instruction.istype.description = +instruction.istype.stackBefore = de\u011fer +instruction.istype.stackAfter = booleanResult +instruction.istype.operands = tip + +instruction.istypelate.shortDescription = Nesnenin belirtilen t\u00fcrde oldu\u011funu kontrol edin (y\u0131\u011f\u0131n\u0131 temel al\u0131r) +instruction.istypelate.description = +instruction.istypelate.stackBefore = de\u011fer, tip +instruction.istypelate.stackAfter = booleanResult +instruction.istypelate.operands = + +instruction.in.shortDescription = Nesnenin m\u00fclk\u00fc adland\u0131rd\u0131\u011f\u0131n\u0131 kontrol et +instruction.in.description = +instruction.in.stackBefore = isim, obj +instruction.in.stackAfter = booleanResult +instruction.in.operands = + +instruction.add_p.shortDescription = Say\u0131 ba\u011flam\u0131n\u0131 kullanarak iki de\u011fer ekle +instruction.add_p.description = +instruction.add_p.stackBefore = de\u011fer1, de\u011fer2 +instruction.add_p.stackAfter = de\u011fer3 +instruction.add_p.operands = numberContext + +instruction.subtract_p.shortDescription = Say\u0131 ba\u011flam\u0131n\u0131 kullanarak iki de\u011feri \u00e7\u0131kar\u0131n +instruction.subtract_p.description = +instruction.subtract_p.stackBefore = de\u011fer1, de\u011fer2 +instruction.subtract_p.stackAfter = de\u011fer3 +instruction.subtract_p.operands = numberContext + +instruction.multiply_p.shortDescription = Say\u0131 ba\u011flam\u0131n\u0131 kullanarak iki de\u011feri \u00e7arp\u0131n +instruction.multiply_p.description = +instruction.multiply_p.stackBefore = de\u011fer1, de\u011fer2 +instruction.multiply_p.stackAfter = de\u011fer3 +instruction.multiply_p.operands = numberContext + +instruction.divide_p.shortDescription = Say\u0131 ba\u011flam\u0131n\u0131 kullanarak iki de\u011feri b\u00f6l +instruction.divide_p.description = +instruction.divide_p.stackBefore = de\u011fer1, de\u011fer2 +instruction.divide_p.stackAfter = de\u011fer3 +instruction.divide_p.operands = numberContext + +instruction.modulo_p.shortDescription = Mod\u00fclo, say\u0131 i\u00e7eri\u011fini kullanarak iki de\u011feri b\u00f6ler +instruction.modulo_p.description = +instruction.modulo_p.stackBefore = de\u011fer1, de\u011fer2 +instruction.modulo_p.stackAfter = de\u011fer3 +instruction.modulo_p.operands = numberContext + +instruction.increment_i.shortDescription = Tamsay\u0131 de\u011feri art\u0131\u015f\u0131 +instruction.increment_i.description = +instruction.increment_i.stackBefore = de\u011fer +instruction.increment_i.stackAfter = incrementedValue +instruction.increment_i.operands = + +instruction.decrement_i.shortDescription = D\u00fczeltme tamsay\u0131 de\u011feri +instruction.decrement_i.description = +instruction.decrement_i.stackBefore = de\u011fer +instruction.decrement_i.stackAfter = decrementedValue +instruction.decrement_i.operands = + +instruction.inclocal_i.shortDescription = Yerel kay\u0131t tamsay\u0131 de\u011ferini art\u0131rmak +instruction.inclocal_i.description = +instruction.inclocal_i.stackBefore = +instruction.inclocal_i.stackAfter = +instruction.inclocal_i.operands = localRegister + +instruction.declocal_i.shortDescription = Yerel kay\u0131t tamsay\u0131 de\u011ferinin d\u00fc\u015f\u00fcr\u00fclmesi +instruction.declocal_i.description = +instruction.declocal_i.stackBefore = +instruction.declocal_i.stackAfter = +instruction.declocal_i.operands = localRegister + +instruction.negate_i.shortDescription = Negatif tamsay\u0131 de\u011feri +instruction.negate_i.description = +instruction.negate_i.stackBefore = de\u011fer +instruction.negate_i.stackAfter = -de\u011fer +instruction.negate_i.operands = + +instruction.add_i.shortDescription = \u0130ki tamsay\u0131 de\u011feri ekle +instruction.add_i.description = +instruction.add_i.stackBefore = de\u011fer1, de\u011fer2 +instruction.add_i.stackAfter = de\u011fer3 +instruction.add_i.operands = + +instruction.subtract_i.shortDescription = \u0130ki tamsay\u0131 de\u011ferini \u00e7\u0131kar +instruction.subtract_i.description = +instruction.subtract_i.stackBefore = de\u011fer1, de\u011fer2 +instruction.subtract_i.stackAfter = de\u011fer3 +instruction.subtract_i.operands = + +instruction.multiply_i.shortDescription = \u0130ki tam say\u0131 de\u011feri \u00e7arp\u0131n +instruction.multiply_i.description = +instruction.multiply_i.stackBefore = de\u011fer1, de\u011fer2 +instruction.multiply_i.stackAfter = de\u011fer3 +instruction.multiply_i.operands = + +instruction.getlocal_0.shortDescription = Yerel kay\u0131t al\u0131n 0 +instruction.getlocal_0.description = +instruction.getlocal_0.stackBefore = +instruction.getlocal_0.stackAfter = de\u011fer +instruction.getlocal_0.operands = + +instruction.getlocal_1.shortDescription = Yerel kay\u0131t al\u0131n 1 +instruction.getlocal_1.description = +instruction.getlocal_1.stackBefore = +instruction.getlocal_1.stackAfter = de\u011fer +instruction.getlocal_1.operands = + +instruction.getlocal_2.shortDescription = Yerel kay\u0131t al\u0131n 2 +instruction.getlocal_2.description = +instruction.getlocal_2.stackBefore = +instruction.getlocal_2.stackAfter = de\u011fer +instruction.getlocal_2.operands = + +instruction.getlocal_3.shortDescription = Yerel kay\u0131t al\u0131n 3 +instruction.getlocal_3.description = +instruction.getlocal_3.stackBefore = +instruction.getlocal_3.stackAfter = de\u011fer +instruction.getlocal_3.operands = + +instruction.setlocal_0.shortDescription = Yerel kay\u0131t ayarla 0 +instruction.setlocal_0.description = +instruction.setlocal_0.stackBefore = de\u011fer +instruction.setlocal_0.stackAfter = +instruction.setlocal_0.operands = + +instruction.setlocal_1.shortDescription = Yerel kay\u0131t ayarla 1 +instruction.setlocal_1.description = +instruction.setlocal_1.stackBefore = de\u011fer +instruction.setlocal_1.stackAfter = +instruction.setlocal_1.operands = + +instruction.setlocal_2.shortDescription = Yerel kay\u0131t ayarla 2 +instruction.setlocal_2.description = +instruction.setlocal_2.stackBefore = de\u011fer +instruction.setlocal_2.stackAfter = +instruction.setlocal_2.operands = + +instruction.setlocal_3.shortDescription = Yerel kay\u0131t ayarla 3 +instruction.setlocal_3.description = +instruction.setlocal_3.stackBefore = de\u011fer +instruction.setlocal_3.stackAfter = +instruction.setlocal_3.operands = + +#Undocumented: +instruction.invalid.shortDescription = Ge\u00e7ersiz +instruction.invalid.description = +#instruction.invalid.stackBefore = +#instruction.invalid.stackAfter = +#instruction.invalid.operands = + +#Undocumented: +instruction.abs_jump.shortDescription = Mutlak s\u0131\u00e7rama +instruction.abs_jump.description = +#instruction.abs_jump.stackBefore = +#instruction.abs_jump.stackAfter = +#instruction.abs_jump.operands = + +instruction.debug.shortDescription = Hata ay\u0131klama bilgisi +instruction.debug.description = +instruction.debug.stackBefore = +instruction.debug.stackAfter = +instruction.debug.operands = debugType, regName, localRegister, extra + +instruction.debugline.shortDescription = Sat\u0131r numaras\u0131 bilgisini hata ay\u0131klama +instruction.debugline.description = +instruction.debugline.stackBefore = +instruction.debugline.stackAfter = +instruction.debugline.operands = lineNumber + +instruction.debugfile.shortDescription = Hata ay\u0131klama dosyas\u0131 bilgisi +instruction.debugfile.description = +instruction.debugfile.stackBefore = +instruction.debugfile.stackAfter = +instruction.debugfile.operands = fileName + +instruction.bkptline.shortDescription = Hat \u00fczerinde kesme noktas\u0131 +instruction.bkptline.description = +instruction.bkptline.stackBefore = +instruction.bkptline.stackAfter = +instruction.bkptline.operands = lineNumber + +#Undocumented: +instruction.timestamp.shortDescription = Zaman Damgas\u0131 +instruction.timestamp.description = +instruction.timestamp.stackBefore = +instruction.timestamp.stackAfter = +instruction.timestamp.operands = + +#Undocumented: +instruction.verifypass.shortDescription = Ge\u00e7i\u015fi do\u011frulay\u0131n +instruction.verifypass.description = +#instruction.verifypass.stackBefore = +#instruction.verifypass.stackAfter = +#instruction.verifypass.operands = + +#Undocumented: +instruction.alloc.shortDescription = Ay\u0131rma +instruction.alloc.description = +#instruction.alloc.stackBefore = +#instruction.alloc.stackAfter = +#instruction.alloc.operands = + +#Undocumented: +instruction.mark.shortDescription = \u0130\u015faretli +instruction.mark.description = +#instruction.mark.stackBefore = +#instruction.mark.stackAfter = +#instruction.mark.operands = + +#Undocumented: +instruction.wb.shortDescription = Wb +instruction.wb.description = +#instruction.wb.stackBefore = +#instruction.wb.stackAfter = +#instruction.wb.operands = + +#Undocumented: +instruction.prologue.shortDescription = Ba\u015flang\u0131\u00e7 +instruction.prologue.description = +#instruction.prologue.stackBefore = +#instruction.prologue.stackAfter = +#instruction.prologue.operands = + +#Undocumented: +instruction.sendenter.shortDescription = G\u00f6nder ENTER +instruction.sendenter.description = +#instruction.sendenter.stackBefore = +#instruction.sendenter.stackAfter = +#instruction.sendenter.operands = + +#Undocumented: +instruction.doubletoatom.shortDescription = Atom i\u00e7in \u00c7ift +instruction.doubletoatom.description = +#instruction.doubletoatom.stackBefore = +#instruction.doubletoatom.stackAfter = +#instruction.doubletoatom.operands = + +#Undocumented: +instruction.sweep.shortDescription = S\u00fcp\u00fcrme +instruction.sweep.description = +#instruction.sweep.stackBefore = +#instruction.sweep.stackAfter = +#instruction.sweep.operands = + +#Undocumented: +instruction.codegenop.shortDescription = CodeGenOp +instruction.codegenop.description = +#instruction.codegenop.stackBefore = +#instruction.codegenop.stackAfter = +#instruction.codegenop.operands = + +#Undocumented: +instruction.verifyop.shortDescription = VerifyOp +instruction.verifyop.description = +#instruction.verifyop.stackBefore = +#instruction.verifyop.stackAfter = +#instruction.verifyop.operands = + +#Undocumented: +instruction.decode.shortDescription = Kod \u00c7\u00f6zme +instruction.decode.description = +#instruction.decode.stackBefore = +#instruction.decode.stackAfter = +#instruction.decode.operands = + + +instruction.unplus.shortDescription = Birlik art\u0131 - say\u0131sal kuvvet +instruction.unplus.description = +instruction.unplus.stackBefore = de\u011fer +instruction.unplus.stackAfter = de\u011fer +instruction.unplus.operands = + +instruction.pushconstant.shortDescription = \u0130stifte sabit de\u011feri bast\u0131r +instruction.pushconstant.description = +#instruction.pushconstant.stackBefore = +#instruction.pushconstant.stackAfter = +instruction.pushconstant.operands = de\u011fer \ No newline at end of file diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3other_tr.properties b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3other_tr.properties new file mode 100644 index 000000000..c2a3ada47 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3other_tr.properties @@ -0,0 +1,92 @@ +# Copyright (C) 2010-2016 JPEXS, All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3.0 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. +ui.list.heading = AVM2 p-kodu +ui.list.pageTitle = AVM2 p-kodu +ui.list.documentTitle = AVM2 p-kodu +ui.list.pageDescription = P-kodu ayarlar\u0131n\u0131n listesi + + +name.QName = Kalifiye Ad +name.QNameA = Nitelendirilmi\u015f \u0130sim Niteli\u011fi +name.RTQName = \u00c7al\u0131\u015fma Zaman\u0131 Kalifiye Ad\u0131 +name.RTQNameA = \u00d6znitelikte \u00c7al\u0131\u015fma Zaman\u0131 Niteli\u011finin Ad\u0131 +name.RTQNameL = \u00c7al\u0131\u015fma Zaman\u0131 Kalifiye Ad\u0131 Ge\u00e7 +name.RTQNameLA = \u00c7al\u0131\u015fma Zaman\u0131 Kalifiye Ad\u0131 Ge\u00e7erlilik Sonu +name.Multiname = Birden Fazla Ad Alan\u0131 Ad\u0131 +name.MultinameA = \u00d6zniteli\u011fin \u00c7oklu \u0130sim Alan Ad\u0131 +name.MultinameL = Birden Fazla Ad Alan\u0131 Ad\u0131 Ge\u00e7 +name.MultinameLA = Birden Fazla Ad Alan\u0131 Ad\u0131 Ge\u00e7erlilik Sonu +name.TypeName = Tip Ad\u0131 + +namespacekind.Namespace = Ad alan\u0131 +namespacekind.PrivateNamespace = \u00d6zel Ad Alan\u0131 +namespacekind.PackageNamespace = Paket Ad Alan\u0131 +namespacekind.PackageInternalNs = Paket \u0130\u00e7 Ad Alan\u0131 +namespacekind.ProtectedNamespace = Korunan Ad Alan\u0131 +namespacekind.ExplicitNamespace = A\u00e7\u0131k Ad Alan\u0131 +namespacekind.StaticProtectedNs = Statik Ad Alan\u0131 + +trait = \u00d6zellik +#types: +trait.method = Tip y\u00f6nteminin \u00f6zelli\u011fi +trait.slot = Tip yuvas\u0131n\u0131n \u00f6zelli\u011fi +trait.const = Const tipinin \u00f6zelli\u011fi +trait.method = Tip y\u00f6nteminin \u00f6zelli\u011fi +trait.setter = S\u0131n\u0131fland\u0131r\u0131c\u0131 tipinin \u00f6zelli\u011fi +trait.getter = T\u00fcr al\u0131c\u0131n\u0131n \u00f6zelli\u011fi +trait.class = S\u0131n\u0131f t\u00fcr\u00fcn\u00fcn \u00f6zelli\u011fi +trait.function = Tip i\u015flevin niteli\u011fi + +trait.metadata = Meta veri +trait.metadata.item = Bir meta veri \u00f6\u011fesi +trait.metadata.end = Meta verilerin sonu + +trait.flag = \u00d6zel bayrak +trait.flag.METADATA = \u00d6zellikler metadata ekli +trait.flag.FINAL = Son a\u015fama +trait.flag.OVERRIDE = \u00d6zellik \u00fcst \u00f6\u011feyi ge\u00e7ersiz k\u0131lar. + +#method/getter/setter +trait.dispid = G\u00f6nderim kimli\u011fi +#slot/const/class/function +trait.slotid = Yuva kimli\u011fi + +method = Y\u00f6ntem +method.name = Y\u00f6ntemin ad\u0131 +method.flag = Y\u00f6ntem bayra\u011f\u0131 +method.flag.NEED_ARGUMENTS = Kay\u0131t defterindeki "ba\u011f\u0131ms\u0131z de\u011fi\u015fkenler" nesnesi olu\u015fturma method_info.param_count+1 +method.flag.NEED_ACTIVATION = Bu y\u00f6ntem, yeni etkinle\u015ftirme talimat\u0131 kullan\u0131r +method.flag.NEED_REST = Dizide kay\u0131t arg\u00fcmanlar\u0131 yaratmak method_info.param_count+1 +method.flag.HAS_OPTIONAL = Bu y\u00f6ntemin iste\u011fe ba\u011fl\u0131 ba\u011f\u0131ms\u0131z de\u011fi\u015fkenleri var +method.flag.IGNORE_REST = ?? +method.flag.EXPLICIT = ?? +method.flag.SETSDXNS = Bu y\u00f6ntem, dxns veya dxnslate talimatlar\u0131n\u0131 kullan\u0131r +method.flag.HAS_PARAMNAMES = Bu y\u00f6ntem, method_info'da parametre adlar\u0131na sahiptir +method.param = Parametre t\u00fcr\u00fc +method.paramname = Parametrenin ad\u0131 +method.optional = \u0130ste\u011fe ba\u011fl\u0131 parametre i\u00e7in varsay\u0131lan de\u011fer +method.returns = Y\u00f6ntemin geri d\u00f6n\u00fc\u015f t\u00fcr\u00fc +method.body = Y\u00f6ntemin bedeni +method.body.maxstack = Herhangi bir \u00e7al\u0131\u015ft\u0131rma noktas\u0131nda maksimum y\u0131\u011f\u0131n yuvas\u0131 say\u0131s\u0131 +method.body.localcount = En y\u00fcksek numaral\u0131 yerel kay\u0131t art\u0131 i\u015fareti dizini +method.body.initscopedepth = Eri\u015filebilen minimum kapsam derinli\u011fi (maks. \u00d6l\u00e7e\u011fe g\u00f6re) +method.body.maxscopedepth = Eri\u015filebilen maksimum kapsam derinli\u011fi +method.body.try = \u0130stisna blo\u011fu +method.body.try.from = \u0130stisnan\u0131n etkinle\u015ftirildi\u011fi ba\u015flang\u0131\u00e7 \u200b\u200bkonumu +method.body.try.to = \u0130stisna devre d\u0131\u015f\u0131 b\u0131rak\u0131ld\u0131ktan sonra biti\u015f pozisyonu +method.body.try.target = Bu t\u00fcrden istisnalar at\u0131ld\u0131\u011f\u0131nda hangi denetime atlanaca\u011f\u0131 konumu +method.body.try.type = \u00d6rt\u00fcl\u00fc istisna t\u00fcr\u00fc +method.body.try.name = \u00d6zel durum nesnesinin ad\u0131 +method.body.code = Metot g\u00f6vdesi kodu \ No newline at end of file diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index 3013c2ee0..ebe7e7f7e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; @@ -1023,7 +1024,7 @@ public class DefineEditTextTag extends TextTag { ge.glyphIndex = -1; // always use system character glyphs in edit text - String fontName = ge.fontFace != null ? ge.fontFace : FontTag.defaultFontName; + String fontName = ge.fontFace != null ? ge.fontFace : FontTag.getDefaultFontName(); int fontStyle = font == null ? ge.fontStyle : font.getFontStyle(); ge.glyphAdvance = (int) Math.round(SWF.unitDivisor * FontTag.getSystemFontAdvance(fontName, fontStyle, (int) (lastStyle.fontHeight / SWF.unitDivisor), c, nextChar)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index 4389b3e7b..a274a9209 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.DisassemblyListener; @@ -140,7 +141,7 @@ public class DoActionTag extends Tag implements ASMSource { actions = getActions(); } - return Action.actionsToSource(this, actions, toString()/*FIXME?*/, writer); + return Action.actionsToSource(this, actions, getScriptName(), writer); } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 2ffab0cf9..951cfc90a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.DisassemblyListener; @@ -148,7 +149,7 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource { actions = getActions(); } - return Action.actionsToSource(this, actions, toString()/*FIXME?*/, writer); + return Action.actionsToSource(this, actions, getScriptName(), writer); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java index d03e2ed96..0404f998c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.base; import com.jpexs.decompiler.flash.DisassemblyListener; @@ -70,7 +71,7 @@ public class ButtonAction implements ASMSource { actions = getActions(); } - return Action.actionsToSource(this, actions, toString()/*FIXME?*/, writer); + return Action.actionsToSource(this, actions, getScriptName(), writer); } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java index 8975c6a35..b1ef5443d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.base; import com.jpexs.decompiler.flash.SWF; @@ -121,14 +122,19 @@ public abstract class FontTag extends DrawableTag implements AloneTag { return fontNameTag.fontCopyright; } - public static Map> installedFontsByFamily; + private static Map> installedFontsByFamily; - public static Map installedFontsByName; + private static Map installedFontsByName; - public static String defaultFontName; + private static String defaultFontName; - static { - reload(); + private static boolean firstLoaded = false; + + private static void ensureLoaded() { + if (!firstLoaded) { + reload(); + } + firstLoaded = true; } public int getFontId() { @@ -259,6 +265,11 @@ public abstract class FontTag extends DrawableTag implements AloneTag { return gm.getAdvanceX(); } + public static String getDefaultFontName() { + ensureLoaded(); + return defaultFontName; + } + public static void reload() { installedFontsByFamily = FontHelper.getInstalledFonts(); installedFontsByName = new HashMap<>(); @@ -279,6 +290,7 @@ public abstract class FontTag extends DrawableTag implements AloneTag { } public static String getFontNameWithFallback(String fontName) { + ensureLoaded(); if (installedFontsByFamily.containsKey(fontName)) { return fontName; } @@ -307,6 +319,7 @@ public abstract class FontTag extends DrawableTag implements AloneTag { } public static String findInstalledFontName(String fontName) { + ensureLoaded(); if (installedFontsByName.containsKey(fontName)) { return fontName; } @@ -413,4 +426,15 @@ public abstract class FontTag extends DrawableTag implements AloneTag { public FontTag toClassicFont() { return this; } + + public static Map> getInstalledFontsByFamily() { + ensureLoaded(); + return installedFontsByFamily; + } + + public static Map getInstalledFontsByName() { + ensureLoaded(); + return installedFontsByName; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java index f9e9b45b3..4174a0de5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.base; import java.awt.Font; @@ -30,10 +31,10 @@ public class MissingCharacterHandler { public boolean handle(TextTag textTag, FontTag font, char character) { String fontName = font.getFontNameIntag(); - if (!FontTag.installedFontsByFamily.containsKey(fontName)) { + if (!FontTag.getInstalledFontsByFamily().containsKey(fontName)) { return false; } - Map faces = FontTag.installedFontsByFamily.get(fontName); + Map faces = FontTag.getInstalledFontsByFamily().get(fontName); Font f = null; for (String face : faces.keySet()) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index dc9dbc44d..f5448ca69 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types; import com.jpexs.decompiler.flash.DisassemblyListener; @@ -195,7 +196,7 @@ public class BUTTONCONDACTION implements ASMSource, Serializable { actions = getActions(); } - return Action.actionsToSource(this, actions, toString()/*FIXME?*/, writer); + return Action.actionsToSource(this, actions, getScriptName(), writer); } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index d81c8dfbc..b01fda5d2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types; import com.jpexs.decompiler.flash.DisassemblyListener; @@ -197,7 +198,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable { actions = getActions(); } - return Action.actionsToSource(this, actions, toString()/*FIXME?*/, writer); + return Action.actionsToSource(this, actions, getScriptName(), writer); } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index 518914081..6ca70db83 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.xfl; import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; @@ -2358,7 +2359,7 @@ public class XFLConverter { fontName = font.getFontNameIntag(); } if (fontName == null) { - fontName = FontTag.defaultFontName; + fontName = FontTag.getDefaultFontName(); } int fontStyle = font.getFontStyle(); String installedFont; @@ -3035,7 +3036,7 @@ public class XFLConverter { fontName = font.getFontNameIntag(); } if (fontName == null) { - fontName = FontTag.defaultFontName; + fontName = FontTag.getDefaultFontName(); } int fontStyle = 0; if (font != null) { @@ -3197,7 +3198,7 @@ public class XFLConverter { fontName = ft.getFontNameIntag(); } if (fontName == null) { - fontName = FontTag.defaultFontName; + fontName = FontTag.getDefaultFontName(); } italic = ft.isItalic(); bold = ft.isBold(); @@ -3934,7 +3935,7 @@ public class XFLConverter { fontName = ft.getFontNameIntag(); } if (fontName == null) { - fontName = FontTag.defaultFontName; + fontName = FontTag.getDefaultFontName(); } italic = ft.isItalic(); bold = ft.isBold(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java index 2d21d6dbc..6e445b030 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph; import com.jpexs.decompiler.flash.BaseLocalData; @@ -74,6 +75,11 @@ public class Graph { public static final int SOP_REMOVE_STATIC = 2; + private boolean debugPrintAllParts = false; + private boolean debugPrintLoopList = false; + private boolean debugGetLoops = false; + private boolean debugPrintGraph = false; + /** * Identify loop exits * @@ -593,11 +599,36 @@ public class Graph { return g.translate(localData, staticOperation, path); } + protected void afterPopupateAllParts(Set allParts) { + + } + public List translate(BaseLocalData localData, int staticOperation, String path) throws InterruptedException { + Set allParts = new HashSet<>(); for (GraphPart head : heads) { populateParts(head, allParts); } + afterPopupateAllParts(allParts); + if (debugPrintAllParts) { + System.err.println("parts:"); + for (GraphPart p : allParts) { + System.err.print(p); + if (!p.nextParts.isEmpty()) { + System.err.print(", next: "); + } + boolean first = true; + for (GraphPart n : p.nextParts) { + if (!first) { + System.err.print(","); + } + System.err.print(n); + first = false; + } + System.err.println(""); + } + System.err.println("/parts"); + } TranslateStack stack = new TranslateStack(path); List loops = new ArrayList<>(); @@ -626,13 +657,14 @@ public class Graph { loops = loops2; } - /* - System.err.println(""); - for (Loop el : loops) { - System.err.println(el); - } - System.err.println(""); - */ + if (debugPrintLoopList) { + System.err.println(""); + for (Loop el : loops) { + System.err.println(el); + } + System.err.println(""); + } + //TODO: Make getPrecontinues faster getPrecontinues(path, localData, null, heads.get(0), allParts, loops, null); @@ -643,25 +675,25 @@ public class Graph { System.err.println("");//*/ List ret = printGraph(new HashMap<>(), new HashMap<>(), localData, stack, allParts, null, heads.get(0), null, loops, staticOperation, path); processIfs(ret); - finalProcessStack(stack, ret); - finalProcessAll(ret, 0, new FinalProcessLocalData()); + finalProcessStack(stack, ret, path); + finalProcessAll(ret, 0, new FinalProcessLocalData(loops), path); return ret; } - public void finalProcessStack(TranslateStack stack, List output) { + public void finalProcessStack(TranslateStack stack, List output, String path) { } - private void finalProcessAll(List list, int level, FinalProcessLocalData localData) throws InterruptedException { - finalProcess(list, level, localData); + private void finalProcessAll(List list, int level, FinalProcessLocalData localData, String path) throws InterruptedException { + finalProcess(list, level, localData, path); for (GraphTargetItem item : list) { if (item instanceof Block) { List> subs = ((Block) item).getSubs(); for (List sub : subs) { - finalProcessAll(sub, level + 1, localData); + finalProcessAll(sub, level + 1, localData, path); } } } - finalProcessAfter(list, level, localData); + finalProcessAfter(list, level, localData, path); } private boolean processSubBlk(Block b, GraphTargetItem replacement) { @@ -703,7 +735,7 @@ public class Graph { return allSubPush && atleastOne; } - protected void finalProcessAfter(List list, int level, FinalProcessLocalData localData) { + protected void finalProcessAfter(List list, int level, FinalProcessLocalData localData, String path) { if (list.size() >= 2) { if (list.get(list.size() - 1) instanceof ExitItem) { ExitItem e = (ExitItem) list.get(list.size() - 1); @@ -719,7 +751,7 @@ public class Graph { } } - protected void finalProcess(List list, int level, FinalProcessLocalData localData) throws InterruptedException { + protected void finalProcess(List list, int level, FinalProcessLocalData localData, String path) throws InterruptedException { //For detection based on debug line information boolean[] toDelete = new boolean[list.size()]; @@ -1101,7 +1133,6 @@ public class Graph { } private void markLevels(String path, BaseLocalData localData, GraphPart part, Set allParts, List loops, List stopPart, int level, Set visited, int recursionLevel) throws InterruptedException { - boolean debugMode = false; if (stopPart == null) { stopPart = new ArrayList<>(); } @@ -1109,9 +1140,6 @@ public class Graph { throw new RuntimeException(path + ": markLevels max recursion level reached"); } - if (debugMode) { - System.err.println("markLevels " + part); - } if (stopPart.contains(part)) { return; } @@ -1120,9 +1148,6 @@ public class Graph { return; } if (el.phase != 1) { - if (debugMode) { - //System.err.println("ignoring "+el); - } continue; } if (el.loopContinue == part) { @@ -1251,7 +1276,6 @@ public class Graph { } private void getLoops(BaseLocalData localData, GraphPart part, List loops, List stopPart, boolean first, int level, List visited) throws InterruptedException { - boolean debugMode = false; if (part == null) { return; @@ -1265,7 +1289,7 @@ public class Graph { visited.add(part); } - if (debugMode) { + if (debugGetLoops) { System.err.println("getloops: " + part); } //List loopContinues = getLoopsContinues(loops); @@ -1293,7 +1317,7 @@ public class Graph { loops2.remove(lastP1); if (!part.leadsTo(localData, this, code, lastP1.loopContinue, loops2)) { if (lastP1.breakCandidatesLocked == 0) { - if (debugMode) { + if (debugGetLoops) { System.err.println("added breakCandidate " + part + " to " + lastP1); } @@ -1423,6 +1447,7 @@ public class Graph { } } } + // if (lev1 <= lev2) { found = cand2; } else { @@ -1541,9 +1566,8 @@ public class Graph { ret = new ArrayList<>(); } //try { - boolean debugMode = false; - if (debugMode) { + if (debugPrintGraph) { System.err.println("PART " + part + " nextsize:" + part.nextParts.size()); } @@ -1583,19 +1607,19 @@ public class Graph { } } - if (debugMode) { + if (debugPrintGraph) { System.err.println("loopsize:" + loops.size()); } for (int l = loops.size() - 1; l >= 0; l--) { Loop el = loops.get(l); if (el == currentLoop) { - if (debugMode) { + if (debugPrintGraph) { System.err.println("ignoring current loop " + el); } continue; } if (el.phase != 1) { - if (debugMode) { + if (debugPrintGraph) { System.err.println("ignoring loop " + el); } continue; @@ -1604,7 +1628,7 @@ public class Graph { if (currentLoop != null) { currentLoop.phase = 0; } - if (debugMode) { + if (debugPrintGraph) { System.err.println("Adding break"); } ret.add(new BreakItem(null, localData.lineStartInstruction, el.id)); @@ -1614,7 +1638,7 @@ public class Graph { if (currentLoop != null) { currentLoop.phase = 0; } - if (debugMode) { + if (debugPrintGraph) { System.err.println("Adding precontinue"); } ret.add(new ContinueItem(null, localData.lineStartInstruction, el.id)); @@ -1624,7 +1648,7 @@ public class Graph { if (currentLoop != null) { currentLoop.phase = 0; } - if (debugMode) { + if (debugPrintGraph) { System.err.println("Adding continue"); } ret.add(new ContinueItem(null, localData.lineStartInstruction, el.id)); @@ -1636,7 +1660,7 @@ public class Graph { if (currentLoop != null) { currentLoop.phase = 0; } - if (debugMode) { + if (debugPrintGraph) { System.err.println("Stopped on part " + part); } return ret; @@ -1673,10 +1697,9 @@ public class Graph { //makeAllCommands(currentRet, stack); stack = (TranslateStack) stack.clone(); stack.clear(); - loopItem = new UniversalLoopItem(null, localData.lineStartInstruction, currentLoop); + loopItem = new UniversalLoopItem(null, localData.lineStartInstruction, currentLoop, new ArrayList<>()); //loopItem.commands=printGraph(visited, localData, stack, allParts, parent, part, stopPart, loops); currentRet.add(loopItem); - loopItem.commands = new ArrayList<>(); currentRet = loopItem.commands; //return ret; } @@ -2054,6 +2077,7 @@ public class Graph { List bodyBranch = null; boolean inverted = false; boolean breakpos2 = false; + BreakItem addBreakItem = null; if ((ifi.onTrue.size() == 1) && (ifi.onTrue.get(0) instanceof BreakItem)) { BreakItem bi = (BreakItem) ifi.onTrue.get(0); if (bi.loopId == currentLoop.id) { @@ -2067,12 +2091,13 @@ public class Graph { } } else if (loopItem.commands.size() == 2 && (loopItem.commands.get(1) instanceof BreakItem)) { BreakItem bi = (BreakItem) loopItem.commands.get(1); - if (bi.loopId == currentLoop.id) { - if (ifi.onTrue.isEmpty()) { - inverted = true; - } - bodyBranch = inverted ? ifi.onFalse : ifi.onTrue; - breakpos2 = true; + if (ifi.onTrue.isEmpty()) { + inverted = true; + } + bodyBranch = inverted ? ifi.onFalse : ifi.onTrue; + breakpos2 = true; + if (bi.loopId != currentLoop.id) { //it's break of another parent loop + addBreakItem = bi; //we must add it after the loop } } if (bodyBranch != null) { @@ -2111,6 +2136,9 @@ public class Graph { } else { ret.add(index, li = new WhileItem(expr.getSrc(), expr.getLineStartItem(), currentLoop, exprList, commands)); } + if (addBreakItem != null) { + ret.add(index + 1, addBreakItem); + } loopTypeFound = true; } @@ -2274,6 +2302,10 @@ public class Graph { ret.path = path; GraphPart part = ret; while (ip < code.size()) { + ip = checkIp(ip); + if (ip >= code.size()) { + break; + } if (visited2[ip] || ((ip != startip) && (refs.get(ip).size() > 1))) { part.end = lastIp; GraphPart found = null; @@ -2298,8 +2330,6 @@ public class Graph { part = gp; } } - - ip = checkIp(ip); lastIp = ip; GraphSourceItem ins = code.get(ip); if (ins.isIgnored()) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java index b9f91d020..3bc7e66e3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph; import com.jpexs.decompiler.flash.BaseLocalData; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java index c20546d59..6dd9e4b2e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java @@ -12,17 +12,14 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; -import com.jpexs.decompiler.flash.helpers.GraphTextWriter; -import com.jpexs.decompiler.flash.helpers.LoopWithType; -import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.graph.Block; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.Loop; -import com.jpexs.decompiler.graph.TypeItem; import java.util.ArrayList; import java.util.List; @@ -30,72 +27,15 @@ import java.util.List; * * @author JPEXS */ -public class UniversalLoopItem extends LoopItem implements Block { +public class UniversalLoopItem extends WhileItem implements Block { - public List commands; + static final List TRUE_EXPRESSION = new ArrayList<>(); - private boolean labelUsed; - - public UniversalLoopItem(GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop) { - super(src, lineStartIns, loop); + static { + TRUE_EXPRESSION.add(new TrueItem(null, null)); } - @Override - public boolean needsSemicolon() { - return false; - } - - @Override - public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - if (writer instanceof NulWriter) { - ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); - } - if (labelUsed) { - writer.append("loop").append(loop.id).append(":").newLine(); - } - writer.append("while"); - if (writer.getFormatting().spaceBeforeParenthesesWhileParentheses) { - writer.append(" "); - } - writer.append("(true)"); - appendBlock(null, writer, localData, commands); - if (writer instanceof NulWriter) { - LoopWithType loopOjb = ((NulWriter) writer).endLoop(loop.id); - labelUsed = loopOjb.used; - } - return writer; - } - - @Override - public List getContinues() { - List ret = new ArrayList<>(); - for (GraphTargetItem ti : commands) { - if (ti instanceof ContinueItem) { - ret.add((ContinueItem) ti); - } - if (ti instanceof Block) { - ret.addAll(((Block) ti).getContinues()); - } - } - return ret; - } - - @Override - public List> getSubs() { - List> ret = new ArrayList<>(); - if (commands != null) { - ret.add(commands); - } - return ret; - } - - @Override - public boolean hasReturnValue() { - return false; - } - - @Override - public GraphTargetItem returnType() { - return TypeItem.UNBOUNDED; + public UniversalLoopItem(GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List commands) { + super(src, lineStartIns, loop, TRUE_EXPRESSION, commands); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/Reference.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/Reference.java similarity index 91% rename from libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/Reference.java rename to libsrc/ffdec_lib/src/com/jpexs/helpers/Reference.java index 04e3465f1..6b86b8ca7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/Reference.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/Reference.java @@ -12,8 +12,9 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ -package com.jpexs.decompiler.flash.abc.avm2.parser.script; + * License along with this library. + */ +package com.jpexs.helpers; /** * diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionDefineFunctionPushRegisterCleanerTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionDefineFunctionPushRegisterCleanerTest.java new file mode 100644 index 000000000..e70b6c743 --- /dev/null +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionDefineFunctionPushRegisterCleanerTest.java @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2010-2018 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash; + +import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.helpers.CodeFormatting; +import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; +import com.jpexs.decompiler.flash.tags.DoInitActionTag; +import com.jpexs.decompiler.flash.tags.Tag; +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.fail; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.fail; + +/** + * + * @author JPEXS + */ +public class ActionDefineFunctionPushRegisterCleanerTest extends ActionScript2TestBase { + + @BeforeClass + public void init() throws IOException, InterruptedException { + //Main.initLogging(false); + Configuration.autoDeobfuscate.set(false); + Configuration.simplifyExpressions.set(false); + Configuration.decompile.set(true); + Configuration.registerNameFormat.set("_loc%d_"); + swf = new SWF(new BufferedInputStream(new FileInputStream("testdata/as2_definefunc_regs/as2_definefunc_regs.swf")), false); + } + + private void compareSrc(String testClassName, String expectedClassContents) { + DoInitActionTag dia = getClassSource(testClassName); + assertNotNull(dia); + HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); + try { + Action.actionsToSource(dia, dia.getActions(), "", writer); + } catch (InterruptedException ex) { + fail(); + } + String actualResult = cleanPCode(writer.toString()); + String expectedResult = cleanPCode("class " + testClassName + "\r\n" + + "{\r\n" + + expectedClassContents + "\r\n" + + "}"); + assertEquals(actualResult, expectedResult); + } + + private DoInitActionTag getClassSource(String classFullName) { + for (Tag t : swf.getTags()) { + if (t instanceof DoInitActionTag) { + DoInitActionTag dia = (DoInitActionTag) t; + String exportName = swf.getExportName(dia.spriteId); + if (exportName != null && exportName.startsWith(SWF.AS2_PKG_PREFIX)) { + String exportClassName = exportName.substring(SWF.AS2_PKG_PREFIX.length()); + if (exportClassName.equals(classFullName)) { + return dia; + } + } + } + } + return null; + } + + @Test + public void testMyClass() { + compareSrc("MyClass", "function MyClass()\n" + + "{\r\n" + + "}\r\n" + + "function testNoReturn()\r\n" + + "{\r\n" + + "var _loc2_ = 5;\r\n" + + "var _loc1_ = _loc2_ + 27;\r\n" + + "trace(\"hi:\" + _loc1_);\r\n" + + "}\r\n" + + "function testSimpleReturn()\r\n" + + "{\r\n" + + "var a = 5;\r\n" + + "var _loc1_ = 30;\r\n" + + "return \"bagr\" + _loc1_;\r\n" + + "}\r\n" + + "function testReturns()\r\n" + + "{\r\n" + + "var _loc2_ = 10;\r\n" + + "if(_loc2_ > 2)\r\n" + + "{\r\n" + + "_loc2_ = _loc2_ + 1;\r\n" + + "var _loc1_ = 0;\r\n" + + "while(_loc1_ < 100)\r\n" + + "{\r\n" + + "if(_loc2_ + _loc1_ == 27)\r\n" + + "{\r\n" + + "return _loc2_ + 7;\r\n" + + "}\r\n" + + "_loc1_ = _loc1_ + 27;\r\n" + + "_loc1_ = _loc1_ + 1;\r\n" + + "}\r\n" + + "}\r\n" + + "else if(_loc2_ == 4)\r\n" + + "{\r\n" + + "return 4;\r\n" + + "}\r\n" + + "return 3;\r\n" + + "}\r\n" + + "function testSomeReturns()\r\n" + + "{\r\n" + + "var _loc1_ = 5;\r\n" + + "if(_loc1_ < 10)\r\n" + + "{\r\n" + + "return _loc1_;\r\n" + + "}\r\n" + + "}\r\r" + ); + } +} diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ClassesTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ClassesTest.java new file mode 100644 index 000000000..329385913 --- /dev/null +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ClassesTest.java @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2010-2018 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash; + +import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.helpers.CodeFormatting; +import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; +import com.jpexs.decompiler.flash.tags.DoInitActionTag; +import com.jpexs.decompiler.flash.tags.Tag; +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.fail; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.fail; + +/** + * + * @author JPEXS + */ +public class ActionScript2ClassesTest extends ActionScript2TestBase { + + private final String BASE_TEST_PACKAGE = "com.jpexs.flash.test.testcases"; + + @BeforeClass + public void init() throws IOException, InterruptedException { + //Main.initLogging(false); + Configuration.autoDeobfuscate.set(false); + Configuration.simplifyExpressions.set(false); + Configuration.decompile.set(true); + Configuration.registerNameFormat.set("_loc%d_"); + swf = new SWF(new BufferedInputStream(new FileInputStream("testdata/as2/as2.swf")), false); + } + + private void compareSrc(String testClassName, String expectedClassContents) { + DoInitActionTag dia = getClassSource(BASE_TEST_PACKAGE + "." + testClassName); + assertNotNull(dia); + HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); + try { + Action.actionsToSource(dia, dia.getActions(), "", writer); + } catch (InterruptedException ex) { + fail(); + } + String actualResult = cleanPCode(writer.toString()); + String expectedResult = cleanPCode("class " + BASE_TEST_PACKAGE + "." + testClassName + "\r\n" + + "{\r\n" + + expectedClassContents + "\r\n" + + "}"); + assertEquals(actualResult, expectedResult); + } + + private DoInitActionTag getClassSource(String classFullName) { + for (Tag t : swf.getTags()) { + if (t instanceof DoInitActionTag) { + DoInitActionTag dia = (DoInitActionTag) t; + String exportName = swf.getExportName(dia.spriteId); + if (exportName != null && exportName.startsWith(SWF.AS2_PKG_PREFIX)) { + String exportClassName = exportName.substring(SWF.AS2_PKG_PREFIX.length()); + if (exportClassName.equals(classFullName)) { + return dia; + } + } + } + } + return null; + } + + @Test + public void testVarsMethods() { + compareSrc("TestVarsMethods", "var instVar = 1;\r\n" + + "static var statVar = 2;\r\n" + + "function TestVarsMethods()\r\n" + + "{\r\n" + + "trace(\"constructor\");\r\n" + + "}\r\n" + + "function instMethod()\r\n" + + "{\r\n" + + "trace(\"instance method\");\r\n" + + "}\r\n" + + "static function statMethod()\r\n" + + "{\r\n" + + "trace(\"static method\");\r\n" + + "}\r\n" + ); + } + + @Test + public void testMaintainOrder() { + compareSrc("TestMaintainOrder", "var a = 1;\r\n" + + "static var b = 2;\r\n" + + "var c = 3;\r\n" + + "static var d = 4;\r\n" + + "static var e = 5;\r\n" + + "var f = 6;\r\n" + + "var g = 7;\r\n" + + "var _x1 = \"after method m\";\r\n" + + "function TestMaintainOrder()\r\n" + + "{\r\n" + + "}\r\n" + + "function h()\r\n" + + "{\r\n" + + "trace(\"8\");\r\n" + + "}\r\n" + + "function i()\r\n" + + "{\r\n" + + "trace(\"9\");\r\n" + + "}\r\n" + + "static function j()\r\n" + + "{\r\n" + + "trace(\"10\");\r\n" + + "}\r\n" + + "static function k()\r\n" + + "{\r\n" + + "trace(\"11\");\r\n" + + "}\r\n" + + "function l()\r\n" + + "{\r\n" + + "trace(\"12\");\r\n" + + "}\r\n" + + "static function m()\r\n" + + "{\r\n" + + "trace(\"13\");\r\n" + + "}\r\n" + + "function _x2()\r\n" + + "{\r\n" + + "trace(\"after _x1\");\r\n" + + "}\r\n"); + } +} diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java index 32131a3d4..e837c5fe2 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ParserTest.java @@ -12,10 +12,12 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.action.parser.script.ActionScript2Parser; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.graph.CompilationException; import java.io.IOException; @@ -91,4 +93,22 @@ public class ActionScript2ParserTest extends ActionScript2TestBase { + " };\n" + "}"); } + + @Test + private void testAS2SimpleConstantPoolOrder() { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ActionPush.MAX_CONSTANT_INDEX_TYPE8; i++) { + sb.append("trace(\"" + i + "\");\n"); + } + parseAS2(sb.toString()); + } + + @Test + private void testAS2LargeConstantPoolOrder() { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ActionPush.MAX_CONSTANT_INDEX_TYPE8 + 100; i++) { + sb.append("trace(\"" + i + "\");\n"); + } + parseAS2(sb.toString()); + } } diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java index b56af5026..700e78f3f 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.action.Action; @@ -90,7 +91,7 @@ public class ActionScript2Test extends ActionScript2TestBase { @Test public void frame24_unicodeTest() { compareSrc(24, "trace(\"unicodeTest\");\r\n" - + "var k = \"\u05d4\u05d9\u05e4\u05d5\u05e4\u05d5\u05d8\u05de\u05d9, \u05d0\u05d5 \u05d0\";\r\n" + + "var k = \"היפופוטמי, או א\";\r\n" + "trace(k);\r\n" ); } @@ -308,8 +309,6 @@ public class ActionScript2Test extends ActionScript2TestBase { + "ship.moveUp(0.2);\r\n" + "enemy.moveRight(230);\r\n" + "enemy.moveLeft(100);\r\n" - + "var mt = new com.jpexs.MyTest();\r\n" - + "mt.test();\r\n" + "var c = new Cox(box1);\r\n" ); } @@ -667,7 +666,7 @@ public class ActionScript2Test extends ActionScript2TestBase { @Test public void frame55_pushTest() { compareSrc(55, "trace(\"pushTest\");\r\n" - + "53;" + + "53;\r\n" ); } @@ -805,6 +804,28 @@ public class ActionScript2Test extends ActionScript2TestBase { ); } + @Test + public void frame60_numbersTest() { + compareSrc(60, "trace(\"numbersTest\");\r\n" + + "var x = null;\r\n" + + "trace(\"null:\" + x);\r\n" + + "x = true;\r\n" + + "trace(\"true:\" + x);\r\n" + + "x = false;\r\n" + + "trace(\"false:\" + x);\r\n" + + "x = 1;\r\n" + + "trace(\"1:\" + x);\r\n" + + "x = 2147483647;\r\n" + + "trace(\"0x7fffffff:\" + x);\r\n" + + "x = 2147483648;\r\n" + + "trace(\"0x80000000:\" + x);\r\n" + + "x = -2147483648;\r\n" + + "trace(\"-0x80000000:\" + x);\r\n" + + "x = -2147483649;\r\n" + + "trace(\"-0x80000001:\" + x);\r\n" + ); + } + @Test public void frame61_switchDefaultTest() { compareSrc(61, "trace(\"switchDefaultTest\");\r\n" @@ -845,6 +866,7 @@ public class ActionScript2Test extends ActionScript2TestBase { ); } + @Test public void frame63_functionVariablesTest() { compareSrc(63, "function outfunc()\r\n" + "{\r\n" @@ -886,4 +908,1044 @@ public class ActionScript2Test extends ActionScript2TestBase { + "trace(\"functionInnerParametersTest\");\r\n" ); } + + @Test + public void frame65_loadClassesTest() { + compareSrc(65, "trace(\"loadClassesTest\");\r\n" + + "var tst = new com.jpexs.flash.test.TestLoader();\r\n" + + "tst.includeTests();\r\n" + ); + } + + @Test + public void frame66_forInBreakTest() { + compareSrc(66, "function testFunc1()\r\n" + + "{\r\n" + + "for(var _loc1_ in obj)\r\n" + + "{\r\n" + + "trace(_loc1_);\r\n" + + "}\r\n" + + "}\r\n" + + "function testFunc2()\r\n" + + "{\r\n" + + "for(var _loc1_ in obj)\r\n" + + "{\r\n" + + "if(_loc1_ == \"b\")\r\n" + + "{\r\n" + + "trace(\"found\");\r\n" + + "break;\r\n" + + "}\r\n" + + "}\r\n" + + "}\r\n" + + "function testFunc3()\r\n" + + "{\r\n" + + "for(var _loc1_ in obj)\r\n" + + "{\r\n" + + "if(_loc1_ == \"b\")\r\n" + + "{\r\n" + + "trace(\"hi\");\r\n" + + "break;\r\n" + + "}\r\n" + + "}\r\n" + + "trace(\"after\");\r\n" + + "}\r\n" + + "function testFunc4()\r\n" + + "{\r\n" + + "for(var _loc1_ in obj)\r\n" + + "{\r\n" + + "if(_loc1_ == \"b\")\r\n" + + "{\r\n" + + "trace(\"hi\");\r\n" + + "}\r\n" + + "else if(_loc1_ == \"c\")\r\n" + + "{\r\n" + + "trace(\"hello\");\r\n" + + "}\r\n" + + "else\r\n" + + "{\r\n" + + "trace(\"hohoho\");\r\n" + + "continue;\r\n" + + "}\r\n" + + "break;\r\n" + + "}\r\n" + + "trace(\"after\");\r\n" + + "}\r\n" + + "function testFunc5()\r\n" + + "{\r\n" + + "var _loc1_ = {key1:1,key2:2,key3:3};\r\n" + + "for(var _loc3_ in obj)\r\n" + + "{\r\n" + + "if(_loc3_ == \"a\")\r\n" + + "{\r\n" + + "trace(\"loop1_break\");\r\n" + + "break;\r\n" + + "}\r\n" + + "if(_loc3_ == \"b\")\r\n" + + "{\r\n" + + "trace(\"hello\");\r\n" + + "for(var _loc2_ in _loc1_)\r\n" + + "{\r\n" + + "if(_loc2_ == \"key1\")\r\n" + + "{\r\n" + + "trace(\"loop2_break\");\r\n" + + "break;\r\n" + + "}\r\n" + + "trace(\"loop2_inside\");\r\n" + + "}\r\n" + + "trace(\"after_loop2\");\r\n" + + "}\r\n" + + "trace(\"loop1_inside\");\r\n" + + "}\r\n" + + "trace(\"after_loop1\");\r\n" + + "}\r\n" + + "function testFunc6()\r\n" + + "{\r\n" + + "var _loc1_ = {key1:1,key2:2,key3:3};\r\n" + + "for(var _loc3_ in obj)\r\n" + + "{\r\n" + + "if(_loc3_ == \"a\")\r\n" + + "{\r\n" + + "trace(\"loop1_break\");\r\n" + + "break;\r\n" + + "}\r\n" + + "trace(\"hello\");\r\n" + + "for(var _loc2_ in _loc1_)\r\n" + + "{\r\n" + + "if(_loc2_ == \"key1\")\r\n" + + "{\r\n" + + "trace(\"loop2_break\");\r\n" + + "break;\r\n" + + "}\r\n" + + "trace(\"loop2_inside\");\r\n" + + "}\r\n" + + "trace(\"after_loop2\");\r\n" + + "}\r\n" + + "trace(\"after_loop1\");\r\n" + + "}\r\n" + + "trace(\"forInBreakTest\");\r\n" + + "var obj = {a:5,b:6,c:7};\r\n" + ); + } + + @Test + public void frame67_switchVariantsTest() { + compareSrc(67, "function test1()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test2()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test3()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test4()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "default:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test5()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test6()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test7()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test8()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test9()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test10()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place2\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test11()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test12()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test13()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "default:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test14()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test15()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test16()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test17()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test18()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test19()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test20()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test21()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test22()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test23()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test24()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test25()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test26()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test27()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test28()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "default:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test29()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test30()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test31()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test32()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test33()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "default:\r\n" + + "trace(\"place1\");\r\n" + + "case 1:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test34()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test35()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place2\");\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place1\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test36()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "default:\r\n" + + "trace(\"place1\");\r\n" + + "case 1:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test37()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test38()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "default:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test39()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test40()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test41()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test42()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test43()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test44()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test45()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test46()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "default:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test47()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test48()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place2\");\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test49()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "default:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test50()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test51()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "default:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "}\r\n" + + "trace(\"place3\");\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test52()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test53()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test54()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place1\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test55()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test56()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place3\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"place1\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test57()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test58()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "trace(\"place1\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test59()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "trace(\"place2\");\r\n" + + "break;\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "function test60()\r\n" + + "{\r\n" + + "var _loc1_ = random(100);\r\n" + + "switch(_loc1_)\r\n" + + "{\r\n" + + "case 1:\r\n" + + "case 2:\r\n" + + "case 3:\r\n" + + "trace(\"place3\");\r\n" + + "}\r\n" + + "trace(\"after switch\");\r\n" + + "}\r\n" + + "trace(\"switchVariantsTest\");\r\n" + ); + } + + @Test + public void frame68_tryTypeTest() { + compareSrc(68, "trace(\"tryTypeTest\");\r\n" + + "var a = 5;\r\n" + + "try\r\n" + + "{\r\n" + + "a = a / 0;\r\n" + + "}\r\n" + + "catch(e)\r\n" + + "{\r\n" + + "trace(\"err:\" + e);\r\n" + + "}\r\n" + + "try\r\n" + + "{\r\n" + + "a = a / 0;\r\n" + + "}\r\n" + + "catch(e)\r\n" + + "{\r\n" + + "if(a == 0)\r\n" + + "{\r\n" + + "throw e;\r\n" + + "}\r\n" + + "else\r\n" + + "{\r\n" + + "trace(\"err:\" + e);\r\n" + + "}\r\n" + + "}\r\n" + + "try\r\n" + + "{\r\n" + + "a = a / 0;\r\n" + + "}\r\n" + + "catch(e:MyError)\r\n" + + "{\r\n" + + "trace(\"err:\" + e);\r\n" + + "}\r\n" + + "try\r\n" + + "{\r\n" + + "a = a / 0;\r\n" + + "}\r\n" + + "catch(e1:MyError)\r\n" + + "{\r\n" + + "trace(\"err:\" + e1);\r\n" + + "}\r\n" + + "catch(e2)\r\n" + + "{\r\n" + + "trace(\"err:\" + e2);\r\n" + + "}\r\n" + + "try\r\n" + + "{\r\n" + + "a = a / 0;\r\n" + + "}\r\n" + + "catch(e:MyError)\r\n" + + "{\r\n" + + "trace(\"err:\" + e);\r\n" + + "}\r\n" + + "catch(e2:Error)\r\n" + + "{\r\n" + + "trace(\"err:\" + e2);\r\n" + + "}\r\n" + ); + } + + @Test + public void frame69_forInBreakTest() { + compareSrc(69, "trace(\"forInBreakTest\");\r\n" + + "var obj = {a:5,b:6,c:7};\r\n" + + "for(var k in obj)\r\n" + + "{\r\n" + + "trace(k);\r\n" + + "break;\r\n" + + "}\r\n" + + "trace(\"after\");\r\n" + ); + } } diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/generators/SwitchVariantsGenerator.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/generators/SwitchVariantsGenerator.java new file mode 100644 index 000000000..c961f709e --- /dev/null +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/generators/SwitchVariantsGenerator.java @@ -0,0 +1,206 @@ +package com.jpexs.decompiler.flash.generators; + +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Random; +import java.util.Set; + +/** + * + * @author JPEXS + */ +public class SwitchVariantsGenerator { + + /* + switch(x) + { + place1: + place2: + place3: + } + + Variants: + A) place of default (place1,place2,place3 or no place) + B) place1 can be same as place2. place2 can be same as place3 if place3 present. + B.2) if there is default on that place, it cannot be same as following + C) places that are not same as following place have break or do not have break, + C.2) last one place does not have break (its presence does not matter) + */ + public static void main(String[] args) { + int numValueCases = 2; + + int maxSeedBits = getRandomBitsNeeded(numValueCases); + long maxSeed = 1 << (maxSeedBits + 1); + Set switchSet = new HashSet<>(); + + for (long s = 0; s < maxSeed; s++) { + seed = s; + Switch p = new Switch(); + + //A + p.defaultPlace = rnd(0, numValueCases + 1); //0 = no default clause + if (p.defaultPlace > 0) { + p.numPlaces = numValueCases + 1; + } else { + p.numPlaces = numValueCases; + } + //B + + for (int place = 1; place < p.numPlaces /*not counting last*/; place++) { + if (place == p.defaultPlace) { //B.2 + p.placeSameAsNext.put(place, false); + } else { + p.placeSameAsNext.put(place, rndBool()); + } + } + p.placeSameAsNext.put(p.numPlaces, Boolean.FALSE); //last one cannot be same, but put there false + //C + for (int place = 1; place < p.numPlaces /*last one break does not matter*/; place++) { + if (!p.placeSameAsNext.get(place)) { + p.placeHasBreak.put(place, rndBool()); + } + } + switchSet.add(p); + } + + Switch.toStringPrefix = Switch.TAB; + int pos = 0; + for (Switch s : switchSet) { + pos++; + System.out.println("function test" + pos + "()"); + System.out.println("{"); + System.out.print(s.toString()); + System.out.println("}"); + } + } + + private static class Switch { + + public int defaultPlace; + public int numPlaces; + public Map placeSameAsNext = new HashMap<>(); + public Map placeHasBreak = new HashMap<>(); + + public static final String TAB = " "; + + public static String toStringPrefix = ""; + + @Override + public int hashCode() { + int hash = 3; + hash = 31 * hash + this.defaultPlace; + hash = 31 * hash + this.numPlaces; + hash = 31 * hash + Objects.hashCode(this.placeSameAsNext); + hash = 31 * hash + Objects.hashCode(this.placeHasBreak); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Switch other = (Switch) obj; + if (this.defaultPlace != other.defaultPlace) { + return false; + } + if (this.numPlaces != other.numPlaces) { + return false; + } + if (!Objects.equals(this.placeSameAsNext, other.placeSameAsNext)) { + return false; + } + if (!Objects.equals(this.placeHasBreak, other.placeHasBreak)) { + return false; + } + return true; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + final String NL = "\r\n"; + sb.append(toStringPrefix).append("var _loc1_=random(100);").append(NL); + sb.append(toStringPrefix).append("switch(_loc1_)").append(NL); + sb.append(toStringPrefix).append("{").append(NL); + int checkedVal = 0; + for (int place = 1; place <= numPlaces; place++) { + sb.append(toStringPrefix); + if (defaultPlace == place) { + sb.append(TAB).append("default"); + } else { + checkedVal++; + sb.append(TAB).append("case ").append(checkedVal); + } + sb.append(":").append(NL); + if (!placeSameAsNext.get(place)) { + sb.append(toStringPrefix).append(TAB).append(TAB).append("trace(\"place").append(place).append("\");").append(NL); + if (placeHasBreak.containsKey(place) && placeHasBreak.get(place)) { + sb.append(toStringPrefix).append(TAB).append(TAB).append("break;").append(NL); + } + } + } + + sb.append(toStringPrefix).append("}").append(NL); + sb.append(toStringPrefix).append("trace(\"after switch\");").append(NL); + return sb.toString(); + } + + } + + //private static Random RANDOM = new Random(); + private static long seed = 0; + + private static boolean rndBool() { + return nextBit() == 1; + } + + private static int rnd(int min, int max) { + return nextInt(max - min + 1) + min; + } + + private static int nextInt(int bound) { + int bits = getBitsNeeded(bound); + int value = 0; + for (int i = 0; i < bits; i++) { + value = value + (nextBit() << i); + } + return value; + } + + private static int nextBit() { + int bit = (int) (seed & 1); + seed = seed >> 1; + return bit; + } + + private static int getBitsNeeded(int value) { + int numBits = 0; + while (value > 0) { + numBits++; + value = value >> 1; + } + return numBits; + } + + private static int getRandomBitsNeeded(int numCases) { + int x = 0; + int value = numCases + 1; + while (value > 0) { + x++; + value = value >> 1; + } + int y = numCases - 1; + int z = y + 2; + return x + y + z; + } +} diff --git a/libsrc/ffdec_lib/testdata/as2/MyError.as b/libsrc/ffdec_lib/testdata/as2/MyError.as new file mode 100644 index 000000000..17155b011 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2/MyError.as @@ -0,0 +1,4 @@ +class MyError extends Error +{ + var message = "My custom error occurred"; +} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2/as2.fla b/libsrc/ffdec_lib/testdata/as2/as2.fla index 72b8eca2a..4b38fcd38 100644 Binary files a/libsrc/ffdec_lib/testdata/as2/as2.fla and b/libsrc/ffdec_lib/testdata/as2/as2.fla differ diff --git a/libsrc/ffdec_lib/testdata/as2/as2.swf b/libsrc/ffdec_lib/testdata/as2/as2.swf index f728c166d..3b1088827 100644 Binary files a/libsrc/ffdec_lib/testdata/as2/as2.swf and b/libsrc/ffdec_lib/testdata/as2/as2.swf differ diff --git a/libsrc/ffdec_lib/testdata/as2/com/jpexs/MyTest.as b/libsrc/ffdec_lib/testdata/as2/com/jpexs/MyTest.as deleted file mode 100644 index 15b7784fd..000000000 --- a/libsrc/ffdec_lib/testdata/as2/com/jpexs/MyTest.as +++ /dev/null @@ -1,15 +0,0 @@ -class com.jpexs.MyTest { - private var i:Number=5; - static var k:Number=27; - - function test():Number - { - trace("hello"); - return 5; - } - static function testS():Number - { - trace("hi"); - return 88; - } -} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/TestLoader.as b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/TestLoader.as new file mode 100644 index 000000000..4f12ac264 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/TestLoader.as @@ -0,0 +1,12 @@ +/** + * Class for including other TestCases, it is called from frame 65 + */ +class com.jpexs.flash.test.TestLoader { + + public function includeTests() { + new com.jpexs.flash.test.testcases.TestSetterGetter(); + new com.jpexs.flash.test.testcases.TestCallSetterGetter(); + new com.jpexs.flash.test.testcases.TestVarsMethods(); + new com.jpexs.flash.test.testcases.TestMaintainOrder(); + } +} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestCallSetterGetter.as b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestCallSetterGetter.as new file mode 100644 index 000000000..4133f2785 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestCallSetterGetter.as @@ -0,0 +1,18 @@ +class com.jpexs.flash.test.testcases.TestCallSetterGetter { + public var myobj : com.jpexs.flash.test.testcases.TestSetterGetter; + + public function testSetterCall(){ + this.myobj.myvar = 5; + } + public function testGetterCall() : Number { + return this.myobj.myvar; + } + + public function testStatGetterCall() : Number { + return com.jpexs.flash.test.testcases.TestSetterGetter.mystatvar; + } + + public function testStatSetterCall(val:Number) { + com.jpexs.flash.test.testcases.TestSetterGetter.mystatvar = 6; + } +} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestMaintainOrder.as b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestMaintainOrder.as new file mode 100644 index 000000000..10e984243 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestMaintainOrder.as @@ -0,0 +1,36 @@ +class com.jpexs.flash.test.testcases.TestMaintainOrder { + + public var a:Number = 1; + public static var b:Number = 2; + public var c:Number = 3; + public static var d:Number = 4; + public static var e:Number = 5; + public var f:Number = 6; + public var g:Number = 7; + + public function h(){ + trace("8"); + } + + public function i() { + trace("9"); + } + public static function j() { + trace("10"); + } + public static function k() { + trace("11"); + } + public function l() { + trace("12"); + } + public static function m() { + trace("13"); + } + + public var _x1:String = "after method m"; + + public function _x2() { + trace("after _x1"); + } +} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestSetterGetter.as b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestSetterGetter.as new file mode 100644 index 000000000..5dc85b1a9 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestSetterGetter.as @@ -0,0 +1,34 @@ +class com.jpexs.flash.test.testcases.TestSetterGetter { + + private var priv_myvar:Number; + + private static var priv_mystatvar: Number; + + private var priv_myreadonly : Number = 1; + + private var priv_mywriteonly : Number = 2; + + public function get myvar(){ + return this.priv_myvar; + } + + public function set myvar(val){ + this.priv_myvar = val; + } + + public static function get mystatvar(){ + return TestSetterGetter.priv_mystatvar; + } + + public static function set mystatvar(val:Number){ + TestSetterGetter.priv_mystatvar = val; + } + + public function get myreadonly(){ + return this.priv_myreadonly; + } + + public function set mywriteonly(val:Number) { + this.priv_mywriteonly = val; + } +} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestVarsMethods.as b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestVarsMethods.as new file mode 100644 index 000000000..0bbf5c438 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2/com/jpexs/flash/test/testcases/TestVarsMethods.as @@ -0,0 +1,18 @@ +class com.jpexs.flash.test.testcases.TestVarsMethods { + + public var instVar:Number = 1; + public static var statVar:Number = 2; + + + public function TestVarsMethods(){ + trace("constructor"); + } + + public function instMethod() { + trace("instance method"); + } + + public static function statMethod() { + trace("static method"); + } +} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2_definefunc_regs/MyClass.as b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/MyClass.as new file mode 100644 index 000000000..feeadef60 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/MyClass.as @@ -0,0 +1,37 @@ +class MyClass { + + function testNoReturn(){ + var a = 5; + var b = a + 27; + trace("hi:"+b); + } + + function testSimpleReturn(){ + var a = 5; + var b = 5 * 6; + return "bagr"+b; + } + + function testReturns(){ + var a = 10; + if(a > 2){ + a++; + for(var i=0;i<100;i++){ + if(a + i == 27){ + return a + 7; + } + i+= 27; + } + } else if (a == 4){ + return 4; + } + return 3; + } + + function testSomeReturns(){ + var a = 5; + if(a < 10){ + return a; + } + } +} \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.fla b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.fla new file mode 100644 index 000000000..128279142 Binary files /dev/null and b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.fla differ diff --git a/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.html b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.html new file mode 100644 index 000000000..f85c9168c --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.html @@ -0,0 +1,18 @@ + + + + +as2_definefunc_regs + + + + + + + + + + + + + diff --git a/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.swf b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.swf new file mode 100644 index 000000000..1ef4bdb28 Binary files /dev/null and b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/as2_definefunc_regs.swf differ diff --git a/libsrc/ffdec_lib/testdata/as2_definefunc_regs/readme.txt b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/readme.txt new file mode 100644 index 000000000..fd68e4ed7 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as2_definefunc_regs/readme.txt @@ -0,0 +1,6 @@ +This is Flash MX Professional 2004 project with one class and export settings set to Flash 6. + +The swf file has unusual structure: +From Flash 7 onwards, functions are stored as ActionDefineFunction2 with use up to 255 local +registers. When exporting SWF to lower formats Flash5-Flash6 in Flash IDE (for example MX 2004), all ActionDefineFunction2 are replaced with ActionDefineFunction, and it also use local registers (4 of them are +available). The code of ActionDefineFunction is also modified that it pushes all previous values of registers on the code start and pops them back on code exit or when return action shows up. All returns are replaced with jump to popping part. This makes code flow tangled and the decompiler must do some special treatment. \ No newline at end of file diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoMan.java b/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoMan.java index 3314b7bb5..0fc01cbf5 100644 --- a/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoMan.java +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoMan.java @@ -16,14 +16,16 @@ package jsyntaxpane; import javax.swing.event.UndoableEditEvent; import javax.swing.text.AbstractDocument; import javax.swing.text.AbstractDocument.DefaultDocumentEvent; +import javax.swing.undo.CannotRedoException; import javax.swing.undo.CannotUndoException; import javax.swing.undo.CompoundEdit; import javax.swing.undo.UndoManager; import javax.swing.undo.UndoableEdit; /** - * A revised UndoManager that groups undos based on positions. If the change is relatively next to the - * previous change, like when continuous typing, then the undoes are grouped together. + * A revised UndoManager that groups undos based on positions. If the change is + * relatively next to the previous change, like when continuous typing, then the + * undoes are grouped together. * * This is cutomized from the * @@ -34,107 +36,164 @@ import javax.swing.undo.UndoableEdit; * http://tips4java.wordpress.com/2008/10/27/compound-undo-manager/ * * @author Ayman Al-Sairafi + * + * + * JPEXS - updated for java 9+ + * https://github.com/nordfalk/jsyntaxpane/blob/master/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoManager.java + * */ public class CompoundUndoMan extends UndoManager { - private CompoundEdit compoundEdit; - // This allows us to start combining operations. - // it will be reset after the first change. - private boolean startCombine = false; - // This holds the start of the last line edited, if edits are on multiple - // lines, then they will not be combined. - private int lastLine = -1; + private final SyntaxDocument doc; - public CompoundUndoMan(SyntaxDocument doc) { - doc.addUndoableEditListener(this); - lastLine = doc.getStartPosition().getOffset(); - } + private CompoundEdit compoundEdit; + // This allows us to start combining operations. + // it will be reset after the first change. + private boolean startCombine = false; + // This holds the start of the last line edited, if edits are on multiple + // lines, then they will not be combined. + private int lastLine = -1; - /** - * Whenever an UndoableEdit happens the edit will either be absorbed - * by the current compound edit or a new compound edit will be started - */ - @Override - public void undoableEditHappened(UndoableEditEvent e) { - // Start a new compound edit + public CompoundUndoMan(SyntaxDocument doc) { + this.doc = doc; + doc.addUndoableEditListener(this); + lastLine = doc.getStartPosition().getOffset(); + } - AbstractDocument.DefaultDocumentEvent docEvt = (DefaultDocumentEvent) e.getEdit(); + /** + * Whenever an UndoableEdit happens the edit will either be absorbed by the + * current compound edit or a new compound edit will be started + */ + @Override + public void undoableEditHappened(UndoableEditEvent e) { + // Start a new compound edit - if (compoundEdit == null) { - compoundEdit = startCompoundEdit(e.getEdit()); - startCombine = false; - return; - } + if (compoundEdit == null) { + compoundEdit = startCompoundEdit(e.getEdit()); + startCombine = false; + updateDirty(); + return; + } + if (e.getEdit() instanceof DefaultDocumentEvent) { + // Java 6 to 8 + AbstractDocument.DefaultDocumentEvent docEvt = (DefaultDocumentEvent) e.getEdit(); - int editLine = ((SyntaxDocument)docEvt.getDocument()).getLineNumberAt(docEvt.getOffset()); + int editLine = doc.getLineNumberAt(docEvt.getOffset()); - // Check for an incremental edit or backspace. - // The Change in Caret position and Document length should both be - // either 1 or -1. - if ((startCombine || Math.abs(docEvt.getLength()) == 1) && editLine == lastLine) { - compoundEdit.addEdit(e.getEdit()); - startCombine = false; - return; - } + // Check for an incremental edit or backspace. + // The Change in Caret position and Document length should both be + // either 1 or -1. + if ((startCombine || Math.abs(docEvt.getLength()) == 1) && editLine == lastLine) { + compoundEdit.addEdit(e.getEdit()); + startCombine = false; + updateDirty(); + return; + } - // Not incremental edit, end previous edit and start a new one - lastLine = editLine; + // Not incremental edit, end previous edit and start a new one + lastLine = editLine; - compoundEdit.end(); - compoundEdit = startCompoundEdit(e.getEdit()); - } + } else // Java 9: It seems that all the edits are wrapped and we cannot get line number! + // See https://github.com/netroby/jdk9-dev/blob/master/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L279 + // AbstractDocument.DefaultDocumentEventUndoableWrapper docEvt = e.getEdit(); + { + if (startCombine && !e.getEdit().isSignificant()) { + compoundEdit.addEdit(e.getEdit()); + startCombine = false; + updateDirty(); + return; + } + } - /* - ** Each CompoundEdit will store a group of related incremental edits - ** (ie. each character typed or backspaced is an incremental edit) - */ - private CompoundEdit startCompoundEdit(UndoableEdit anEdit) { - // Track Caret and Document information of this compound edit - AbstractDocument.DefaultDocumentEvent docEvt = (DefaultDocumentEvent) anEdit; + compoundEdit.end(); + compoundEdit = startCompoundEdit(e.getEdit()); - // The compound edit is used to store incremental edits + updateDirty(); + } - compoundEdit = new MyCompoundEdit(); - compoundEdit.addEdit(anEdit); + private void updateDirty() { + doc.setCanUndo(canUndo()); + doc.setCanRedo(canRedo()); + } - // The compound edit is added to the UndoManager. All incremental - // edits stored in the compound edit will be undone/redone at once + @Override + protected void undoTo(UndoableEdit edit) throws CannotUndoException { + super.undoTo(edit); + updateDirty(); + } - addEdit(compoundEdit); + @Override + public synchronized void undo() throws CannotUndoException { + super.undo(); + updateDirty(); + } - return compoundEdit; - } + @Override + protected void redoTo(UndoableEdit edit) throws CannotRedoException { + super.redoTo(edit); + updateDirty(); + } - class MyCompoundEdit extends CompoundEdit { + @Override + public synchronized void redo() throws CannotRedoException { + super.redo(); + updateDirty(); + } - @Override - public boolean isInProgress() { - // in order for the canUndo() and canRedo() methods to work - // assume that the compound edit is never in progress - return false; - } + @Override + public synchronized void discardAllEdits() { + super.discardAllEdits(); + updateDirty(); + } - @Override - public void undo() throws CannotUndoException { - // End the edit so future edits don't get absorbed by this edit + /* + ** Each CompoundEdit will store a group of related incremental edits + ** (ie. each character typed or backspaced is an incremental edit) + */ + private CompoundEdit startCompoundEdit(UndoableEdit anEdit) { + // Track Caret and Document information of this compound edit + // AbstractDocument.DefaultDocumentEvent docEvt = (DefaultDocumentEvent) anEdit; - if (compoundEdit != null) { - compoundEdit.end(); - } + // The compound edit is used to store incremental edits + compoundEdit = new MyCompoundEdit(); + compoundEdit.addEdit(anEdit); - super.undo(); + // The compound edit is added to the UndoManager. All incremental + // edits stored in the compound edit will be undone/redone at once + addEdit(compoundEdit); - // Always start a new compound edit after an undo + return compoundEdit; + } - compoundEdit = null; - } - } + class MyCompoundEdit extends CompoundEdit { - /** - * Start to combine the next operations together. Only the next operation is combined. - * The flag is then automatically reset. - */ - public void startCombine() { - startCombine = true; - } + @Override + public boolean isInProgress() { + // in order for the canUndo() and canRedo() methods to work + // assume that the compound edit is never in progress + return false; + } + + @Override + public void undo() throws CannotUndoException { + // End the edit so future edits don't get absorbed by this edit + + if (compoundEdit != null) { + compoundEdit.end(); + } + + super.undo(); + + // Always start a new compound edit after an undo + compoundEdit = null; + } + } + + /** + * Start to combine the next operations together. Only the next operation is + * combined. The flag is then automatically reset. + */ + public void startCombine() { + startCombine = true; + } } diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxDocument.java b/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxDocument.java index fcc5bed2b..efd06df06 100644 --- a/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxDocument.java +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxDocument.java @@ -13,6 +13,7 @@ */ package jsyntaxpane; +import java.beans.PropertyChangeSupport; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -30,577 +31,616 @@ import javax.swing.text.PlainDocument; import javax.swing.text.Segment; /** - * A document that supports being highlighted. The document maintains an - * internal List of all the Tokens. The Tokens are updated using - * a Lexer, passed to it during construction. - * + * A document that supports being highlighted. The document maintains an + * internal List of all the Tokens. The Tokens are updated using a Lexer, passed + * to it during construction. + * * @author Ayman Al-Sairafi */ public class SyntaxDocument extends PlainDocument { - Lexer lexer; - List tokens; - CompoundUndoMan undo; - boolean ignoreUpdate; + public static final String CAN_UNDO = "can-undo"; + public static final String CAN_REDO = "can-redo"; - public SyntaxDocument(Lexer lexer) { - super(); - putProperty(PlainDocument.tabSizeAttribute, 4); - this.lexer = lexer; - // Listen for undo and redo events - undo = new CompoundUndoMan(this); - } + Lexer lexer; + List tokens; + CompoundUndoMan undo; - /** - * Parse the entire document and return list of tokens that do not already - * exist in the tokens list. There may be overlaps, and replacements, - * which we will cleanup later. - * @return list of tokens that do not exist in the tokens field - */ - private void parse() { - // if we have no lexer, then we must have no tokens... - if (lexer == null) { - tokens = null; - return; - } - int len = getLength(); - List toks = new ArrayList(len / 10); - long ts = System.nanoTime(); - try { - Segment seg = new Segment(); - getText(0, len, seg); - lexer.parse(seg, 0, toks); - } catch (BadLocationException ex) { - log.log(Level.SEVERE, null, ex); - } finally { - if (log.isLoggable(Level.FINEST)) { - log.finest(String.format("Parsed %d in %d ms, giving %d tokens\n", - len, (System.nanoTime() - ts) / 1000000, toks.size())); - } - tokens = toks; - } - } + boolean ignoreUpdate; + private final PropertyChangeSupport propSupport; + private boolean canUndoState = false; + private boolean canRedoState = false; - @Override - protected void fireChangedUpdate(DocumentEvent e) { - parse(); - super.fireChangedUpdate(e); - } + public SyntaxDocument(Lexer lexer) { + super(); + putProperty(PlainDocument.tabSizeAttribute, 4); + this.lexer = lexer; + // Listen for undo and redo events + undo = new CompoundUndoMan(this); + propSupport = new PropertyChangeSupport(this); + } - @Override - protected void fireInsertUpdate(DocumentEvent e) { - if (ignoreUpdate) { - return; - } - parse(); - super.fireInsertUpdate(e); - } + /** + * Parse the entire document and return list of tokens that do not already + * exist in the tokens list. There may be overlaps, and replacements, which + * we will cleanup later. + * + * @return list of tokens that do not exist in the tokens field + */ + private void parse() { + // if we have no lexer, then we must have no tokens... + if (lexer == null) { + tokens = null; + return; + } + int len = getLength(); + List toks = new ArrayList(len / 10); + long ts = System.nanoTime(); + try { + Segment seg = new Segment(); + getText(0, len, seg); + lexer.parse(seg, 0, toks); + } catch (BadLocationException ex) { + log.log(Level.SEVERE, null, ex); + } finally { + if (log.isLoggable(Level.FINEST)) { + log.finest(String.format("Parsed %d in %d ms, giving %d tokens\n", + len, (System.nanoTime() - ts) / 1000000, toks.size())); + } + tokens = toks; + } + } - @Override - protected void fireRemoveUpdate(DocumentEvent e) { - parse(); - super.fireRemoveUpdate(e); - } + @Override + protected void fireChangedUpdate(DocumentEvent e) { + parse(); + super.fireChangedUpdate(e); + } - public void setIgnoreUpdate(boolean value) { - ignoreUpdate = value; - if (!ignoreUpdate) { - parse(); - } - } + @Override + protected void fireInsertUpdate(DocumentEvent e) { + if (ignoreUpdate) { + return; + } + parse(); + super.fireInsertUpdate(e); + } - /** - * Replace the token with the replacement string - * @param token - * @param replacement - */ - public void replaceToken(Token token, String replacement) { - try { - replace(token.start, token.length, replacement, null); - } catch (BadLocationException ex) { - log.log(Level.WARNING, "unable to replace token: " + token, ex); - } - } + @Override + protected void fireRemoveUpdate(DocumentEvent e) { + parse(); + super.fireRemoveUpdate(e); + } - /** - * This class is used to iterate over tokens between two positions - * - */ - class TokenIterator implements ListIterator { + public void setIgnoreUpdate(boolean value) { + ignoreUpdate = value; + if (!ignoreUpdate) { + parse(); + } + } - int start; - int end; - int ndx = 0; + /** + * Replace the token with the replacement string + * + * @param token + * @param replacement + */ + public void replaceToken(Token token, String replacement) { + try { + replace(token.start, token.length, replacement, null); + } catch (BadLocationException ex) { + log.log(Level.WARNING, "unable to replace token: " + token, ex); + } + } - @SuppressWarnings("unchecked") - private TokenIterator(int start, int end) { - this.start = start; - this.end = end; - if (tokens != null && !tokens.isEmpty()) { - Token token = new Token(TokenType.COMMENT, start, end - start); - ndx = Collections.binarySearch((List) tokens, token); - // we will probably not find the exact token... - if (ndx < 0) { - // so, start from one before the token where we should be... - // -1 to get the location, and another -1 to go back.. - ndx = (-ndx - 1 - 1 < 0) ? 0 : (-ndx - 1 - 1); - Token t = tokens.get(ndx); - // if the prev token does not overlap, then advance one - if (t.end() <= start) { - ndx++; - } + /** + * This class is used to iterate over tokens between two positions + * + */ + class TokenIterator implements ListIterator { - } - } - } + int start; + int end; + int ndx = 0; - @Override - public boolean hasNext() { - if (tokens == null) { - return false; - } - if (ndx >= tokens.size()) { - return false; - } - Token t = tokens.get(ndx); - if (t.start >= end) { - return false; - } - return true; - } + @SuppressWarnings("unchecked") + private TokenIterator(int start, int end) { + this.start = start; + this.end = end; + if (tokens != null && !tokens.isEmpty()) { + Token token = new Token(TokenType.COMMENT, start, end - start); + ndx = Collections.binarySearch((List) tokens, token); + // we will probably not find the exact token... + if (ndx < 0) { + // so, start from one before the token where we should be... + // -1 to get the location, and another -1 to go back.. + ndx = (-ndx - 1 - 1 < 0) ? 0 : (-ndx - 1 - 1); + Token t = tokens.get(ndx); + // if the prev token does not overlap, then advance one + if (t.end() <= start) { + ndx++; + } - @Override - public Token next() { - return tokens.get(ndx++); - } + } + } + } - @Override - public void remove() { - throw new UnsupportedOperationException(); - } + @Override + public boolean hasNext() { + if (tokens == null) { + return false; + } + if (ndx >= tokens.size()) { + return false; + } + Token t = tokens.get(ndx); + if (t.start >= end) { + return false; + } + return true; + } - @Override - public boolean hasPrevious() { - if (tokens == null) { - return false; - } - if (ndx <= 0) { - return false; - } - Token t = tokens.get(ndx); - if (t.end() <= start) { - return false; - } - return true; - } + @Override + public Token next() { + return tokens.get(ndx++); + } - @Override - public Token previous() { - return tokens.get(ndx--); - } + @Override + public void remove() { + throw new UnsupportedOperationException(); + } - @Override - public int nextIndex() { - return ndx + 1; - } + @Override + public boolean hasPrevious() { + if (tokens == null) { + return false; + } + if (ndx <= 0) { + return false; + } + Token t = tokens.get(ndx); + if (t.end() <= start) { + return false; + } + return true; + } - @Override - public int previousIndex() { - return ndx - 1; - } + @Override + public Token previous() { + return tokens.get(ndx--); + } - @Override - public void set(Token e) { - throw new UnsupportedOperationException(); - } + @Override + public int nextIndex() { + return ndx + 1; + } - @Override - public void add(Token e) { - throw new UnsupportedOperationException(); - } - } + @Override + public int previousIndex() { + return ndx - 1; + } - /** - * Return an iterator of tokens between p0 and p1. - * @param start start position for getting tokens - * @param end position for last token - * @return Iterator for tokens that overal with range from start to end - */ - public Iterator getTokens(int start, int end) { - return new TokenIterator(start, end); - } + @Override + public void set(Token e) { + throw new UnsupportedOperationException(); + } - /** - * Find the token at a given position. May return null if no token is - * found (whitespace skipped) or if the position is out of range: - * @param pos - * @return - */ - public Token getTokenAt(int pos) { - if (tokens == null || tokens.isEmpty() || pos > getLength()) { - return null; - } - Token tok = null; - Token tKey = new Token(TokenType.DEFAULT, pos, 1); - @SuppressWarnings("unchecked") - int ndx = Collections.binarySearch((List) tokens, tKey); - if (ndx < 0) { - // so, start from one before the token where we should be... - // -1 to get the location, and another -1 to go back.. - ndx = (-ndx - 1 - 1 < 0) ? 0 : (-ndx - 1 - 1); - Token t = tokens.get(ndx); - if ((t.start <= pos) && (pos <= t.end())) { - tok = t; - } - } else { - tok = tokens.get(ndx); - } - return tok; - } + @Override + public void add(Token e) { + throw new UnsupportedOperationException(); + } + } - public Token getWordAt(int offs, Pattern p) { - Token word = null; - try { - Element line = getParagraphElement(offs); - if (line == null) { - return word; - } - int lineStart = line.getStartOffset(); - int lineEnd = Math.min(line.getEndOffset(), getLength()); - Segment seg = new Segment(); - getText(lineStart, lineEnd - lineStart, seg); - if (seg.count > 0) { - // we need to get the word using the words pattern p - Matcher m = p.matcher(seg); - int o = offs - lineStart; - while (m.find()) { - if (m.start() <= o && o <= m.end()) { - word = new Token(TokenType.DEFAULT, m.start() + lineStart, m.end() - m.start()); - break; - } - } - } - } catch (BadLocationException ex) { - Logger.getLogger(SyntaxDocument.class.getName()).log(Level.SEVERE, null, ex); - } finally { - return word; - } - } + /** + * Return an iterator of tokens between p0 and p1. + * + * @param start start position for getting tokens + * @param end position for last token + * @return Iterator for tokens that overal with range from start to end + */ + public Iterator getTokens(int start, int end) { + return new TokenIterator(start, end); + } - /** - * Return the token following the current token, or null - * This is an expensive operation, so do not use it to update the gui - * @param tok - * @return - */ - public Token getNextToken(Token tok) { - int n = tokens.indexOf(tok); - if ((n >= 0) && (n < (tokens.size() - 1))) { - return tokens.get(n + 1); - } else { - return null; - } - } + /** + * Find the token at a given position. May return null if no token is found + * (whitespace skipped) or if the position is out of range: + * + * @param pos + * @return + */ + public Token getTokenAt(int pos) { + if (tokens == null || tokens.isEmpty() || pos > getLength()) { + return null; + } + Token tok = null; + Token tKey = new Token(TokenType.DEFAULT, pos, 1); + @SuppressWarnings("unchecked") + int ndx = Collections.binarySearch((List) tokens, tKey); + if (ndx < 0) { + // so, start from one before the token where we should be... + // -1 to get the location, and another -1 to go back.. + ndx = (-ndx - 1 - 1 < 0) ? 0 : (-ndx - 1 - 1); + Token t = tokens.get(ndx); + if ((t.start <= pos) && (pos <= t.end())) { + tok = t; + } + } else { + tok = tokens.get(ndx); + } + return tok; + } - /** - * Return the token prior to the given token, or null - * This is an expensive operation, so do not use it to update the gui - * @param tok - * @return - */ - public Token getPrevToken(Token tok) { - int n = tokens.indexOf(tok); - if ((n > 0) && (!tokens.isEmpty())) { - return tokens.get(n - 1); - } else { - return null; - } - } + public Token getWordAt(int offs, Pattern p) { + Token word = null; + try { + Element line = getParagraphElement(offs); + if (line == null) { + return word; + } + int lineStart = line.getStartOffset(); + int lineEnd = Math.min(line.getEndOffset(), getLength()); + Segment seg = new Segment(); + getText(lineStart, lineEnd - lineStart, seg); + if (seg.count > 0) { + // we need to get the word using the words pattern p + Matcher m = p.matcher(seg); + int o = offs - lineStart; + while (m.find()) { + if (m.start() <= o && o <= m.end()) { + word = new Token(TokenType.DEFAULT, m.start() + lineStart, m.end() - m.start()); + break; + } + } + } + } catch (BadLocationException ex) { + Logger.getLogger(SyntaxDocument.class.getName()).log(Level.SEVERE, null, ex); + } finally { + return word; + } + } - /** - * This is used to return the other part of a paired token in the document. - * A paired part has token.pairValue <> 0, and the paired token will - * have the negative of t.pairValue. - * This method properly handles nestings of same pairValues, but overlaps - * are not checked. - * if The document does not contain a paired token, then null is returned. - * @param t - * @return the other pair's token, or null if nothing is found. - */ - public Token getPairFor(Token t) { - if (t == null || t.pairValue == 0) { - return null; - } - Token p = null; - int ndx = tokens.indexOf(t); - // w will be similar to a stack. The openners weght is added to it - // and the closers are subtracted from it (closers are already negative) - int w = t.pairValue; - int direction = (t.pairValue > 0) ? 1 : -1; - boolean done = false; - int v = Math.abs(t.pairValue); - while (!done) { - ndx += direction; - if (ndx < 0 || ndx >= tokens.size()) { - break; - } - Token current = tokens.get(ndx); - if (Math.abs(current.pairValue) == v) { - w += current.pairValue; - if (w == 0) { - p = current; - done = true; - } - } - } + /** + * Return the token following the current token, or null + * This is an expensive operation, so do not use it to update the gui + * + * @param tok + * @return + */ + public Token getNextToken(Token tok) { + int n = tokens.indexOf(tok); + if ((n >= 0) && (n < (tokens.size() - 1))) { + return tokens.get(n + 1); + } else { + return null; + } + } - return p; - } + /** + * Return the token prior to the given token, or null + * This is an expensive operation, so do not use it to update the gui + * + * @param tok + * @return + */ + public Token getPrevToken(Token tok) { + int n = tokens.indexOf(tok); + if ((n > 0) && (!tokens.isEmpty())) { + return tokens.get(n - 1); + } else { + return null; + } + } - /** - * Perform an undo action, if possible - */ - public void doUndo() { - if (undo.canUndo()) { - undo.undo(); - parse(); - } - } + /** + * This is used to return the other part of a paired token in the document. + * A paired part has token.pairValue <> 0, and the paired token will have + * the negative of t.pairValue. This method properly handles nestings of + * same pairValues, but overlaps are not checked. if The document does not + * contain a paired token, then null is returned. + * + * @param t + * @return the other pair's token, or null if nothing is found. + */ + public Token getPairFor(Token t) { + if (t == null || t.pairValue == 0) { + return null; + } + Token p = null; + int ndx = tokens.indexOf(t); + // w will be similar to a stack. The openners weght is added to it + // and the closers are subtracted from it (closers are already negative) + int w = t.pairValue; + int direction = (t.pairValue > 0) ? 1 : -1; + boolean done = false; + int v = Math.abs(t.pairValue); + while (!done) { + ndx += direction; + if (ndx < 0 || ndx >= tokens.size()) { + break; + } + Token current = tokens.get(ndx); + if (Math.abs(current.pairValue) == v) { + w += current.pairValue; + if (w == 0) { + p = current; + done = true; + } + } + } - /** - * Perform a redo action, if possible. - */ - public void doRedo() { - if (undo.canRedo()) { - undo.redo(); - parse(); - } - } + return p; + } - /** - * Return a matcher that matches the given pattern on the entire document - * @param pattern - * @return matcher object - */ - public Matcher getMatcher(Pattern pattern) { - return getMatcher(pattern, 0, getLength()); - } + /** + * Perform an undo action, if possible + */ + public void doUndo() { + if (undo.canUndo()) { + undo.undo(); + parse(); + } + } - /** - * Return a matcher that matches the given pattern in the part of the - * document starting at offset start. Note that the matcher will have - * offset starting from start - * - * @param pattern - * @param start - * @return matcher that MUST be offset by start to get the proper - * location within the document - */ - public Matcher getMatcher(Pattern pattern, int start) { - return getMatcher(pattern, start, getLength() - start); - } + /** + * Perform a redo action, if possible. + */ + public void doRedo() { + if (undo.canRedo()) { + undo.redo(); + parse(); + } + } - /** - * Return a matcher that matches the given pattern in the part of the - * document starting at offset start and ending at start + length. - * Note that the matcher will have - * offset starting from start - * - * @param pattern - * @param start - * @param length - * @return matcher that MUST be offset by start to get the proper - * location within the document - */ - public Matcher getMatcher(Pattern pattern, int start, int length) { - Matcher matcher = null; - if (getLength() == 0) { - return null; - } - if (start >= getLength()) { - return null; - } - try { - if (start < 0) { - start = 0; - } - if (start + length > getLength()) { - length = getLength() - start; - } - Segment seg = new Segment(); - getText(start, length, seg); - matcher = pattern.matcher(seg); - } catch (BadLocationException ex) { - log.log(Level.SEVERE, "Requested offset: " + ex.offsetRequested(), ex); - } - return matcher; - } + /** + * Return a matcher that matches the given pattern on the entire document + * + * @param pattern + * @return matcher object + */ + public Matcher getMatcher(Pattern pattern) { + return getMatcher(pattern, 0, getLength()); + } - /** - * This will discard all undoable edits - */ - public void clearUndos() { - undo.discardAllEdits(); - } + /** + * Return a matcher that matches the given pattern in the part of the + * document starting at offset start. Note that the matcher will have offset + * starting from start + * + * @param pattern + * @param start + * @return matcher that MUST be offset by start to get the proper + * location within the document + */ + public Matcher getMatcher(Pattern pattern, int start) { + return getMatcher(pattern, start, getLength() - start); + } - /** - * Gets the line at given position. The line returned will NOT include - * the line terminator '\n' - * @param pos Position (usually from text.getCaretPosition() - * @return the STring of text at given position - * @throws BadLocationException - */ - public String getLineAt(int pos) throws BadLocationException { - Element e = getParagraphElement(pos); - Segment seg = new Segment(); - getText(e.getStartOffset(), e.getEndOffset() - e.getStartOffset(), seg); - char last = seg.last(); - if (last == '\n' || last == '\r') { - seg.count--; - } - return seg.toString(); - } + /** + * Return a matcher that matches the given pattern in the part of the + * document starting at offset start and ending at start + length. Note that + * the matcher will have offset starting from start + * + * @param pattern + * @param start + * @param length + * @return matcher that MUST be offset by start to get the proper + * location within the document + */ + public Matcher getMatcher(Pattern pattern, int start, int length) { + Matcher matcher = null; + if (getLength() == 0) { + return null; + } + if (start >= getLength()) { + return null; + } + try { + if (start < 0) { + start = 0; + } + if (start + length > getLength()) { + length = getLength() - start; + } + Segment seg = new Segment(); + getText(start, length, seg); + matcher = pattern.matcher(seg); + } catch (BadLocationException ex) { + log.log(Level.SEVERE, "Requested offset: " + ex.offsetRequested(), ex); + } + return matcher; + } - /** - * Deletes the line at given position - * @param pos - * @throws javax.swing.text.BadLocationException - */ - public void removeLineAt(int pos) - throws BadLocationException { - Element e = getParagraphElement(pos); - remove(e.getStartOffset(), getElementLength(e)); - } + /** + * This will discard all undoable edits + */ + public void clearUndos() { + undo.discardAllEdits(); + } - /** - * Replace the line at given position with the given string, which can span - * multiple lines - * @param pos - * @param newLines - * @throws javax.swing.text.BadLocationException - */ - public void replaceLineAt(int pos, String newLines) - throws BadLocationException { - Element e = getParagraphElement(pos); - replace(e.getStartOffset(), getElementLength(e), newLines, null); - } + /** + * Gets the line at given position. The line returned will NOT include the + * line terminator '\n' + * + * @param pos Position (usually from text.getCaretPosition() + * @return the STring of text at given position + * @throws BadLocationException + */ + public String getLineAt(int pos) throws BadLocationException { + Element e = getParagraphElement(pos); + Segment seg = new Segment(); + getText(e.getStartOffset(), e.getEndOffset() - e.getStartOffset(), seg); + char last = seg.last(); + if (last == '\n' || last == '\r') { + seg.count--; + } + return seg.toString(); + } - /** - * Helper method to get the length of an element and avoid getting - * a too long element at the end of the document - * @param e - * @return - */ - private int getElementLength(Element e) { - int end = e.getEndOffset(); - if (end >= (getLength() - 1)) { - end--; - } - return end - e.getStartOffset(); - } + /** + * Deletes the line at given position + * + * @param pos + * @throws javax.swing.text.BadLocationException + */ + public void removeLineAt(int pos) + throws BadLocationException { + Element e = getParagraphElement(pos); + remove(e.getStartOffset(), getElementLength(e)); + } - /** - * Gets the text without the comments. For example for the string - * { // it's a comment this method will return "{ ". - * @param aStart start of the text. - * @param anEnd end of the text. - * @return String for the line without comments (if exists). - */ - public synchronized String getUncommentedText(int aStart, int anEnd) { - readLock(); - StringBuilder result = new StringBuilder(); - Iterator iter = getTokens(aStart, anEnd); - while (iter.hasNext()) { - Token t = iter.next(); - if (!TokenType.isComment(t)) { - result.append(t.getText(this)); - } - } - readUnlock(); - return result.toString(); - } + /** + * Replace the line at given position with the given string, which can span + * multiple lines + * + * @param pos + * @param newLines + * @throws javax.swing.text.BadLocationException + */ + public void replaceLineAt(int pos, String newLines) + throws BadLocationException { + Element e = getParagraphElement(pos); + replace(e.getStartOffset(), getElementLength(e), newLines, null); + } - /** - * Returns the starting position of the line at pos - * @param pos - * @return starting position of the line - */ - public int getLineStartOffset(int pos) { - return getParagraphElement(pos).getStartOffset(); - } + /** + * Helper method to get the length of an element and avoid getting a too + * long element at the end of the document + * + * @param e + * @return + */ + private int getElementLength(Element e) { + int end = e.getEndOffset(); + if (end >= (getLength() - 1)) { + end--; + } + return end - e.getStartOffset(); + } - /** - * Returns the end position of the line at pos. - * Does a bounds check to ensure the returned value does not exceed - * document length - * @param pos - * @return - */ - public int getLineEndOffset(int pos) { - int end = 0; - end = getParagraphElement(pos).getEndOffset(); - if (end >= getLength()) { - end = getLength(); - } - return end; - } + /** + * Gets the text without the comments. For example for the string + * { // it's a comment this method will return "{ ". + * + * @param aStart start of the text. + * @param anEnd end of the text. + * @return String for the line without comments (if exists). + */ + public synchronized String getUncommentedText(int aStart, int anEnd) { + readLock(); + StringBuilder result = new StringBuilder(); + Iterator iter = getTokens(aStart, anEnd); + while (iter.hasNext()) { + Token t = iter.next(); + if (!TokenType.isComment(t)) { + result.append(t.getText(this)); + } + } + readUnlock(); + return result.toString(); + } - /** - * Return the number of lines in this document - * @return - */ - public int getLineCount() { - Element e = getDefaultRootElement(); - int cnt = e.getElementCount(); - return cnt; - } + /** + * Returns the starting position of the line at pos + * + * @param pos + * @return starting position of the line + */ + public int getLineStartOffset(int pos) { + return getParagraphElement(pos).getStartOffset(); + } - /** - * Return the line number at given position. The line numbers are zero based - * @param pos - * @return - */ - public int getLineNumberAt(int pos) { - int lineNr = getDefaultRootElement().getElementIndex(pos); - return lineNr; - } + /** + * Returns the end position of the line at pos. Does a bounds check to + * ensure the returned value does not exceed document length + * + * @param pos + * @return + */ + public int getLineEndOffset(int pos) { + int end = getParagraphElement(pos).getEndOffset(); + if (end >= getLength()) { + end = getLength(); + } + return end; + } - @Override - public String toString() { - return "SyntaxDocument(" + lexer + ", " + ((tokens == null) ? 0 : tokens.size()) + " tokens)@" + - hashCode(); - } + /** + * Return the number of lines in this document + * + * @return + */ + public int getLineCount() { + Element e = getDefaultRootElement(); + int cnt = e.getElementCount(); + return cnt; + } - /** - * We override this here so that the replace is treated as one operation - * by the undomanager - * @param offset - * @param length - * @param text - * @param attrs - * @throws BadLocationException - */ - @Override - public void replace(int offset, int length, String text, AttributeSet attrs) throws BadLocationException { - remove(offset, length); - undo.startCombine(); - insertString(offset, text, attrs); - } + /** + * Return the line number at given position. The line numbers are zero based + * + * @param pos + * @return + */ + public int getLineNumberAt(int pos) { + int lineNr = getDefaultRootElement().getElementIndex(pos); + return lineNr; + } - /** - * Append the given string to the text of this document. - * @param str - * @return this document - */ - public SyntaxDocument append(String str) { - try { - insertString(getLength(), str, null); - } catch (BadLocationException ex) { - log.log(Level.WARNING, "Error appending str", ex); - } - return this; - } + @Override + public String toString() { + return "SyntaxDocument(" + lexer + ", " + ((tokens == null) ? 0 : tokens.size()) + " tokens)@" + + hashCode(); + } + + /** + * We override this here so that the replace is treated as one operation by + * the undomanager + * + * @param offset + * @param length + * @param text + * @param attrs + * @throws BadLocationException + */ + @Override + public void replace(int offset, int length, String text, AttributeSet attrs) throws BadLocationException { + remove(offset, length); + undo.startCombine(); + insertString(offset, text, attrs); + } + + /** + * Append the given string to the text of this document. + * + * @param str + * @return this document + */ + public SyntaxDocument append(String str) { + try { + insertString(getLength(), str, null); + } catch (BadLocationException ex) { + log.log(Level.WARNING, "Error appending str", ex); + } + return this; + } + + public void setCanUndo(boolean value) { + if (canUndoState != value) { + // System.out.println("canUndo = " + value); + canUndoState = value; + propSupport.firePropertyChange(CAN_UNDO, !value, value); + } + } + + public void setCanRedo(boolean value) { + if (canRedoState != value) { + // System.out.println("canRedo = " + value); + canRedoState = value; + propSupport.firePropertyChange(CAN_REDO, !value, value); + } + } // our logger instance... - private static final Logger log = Logger.getLogger(SyntaxDocument.class.getName()); + private static final Logger log = Logger.getLogger(SyntaxDocument.class.getName()); } diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config_tr.properties b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config_tr.properties new file mode 100644 index 000000000..ecbf2cb72 --- /dev/null +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config_tr.properties @@ -0,0 +1,118 @@ +DefaultAction.copy-to-clipboard.MenuText = Kopya +DefaultAction.cut-to-clipboard.MenuText = Kesmek +DefaultAction.paste-from-clipboard.MenuText = Yap\u0131\u015ft\u0131rmak +DefaultAction.select-all.MenuText = Hepsini Se\u00e7 + +Action.find.MenuText = Bulmak +Action.find.ToolTip = Bul ve De\u011fi\u015ftir ileti\u015fim kutusunu g\u00f6r\u00fcnt\u00fcle +Action.find-next.MenuText = Sonrakini Bul +Action.find-next.ToolTip = Son Bulmay\u0131 Yinele +Action.goto-line.MenuText = Sat\u0131r Numaras\u0131na Git +Action.goto-line.ToolTip = Sat\u0131r Numaras\u0131na Git +Action.indent.MenuText = Sat\u0131rba\u015f\u0131 +Action.unindent.MenuText = Girintisiz +Action.undo.MenuText = Geri al +Action.redo.MenuText = Yeniden Yapmak +Action.delete-lines.MenuText = \u00c7izgi(ler) Sil +Action.dup-lines-up.MenuText = Yukar\u0131daki Yinelenen Sat\u0131r +Action.dup-lines-down.MenuText = \u00c7izgileri A\u015fa\u011f\u0131 \u00c7o\u011falt +Action.toggle-lines.MenuText = Sat\u0131r Say\u0131lar\u0131n\u0131 De\u011fi\u015ftir +Action.show-abbs.MenuText = K\u0131saltmalar\u0131 g\u00f6ster +Action.show-abbs.ToolTip = K\u0131saltmalar\u0131 g\u00f6ster +Action.complete-word.MenuText = Tam Kelime +Action.jump-to-pair.MenuText = \u00c7ifte Ge\u00e7 +Action.toggle-comments.MenuText = Yorumlar\u0131 De\u011fi\u015ftir/A\u00e7/Kapat + +# !!!! FFDec translators - please do not edit anything below this line !!! +#========================================================================== + +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersRuler +# This is the color to highlight tokens whenever the cursor is on them +TokenMarker.Color = 0xffeeaa +# Colors for PairMarkers +PairMarker.Color = 0xffbb77 +# +# Right Margin for LineNumbers border in pixels, Default = 5 +LineNumbers.RightMargin = 7 +# Foreground for line numbers, Default = Black +LineNumbers.Foreground = 0x333300 +# Background for line numbers, Default = White +LineNumbers.Background = 0xeeeeff +# Color to use for highlighting current line background +LineNumbers.CurrentBack = 0xccccee +# Default color for the Caret, Black +CaretColor = 0x000000 +# Actions: +Action.quick-find = jsyntaxpane.actions.QuickFindAction, control F +Action.find = jsyntaxpane.actions.FindReplaceAction, control H +Action.find-next = jsyntaxpane.actions.FindNextAction, F3 +Action.goto-line = jsyntaxpane.actions.GotoLineAction, control G + +Action.indent = jsyntaxpane.actions.IndentAction, TAB +Action.indent.Abbreviations = ${class_path}/abbreviations.properties +Action.unindent = jsyntaxpane.actions.UnindentAction, shift TAB + +Action.jindent = jsyntaxpane.actions.JIndentAction, ENTER +Action.undo = jsyntaxpane.actions.UndoAction, menu Z +Action.redo = jsyntaxpane.actions.RedoAction, menu Y +Action.delete-lines = jsyntaxpane.actions.DeleteLinesAction, control E +Action.dup-lines-up = jsyntaxpane.actions.DuplicateLinesAction, shift control UP +Action.dup-lines-down = jsyntaxpane.actions.DuplicateLinesAction, shift control DOWN + +Action.toggle-lines = jsyntaxpane.actions.ToggleComponentAction, control F2 +Action.toggle-lines.Component = jsyntaxpane.components.LineNumbersRuler + +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.SmallIcon = comment.png +Action.jump-to-pair = jsyntaxpane.actions.JumpToPairAction, control OPEN_BRACKET +Action.complete-word = jsyntaxpane.actions.CompleteWordAction, control K + +Action.smart-home = jsyntaxpane.actions.SmartHomeAction, HOME +Action.smart-home-select = jsyntaxpane.actions.SmartHomeSelectAction, shift HOME +Action.show-abbs = jsyntaxpane.actions.ShowAbbsAction, F8 + +# +# View configuration: +TextAA = ON +DEFAULT_EDIT_MENU= \ + cut-to-clipboard , \ + copy-to-clipboard , \ + paste-from-clipboard , \ + - , \ + select-all , \ + - , \ + undo , \ + redo , \ + - , \ + find , \ + find-next , \ + goto-line , \ + jump-to-pair , \ + - , \ + complete-word + +# Default Popup Menu +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + goto-line , \ + toggle-comments +# TokenType attributes +Style.OPERATOR = 0x000000, 0 +Style.DELIMITER = 0x000000, 1 +Style.KEYWORD = 0x3333ee, 0 +Style.KEYWORD2 = 0x3333ee, 3 +Style.TYPE = 0x000000, 2 +Style.TYPE2 = 0x000000, 1 +Style.TYPE3 = 0x000000, 3 +Style.STRING = 0xcc6600, 0 +Style.STRING2 = 0xcc6600, 1 +Style.NUMBER = 0x999933, 1 +Style.REGEX = 0xcc6600, 0 +Style.IDENTIFIER = 0x000000, 0 +Style.COMMENT = 0x339933, 2 +Style.COMMENT2 = 0x339933, 3 +Style.DEFAULT = 0x000000, 0 +Style.WARNING = 0xCC0000, 0 +Style.ERROR = 0xCC0000, 3 \ No newline at end of file diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3methodinfosyntaxkit/config_tr.properties b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3methodinfosyntaxkit/config_tr.properties new file mode 100644 index 000000000..7eed09f59 --- /dev/null +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3methodinfosyntaxkit/config_tr.properties @@ -0,0 +1,36 @@ +Action.toggle-token-marker.MenuText = \u0130\u015faret \u0130\u015faret\u00e7isini De\u011fi\u015ftir + +# !!!! FFDec translators - please do not edit anything below this line !!! +#========================================================================== + +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.LineNumbersBreakpointsRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +#Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +#Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config_tr.properties b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config_tr.properties new file mode 100644 index 000000000..3504d2d17 --- /dev/null +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config_tr.properties @@ -0,0 +1,45 @@ +Action.combo-completion.MenuText = Bir talimat se\u00e7 +Action.toggle-token-marker.MenuText = \u0130\u015faret \u0130\u015faret\u00e7isini De\u011fi\u015ftir + +# !!!! FFDec translators - please do not edit anything below this line !!! +#========================================================================== + +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersBreakpointsRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +#Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +#Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-lines , \ + toggle-token-marker + +Style.KEYWORD = 0x0000ff, 1 +Style.KEYWORD2 = 0x007f7f, 1 +Style.OPERATOR = 0x7f007f, 0 \ No newline at end of file diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config_tr.properties b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config_tr.properties new file mode 100644 index 000000000..cefe52504 --- /dev/null +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config_tr.properties @@ -0,0 +1,40 @@ +Action.toggle-token-marker.MenuText = \u0130\u015faret \u0130\u015faret\u00e7isini De\u011fi\u015ftir + +# !!!! FFDec translators - please do not edit anything below this line !!! +#========================================================================== + +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.LineNumbersBreakpointsRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +#Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +#Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane/Bundle_tr.properties b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane/Bundle_tr.properties new file mode 100644 index 000000000..8fe363333 --- /dev/null +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane/Bundle_tr.properties @@ -0,0 +1,38 @@ +SyntaxTester.title = JSyntaxPane Test Cihaz\u0131 +SyntaxTester.lblCaretPos.text = D\u00fczeltme Pozisyonu +SyntaxTester.lblToken.text = \u0130mlecin alt\u0131ndaki simge +SyntaxTester.jEdtTest.contentType = +NO_TOKEN_AT_CURSOR = \u0130\u015faret\u00e7i yok + +HTMLPreviewFrame.title = HTML \u00d6nizleme +HTMLPreviewFrame.jEdtHtml.contentType = metin/HTML +QuickFindDialog.jChkWrap.text = Sarmak +QuickFindDialog.jChkRegExp.text = Reg Exp +QuickFindDialog.jChkIgnoreCase.text = Vakay\u0131 Yoksay +QuickFindDialog.jLabel1.text = H\u0131zl\u0131 arama +QuickFindDialog.NotFound = bulunamad\u0131 +ReplaceDialog.jChkRegex.text = D\u00fczenli \u0130fade +ReplaceDialog.jChkIgnoreCase.text = Vakay\u0131 Yoksay +ReplaceDialog.jLblReplace.text = De\u011fi\u015ftirmek +ReplaceDialog.jTglHighlight.text = Vurgulamak +ReplaceDialog.jBtnReplaceAll.text = Hepsini de\u011fi\u015ftir +ReplaceDialog.jBtnPrev.text = \u00d6nceki +ReplaceDialog.jChkWrap.toolTipText = Sona erdi\u011finde ba\u015fa sar\u0131n +ReplaceDialog.jChkWrap.text = Etraf\u0131na sarmak +ReplaceDialog.title = Bul ve De\u011fi\u015ftir +ReplaceDialog.jBtnNext.text = Sonraki +ReplaceDialog.jLblFind.text = Bulmak +ReplaceDialog.jBtnReplace.text = De\u011fi\u015ftirmek +ShowAbbsDialog.title = K\u0131saltmalar +GotoLineDialog.title = Sat\u0131ra git. +GotoLineDialog.jBtnOk.text = Gidi\u015f + +DocumentSearchData.SearchStringNotFound = Arama Dizesi {0} bulunamad\u0131 +DocumentSearchData.Find = Bulmak +ScriptAction.NoScriptConfigured = \u0130\u015flemin komut dosyas\u0131 i\u015flevi yap\u0131land\u0131r\u0131lmad\u0131 +ScriptAction.ErrorInScript = Komut Dosyas\u0131ndaki Hata +ScriptAction.NoScriptFoundIn = \u0130\u00e7inde hi\u00e7bir komut dosyas\u0131 bulunamad\u0131: +ScriptRunnerAction.ErrorExecutingScript = Komut dosyas\u0131 \u00e7al\u0131\u015ft\u0131r\u0131l\u0131rken hata olu\u015ftu:\\n +ScriptRunnerAction.ScriptError = Komut Dosyas\u0131 Hatas\u0131 +ScriptRunnerAction.ScriptEngineNotFound = [{0}] i\u00e7in komut dosyas\u0131 bulunamad\u0131. Bu \u0130\u015flemi Devre D\u0131\u015f\u0131 B\u0131rakma +ShowAbbsAction.NoAbbsForType = Bu i\u00e7erik t\u00fcr\u00fc i\u00e7in k\u0131saltma yok diff --git a/nsis_locales/Turkish.nsh b/nsis_locales/Turkish.nsh new file mode 100644 index 000000000..5a0da00c6 --- /dev/null +++ b/nsis_locales/Turkish.nsh @@ -0,0 +1,63 @@ +!define LANG "TURKISH" ; Must be the lang name define by NSIS +!insertmacro LANG_STRING STRING_SWC_NOTFOUND "PlayerGlobal.SWC, Adobe web sayfalarında bulunamadı. Belki de güvenlik duvarınız erişimi engelliyor veya etkinleştirilmiş bazı proxy'iniz var. Daha sonra gelişmiş ayarlarda SWC dosyasının yolunu ayarlayabilirsiniz." +!insertmacro LANG_STRING STRING_SAVED_TO "kaydedildi" +!insertmacro LANG_STRING STRING_EXISTS_SKIP_DOWNLOAD "zaten var, indirmeyi atla" +!insertmacro LANG_STRING STRING_STARTING_DOWNLOAD "İndirme işlemini başlatma" +!insertmacro LANG_STRING STRING_DESKTOP_SHORTCUT "Masaüstü kısayolu" +!insertmacro LANG_STRING STRING_ADD_CONTEXT_MENU "Bağlam menüsüne ekle" +!insertmacro LANG_STRING STRING_SECTION_APP "Uygulama GUI ve Kütüphaneler" +!insertmacro LANG_STRING STRING_SECTION_SWC "Adobe sitesinden FlashPlayer kitaplığını indirin - ActionScript doğrudan düzenlenmesi ve diğer özellikleri için kullanışlıdır" +!insertmacro LANG_STRING STRING_SECTION_CONTEXT_MENU "Windows Gezgini'nde SWF ve GFX dosyalarının içerik menüsüne FFDec ekler." +!insertmacro LANG_STRING STRING_SECTION_SHORTCUT "Masaüstünde kısayol oluşturur" +!insertmacro LANG_STRING STRING_UNINST_USER "Kullanıcı yapılandırmasını kaldır" +!insertmacro LANG_STRING STRING_HELP_US "Bize yardım et" +!insertmacro LANG_STRING STRING_HELP_US_FREE "Bu bütün decompiler Serbest ve Açık Kaynaktır. Bize destek olmak istiyorsan, diğer insanlara dekomprizanımızı anlatabilirsin. Sayfalarımızın bağlantısını kullanın, bir kelime paylaşın." +!insertmacro LANG_STRING STRING_HELP_US_DONATE "Yazarın gelişmekte olan vakit ve kaynaklar için takdirlerinizi belirtmek isterseniz parasal bağışları kabul ve takdir ediyoruz." +!insertmacro LANG_STRING STRING_HELP_US_MORE "Daha fazla bilgi için buraya tıklayın:" +!insertmacro LANG_STRING STRING_HELP_US_DOYOU "Bize yardımcı olabileceğini biliyor musun?" +!insertmacro LANG_STRING STRING_HELP_US_BUTTON "Bize yardım et!" +!insertmacro LANG_STRING STRING_SWC "PlayerGlobal.swc indirin" +!insertmacro LANG_STRING STRING_SWC_CHECK "En yeni PlayerGlobal.swc dosyası için Adobe sitesini kontrol etme" + +;Flash ActiveX: +!insertmacro LANG_STRING STRING_FLASH_AX_REQUIRED_TITLE "Flash Player ActiveX denetimi gerekiyor" +!insertmacro LANG_STRING STRING_FLASH_AX_REQUIRED "Bu uygulama Flash ActiveX kontrolü gerektiriyor" +!insertmacro LANG_STRING STRING_FLASH_AX_WILLINSTALL "Bu uygulama, Flash ActiveX denetiminin kurulmasını gerektirir. Bu, kurulumun bir parçası olarak indirilecek ve yüklenecektir." +!insertmacro LANG_STRING STRING_FLASH_AX_ALREADYINSTALLED "Flash ActiveX yüklü" +!insertmacro LANG_STRING STRING_FLASH_AX_MISSING "Sonuç: Flash ActiveX eksik." +!insertmacro LANG_STRING STRING_FLASH_AX_WILLDOWNLOAD "Flash'ı indirme hakkında " +!insertmacro LANG_STRING STRING_FLASH_AX_DOWNRESULT "İndirme sonucu = " +!insertmacro LANG_STRING STRING_FLASH_AX_CANNOTDOWNLOAD "Flash ActiveX'i karşıdan yükleyemiyor. Daha sonra manuel olarak indirebilir veya kendi flash görüntüleyicimizi kullanabilirsiniz." +!insertmacro LANG_STRING STRING_FLASH_AX_LAUNCHSETUP "Flash kurulumunu başlatma" +!insertmacro LANG_STRING STRING_FLASH_AX_INTERRUPTED "Flash kurulumu anormal şekilde kesildi - dönüş kodu" +!insertmacro LANG_STRING STRING_FLASH_AX_SETUPOUTCOME "Flash Kurulumun sonuçlarını kontrol etme" +!insertmacro LANG_STRING STRING_FLASH_AX_UNABLEFINDAFTER "Flash kurulumu başarılı olmasına rağmen Flash ActiveX'i bulunamadı." +!insertmacro LANG_STRING STRING_FLASH_AX_UNABLEINSTALL "Flash ActiveX yüklenemiyor. Daha sonra manuel olarak indirebilir veya kendi flash görüntüleyicimizi kullanabilirsiniz." +!insertmacro LANG_STRING STRING_FLASH_AX_SETUPFINISHED "Flash Kurulumu tamamlandı" +!insertmacro LANG_STRING STRING_FLASH_AX_DETECTING "Flash ActiveX'i Algılama" + +;JRE: +!insertmacro LANG_STRING STRING_JRE_REQUIRED_TITLE "JRE Kurulumu Gerekli" +!insertmacro LANG_STRING STRING_JRE_REQUIRED "Bu uygulama, Java $ {JRE_VERSION} veya üstünü gerektirir" +!insertmacro LANG_STRING STRING_JRE_REQUIRED_INFO "Bu uygulama, Java Runtime Environment'ın kurulumunu gerektirir. Bu, kurulumun bir parçası olarak indirilecek ve yüklenecektir." +!insertmacro LANG_STRING STRING_JRE_UPDATEREQUIRED_TITLE "JRE Güncellemesi Gerekli" +!insertmacro LANG_STRING STRING_JRE_UPDATEREQUIRED "Bu uygulama, Java $ {JRE_VERSION} veya üstünü gerektirir" +!insertmacro LANG_STRING STRING_JRE_UPDATEREQUIRED_INFO "Bu uygulama, Java Çalışma Zamanı Ortamı'nın daha yeni bir sürümünü gerektirir. Bu, kurulumun bir parçası olarak indirilecek ve yüklenecektir." +!insertmacro LANG_STRING STRING_JRE_DETECTVERSION "JRE Sürümünü Algılama" +!insertmacro LANG_STRING STRING_JRE_DETECTCOMPLETE "JRE Sürüm algılama tamamlandı - sonuç = " +!insertmacro LANG_STRING STRING_JRE_DETECTCOMPLETE_OLD "Eski JRE bulundu" +!insertmacro LANG_STRING STRING_JRE_DETECTCOMPLETE_NO "JRE Bulunamadı" +!insertmacro LANG_STRING STRING_JRE_DETECTCOMPARE_1 "Karşılaştırma sürümü " +!insertmacro LANG_STRING STRING_JRE_DETECTCOMPARE_2 " için " +!insertmacro LANG_STRING STRING_JRE_DETECTCOMPARE_3 " içinde sonuç " +!insertmacro LANG_STRING STRING_JRE_WILLDOWNLOAD "JRE hakkında bilgi almak için " +!insertmacro LANG_STRING STRING_JRE_DOWNRESULT "İndirme sonucu = " +!insertmacro LANG_STRING STRING_JRE_CANNOTDOWNLOAD "Java indirilemiyor. Daha sonra manuel olarak indirebilirsiniz." +!insertmacro LANG_STRING STRING_JRE_LAUNCHSETUP "JRE kurulumunu başlatma" +!insertmacro LANG_STRING STRING_JRE_SETUPFINISHED "JRE Kurulumu tamamlandı" +!insertmacro LANG_STRING STRING_JRE_INTERRUPTED "JRE kurulumu anormal şekilde kesildi - dönüş kodu " +!insertmacro LANG_STRING STRING_JRE_SETUPOUTCOME "JRE Kurulumunun sonucunu kontrol etme" +!insertmacro LANG_STRING STRING_JRE_UNABLEFINDAFTER "JRE kurulumu başarılı olmasına rağmen $ {JRE_VERSION} değerinin üstündeki JRE'yi bulamıyor" +!insertmacro LANG_STRING STRING_JRE_UNABLEINSTALL "Java yüklenemiyor. Daha sonra manuel olarak kurabilirsiniz." + +;!insertmacro LANG_STRING STRING_ "" diff --git a/src/com/jpexs/browsers/cache/CacheEntry.java b/src/com/jpexs/browsers/cache/CacheEntry.java index 7ac3db2e3..80d82d1d3 100644 --- a/src/com/jpexs/browsers/cache/CacheEntry.java +++ b/src/com/jpexs/browsers/cache/CacheEntry.java @@ -19,6 +19,7 @@ package com.jpexs.browsers.cache; import com.jpexs.helpers.LimitedInputStream; import java.io.IOException; import java.io.InputStream; +import java.util.Locale; import java.util.Map; import java.util.zip.GZIPInputStream; import java.util.zip.InflaterInputStream; @@ -102,7 +103,7 @@ public abstract class CacheEntry { return null; } for (String k : m.keySet()) { - if (k.toLowerCase().equals(header.toLowerCase())) { + if (k.toLowerCase(Locale.ENGLISH).equals(header.toLowerCase(Locale.ENGLISH))) { return m.get(k); } } diff --git a/src/com/jpexs/browsers/cache/chrome/ChromeCache.java b/src/com/jpexs/browsers/cache/chrome/ChromeCache.java index ddcf9729e..e03ed6349 100644 --- a/src/com/jpexs/browsers/cache/chrome/ChromeCache.java +++ b/src/com/jpexs/browsers/cache/chrome/ChromeCache.java @@ -26,6 +26,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; @@ -154,7 +155,7 @@ public class ChromeCache implements CacheImplementation { OSId id = OSId.UNIX; String osName = AccessController.doPrivileged(doGetOSName); if (osName != null) { - if (osName.toLowerCase().startsWith("mac os x")) { + if (osName.toLowerCase(Locale.ENGLISH).startsWith("mac os x")) { id = OSId.OSX; } else if (osName.contains("Windows")) { id = OSId.WINDOWS; diff --git a/src/com/jpexs/browsers/cache/chrome/HttpResponseInfo.java b/src/com/jpexs/browsers/cache/chrome/HttpResponseInfo.java index fc8bc2066..72c847bfe 100644 --- a/src/com/jpexs/browsers/cache/chrome/HttpResponseInfo.java +++ b/src/com/jpexs/browsers/cache/chrome/HttpResponseInfo.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; +import java.util.Locale; /** * @@ -93,9 +94,9 @@ public class HttpResponseInfo { for (String h : headers) { if (h.contains(":")) { String[] keyval = h.split(":"); - String key = keyval[0].trim().toLowerCase(); + String key = keyval[0].trim().toLowerCase(Locale.ENGLISH); String val = keyval[1].trim(); - if (header.toLowerCase().equals(key)) { + if (header.toLowerCase(Locale.ENGLISH).equals(key)) { return val; } } diff --git a/src/com/jpexs/browsers/cache/firefox/FirefoxCache.java b/src/com/jpexs/browsers/cache/firefox/FirefoxCache.java index 9185502b4..0479438a5 100644 --- a/src/com/jpexs/browsers/cache/firefox/FirefoxCache.java +++ b/src/com/jpexs/browsers/cache/firefox/FirefoxCache.java @@ -24,6 +24,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; @@ -97,7 +98,7 @@ public class FirefoxCache implements CacheImplementation { OSId id = OSId.UNIX; String osName = AccessController.doPrivileged(doGetOSName); if (osName != null) { - if (osName.toLowerCase().startsWith("mac os x")) { + if (osName.toLowerCase(Locale.ENGLISH).startsWith("mac os x")) { id = OSId.OSX; } else if (osName.contains("Windows")) { id = OSId.WINDOWS; diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index d4e7f4e4a..ab2fae4c4 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -774,7 +774,7 @@ public class CommandLineArgumentParser { while (true) { nextParamOriginal = args.pop(); if (nextParamOriginal != null) { - nextParam = nextParamOriginal.toLowerCase(); + nextParam = nextParamOriginal.toLowerCase(Locale.ENGLISH); } if (nextParam == null) { nextParam = ""; @@ -1025,7 +1025,7 @@ public class CommandLineArgumentParser { cp = new String[]{cp[0], "1"}; } - Field field = fields.get(cp[0].toLowerCase()); + Field field = fields.get(cp[0].toLowerCase(Locale.ENGLISH)); ConfigurationItem item = ConfigurationItem.getItem(field); String stringValue = cp[1]; Class type = ConfigurationItem.getConfigurationFieldType(field); @@ -1078,7 +1078,7 @@ public class CommandLineArgumentParser { } Boolean bValue = null; - value = value.toLowerCase(); + value = value.toLowerCase(Locale.ENGLISH); if (value.equals("0") || value.equals("false") || value.equals("no") || value.equals("off")) { bValue = false; } @@ -1139,7 +1139,7 @@ public class CommandLineArgumentParser { File stdOutFile = null; File swfFile = null; while (!args.isEmpty()) { - String paramName = args.pop().toLowerCase(); + String paramName = args.pop().toLowerCase(Locale.ENGLISH); switch (paramName) { case "-outfile": if (args.empty()) { @@ -1188,7 +1188,7 @@ public class CommandLineArgumentParser { File swfFile = null; while (!args.empty()) { - String paramName = args.pop().toLowerCase(); + String paramName = args.pop().toLowerCase(Locale.ENGLISH); if (processedParams.contains(paramName)) { System.err.println("Parameter " + paramName + " can appear only once."); } @@ -1333,7 +1333,7 @@ public class CommandLineArgumentParser { File valueFile = null; while (!args.empty()) { - String paramName = args.pop().toLowerCase(); + String paramName = args.pop().toLowerCase(Locale.ENGLISH); if (processedParams.contains(paramName)) { System.err.println("Parameter " + paramName + " can appear only once."); } @@ -1540,7 +1540,7 @@ public class CommandLineArgumentParser { File swfFile = null; File outFile = null; while (!args.empty()) { - String paramName = args.pop().toLowerCase(); + String paramName = args.pop().toLowerCase(Locale.ENGLISH); if (processedParams.contains(paramName)) { System.err.println("Parameter " + paramName + " can appear only once."); } @@ -1914,7 +1914,7 @@ public class CommandLineArgumentParser { } private static void parseDebugTool(Stack args) { - String cmd = args.pop().toLowerCase(); + String cmd = args.pop().toLowerCase(Locale.ENGLISH); switch (cmd) { case "findtag": { String folder = args.pop(); @@ -2026,7 +2026,7 @@ public class CommandLineArgumentParser { } private static void parseCompareResources(Stack args) { - String revision = args.pop().toLowerCase(); + String revision = args.pop().toLowerCase(Locale.ENGLISH); String revision2 = null; if (!args.isEmpty()) { revision2 = args.pop(); @@ -2102,7 +2102,7 @@ public class CommandLineArgumentParser { handler = new ConsoleAbortRetryIgnoreHandler(AbortRetryIgnoreHandler.UNDEFINED, 0); } - String exportFormatString = args.pop().toLowerCase(); + String exportFormatString = args.pop().toLowerCase(Locale.ENGLISH); List exportFormats = Arrays.asList(exportFormatString.split(",")); long startTime = System.currentTimeMillis(); @@ -2399,7 +2399,7 @@ public class CommandLineArgumentParser { outFile = Path.combine(outFile, exportFormat); }; - String outFileName = inFile.getName().toLowerCase().endsWith(".swf") ? inFile.getName().substring(0, inFile.getName().length() - 3) + exportFormat : inFile.getName(); + String outFileName = inFile.getName().toLowerCase(Locale.ENGLISH).endsWith(".swf") ? inFile.getName().substring(0, inFile.getName().length() - 3) + exportFormat : inFile.getName(); outFile = Path.combine(outFile, outFileName); XFLExportSettings settings = new XFLExportSettings(); settings.compressed = compressed; @@ -2495,7 +2495,7 @@ public class CommandLineArgumentParser { SWFCompression compression = SWFCompression.ZLIB; String compressionString = !args.isEmpty() ? args.pop() : null; if (compressionString != null) { - switch (compressionString.toLowerCase()) { + switch (compressionString.toLowerCase(Locale.ENGLISH)) { case "zlib": compression = SWFCompression.ZLIB; break; @@ -2598,7 +2598,7 @@ public class CommandLineArgumentParser { boolean noCheck = false; String output = null; - if (args.size() > 0 && args.peek().toLowerCase().equals("-o")) { + if (args.size() > 0 && args.peek().toLowerCase(Locale.ENGLISH).equals("-o")) { args.pop(); if (args.size() < 1) { badArguments("extract"); @@ -2606,13 +2606,13 @@ public class CommandLineArgumentParser { output = args.pop(); } - if (args.size() > 0 && args.peek().toLowerCase().equals("nocheck")) { + if (args.size() > 0 && args.peek().toLowerCase(Locale.ENGLISH).equals("nocheck")) { noCheck = true; args.pop(); } if (args.size() > 0) { - String modeStr = args.pop().toLowerCase(); + String modeStr = args.pop().toLowerCase(Locale.ENGLISH); switch (modeStr) { case "biggest": mode = SearchMode.BIGGEST; @@ -2766,7 +2766,7 @@ public class CommandLineArgumentParser { String renameTypeStr = args.pop(); RenameType renameType; - switch (renameTypeStr.toLowerCase()) { + switch (renameTypeStr.toLowerCase(Locale.ENGLISH)) { case "typenumber": renameType = RenameType.TYPENUMBER; break; @@ -2813,7 +2813,7 @@ public class CommandLineArgumentParser { badArguments("format"); } String[] parts = fmt.split(":"); - ret.put(parts[0].toLowerCase(), parts[1].toLowerCase()); + ret.put(parts[0].toLowerCase(Locale.ENGLISH), parts[1].toLowerCase(Locale.ENGLISH)); } return ret; } @@ -2960,7 +2960,7 @@ public class CommandLineArgumentParser { } else if (characterTag instanceof SoundTag) { SoundTag st = (SoundTag) characterTag; int soundFormat = SoundFormat.FORMAT_UNCOMPRESSED_LITTLE_ENDIAN; - if (repFile.toLowerCase().endsWith(".mp3")) { + if (repFile.toLowerCase(Locale.ENGLISH).endsWith(".mp3")) { soundFormat = SoundFormat.FORMAT_MP3; } boolean ok = st.setSound(new ByteArrayInputStream(data), soundFormat); @@ -3051,7 +3051,7 @@ public class CommandLineArgumentParser { return 0; } - int res = ImageImporter.getImageTagType(args.peek().toLowerCase()); + int res = ImageImporter.getImageTagType(args.peek().toLowerCase(Locale.ENGLISH)); if (res != 0) { args.pop(); } @@ -3187,7 +3187,7 @@ public class CommandLineArgumentParser { try { try (FileInputStream is = new FileInputStream(inFile)) { SWF swf = new SWF(is, Configuration.parallelSpeedUp.get()); - String arg = args.pop().toLowerCase(); + String arg = args.pop().toLowerCase(Locale.ENGLISH); if (arg.equals("pack")) { swf.packCharacterIds(); } else if (arg.equals("sort")) { @@ -3259,7 +3259,7 @@ public class CommandLineArgumentParser { } CharacterTag characterTag = swf.getCharacter(characterId); - String targetType = args.pop().toLowerCase(); + String targetType = args.pop().toLowerCase(Locale.ENGLISH); if (characterTag instanceof ImageTag) { int format = ImageImporter.getImageTagType(targetType); ImageTag imageTag = (ImageTag) characterTag; @@ -3916,7 +3916,7 @@ public class CommandLineArgumentParser { swf = new SWF(fis, Configuration.parallelSpeedUp.get()); fis.close(); String outSwd = outfile; - if (outSwd.toLowerCase().endsWith(".swf")) { + if (outSwd.toLowerCase(Locale.ENGLISH).endsWith(".swf")) { outSwd = outSwd.substring(0, outSwd.length() - 4) + ".swd"; } else { outSwd = outSwd + ".swd"; @@ -3968,7 +3968,7 @@ public class CommandLineArgumentParser { } private static FilenameFilter getSwfFilter() { - return (File dir, String name) -> name.toLowerCase().endsWith(".swf"); + return (File dir, String name) -> name.toLowerCase(Locale.ENGLISH).endsWith(".swf"); } private static E enumFromStr(String str, Class cls) { @@ -3977,7 +3977,7 @@ public class CommandLineArgumentParser { return vals[0]; } for (E e : vals) { - if (e.toString().toLowerCase().replace("_", "").equals(str.toLowerCase().replace("_", ""))) { + if (e.toString().toLowerCase(Locale.ENGLISH).replace("_", "").equals(str.toLowerCase(Locale.ENGLISH).replace("_", ""))) { return e; } } diff --git a/src/com/jpexs/decompiler/flash/console/ConsoleAbortRetryIgnoreHandler.java b/src/com/jpexs/decompiler/flash/console/ConsoleAbortRetryIgnoreHandler.java index ae13a7970..922bdfc03 100644 --- a/src/com/jpexs/decompiler/flash/console/ConsoleAbortRetryIgnoreHandler.java +++ b/src/com/jpexs/decompiler/flash/console/ConsoleAbortRetryIgnoreHandler.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.console; import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; +import java.util.Locale; import java.util.Scanner; import java.util.logging.Level; import java.util.logging.Logger; @@ -57,7 +58,7 @@ public class ConsoleAbortRetryIgnoreHandler implements AbortRetryIgnoreHandler { do { System.out.print("Select action: (A)bort, (R)Retry, (I)Ignore:"); String n = sc.nextLine(); - switch (n.toLowerCase()) { + switch (n.toLowerCase(Locale.ENGLISH)) { case "a": return AbortRetryIgnoreHandler.ABORT; case "r": diff --git a/src/com/jpexs/decompiler/flash/gui/ExportDialog.java b/src/com/jpexs/decompiler/flash/gui/ExportDialog.java index 485d55396..1857992bd 100644 --- a/src/com/jpexs/decompiler/flash/gui/ExportDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/ExportDialog.java @@ -45,6 +45,7 @@ import com.jpexs.decompiler.flash.tags.base.SoundTag; import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag; import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.timeline.Frame; +import com.jpexs.decompiler.flash.timeline.TagScript; import com.jpexs.decompiler.flash.treeitems.TreeItem; import java.awt.BorderLayout; import java.awt.Container; @@ -53,6 +54,7 @@ import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.util.Arrays; import java.util.List; +import java.util.Locale; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; @@ -92,14 +94,14 @@ public class ExportDialog extends AppDialog { {ImageTag.class}, {DefineVideoStreamTag.class}, {SoundTag.class}, - {ASMSource.class, ScriptPack.class}, + {ASMSource.class, ScriptPack.class, TagScript.class}, {DefineBinaryDataTag.class}, {Frame.class}, {Frame.class}, {ButtonTag.class}, {FontTag.class}, {MorphShapeTag.class}, - {SymbolClassTypeTag.class}, + {SymbolClassTypeTag.class} }; //Enum classes for values @@ -116,7 +118,7 @@ public class ExportDialog extends AppDialog { ButtonExportMode.class, FontExportMode.class, MorphShapeExportMode.class, - SymbolClassExportMode.class, + SymbolClassExportMode.class }; Class[] zoomClasses = { @@ -125,7 +127,7 @@ public class ExportDialog extends AppDialog { TextExportMode.class, FrameExportMode.class, SpriteExportMode.class, - ButtonExportMode.class, + ButtonExportMode.class }; private final JComboBox[] combos; @@ -167,7 +169,7 @@ public class ExportDialog extends AppDialog { int selIndex = combos[i].getSelectedIndex(); Class c = optionClasses[i]; Object[] vals = c.getEnumConstants(); - String key = optionNames[i] + "." + vals[selIndex].toString().toLowerCase(); + String key = optionNames[i] + "." + vals[selIndex].toString().toLowerCase(Locale.ENGLISH); if (i > 0) { cfg.append(","); } @@ -275,7 +277,7 @@ public class ExportDialog extends AppDialog { int itemIndex = -1; for (int j = 0; j < vals.length; j++) { - String key = optionNames[i] + "." + vals[j].toString().toLowerCase(); + String key = optionNames[i] + "." + vals[j].toString().toLowerCase(Locale.ENGLISH); if (exportFormats.contains(key)) { itemIndex = j; } diff --git a/src/com/jpexs/decompiler/flash/gui/FontPanel.java b/src/com/jpexs/decompiler/flash/gui/FontPanel.java index 1fe3c9fe7..d43296056 100644 --- a/src/com/jpexs/decompiler/flash/gui/FontPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/FontPanel.java @@ -92,7 +92,7 @@ public class FontPanel extends JPanel { public static ComboBoxModel getFamilyModel() { Set famSet = new TreeSet<>(); - for (Font f : FontTag.installedFontsByName.values()) { + for (Font f : FontTag.getInstalledFontsByName().values()) { famSet.add(new FontFamily(f)); } return new DefaultComboBoxModel<>(new Vector<>(famSet)); @@ -101,7 +101,7 @@ public class FontPanel extends JPanel { public static ComboBoxModel getFaceModel(FontFamily family) { Set faceSet = new TreeSet<>(); - for (Font f : FontTag.installedFontsByFamily.get(family.familyEn).values()) { + for (Font f : FontTag.getInstalledFontsByFamily().get(family.familyEn).values()) { faceSet.add(new FontFace(f)); } @@ -403,7 +403,7 @@ public class FontPanel extends JPanel { fontFamilyNameSelection.setPreferredSize(new Dimension(100, fontFamilyNameSelection.getMinimumSize().height)); fontFamilyNameSelection.setModel(getFamilyModel()); - fontFamilyNameSelection.setSelectedItem(FontTag.defaultFontName); + fontFamilyNameSelection.setSelectedItem(FontTag.getDefaultFontName()); fontFaceSelection.setModel(getFaceModel((FontFamily) fontFamilyNameSelection.getSelectedItem())); fontFamilyNameSelection.addItemListener(new ItemListener() { @Override diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 4c20d3422..af64fbc66 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -35,7 +35,7 @@ import com.jpexs.decompiler.flash.SwfOpenException; import com.jpexs.decompiler.flash.UrlResolver; import com.jpexs.decompiler.flash.Version; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.configuration.SwfSpecificConfiguration; import com.jpexs.decompiler.flash.console.CommandLineArgumentParser; @@ -375,7 +375,7 @@ public class Main { } if (instrSWF != null) { String swfFileName = fTempFile.getAbsolutePath(); - if (swfFileName.toLowerCase().endsWith(".swf")) { + if (swfFileName.toLowerCase(Locale.ENGLISH).endsWith(".swf")) { swfFileName = swfFileName.substring(0, swfFileName.length() - 4) + ".swd"; } else { swfFileName = swfFileName + ".swd"; @@ -806,7 +806,7 @@ public class Main { @Override public boolean accept(File f) { - String name = f.getName().toLowerCase(); + String name = f.getName().toLowerCase(Locale.ENGLISH); for (String ext : supportedExtensions) { if (name.endsWith(ext)) { return true; @@ -825,7 +825,7 @@ public class Main { FileFilter swfFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".swf")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".swf")) || (f.isDirectory()); } @Override @@ -838,7 +838,7 @@ public class Main { FileFilter gfxFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".gfx")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".gfx")) || (f.isDirectory()); } @Override @@ -1354,7 +1354,7 @@ public class Main { FileFilter swfFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".swf")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".swf")) || (f.isDirectory()); } @Override @@ -1366,7 +1366,7 @@ public class Main { FileFilter gfxFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".gfx")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".gfx")) || (f.isDirectory()); } @Override @@ -1405,7 +1405,7 @@ public class Main { FileFilter exeFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(fext)) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(fext)) || (f.isDirectory()); } @Override @@ -1431,13 +1431,13 @@ public class Main { try { String fileName = file.getAbsolutePath(); if (selFilter == swfFilter) { - if (!fileName.toLowerCase().endsWith(extension)) { + if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(extension)) { fileName += extension; } swf.gfx = false; } if (selFilter == gfxFilter) { - if (!fileName.toLowerCase().endsWith(".gfx")) { + if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(".gfx")) { fileName += ".gfx"; } swf.gfx = true; @@ -1465,7 +1465,7 @@ public class Main { @Override public boolean accept(File f) { - String name = f.getName().toLowerCase(); + String name = f.getName().toLowerCase(Locale.ENGLISH); for (String ext : supportedExtensions) { if (name.endsWith(ext)) { return true; @@ -1484,7 +1484,7 @@ public class Main { FileFilter swfFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".swf")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".swf")) || (f.isDirectory()); } @Override @@ -1497,7 +1497,7 @@ public class Main { FileFilter swcFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".swc")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".swc")) || (f.isDirectory()); } @Override @@ -1510,7 +1510,7 @@ public class Main { FileFilter gfxFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".gfx")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".gfx")) || (f.isDirectory()); } @Override @@ -1523,7 +1523,7 @@ public class Main { FileFilter iggyFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".iggy")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".iggy")) || (f.isDirectory()); } @Override @@ -1536,7 +1536,7 @@ public class Main { FileFilter zipFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".zip")) || (f.isDirectory()); + return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".zip")) || (f.isDirectory()); } @Override diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 2f2f1f76a..d7da6dfb9 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -193,6 +193,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Random; @@ -2108,7 +2109,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se FileFilter f = new FileFilter() { @Override public boolean accept(File f) { - return f.isDirectory() || (f.getName().toLowerCase().endsWith(".fla")); + return f.isDirectory() || (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".fla")); } @Override @@ -2125,7 +2126,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se f = new FileFilter() { @Override public boolean accept(File f) { - return f.isDirectory() || (f.getName().toLowerCase().endsWith(".xfl")); + return f.isDirectory() || (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".xfl")); } @Override @@ -2676,7 +2677,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se if (fontName == null) { fontName = font.getFontName(); } - final Font f = FontTag.installedFontsByName.get(fontName); + final Font f = FontTag.getInstalledFontsByName().get(fontName); if (f == null || !f.canDisplay(character)) { String msg = translate("error.font.nocharacter").replace("%char%", "" + character); logger.log(Level.SEVERE, "{0} FontId: {1} TextId: {2}", new Object[]{msg, font.getCharacterId(), textTag.getCharacterId()}); @@ -2761,7 +2762,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se File selfile = Helper.fixDialogFile(selectedFile); DefineSoundTag ds = (DefineSoundTag) item; int soundFormat = SoundFormat.FORMAT_UNCOMPRESSED_LITTLE_ENDIAN; - if (selfile.getName().toLowerCase().endsWith(".mp3")) { + if (selfile.getName().toLowerCase(Locale.ENGLISH).endsWith(".mp3")) { soundFormat = SoundFormat.FORMAT_MP3; } @@ -2969,7 +2970,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se if (f.isDirectory()) { return true; } - String fileName = f.getName().toLowerCase(); + String fileName = f.getName().toLowerCase(Locale.ENGLISH); for (String ext : extensions) { if (fileName.endsWith(ext)) { return true; diff --git a/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java b/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java index 036dadb62..09ae3bfee 100644 --- a/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java @@ -41,7 +41,7 @@ public class SelectLanguageDialog extends AppDialog { public String languageCode = null; - protected static final String[] languages = new String[]{"en", "ca", "cs", "zh", "de", "es", "fr", "hu", "it", "nl", "pl", "pt", "pt-BR", "ru", "sv", "uk"}; + protected static final String[] languages = new String[]{"en", "ca", "cs", "zh", "de", "es", "fr", "hu", "it", "nl", "pl", "pt", "pt-BR", "ru", "sv", "tr", "uk"}; public SelectLanguageDialog() { setSize(350, 130); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index a8d1732b5..36f463c38 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -27,7 +27,7 @@ import com.jpexs.decompiler.flash.abc.ScriptPack; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java b/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java index 5662fbb46..fa9f7f36f 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem; import com.jpexs.decompiler.graph.DottedChain; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; import javax.swing.tree.TreeModel; @@ -80,11 +81,11 @@ public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel getSwf().getFlexMainClass(ignoredClasses, ignoredNss); } - filter = (filter == null || filter.isEmpty()) ? null : filter.toLowerCase(); + filter = (filter == null || filter.isEmpty()) ? null : filter.toLowerCase(Locale.ENGLISH); loop: for (ScriptPack item : list) { if (filter != null) { - if (!item.getClassPath().toString().toLowerCase().contains(filter)) { + if (!item.getClassPath().toString().toLowerCase(Locale.ENGLISH).contains(filter)) { continue; } } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 485208609..0e6a42a48 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -24,7 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.ConstructSuperIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallSuperIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallSuperVoidIns; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.abc.types.ClassInfo; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index 59d2eccde..f9acb01be 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -55,6 +55,7 @@ import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; import com.jpexs.decompiler.flash.search.ActionScriptSearch; import com.jpexs.decompiler.flash.search.ActionSearchResult; import com.jpexs.decompiler.flash.search.ScriptSearchListener; +import com.jpexs.decompiler.flash.tags.DoInitActionTag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.helpers.CancellableWorker; @@ -186,7 +187,7 @@ public class ActionPanel extends JPanel implements SearchListener(), new HashMap<>(), new HashMap<>(), SWF.DEFAULT_VERSION), ""); + boolean insideDoInitAction = (this.src instanceof DoInitActionTag); + GraphDialog gf = new GraphDialog(mainPanel.getMainFrame().getWindow(), new ActionGraph(this.src.getScriptName(), insideDoInitAction, lastCode, new HashMap<>(), new HashMap<>(), new HashMap<>(), SWF.DEFAULT_VERSION), ""); gf.setVisible(true); } catch (InterruptedException ex) { logger.log(Level.SEVERE, null, ex); diff --git a/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java b/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java index 06c67ecbe..5bbdded28 100644 --- a/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java @@ -16,7 +16,7 @@ */ package com.jpexs.decompiler.flash.gui.editor; -import com.jpexs.decompiler.flash.abc.avm2.parser.script.Reference; +import com.jpexs.helpers.Reference; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.AppStrings; import java.awt.Color; diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AboutDialog_tr.properties b/src/com/jpexs/decompiler/flash/gui/locales/AboutDialog_tr.properties new file mode 100644 index 000000000..abc6af3b1 --- /dev/null +++ b/src/com/jpexs/decompiler/flash/gui/locales/AboutDialog_tr.properties @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2016 JPEXS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +version = versiyon +by = taraf\u0131ndan +button.ok = OK +dialog.title = Hakk\u0131nda +contributors = Katk\u0131da Bulunanlar: +#In the translation, replace "english" with target language name +translation.author.label = T\u00fcrk\u00e7e \u00e7evirmen yazar\u0131: +#In the translation, insert your name here +translation.author = Osman \u00d6Z +developers = Geli\u015ftiriciler: +developers.others = + GitHub ve Google kodundan ba\u015fkalar\u0131 +translators = \u00c7evirmenler: \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_tr.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_tr.properties new file mode 100644 index 000000000..7bad5a220 --- /dev/null +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_tr.properties @@ -0,0 +1,449 @@ +# Copyright (C) 2010-2016 JPEXS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +advancedSettings.dialog.title = Geli\u015fmi\u015f Ayarlar +advancedSettings.restartConfirmation = Baz\u0131 de\u011fi\u015fikliklerin y\u00fcr\u00fcrl\u00fc\u011fe girmesi i\u00e7in program\u0131 yeniden ba\u015flatman\u0131z gerekir. \u015eimdi yeniden ba\u015flatmak istiyor musunuz? +advancedSettings.columns.name = \u0130sim +advancedSettings.columns.value = De\u011fer +advancedSettings.columns.description = A\u00e7\u0131klama +default = varsay\u0131lan + +config.group.name.export = \u0130hracat +config.group.description.export = \u0130hracat konfig\u00fcrasyonu + +config.group.name.script = Senaryo +config.group.description.script = ActionScript ayr\u0131\u015ft\u0131rma ile ilgili + +config.group.name.update = G\u00fcncellemeler +config.group.description.update = G\u00fcncellemeleri kontrol etme + +config.group.name.format = Bi\u00e7imlendirme +config.group.description.format = ActionScript kod bi\u00e7imlendirmesi + +config.group.name.limit = S\u0131n\u0131rlar\u0131 +config.group.description.limit = Karart\u0131lm\u0131\u015f kod i\u00e7in ayr\u0131\u015ft\u0131rma s\u0131n\u0131rlar\u0131 vb. + +config.group.name.ui = Arabirim +config.group.description.ui = Kullan\u0131c\u0131 arabirimi yap\u0131land\u0131rmas\u0131 + +config.group.name.debug = Hata ay\u0131klama +config.group.description.debug = Hata ay\u0131klama ayarlar\u0131 + +config.group.name.display = G\u00f6r\u00fcnt\u00fcle +config.group.description.display = Flash nesnelerin g\u00f6sterimi vb. + +config.group.name.decompilation = Ayr\u0131\u015ft\u0131rma +config.group.description.decompilation = K\u00fcresel ayr\u0131\u015ft\u0131rma fonksiyonlar\u0131 + +config.group.name.other = Ba\u015fka +config.group.description.other = Di\u011fer S\u0131n\u0131fland\u0131r\u0131lmam\u0131\u015f yap\u0131land\u0131rmalar + +config.name.openMultipleFiles = Birden \u00e7ok dosyay\u0131 a\u00e7 +config.description.openMultipleFiles = Bir pencerede birden fazla dosyay\u0131 ayn\u0131 anda a\u00e7man\u0131za izin verir + +config.name.decompile = ActionScript kaynak g\u00f6ster +config.description.decompile = AS ayr\u0131\u015ft\u0131rmas\u0131n\u0131 devre d\u0131\u015f\u0131 b\u0131rakabilirsiniz, bu durumda yaln\u0131zca P kodu g\u00f6sterilir + +config.name.dumpView = D\u00f6k\u00fcm G\u00f6r\u00fcn\u00fcm\u00fc +config.description.dumpView = Ham veri d\u00f6k\u00fcm\u00fcn\u00fc g\u00f6r\u00fcnt\u00fcleme + +config.name.useHexColorFormat = Onalt\u0131l\u0131k renk format\u0131 +config.description.useHexColorFormat = Renkleri onalt\u0131l\u0131k bi\u00e7imde g\u00f6ster + +config.name.parallelSpeedUp = Paralel SpeedUp +config.description.parallelSpeedUp = Paralellik, ayr\u0131\u015ft\u0131rmay\u0131 h\u0131zland\u0131rabilir + +config.name.parallelSpeedUpThreadCount = Konu say\u0131s\u0131 +config.description.parallelSpeedUpThreadCount = Paralel h\u0131zland\u0131rma i\u00e7in i\u015f par\u00e7ac\u0131\u011f\u0131 say\u0131s\u0131 + +config.name.autoDeobfuscate = Otomatik ayr\u0131\u015ft\u0131rma +config.description.autoDeobfuscate = ActionScript ayr\u0131\u015ft\u0131rmas\u0131 olmadan \u00f6nce ayr\u0131\u015ft\u0131rma \u00f6\u011fesini her dosyada \u00e7al\u0131\u015ft\u0131rma + +config.name.cacheOnDisk = Diskte \u00f6nbelle\u011fe alma kullan +config.description.cacheOnDisk = Bellek yerine sabit s\u00fcr\u00fcc\u00fcdeki b\u00f6l\u00fcmleri zaten \u00f6nbelle\u011fe alma + +config.name.internalFlashViewer = Kendi fla\u015f g\u00f6r\u00fcnt\u00fcleyicisini kullan +config.description.internalFlashViewer = Fla\u015f par\u00e7alar\u0131 g\u00f6sterimi i\u00e7in standart Flash Player yerine JPEXS Flash Viewer'\u0131 kullan\u0131n + +config.name.gotoMainClassOnStartup = Ba\u015flang\u0131\u00e7ta ana s\u0131n\u0131fa gidin (AS3) +config.description.gotoMainClassOnStartup = SWF a\u00e7\u0131ld\u0131\u011f\u0131nda AS3 dosyas\u0131n\u0131n belge s\u0131n\u0131f\u0131na gidiyor + +config.name.autoRenameIdentifiers = Otomatik yeniden adland\u0131rma tan\u0131mlay\u0131c\u0131lar\u0131 +config.description.autoRenameIdentifiers = SWF y\u00fck\u00fcnde ge\u00e7ersiz tan\u0131mlay\u0131c\u0131lar\u0131 otomatik olarak yeniden adland\u0131r\u0131n + +config.name.offeredAssociation = (Dahili) SWF dosyalar\u0131 ile ili\u015fkili g\u00f6r\u00fcnt\u00fc +config.description.offeredAssociation = Dosya ili\u015fkilendirmesi hakk\u0131nda diyalog zaten g\u00f6r\u00fcnt\u00fcleniyor + +config.name.decimalAddress = Ondal\u0131k adresleri kullan +config.description.decimalAddress = Onalt\u0131l\u0131k yerine ondal\u0131k adresleri kullan + +config.name.showAllAddresses = T\u00fcm adresleri g\u00f6ster +config.description.showAllAddresses = T\u00fcm ActionScript komut adreslerini g\u00f6r\u00fcnt\u00fcleme + +config.name.useFrameCache = \u00c7er\u00e7eve \u00f6nbellek kullan +config.description.useFrameCache = \u00c7er\u00e7eveleri yeniden olu\u015fturmadan \u00f6nce \u00f6nbelle\u011fe al + +config.name.useRibbonInterface = \u015eerit aray\u00fcz\u00fc +config.description.useRibbonInterface = \u015eerit men\u00fcs\u00fc olmaks\u0131z\u0131n klasik aray\u00fcz\u00fc kullanmak i\u00e7in i\u015fareti kald\u0131r\u0131n + +config.name.openFolderAfterFlaExport = FLA d\u0131\u015fa aktarmadan sonra klas\u00f6r\u00fc a\u00e7 +config.description.openFolderAfterFlaExport = FLA dosyas\u0131n\u0131 d\u0131\u015fa aktard\u0131ktan sonra \u00e7\u0131k\u0131\u015f dizini g\u00f6r\u00fcnt\u00fcleme + +config.name.useDetailedLogging = FFDec ayr\u0131nt\u0131l\u0131 G\u00fcnl\u00fc\u011f\u00fc +config.description.useDetailedLogging = Ayr\u0131nt\u0131l\u0131 hata iletilerini ve FFDec'in hata ay\u0131klamas\u0131 i\u00e7in bilgi g\u00fcnl\u00fc\u011f\u00fcn\u00fc yaz\u0131n + +config.name._debugMode = Hata ay\u0131klama modunda FFDec +config.description._debugMode = FFDec hata ay\u0131klama modu. Hata ay\u0131klama men\u00fcs\u00fcn\u00fc a\u00e7ar. Bu, hata ay\u0131klay\u0131c\u0131 i\u015flevselli\u011fi ile ilgisi yoktur + +config.name.resolveConstants = Sabitleri AS1/2 p-kodunda \u00e7\u00f6zme +config.description.resolveConstants = P kod penceresinde ger\u00e7ek de\u011ferler yerine 'sabitxx' g\u00f6stermek i\u00e7in bunu kapat\u0131n + +config.name.sublimiter = Kod alt s\u0131n\u0131r\u0131 +config.description.sublimiter = Karart\u0131lm\u0131\u015f kod i\u00e7in kod alt s\u0131n\u0131r\u0131. + +config.name.exportTimeout = Toplam d\u0131\u015fa aktarma zaman a\u015f\u0131m\u0131 (saniye) +config.description.exportTimeout = Decompiler bu saatten sonra d\u0131\u015fa aktarmay\u0131 durduracak + +config.name.decompilationTimeoutFile = Tek dosya \u00e7\u00f6zme zaman a\u015f\u0131m\u0131 (saniye) +config.description.decompilationTimeoutFile = Decompiler, bu sefer bir dosyaya eri\u015ftikten sonra ActionScript decompilation'\u0131 durduracakt\u0131r + +config.name.paramNamesEnable = AS3'te parametre adlar\u0131n\u0131 etkinle\u015ftir +config.description.paramNamesEnable = Flash CS 5.5 gibi resmi programlar yanl\u0131\u015f parametre isimleri indeksleri ekler, \u00e7\u00fcnk\u00fc decompiling parametre adlar\u0131n\u0131 kullanmak sorunlara neden olabilir + +config.name.displayFileName = Ba\u015fl\u0131kta SWF ad\u0131n\u0131 g\u00f6ster +config.description.displayFileName = Pencere ba\u015fl\u0131\u011f\u0131nda SWF dosyas\u0131/url ad\u0131n\u0131 g\u00f6r\u00fcnt\u00fcleyin (Ekran g\u00f6r\u00fcnt\u00fcleri olu\u015fturabilirsiniz) + +config.name._debugCopy = FFDec hata ay\u0131klama derlemesi +config.description._debugCopy = Ayn\u0131 ikili kod \u00fcretti\u011finden emin olmak i\u00e7in a\u00e7\u0131ld\u0131ktan hemen sonra SWF dosyas\u0131n\u0131 tekrar derlemeye \u00e7al\u0131\u015f\u0131r. Yaln\u0131zca FFDec'in \u00e7\u00f6z\u00fclmesi i\u00e7in kullan\u0131n! + +config.name.dumpTags = Etiketleri konsola d\u00f6k\u00fcmle +config.description.dumpTags = SWF dosyas\u0131n\u0131 okurken etiketleri konsola d\u00f6k\u00fcm\u00fc d\u00f6kme + +config.name.decompilationTimeoutSingleMethod = AS3: Tek y\u00f6ntem decompilation zaman a\u015f\u0131m\u0131 (saniye) +config.description.decompilationTimeoutSingleMethod = Decompiler, bu sefer bir y\u00f6ntemle eri\u015ftikten sonra ActionScript decompilation'\u0131 durduracakt\u0131r + +config.name.lastRenameType = (\u00c7evrimi\u00e7i) Son yeniden adland\u0131rma t\u00fcr\u00fc +config.description.lastRenameType = Son kullan\u0131lan adlar\u0131 yeniden adland\u0131r tiplendir + +config.name.lastSaveDir = (\u00c7evrimi\u00e7i) Son kaydetme dizini +config.description.lastSaveDir = Son kullan\u0131lan kaydetme dizini + +config.name.lastOpenDir = (\u00c7evrimi\u00e7i) Son a\u00e7\u0131k dizin +config.description.lastOpenDir = En son kullan\u0131lan a\u00e7\u0131k dizin + +config.name.lastExportDir = (\u00c7evrimi\u00e7i) Son ihra\u00e7 rehberi +config.description.lastExportDir = Son kullan\u0131lan ihra\u00e7 rehberi + +config.name.locale = Dil +config.description.locale = Yerel ayar tan\u0131mlay\u0131c\u0131 + +config.name.registerNameFormat = De\u011fi\u015fken bi\u00e7imi kaydet +config.description.registerNameFormat = Yerel kay\u0131t de\u011fi\u015fken adlar\u0131n\u0131n bi\u00e7imi. Kay\u0131t numaras\u0131 i\u00e7in %d kullan\u0131n. + +config.name.maxRecentFileCount = Maksimum yeni say\u0131m +config.description.maxRecentFileCount = Maksimum yeni dosya say\u0131s\u0131 + +config.name.recentFiles = (\u00c7evrimi\u00e7i) En yeni resimler +config.description.recentFiles = Son a\u00e7\u0131lan dosyalar + +config.name.fontPairingMap = (\u00c7evrimi\u00e7i) \u0130\u00e7e aktarma i\u00e7in font \u00e7iftleri +config.description.fontPairingMap = Yeni karakterleri i\u00e7e aktarmak i\u00e7in font \u00e7iftleri + +config.name.lastUpdatesCheckDate = (\u00c7evrimi\u00e7i) Son g\u00fcncelleme tarihi kontrol edin +config.description.lastUpdatesCheckDate = Sunucudaki g\u00fcncellemeleri kontrol etme tarihi + +config.name.gui.window.width = (\u00c7evrimi\u00e7i) Son pencere geni\u015fli\u011fi +config.description.gui.window.width = Son kaydedilen pencere geni\u015fli\u011fi + +config.name.gui.window.height = (\u00c7evrimi\u00e7i) Son pencere y\u00fcksekli\u011fi +config.description.gui.window.height = Son kaydedilen pencere y\u00fcksekli\u011fi + +config.name.gui.window.maximized.horizontal = (\u00c7evrimi\u00e7i) Yatay olarak maksimize edilmi\u015f pencere +config.description.gui.window.maximized.horizontal = Son pencere durumu - yatay olarak maksimize edildi + +config.name.gui.window.maximized.vertical = (\u00c7evrimi\u00e7i) Dikey maksimize edilmi\u015f pencere +config.description.gui.window.maximized.vertical = Son pencere durumu - dikey olarak maksimize edildi + +config.name.gui.avm2.splitPane.dividerLocationPercent = (\u00c7evrimi\u00e7i) AS3 Ay\u0131r\u0131c\u0131 konumu +config.description.gui.avm2.splitPane.dividerLocationPercent = + +config.name.gui.actionSplitPane.dividerLocationPercent = (\u00c7evrimi\u00e7i) AS1/2 ay\u0131r\u0131c\u0131 konumu +config.description.gui.actionSplitPane.dividerLocationPercent = + +config.name.gui.previewSplitPane.dividerLocationPercent = (\u00c7evrimi\u00e7i) Ay\u0131r\u0131c\u0131 konumunu \u00f6nizle +config.description.gui.previewSplitPane.dividerLocationPercent = + +config.name.gui.splitPane1.dividerLocationPercent = (\u00c7evrimi\u00e7i) Ay\u0131r\u0131c\u0131 konumu 1 +config.description.gui.splitPane1.dividerLocationPercent = + +config.name.gui.splitPane2.dividerLocationPercent = (\u00c7evrimi\u00e7i) Ay\u0131r\u0131c\u0131 konumu 2 +config.description.gui.splitPane2.dividerLocationPercent = + +config.name.saveAsExeScaleMode = EXE \u00f6l\u00e7ek modu olarak kaydet +config.description.saveAsExeScaleMode = EXE d\u0131\u015fa aktarma i\u00e7in \u00f6l\u00e7ekleme modu + +config.name.syntaxHighlightLimit = S\u00f6zdizimini en fazla karakter ile vurggula +config.description.syntaxHighlightLimit = S\u00f6z dizimini \u00e7al\u0131\u015ft\u0131rmak i\u00e7in maksimum karakter say\u0131s\u0131 a\u00e7\u0131k + +config.name.guiFontPreviewSampleText = (\u00c7evrimi\u00e7i) Last font preview sample text +config.description.guiFontPreviewSampleText = Son yaz\u0131 tipi \u00f6nizleme \u00f6rnek metin + +config.name.gui.fontPreviewWindow.width = (\u00c7evrimi\u00e7i) Son yaz\u0131 tipi \u00f6nizleme penceresinin geni\u015fli\u011fi +config.description.gui.fontPreviewWindow.width = + +config.name.gui.fontPreviewWindow.height = (\u00c7evrimi\u00e7i) Son yaz\u0131 tipi \u00f6nizleme penceresinin y\u00fcksekli\u011fi +config.description.gui.fontPreviewWindow.height = + +config.name.gui.fontPreviewWindow.posX = (\u00c7evrimi\u00e7i) Son yaz\u0131 tipi \u00f6nizleme penceresi X +config.description.gui.fontPreviewWindow.posX = + +config.name.gui.fontPreviewWindow.posY = (\u00c7evrimi\u00e7i) Son yaz\u0131 tipi \u00f6nizleme penceresi Y +config.description.gui.fontPreviewWindow.posY = + +config.name.formatting.indent.size = Girinti ba\u015f\u0131na karakterler +config.description.formatting.indent.size = Bir girinti i\u00e7in say\u0131 veya bo\u015fluklar (veya sekmeler) + +config.name.formatting.indent.useTabs = Girinti i\u00e7in sekmeler +config.description.formatting.indent.useTabs = Girinti bo\u015fluklar\u0131 yerine sekmeler kullan\u0131n + +config.name.beginBlockOnNewLine = Yeni sat\u0131ra k\u0131vr\u0131ml\u0131 parantez +config.description.beginBlockOnNewLine = Yeni sat\u0131ra k\u0131vr\u0131ml\u0131 parantezle ba\u015flay\u0131n + +config.name.check.updates.delay = G\u00fcncellemelerde gecikmeyi kontrol et +config.description.check.updates.delay = Uygulama ba\u015flatmada g\u00fcncellemeler i\u00e7in otomatik kontroller aras\u0131ndaki minimum s\u00fcre + +config.name.check.updates.stable = Kararl\u0131 s\u00fcr\u00fcmleri kontrol et +config.description.check.updates.stable = Kararl\u0131 s\u00fcr\u00fcm g\u00fcncellemelerini kontrol etme + +config.name.check.updates.nightly = Gece versiyonlar\u0131n\u0131 kontrol et +config.description.check.updates.nightly = Gece s\u00fcr\u00fcm g\u00fcncellemelerini kontrol etme + +config.name.check.updates.enabled = G\u00fcncellemelerin kontrol\u00fc etkinle\u015ftirildi +config.description.check.updates.enabled = Uygulama ba\u015flat\u0131ld\u0131\u011f\u0131nda g\u00fcncellemeleri otomatik olarak kontrol etme + +config.name.export.formats = (\u00c7evrimi\u00e7i) d\u0131\u015fa aktarma bi\u00e7imleri +config.description.export.formats = En son kullan\u0131lan d\u0131\u015fa aktarma bi\u00e7imleri + +config.name.textExportSingleFile = Metinleri tek bir dosyaya aktar +config.description.textExportSingleFile = Metinleri birden \u00e7ok yerine tek bir dosyaya d\u0131\u015fa aktarma + +config.name.textExportSingleFileSeparator = Tek bir dosya metin ihracat\u0131nda metin ay\u0131r\u0131c\u0131 +config.description.textExportSingleFileSeparator = Tek dosya metin d\u0131\u015fa aktarma metinleri aras\u0131na eklemek i\u00e7in metin + +config.name.textExportSingleFileRecordSeparator = Tek bir dosya metin d\u0131\u015fa aktarma kay\u0131tlar\u0131n\u0131n ay\u0131r\u0131c\u0131s\u0131 +config.description.textExportSingleFileRecordSeparator = Tek dosya metin d\u0131\u015fa aktarma metin kay\u0131tlar\u0131 aras\u0131na eklenecek metin + +config.name.warning.experimental.as12edit = AS1/2 do\u011frudan d\u00fczenleme uyar\u0131s\u0131 +config.description.warning.experimental.as12edit = AS1/2 deneysel do\u011frudan d\u00fczenlemede uyar\u0131 g\u00f6ster + +config.name.warning.experimental.as3edit = AS3 do\u011frudan d\u00fczenleme uyar\u0131s\u0131 +config.description.warning.experimental.as3edit = AS3 deneysel do\u011frudan d\u00fczenlemesinde uyar\u0131 g\u00f6ster + +config.name.packJavaScripts = JavaScript'leri paketleyin +config.description.packJavaScripts = Canvas Export'da olu\u015fturulan komut dosyalar\u0131nda JavaScript paketleyici \u00e7al\u0131\u015ft\u0131r\u0131n. + +config.name.textExportExportFontFace = SVG d\u0131\u015fa aktar\u0131m\u0131nda font-y\u00fcz\u00fcn\u00fc kullan\u0131n +config.description.textExportExportFontFace = \u015eekil yerine yaz\u0131 tipi y\u00fcz\u00fcn\u00fc kullanarak yaz\u0131 tipi dosyalar\u0131n\u0131 SVG'ye kat\u0131\u015ft\u0131r\u0131n + +config.name.lzmaFastBytes = LZMA h\u0131zl\u0131 bayt (ge\u00e7erli de\u011ferler: 5-255) +config.description.lzmaFastBytes = LZMA enkoderinin h\u0131zl\u0131 bayt parametresi + +config.name.pluginPath = Eklenti Yolu +config.description.pluginPath = - + +config.name.showMethodBodyId = Metod g\u00f6vde kimli\u011fini g\u00f6ster +config.description.showMethodBodyId = Komut sat\u0131r\u0131n\u0131 i\u00e7e aktarmak i\u00e7in y\u00f6ntem nesnesinin kimli\u011fini g\u00f6sterir + +config.name.export.zoom = (\u00c7evrimi\u00e7i) Yak\u0131nla\u015ft\u0131rmay\u0131 d\u0131\u015fa aktar +config.description.export.zoom = Son kullan\u0131lan d\u0131\u015fa aktarma yak\u0131nla\u015ft\u0131rmas\u0131 + +config.name.debuggerPort = Hata ay\u0131klay\u0131c\u0131 ba\u011flant\u0131 noktas\u0131 +config.description.debuggerPort = Soket hata ay\u0131klama i\u00e7in kullan\u0131lan ba\u011flant\u0131 noktas\u0131 + +config.name.displayDebuggerInfo = (\u00c7evrimi\u00e7i) Hata ay\u0131klay\u0131c\u0131 bilgisini g\u00f6ster +config.description.displayDebuggerInfo = Anahtarlamadan \u00f6nce hata ay\u0131klay\u0131c\u0131 hakk\u0131ndaki bilgileri g\u00f6r\u00fcnt\u00fcleyin + +config.name.randomDebuggerPackage = Hata ay\u0131klay\u0131c\u0131 i\u00e7in rasgele paket ad\u0131 kullan\u0131n +config.description.randomDebuggerPackage = Bu, Hata Ay\u0131klay\u0131c\u0131 paketini, rasgele dize olarak yeniden adland\u0131r\u0131r; bu da hata ay\u0131klay\u0131c\u0131 varl\u0131\u011f\u0131n\u0131 ActionScript taraf\u0131ndan alg\u0131lanmas\u0131n\u0131 zorla\u015ft\u0131r\u0131r + +config.name.lastDebuggerReplaceFunction = (\u00c7evrimi\u00e7i) Son se\u00e7ilen iz de\u011fi\u015ftirme +config.description.lastDebuggerReplaceFunction = Son olarak iz i\u015flevinin yerini al\u0131p hata ay\u0131klay\u0131c\u0131yla de\u011fi\u015ftirilen i\u015flev ad\u0131 + +config.name.getLocalNamesFromDebugInfo = AS3: Hata ay\u0131klama bilgilerinden yerel kay\u0131t adlar\u0131 al\u0131n +config.description.getLocalNamesFromDebugInfo = Hata ay\u0131klama bilgisi mevcutsa, yerel kay\u0131tlar\u0131 _loc_x_'dan ger\u00e7ek adlara yeniden adland\u0131r\u0131r. Baz\u0131 karartmalar burada hatal\u0131 kay\u0131t isimleri kulland\u0131klar\u0131 i\u00e7in bu kapat\u0131labilir. + +config.name.tagTreeShowEmptyFolders = Bo\u015f klas\u00f6rleri g\u00f6ster +config.description.tagTreeShowEmptyFolders = Etiket a\u011fac\u0131nda bo\u015f klas\u00f6rleri g\u00f6ster. + +config.name.autoLoadEmbeddedSwfs = Kat\u0131\u015ft\u0131r\u0131lm\u0131\u015f SWF'leri otomatik y\u00fckle +config.description.autoLoadEmbeddedSwfs = Kat\u0131\u015ft\u0131r\u0131lm\u0131\u015f SWF'leri DefineBinaryData etiketlerinden otomatik olarak y\u00fckleyin. + +config.name.overrideTextExportFileName = Metin d\u0131\u015fa aktarma dosya ad\u0131n\u0131 ge\u00e7ersiz k\u0131l +config.description.overrideTextExportFileName = D\u0131\u015fa aktar\u0131lan metnin dosya ad\u0131n\u0131 \u00f6zelle\u015ftirebilirsiniz. Ge\u00e7erli SWF'nin dosya ad\u0131n\u0131 kullanmak i\u00e7in {filename} yer tutucu kullan\u0131n. + +config.name.showOldTextDuringTextEditing = Metin d\u00fczenleme s\u0131ras\u0131nda eski metni g\u00f6ster +config.description.showOldTextDuringTextEditing = \u00d6nizleme alan\u0131nda metin etiketinin orijinal metnini gri renkle g\u00f6sterir. + +config.group.name.import = \u0130thalat +config.group.description.import = \u0130thalat\u0131n konfig\u00fcrasyonu + +config.name.textImportResizeTextBoundsMode = Metin s\u0131n\u0131rlamal\u0131 yeniden boyutland\u0131rma modu +config.description.textImportResizeTextBoundsMode = Metin, metin d\u00fczenlemesinden sonra yeniden boyutland\u0131rma kipini s\u0131n\u0131rlar. + +config.name.showCloseConfirmation = SWF kapat onay\u0131n\u0131 tekrar g\u00f6ster +config.description.showCloseConfirmation = De\u011fi\u015ftirilen dosyalar i\u00e7in SWF kapat onay\u0131n\u0131 tekrar g\u00f6ster. + +config.name.showCodeSavedMessage = Kay\u0131tl\u0131 mesaj\u0131 tekrar g\u00f6ster +config.description.showCodeSavedMessage = Kay\u0131tl\u0131 mesaj\u0131 tekrar g\u00f6ster + +config.name.showTraitSavedMessage = Yeniden \u00f6zellik kaydedilen mesaj\u0131 g\u00f6ster +config.description.showTraitSavedMessage = Yeniden \u00f6zellik kaydedilen mesaj\u0131 g\u00f6ster + +config.name.updateProxyAddress = G\u00fcncellemeleri kontrol etmek i\u00e7in Http Proxy adresi +config.description.updateProxyAddress = G\u00fcncellemeleri kontrol etmek i\u00e7in Http Proxy adresi. Bi\u00e7im: example.com:8080 + +config.name.editorMode = Edit\u00f6r Modu +config.description.editorMode = Bir Metin veya Komut Dosyas\u0131 d\u00fc\u011f\u00fcm\u00fc se\u00e7ti\u011finizde metin alanlar\u0131n\u0131 otomatik olarak d\u00fczenlenebilir yap\u0131n + +config.name.autoSaveTagModifications = Etiket de\u011fi\u015fikliklerini otomatik kaydet +config.description.autoSaveTagModifications = A\u011fa\u00e7ta yeni bir etiket se\u00e7ti\u011finizde de\u011fi\u015fiklikleri kaydedin + +config.name.saveSessionOnExit = \u00c7\u0131k\u0131\u015fta oturumu kaydet +config.description.saveSessionOnExit = Ge\u00e7erli oturumu kaydedin ve FFDec yeniden ba\u015flat\u0131ld\u0131ktan sonra tekrar a\u00e7\u0131n (yaln\u0131zca ger\u00e7ek dosyalarla \u00e7al\u0131\u015f\u0131r) + +config.name._showDebugMenu = FFDec hata ay\u0131klama men\u00fcs\u00fcn\u00fc g\u00f6ster +config.description._showDebugMenu = Kar\u0131\u015ft\u0131r\u0131c\u0131y\u0131 hata ay\u0131klama i\u00e7in kurdele hata ay\u0131klama men\u00fcs\u00fcn\u00fc g\u00f6sterir. + +config.name.allowOnlyOneInstance = Yaln\u0131zca bir FFDec \u00f6rne\u011fine izin ver (Yaln\u0131zca Windows OS) +config.description.allowOnlyOneInstance = FFDec daha sonra yaln\u0131zca bir kez \u00e7al\u0131\u015ft\u0131r\u0131labilir, a\u00e7\u0131lan t\u00fcm dosyalar bir pencereye eklenir. Yaln\u0131zca Windows i\u015fletim sistemi ile \u00e7al\u0131\u015f\u0131r. + +config.name.scriptExportSingleFile = Komut dosyalar\u0131n\u0131 tek bir dosyaya aktar +config.description.scriptExportSingleFile = Komut dosyalar\u0131n\u0131 birden \u00e7ok yerine tek bir dosyaya d\u0131\u015fa aktarma + +config.name.setFFDecVersionInExportedFont = D\u0131\u015fa aktar\u0131lan fontta FFDec s\u00fcr\u00fcm numaras\u0131n\u0131 ayarla +config.description.setFFDecVersionInExportedFont = Bu ayar devre d\u0131\u015f\u0131 b\u0131rak\u0131ld\u0131\u011f\u0131nda, FFDec ge\u00e7erli FFDec s\u00fcr\u00fcm numaras\u0131n\u0131 d\u0131\u015fa aktar\u0131lan fonta eklemeyecektir. + +config.name.gui.skin = Kullan\u0131c\u0131 Arabirimi Cildi +config.description.gui.skin = Cildi g\u00f6rmek ve hissetmek + +config.name.lastSessionFiles = Son oturum dosyalar\u0131 +config.description.lastSessionFiles = Son oturumdaki dosyalar\u0131 a\u00e7ar + +config.name.lastSessionSelection = Son oturum se\u00e7imi +config.description.lastSessionSelection = Son oturumdaki se\u00e7imi i\u00e7erir + +config.name.loopMedia = D\u00f6ng\u00fcsel sesler ve spritler +config.description.loopMedia = Sesleri ve sprite'leri otomatik olarak yeniden ba\u015flat\u0131r + +config.name.gui.timeLineSplitPane.dividerLocationPercent = (\u00c7evrimi\u00e7i) Zaman \u00c7izelgesi B\u00f6l\u00fcc\u00fc konumu +config.description.gui.timeLineSplitPane.dividerLocationPercent = + +config.name.cacheImages = \u00d6nbellek g\u00f6r\u00fcnt\u00fcleri +config.description.cacheImages = \u00c7\u00f6z\u00fclen resim nesnelerini \u00f6nbellekle sakla + +config.name.swfSpecificConfigs = SWF'ye \u00f6zel yap\u0131land\u0131rmalar +config.description.swfSpecificConfigs = SWF'ye \u00f6zg\u00fc yap\u0131land\u0131rmalar\u0131 i\u00e7erir + +config.name.exeExportMode = EXE d\u0131\u015fa aktarma modu +config.description.exeExportMode = EXE d\u0131\u015fa aktarma modu + +config.name.ignoreCLikePackages = FlashCC/Alchemy veya benzeri paketleri yoksay +config.description.ignoreCLikePackages = FlashCC/Alchemy paketleri genellikle do\u011fru \u015fekilde ayr\u0131\u015ft\u0131r\u0131lamaz. Di\u011fer paketlerin derlemesini h\u0131zland\u0131rmak i\u00e7in bunlar\u0131 devre d\u0131\u015f\u0131 b\u0131rakabilirsiniz. + +config.name.overwriteExistingFiles = Varolan dosyalar\u0131n \u00fczerine yaz +config.description.overwriteExistingFiles = D\u0131\u015fa aktarma s\u0131ras\u0131nda mevcut dosyalar\u0131n \u00fczerine yaz\u0131n. \u015eu an i\u00e7in yaln\u0131zca AS2/3 komut dosyalar\u0131 i\u00e7in + +config.name.smartNumberFormatting = Ak\u0131ll\u0131 say\u0131 bi\u00e7imlendirmesini kullan +config.description.smartNumberFormatting = \u00d6zel say\u0131lar\u0131 bi\u00e7imlendirin (\u00f6rne\u011fin renkler ve saatler) + +config.name.enableScriptInitializerDisplay = G\u00f6r\u00fcnt\u00fc komut dosyas\u0131 ba\u015flat\u0131c\u0131lar\u0131 +config.description.enableScriptInitializerDisplay = Komut ba\u015flat\u0131c\u0131lar\u0131 g\u00f6r\u00fcnt\u00fcleme ve d\u00fczenleme i\u015flemini etkinle\u015ftir. Bu ayar, vurgulamak i\u00e7in her s\u0131n\u0131f dosyas\u0131na bir yeni sat\u0131r ekleyebilir. + +config.name.autoOpenLoadedSWFs = \u00c7al\u0131\u015ft\u0131r\u0131l\u0131rken y\u00fcklenen SWF'leri a\u00e7 (Harici g\u00f6r\u00fcnt\u00fcleyici = yaln\u0131zca WIN) +config.description.autoOpenLoadedSWFs = FFDec harici oynat\u0131c\u0131da oynat\u0131ld\u0131\u011f\u0131nda SWF'yi \u00e7al\u0131\u015ft\u0131rarak AS3 s\u0131n\u0131f\u0131 Loader taraf\u0131ndan y\u00fcklenen t\u00fcm SWF'leri otomatik olarak a\u00e7ar. Bu \u00f6zellik yaln\u0131zca Windows'dur. + +config.name.lastSessionFileTitles = Son oturum dosyas\u0131 ba\u015fl\u0131klar\u0131 +config.description.lastSessionFileTitles = Son oturumdaki a\u00e7\u0131lm\u0131\u015f dosya ba\u015fl\u0131klar\u0131n\u0131 i\u00e7erir (\u00f6rne\u011fin URL'den y\u00fcklendi\u011finde vs.) + +config.group.name.paths = Yollar +config.group.description.paths = Gerekli dosyalar\u0131n yeri +config.group.tip.paths = Projekt\u00f6r\u00fc ve Playerglobal'\u0131 indirin adobe webpage. Flex SDK can be downloaded on adobe devnet. +config.group.link.paths = https://www.adobe.com/support/flashplayer/debug_downloads.html http://www.adobe.com/devnet/flex/flex-sdk-download.html + +config.name.playerLocation = 1) Flash Player projekt\u00f6r yolu +config.description.playerLocation = Ba\u011f\u0131ms\u0131z flash oynat\u0131c\u0131n\u0131n y\u00fcr\u00fct\u00fclebilir konumu. \u00c7al\u0131\u015ft\u0131rma eylemi i\u00e7in kullan\u0131l\u0131r. + +config.name.playerDebugLocation = 2) Flash Player projekt\u00f6r i\u00e7erik hata ay\u0131klay\u0131c\u0131 yolu +config.description.playerDebugLocation = Tek ba\u015f\u0131na hata ay\u0131klama flash oynat\u0131c\u0131n\u0131n y\u00fcr\u00fct\u00fclebilir konumu. Hata ay\u0131klama eylemi i\u00e7in kullan\u0131l\u0131r. + +config.name.playerLibLocation = 3) PlayerGlobal (.swc) yolu +config.description.playerLibLocation = Playerglobal.swc flash player kitapl\u0131\u011f\u0131n\u0131n yeri. \u00c7o\u011funlukla AS3 derlemesi i\u00e7in kullan\u0131l\u0131r. + +config.name.debugHalt = Hata ay\u0131klama ba\u015flatmada durma +config.description.debugHalt = Hata ay\u0131klama i\u015fleminin ba\u015flang\u0131c\u0131nda SWF'yi duraklat\u0131n. + +config.name.gui.avm2.splitPane.vars.dividerLocationPercent = (Dahili) Hata ay\u0131klama men\u00fcs\u00fc b\u00f6l\u00fcc\u00fc konumu +config.description.gui.avm2.splitPane.vars.dividerLocationPercent = + +tip = Tip:\u0020 + +config.name.gui.action.splitPane.vars.dividerLocationPercent = (Dahili) AS1/2 Hata ay\u0131klama men\u00fcs\u00fc b\u00f6l\u00fcc\u00fc konumu +config.description.gui.action.splitPane.vars.dividerLocationPercent = + +config.name.setMovieDelay = D\u0131\u015f oyuncudaki SWF'yi de\u011fi\u015ftirmeden \u00f6nce gecikme ms +config.description.setMovieDelay = Bu de\u011feri 1000 ms'nin alt\u0131nda de\u011fi\u015ftirmeniz \u00f6nerilmez + +config.name.warning.svgImport = SVG i\u00e7e aktarma konusunda uyar\u0131 +config.description.warning.svgImport = + +config.name.shapeImport.useNonSmoothedFill = Bir \u015fekil bir resimle de\u011fi\u015ftirildi\u011finde p\u00fcr\u00fczs\u00fcz dolguyu kullan\u0131n +config.description.shapeImport.useNonSmoothedFill = + +config.name.internalFlashViewer.execute.as12 = Kendi fla\u015f g\u00f6r\u00fcnt\u00fcleyicide AS1/2 (Deneysel) +config.description.internalFlashViewer.execute.as12 = FFDec fla\u015f g\u00f6r\u00fcnt\u00fcleyicisini kullanarak SWF oynatma s\u0131ras\u0131nda ActionScript 1/2 y\u00fcr\u00fctmeyi deneyin + +config.name.warning.hexViewNotUpToDate = Onalt\u0131l\u0131k g\u00f6r\u00fcn\u00fcm\u00fc g\u00f6ster g\u00fcncel uyar\u0131 de\u011fil +config.description.warning.hexViewNotUpToDate = + +config.name.displayDupInstructions = G\u00f6ster \u00a7\u00a7d\u00fc\u015f\u00fck talimatlar +config.description.displayDupInstructions = Kodda g\u00f6sterilecek \u00a7\u00a7d\u00fc\u015f\u00fck talimatlar. Bunlar olmadan kod kolayca derlenebilir ancak yan etkileri olan baz\u0131 dupped kodlar iki kez y\u00fcr\u00fct\u00fclebilir. + +config.name.useRegExprLiteral = RegExp dosyas\u0131n\u0131 /pattern/mod de\u011fi\u015fkeni olarak derleyelim. +config.description.useRegExprLiteral = Normal ifadeleri ayr\u0131\u015ft\u0131r\u0131rken /pattern/mod s\u00f6zdizimini kullan\u0131n. aksi takdirde yeni RegExp ("pat", "mod") kullan\u0131l\u0131r + +config.name.handleSkinPartsAutomatically = [SkinPart] meta verisini otomatik olarak y\u00f6netin +config.description.handleSkinPartsAutomatically = D\u00fczenlemeleri [SkinPart] meta verilerini otomatik olarak derleyip do\u011frudan d\u00fczenler. Kapat\u0131ld\u0131\u011f\u0131nda _skinParts \u00f6zelli\u011fi ve getter y\u00f6ntemi g\u00f6r\u00fcn\u00fcr ve manuel olarak d\u00fczenlenebilir. + +config.name.simplifyExpressions = Deyimleri basitle\u015ftir +config.description.simplifyExpressions = Kodun okunabilir olmas\u0131n\u0131 sa\u011flamak i\u00e7in ifadeleri de\u011ferlendirin ve basitle\u015ftirin + +config.name.resetLetterSpacingOnTextImport = Metin i\u00e7e aktar\u0131m\u0131nda Mektup Yerle\u015fimini S\u0131f\u0131rla +config.description.resetLetterSpacingOnTextImport = Kiril yaz\u0131 tipleri i\u00e7in daha kullan\u0131\u015fl\u0131, \u00e7\u00fcnk\u00fc bunlar daha geni\u015f + +config.name.flexSdkLocation = 4) Flex SDK dizin yolu +config.description.flexSdkLocation = Adobe Flex SDK'n\u0131n konumu. \u00c7o\u011funlukla AS3 derlemesi i\u00e7in kullan\u0131l\u0131r. + +config.name.useFlexAs3Compiler = Flex SDK AS3 derleyici kullan\u0131n +config.description.useFlexAs3Compiler = ActionScript do\u011frudan d\u00fczenleme s\u0131ras\u0131nda Flex SDK'den AS3 derleyicisi kullan\u0131n (Flex SDK dizininin ayarlanmas\u0131 gereklidir) + +config.name.showSetAdvanceValuesMessage = Avans de\u011ferlerini ayarlama hakk\u0131nda bilgileri tekrar g\u00f6ster +config.description.showSetAdvanceValuesMessage = Avans de\u011ferlerini ayarlama hakk\u0131nda bilgileri tekrar g\u00f6ster + +config.name.gui.fontSizeMultiplier = Yaz\u0131 tipi boyutu \u00e7arpan\u0131 +config.description.gui.fontSizeMultiplier = Yaz\u0131 tipi boyutu \u00e7arpan\u0131 + +#Do not translate the Font Styles (Plain... etc.) +config.name.gui.sourceFont = Kaynak yaz\u0131 tipi stili +config.description.gui.sourceFont = FontNameFontSize-FontStyle(D\u00fcz, Kal\u0131n, \u0130talik BoldItalic)-FontSize \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/DebugLogDialog_tr.properties b/src/com/jpexs/decompiler/flash/gui/locales/DebugLogDialog_tr.properties new file mode 100644 index 000000000..03bc4b831 --- /dev/null +++ b/src/com/jpexs/decompiler/flash/gui/locales/DebugLogDialog_tr.properties @@ -0,0 +1,19 @@ +# Copyright (C) 2010-2016 JPEXS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +dialog.title = Hata ay\u0131klay\u0131c\u0131 G\u00fcnl\u00fc\u011f\u00fc +button.clear = Temizle +button.close = Kapat +msg.header = ba\u011flan %clientid%: \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/ErrorLogFrame_tr.properties b/src/com/jpexs/decompiler/flash/gui/locales/ErrorLogFrame_tr.properties new file mode 100644 index 000000000..a06d98edb --- /dev/null +++ b/src/com/jpexs/decompiler/flash/gui/locales/ErrorLogFrame_tr.properties @@ -0,0 +1,21 @@ +# Copyright (C) 2010-2016 JPEXS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +copy = Panoya kopyala +details = Detaylar\u0131 g\u00f6ster +dialog.title = Giri\u015f + +#after version 1.7.0u1: +clear = Temizle \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog_tr.properties b/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog_tr.properties new file mode 100644 index 000000000..45eb055db --- /dev/null +++ b/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog_tr.properties @@ -0,0 +1,99 @@ +# Copyright (C) 2010-2016 JPEXS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +shapes = Bi\u00e7im +shapes.svg = SVG +shapes.png = PNG +shapes.bmp = BMP +shapes.canvas = HTML5 Canvas +shapes.swf = SWF + +texts = Metinler +texts.plain = D\u00fcz metin +texts.formatted = Bi\u00e7imlendirilmi\u015f metin +texts.svg = SVG + +images = G\u00f6r\u00fcnt\u00fcler +images.png_gif_jpeg = PNG/GIF/JPEG +images.png = PNG +images.jpeg = JPEG +images.bmp = BMP + +movies = Filmler +movies.flv = FLV (Ses yok) + +sounds = Sesler +sounds.mp3_wav_flv = MP3/WAV/FLV +sounds.flv = FLV (Audio only) +sounds.mp3_wav = MP3/WAV +sounds.wav = WAV + +scripts = Komutlar +scripts.as = ActionScript +scripts.pcode = P-code +scripts.pcode_hex = P-code with Hex +scripts.hex = B\u00fcy\u00fc +scripts.constants = Sabitler +scripts.as_method_stubs = ActionScript y\u00f6ntemi taslaklar\u0131 + +binaryData = \u0130kili veri +binaryData.raw = Raw + +dialog.title = \u0130hracat... + +button.ok = OK +button.cancel = \u0130ptal + +morphshapes = Morph \u015fekilleri +morphshapes.gif = GIF +morphshapes.svg = SVG +morphshapes.canvas = HTML5 Canvas +morphshapes.swf = SWF + +frames = \u00c7er\u00e7eveler +frames.png = PNG +frames.gif = GIF +frames.avi = AVI +frames.svg = SVG +frames.canvas = HTML5 Canvas +frames.pdf = PDF +frames.bmp = BMP +frames.swf = SWF + +sprites = Hareketliler +sprites.png = PNG +sprites.gif = GIF +sprites.avi = AVI +sprites.svg = SVG +sprites.canvas = HTML5 Canvas +sprites.pdf = PDF +sprites.bmp = BMP +sprites.swf = SWF + +buttons = D\u00fc\u011fmeler +buttons.png = PNG +buttons.svg = SVG +buttons.bmp = BMP +buttons.swf = SWF + +fonts = Yaz\u0131 +fonts.ttf = TTF +fonts.woff = WOFF + +zoom = Yak\u0131nla\u015ft\u0131rmak +zoom.percent = % +zoom.invalid = Ge\u00e7ersiz yak\u0131nla\u015ft\u0131rma de\u011feri. + +symbolclass = Sembol S\u0131n\u0131f\u0131 haritalama +symbolclass.csv = CSV \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/FontEmbedDialog_tr.properties b/src/com/jpexs/decompiler/flash/gui/locales/FontEmbedDialog_tr.properties new file mode 100644 index 000000000..b6841c1db --- /dev/null +++ b/src/com/jpexs/decompiler/flash/gui/locales/FontEmbedDialog_tr.properties @@ -0,0 +1,26 @@ +# Copyright (C) 2010-2016 JPEXS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +range.description = %name% (%available% of %total% characters) +dialog.title = Yaz\u0131 tipi g\u00f6mme +label.individual = Bireysel karakterler: +button.loadfont = Yaz\u0131tipini diskten y\u00fckle... +filter.ttf = True Type Font dosyalar\u0131 (*.ttf) +error.invalidfontfile = Ge\u00e7ersiz yaz\u0131 tipi dosyas\u0131 +error.cannotreadfontfile = Yaz\u0131 tipi dosyas\u0131 okunam\u0131yor +installed = Kurulmu\u015f: +ttffile.noselection = TTF dosyas\u0131: