Code format & Organize imports

This commit is contained in:
Jindra Petk
2014-02-02 05:39:36 +01:00
parent 7b6d54bc68
commit e595437dc2
59 changed files with 2350 additions and 1509 deletions

View File

@@ -52,7 +52,6 @@ import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.ecma.Null;
import com.jpexs.decompiler.flash.exporters.BitmapExporter;
import com.jpexs.decompiler.flash.exporters.Matrix;
import com.jpexs.decompiler.flash.flv.AUDIODATA;
import com.jpexs.decompiler.flash.flv.FLVOutputStream;
@@ -430,7 +429,7 @@ public final class SWF implements TreeItem {
showFrameTag.innerTags = innerTags;
}
}
assignExportNamesToSymbols();
assignClassesToSymbols();
findFileAttributes();
@@ -991,7 +990,7 @@ public final class SWF implements TreeItem {
}
return ret;
}
public static void getTagsFromTreeNodes(List<TreeNode> treeNodes, List<Tag> result) {
for (TreeNode treeNode : treeNodes) {
TreeItem treeItem = treeNode.getItem();
@@ -1001,7 +1000,7 @@ public final class SWF implements TreeItem {
getTagsFromTreeNodes(treeNode.subNodes, result);
}
}
private final HashSet<EventListener> listeners = new HashSet<>();
public final void addEventListener(EventListener listener) {
@@ -2076,7 +2075,7 @@ public final class SWF implements TreeItem {
mat.getRotateSkew1Float(), mat.getScaleYFloat(),
mat.translateX, mat.translateY);
}
private static Cache<SerializableImage> frameCache = Cache.getInstance(false);
public static SerializableImage getFromCache(String key) {
@@ -2085,11 +2084,11 @@ public final class SWF implements TreeItem {
}
return null;
}
public static void putToCache(String key, SerializableImage img) {
frameCache.put(key, img);
}
public static void clearImageCache() {
frameCache.clear();
}
@@ -2165,8 +2164,8 @@ public final class SWF implements TreeItem {
CharacterTag character = characters.get(layer.characterId);
Matrix mat = new Matrix(layer.matrix);
/*if (firstLevel) {
mat.scale(unzoom);
}*/
mat.scale(unzoom);
}*/
mat.translate(fixX, fixY);
if (character instanceof DrawableTag) {
@@ -2174,9 +2173,9 @@ public final class SWF implements TreeItem {
SerializableImage img = drawable.toImage(layer.ratio < 0 ? 0 : layer.ratio/*layer.duration*/, allTags, characters, visited, transformation);
mat.translate(img.bounds.getMinX() * unzoom, img.bounds.getMinY() * unzoom);
/*if (character instanceof BoundedTag) {
BoundedTag bounded = (BoundedTag) character;
RECT rect = bounded.getRect(characters, visited);
}*/
BoundedTag bounded = (BoundedTag) character;
RECT rect = bounded.getRect(characters, visited);
}*/
if (layer.filters != null) {
for (FILTER filter : layer.filters) {
img = filter.apply(img);

View File

@@ -20,13 +20,177 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.model.ConstantPool;
import com.jpexs.decompiler.flash.action.special.ActionEnd;
import com.jpexs.decompiler.flash.action.special.ActionNop;
import com.jpexs.decompiler.flash.action.swf3.*;
import com.jpexs.decompiler.flash.action.swf4.*;
import com.jpexs.decompiler.flash.action.swf5.*;
import com.jpexs.decompiler.flash.action.swf6.*;
import com.jpexs.decompiler.flash.action.swf7.*;
import com.jpexs.decompiler.flash.action.swf3.ActionGetURL;
import com.jpexs.decompiler.flash.action.swf3.ActionGoToLabel;
import com.jpexs.decompiler.flash.action.swf3.ActionGotoFrame;
import com.jpexs.decompiler.flash.action.swf3.ActionNextFrame;
import com.jpexs.decompiler.flash.action.swf3.ActionPlay;
import com.jpexs.decompiler.flash.action.swf3.ActionPrevFrame;
import com.jpexs.decompiler.flash.action.swf3.ActionSetTarget;
import com.jpexs.decompiler.flash.action.swf3.ActionStop;
import com.jpexs.decompiler.flash.action.swf3.ActionStopSounds;
import com.jpexs.decompiler.flash.action.swf3.ActionToggleQuality;
import com.jpexs.decompiler.flash.action.swf3.ActionWaitForFrame;
import com.jpexs.decompiler.flash.action.swf4.ActionAdd;
import com.jpexs.decompiler.flash.action.swf4.ActionAnd;
import com.jpexs.decompiler.flash.action.swf4.ActionAsciiToChar;
import com.jpexs.decompiler.flash.action.swf4.ActionCall;
import com.jpexs.decompiler.flash.action.swf4.ActionCharToAscii;
import com.jpexs.decompiler.flash.action.swf4.ActionCloneSprite;
import com.jpexs.decompiler.flash.action.swf4.ActionDivide;
import com.jpexs.decompiler.flash.action.swf4.ActionEndDrag;
import com.jpexs.decompiler.flash.action.swf4.ActionEquals;
import com.jpexs.decompiler.flash.action.swf4.ActionGetProperty;
import com.jpexs.decompiler.flash.action.swf4.ActionGetTime;
import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2;
import com.jpexs.decompiler.flash.action.swf4.ActionGetVariable;
import com.jpexs.decompiler.flash.action.swf4.ActionGotoFrame2;
import com.jpexs.decompiler.flash.action.swf4.ActionIf;
import com.jpexs.decompiler.flash.action.swf4.ActionJump;
import com.jpexs.decompiler.flash.action.swf4.ActionLess;
import com.jpexs.decompiler.flash.action.swf4.ActionMBAsciiToChar;
import com.jpexs.decompiler.flash.action.swf4.ActionMBCharToAscii;
import com.jpexs.decompiler.flash.action.swf4.ActionMBStringExtract;
import com.jpexs.decompiler.flash.action.swf4.ActionMBStringLength;
import com.jpexs.decompiler.flash.action.swf4.ActionMultiply;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
import com.jpexs.decompiler.flash.action.swf4.ActionOr;
import com.jpexs.decompiler.flash.action.swf4.ActionPop;
import com.jpexs.decompiler.flash.action.swf4.ActionPush;
import com.jpexs.decompiler.flash.action.swf4.ActionRandomNumber;
import com.jpexs.decompiler.flash.action.swf4.ActionRemoveSprite;
import com.jpexs.decompiler.flash.action.swf4.ActionSetProperty;
import com.jpexs.decompiler.flash.action.swf4.ActionSetTarget2;
import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable;
import com.jpexs.decompiler.flash.action.swf4.ActionStartDrag;
import com.jpexs.decompiler.flash.action.swf4.ActionStringAdd;
import com.jpexs.decompiler.flash.action.swf4.ActionStringEquals;
import com.jpexs.decompiler.flash.action.swf4.ActionStringExtract;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLength;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLess;
import com.jpexs.decompiler.flash.action.swf4.ActionSubtract;
import com.jpexs.decompiler.flash.action.swf4.ActionToInteger;
import com.jpexs.decompiler.flash.action.swf4.ActionTrace;
import com.jpexs.decompiler.flash.action.swf4.ActionWaitForFrame2;
import com.jpexs.decompiler.flash.action.swf5.ActionAdd2;
import com.jpexs.decompiler.flash.action.swf5.ActionBitAnd;
import com.jpexs.decompiler.flash.action.swf5.ActionBitLShift;
import com.jpexs.decompiler.flash.action.swf5.ActionBitOr;
import com.jpexs.decompiler.flash.action.swf5.ActionBitRShift;
import com.jpexs.decompiler.flash.action.swf5.ActionBitURShift;
import com.jpexs.decompiler.flash.action.swf5.ActionBitXor;
import com.jpexs.decompiler.flash.action.swf5.ActionCallFunction;
import com.jpexs.decompiler.flash.action.swf5.ActionCallMethod;
import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool;
import com.jpexs.decompiler.flash.action.swf5.ActionDecrement;
import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction;
import com.jpexs.decompiler.flash.action.swf5.ActionDefineLocal;
import com.jpexs.decompiler.flash.action.swf5.ActionDefineLocal2;
import com.jpexs.decompiler.flash.action.swf5.ActionDelete;
import com.jpexs.decompiler.flash.action.swf5.ActionDelete2;
import com.jpexs.decompiler.flash.action.swf5.ActionEnumerate;
import com.jpexs.decompiler.flash.action.swf5.ActionEquals2;
import com.jpexs.decompiler.flash.action.swf5.ActionGetMember;
import com.jpexs.decompiler.flash.action.swf5.ActionIncrement;
import com.jpexs.decompiler.flash.action.swf5.ActionInitArray;
import com.jpexs.decompiler.flash.action.swf5.ActionInitObject;
import com.jpexs.decompiler.flash.action.swf5.ActionLess2;
import com.jpexs.decompiler.flash.action.swf5.ActionModulo;
import com.jpexs.decompiler.flash.action.swf5.ActionNewMethod;
import com.jpexs.decompiler.flash.action.swf5.ActionNewObject;
import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate;
import com.jpexs.decompiler.flash.action.swf5.ActionReturn;
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
import com.jpexs.decompiler.flash.action.swf5.ActionStackSwap;
import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister;
import com.jpexs.decompiler.flash.action.swf5.ActionTargetPath;
import com.jpexs.decompiler.flash.action.swf5.ActionToNumber;
import com.jpexs.decompiler.flash.action.swf5.ActionToString;
import com.jpexs.decompiler.flash.action.swf5.ActionTypeOf;
import com.jpexs.decompiler.flash.action.swf5.ActionWith;
import com.jpexs.decompiler.flash.action.swf6.ActionEnumerate2;
import com.jpexs.decompiler.flash.action.swf6.ActionGreater;
import com.jpexs.decompiler.flash.action.swf6.ActionInstanceOf;
import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals;
import com.jpexs.decompiler.flash.action.swf6.ActionStringGreater;
import com.jpexs.decompiler.flash.action.swf7.ActionCastOp;
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
import com.jpexs.decompiler.flash.action.swf7.ActionExtends;
import com.jpexs.decompiler.flash.action.swf7.ActionImplementsOp;
import com.jpexs.decompiler.flash.action.swf7.ActionThrow;
import com.jpexs.decompiler.flash.action.swf7.ActionTry;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.tags.*;
import com.jpexs.decompiler.flash.tags.CSMTextSettingsTag;
import com.jpexs.decompiler.flash.tags.DebugIDTag;
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag;
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag;
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG4Tag;
import com.jpexs.decompiler.flash.tags.DefineBitsLossless2Tag;
import com.jpexs.decompiler.flash.tags.DefineBitsLosslessTag;
import com.jpexs.decompiler.flash.tags.DefineBitsTag;
import com.jpexs.decompiler.flash.tags.DefineButton2Tag;
import com.jpexs.decompiler.flash.tags.DefineButtonCxformTag;
import com.jpexs.decompiler.flash.tags.DefineButtonSoundTag;
import com.jpexs.decompiler.flash.tags.DefineButtonTag;
import com.jpexs.decompiler.flash.tags.DefineEditTextTag;
import com.jpexs.decompiler.flash.tags.DefineFont2Tag;
import com.jpexs.decompiler.flash.tags.DefineFont3Tag;
import com.jpexs.decompiler.flash.tags.DefineFont4Tag;
import com.jpexs.decompiler.flash.tags.DefineFontAlignZonesTag;
import com.jpexs.decompiler.flash.tags.DefineFontInfo2Tag;
import com.jpexs.decompiler.flash.tags.DefineFontInfoTag;
import com.jpexs.decompiler.flash.tags.DefineFontNameTag;
import com.jpexs.decompiler.flash.tags.DefineFontTag;
import com.jpexs.decompiler.flash.tags.DefineMorphShape2Tag;
import com.jpexs.decompiler.flash.tags.DefineMorphShapeTag;
import com.jpexs.decompiler.flash.tags.DefineScalingGridTag;
import com.jpexs.decompiler.flash.tags.DefineSceneAndFrameLabelDataTag;
import com.jpexs.decompiler.flash.tags.DefineShape2Tag;
import com.jpexs.decompiler.flash.tags.DefineShape3Tag;
import com.jpexs.decompiler.flash.tags.DefineShape4Tag;
import com.jpexs.decompiler.flash.tags.DefineShapeTag;
import com.jpexs.decompiler.flash.tags.DefineSoundTag;
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
import com.jpexs.decompiler.flash.tags.DefineText2Tag;
import com.jpexs.decompiler.flash.tags.DefineTextTag;
import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag;
import com.jpexs.decompiler.flash.tags.DoABCDefineTag;
import com.jpexs.decompiler.flash.tags.DoABCTag;
import com.jpexs.decompiler.flash.tags.DoActionTag;
import com.jpexs.decompiler.flash.tags.DoInitActionTag;
import com.jpexs.decompiler.flash.tags.EnableDebugger2Tag;
import com.jpexs.decompiler.flash.tags.EnableDebuggerTag;
import com.jpexs.decompiler.flash.tags.EnableTelemetryTag;
import com.jpexs.decompiler.flash.tags.EndTag;
import com.jpexs.decompiler.flash.tags.ExportAssetsTag;
import com.jpexs.decompiler.flash.tags.FileAttributesTag;
import com.jpexs.decompiler.flash.tags.FrameLabelTag;
import com.jpexs.decompiler.flash.tags.ImportAssets2Tag;
import com.jpexs.decompiler.flash.tags.ImportAssetsTag;
import com.jpexs.decompiler.flash.tags.JPEGTablesTag;
import com.jpexs.decompiler.flash.tags.MetadataTag;
import com.jpexs.decompiler.flash.tags.PlaceObject2Tag;
import com.jpexs.decompiler.flash.tags.PlaceObject3Tag;
import com.jpexs.decompiler.flash.tags.PlaceObject4Tag;
import com.jpexs.decompiler.flash.tags.PlaceObjectTag;
import com.jpexs.decompiler.flash.tags.ProductInfoTag;
import com.jpexs.decompiler.flash.tags.ProtectTag;
import com.jpexs.decompiler.flash.tags.RemoveObject2Tag;
import com.jpexs.decompiler.flash.tags.RemoveObjectTag;
import com.jpexs.decompiler.flash.tags.ScriptLimitsTag;
import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag;
import com.jpexs.decompiler.flash.tags.SetTabIndexTag;
import com.jpexs.decompiler.flash.tags.ShowFrameTag;
import com.jpexs.decompiler.flash.tags.SoundStreamBlockTag;
import com.jpexs.decompiler.flash.tags.SoundStreamHead2Tag;
import com.jpexs.decompiler.flash.tags.SoundStreamHeadTag;
import com.jpexs.decompiler.flash.tags.StartSound2Tag;
import com.jpexs.decompiler.flash.tags.StartSoundTag;
import com.jpexs.decompiler.flash.tags.SymbolClassTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.UnknownTag;
import com.jpexs.decompiler.flash.tags.VideoFrameTag;
import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalGradient;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalImage;
@@ -37,7 +201,49 @@ import com.jpexs.decompiler.flash.tags.gfx.DefineGradientMap;
import com.jpexs.decompiler.flash.tags.gfx.DefineSubImage;
import com.jpexs.decompiler.flash.tags.gfx.ExporterInfoTag;
import com.jpexs.decompiler.flash.tags.gfx.FontTextureInfo;
import com.jpexs.decompiler.flash.types.*;
import com.jpexs.decompiler.flash.types.ALPHABITMAPDATA;
import com.jpexs.decompiler.flash.types.ALPHACOLORMAPDATA;
import com.jpexs.decompiler.flash.types.ARGB;
import com.jpexs.decompiler.flash.types.BITMAPDATA;
import com.jpexs.decompiler.flash.types.BUTTONCONDACTION;
import com.jpexs.decompiler.flash.types.BUTTONRECORD;
import com.jpexs.decompiler.flash.types.CLIPACTIONRECORD;
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
import com.jpexs.decompiler.flash.types.CLIPEVENTFLAGS;
import com.jpexs.decompiler.flash.types.COLORMAPDATA;
import com.jpexs.decompiler.flash.types.CXFORM;
import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA;
import com.jpexs.decompiler.flash.types.FILLSTYLE;
import com.jpexs.decompiler.flash.types.FILLSTYLEARRAY;
import com.jpexs.decompiler.flash.types.FOCALGRADIENT;
import com.jpexs.decompiler.flash.types.GLYPHENTRY;
import com.jpexs.decompiler.flash.types.GRADIENT;
import com.jpexs.decompiler.flash.types.GRADRECORD;
import com.jpexs.decompiler.flash.types.KERNINGRECORD;
import com.jpexs.decompiler.flash.types.LANGCODE;
import com.jpexs.decompiler.flash.types.LINESTYLE;
import com.jpexs.decompiler.flash.types.LINESTYLE2;
import com.jpexs.decompiler.flash.types.LINESTYLEARRAY;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.MORPHFILLSTYLE;
import com.jpexs.decompiler.flash.types.MORPHFILLSTYLEARRAY;
import com.jpexs.decompiler.flash.types.MORPHGRADIENT;
import com.jpexs.decompiler.flash.types.MORPHGRADRECORD;
import com.jpexs.decompiler.flash.types.MORPHLINESTYLE;
import com.jpexs.decompiler.flash.types.MORPHLINESTYLE2;
import com.jpexs.decompiler.flash.types.MORPHLINESTYLEARRAY;
import com.jpexs.decompiler.flash.types.PIX15;
import com.jpexs.decompiler.flash.types.PIX24;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.RGB;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.SHAPE;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.SOUNDENVELOPE;
import com.jpexs.decompiler.flash.types.SOUNDINFO;
import com.jpexs.decompiler.flash.types.TEXTRECORD;
import com.jpexs.decompiler.flash.types.ZONEDATA;
import com.jpexs.decompiler.flash.types.ZONERECORD;
import com.jpexs.decompiler.flash.types.filters.BEVELFILTER;
import com.jpexs.decompiler.flash.types.filters.BLURFILTER;
import com.jpexs.decompiler.flash.types.filters.COLORMATRIXFILTER;
@@ -92,15 +298,17 @@ public class SWFInputStream extends InputStream {
private ByteArrayOutputStream buffer;
private List<Long> tagPositionsInFrame = new ArrayList<>();
public Map<Long, List<Long>> tagPositionsInFrames = new HashMap<>();
private List<Integer> frameTagTypeIds = new ArrayList<Integer>() {{
add(PlaceObjectTag.ID);
add(PlaceObject2Tag.ID);
add(PlaceObject3Tag.ID);
add(PlaceObject4Tag.ID);
add(RemoveObjectTag.ID);
add(RemoveObject2Tag.ID);
add(FrameLabelTag.ID);
}};
private List<Integer> frameTagTypeIds = new ArrayList<Integer>() {
{
add(PlaceObjectTag.ID);
add(PlaceObject2Tag.ID);
add(PlaceObject3Tag.ID);
add(PlaceObject4Tag.ID);
add(RemoveObjectTag.ID);
add(RemoveObject2Tag.ID);
add(FrameLabelTag.ID);
}
};
public int getVersion() {
return version;
@@ -667,15 +875,14 @@ public class SWFInputStream extends InputStream {
}
tag.previousTag = previousTag;
previousTag = tag;
if (frameTagTypeIds.contains(tag.getId())) {
tagPositionsInFrame.add(pos);
}
else if (tag.getId() == ShowFrameTag.ID) {
} else if (tag.getId() == ShowFrameTag.ID) {
tagPositionsInFrames.put(pos, tagPositionsInFrame);
tagPositionsInFrame = new ArrayList<>();
}
boolean doParse;
if (!skipUnusualTags) {
doParse = true;

View File

@@ -18,7 +18,47 @@ package com.jpexs.decompiler.flash;
import com.jpexs.decompiler.flash.tags.DefineBitsLosslessTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.types.*;
import com.jpexs.decompiler.flash.types.ALPHABITMAPDATA;
import com.jpexs.decompiler.flash.types.ARGB;
import com.jpexs.decompiler.flash.types.BITMAPDATA;
import com.jpexs.decompiler.flash.types.BUTTONCONDACTION;
import com.jpexs.decompiler.flash.types.BUTTONRECORD;
import com.jpexs.decompiler.flash.types.CLIPACTIONRECORD;
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
import com.jpexs.decompiler.flash.types.CLIPEVENTFLAGS;
import com.jpexs.decompiler.flash.types.CXFORM;
import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA;
import com.jpexs.decompiler.flash.types.FILLSTYLE;
import com.jpexs.decompiler.flash.types.FILLSTYLEARRAY;
import com.jpexs.decompiler.flash.types.FOCALGRADIENT;
import com.jpexs.decompiler.flash.types.GLYPHENTRY;
import com.jpexs.decompiler.flash.types.GRADIENT;
import com.jpexs.decompiler.flash.types.GRADRECORD;
import com.jpexs.decompiler.flash.types.KERNINGRECORD;
import com.jpexs.decompiler.flash.types.LANGCODE;
import com.jpexs.decompiler.flash.types.LINESTYLE;
import com.jpexs.decompiler.flash.types.LINESTYLE2;
import com.jpexs.decompiler.flash.types.LINESTYLEARRAY;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.MORPHFILLSTYLE;
import com.jpexs.decompiler.flash.types.MORPHFILLSTYLEARRAY;
import com.jpexs.decompiler.flash.types.MORPHGRADIENT;
import com.jpexs.decompiler.flash.types.MORPHGRADRECORD;
import com.jpexs.decompiler.flash.types.MORPHLINESTYLE;
import com.jpexs.decompiler.flash.types.MORPHLINESTYLE2;
import com.jpexs.decompiler.flash.types.MORPHLINESTYLEARRAY;
import com.jpexs.decompiler.flash.types.PIX15;
import com.jpexs.decompiler.flash.types.PIX24;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.RGB;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.SHAPE;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.SOUNDENVELOPE;
import com.jpexs.decompiler.flash.types.SOUNDINFO;
import com.jpexs.decompiler.flash.types.TEXTRECORD;
import com.jpexs.decompiler.flash.types.ZONEDATA;
import com.jpexs.decompiler.flash.types.ZONERECORD;
import com.jpexs.decompiler.flash.types.filters.BEVELFILTER;
import com.jpexs.decompiler.flash.types.filters.BLURFILTER;
import com.jpexs.decompiler.flash.types.filters.COLORMATRIXFILTER;
@@ -358,7 +398,7 @@ public class SWFOutputStream extends OutputStream {
writeSB(nBits, yMax);
alignByte();
}
private int truncateTo31Bit(int value) {
if (value > 0x3fffffff) {
value = 0x3fffffff;

View File

@@ -48,7 +48,7 @@ public class ZippedSWFBundle implements SWFBundle {
try {
while ((entry = zip.getNextEntry()) != null) {
if (entry.getName().toLowerCase().endsWith(".swf")
|| entry.getName().toLowerCase().endsWith(".gfx")) {
|| entry.getName().toLowerCase().endsWith(".gfx")) {
keySet.add(entry.getName());
}
//streamMap.put(, is)

View File

@@ -25,14 +25,33 @@ import com.jpexs.decompiler.flash.abc.avm2.UnknownInstructionCode;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallPropertyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushStringIns;
import com.jpexs.decompiler.flash.abc.types.*;
import com.jpexs.decompiler.flash.abc.types.ABCException;
import com.jpexs.decompiler.flash.abc.types.ClassInfo;
import com.jpexs.decompiler.flash.abc.types.InstanceInfo;
import com.jpexs.decompiler.flash.abc.types.MetadataInfo;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
import com.jpexs.decompiler.flash.abc.types.Multiname;
import com.jpexs.decompiler.flash.abc.types.Namespace;
import com.jpexs.decompiler.flash.abc.types.NamespaceSet;
import com.jpexs.decompiler.flash.abc.types.ScriptInfo;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.abc.types.traits.TraitClass;
import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction;
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
import com.jpexs.decompiler.flash.abc.usages.*;
import com.jpexs.decompiler.flash.abc.usages.ClassNameMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.ConstVarNameMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.ConstVarTypeMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.ExtendsMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.ImplementsMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.MethodBodyMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.MethodNameMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.MethodParamsMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.MethodReturnTypeMultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.MultinameUsage;
import com.jpexs.decompiler.flash.abc.usages.TypeNameMultinameUsage;
import com.jpexs.decompiler.flash.helpers.HilightedTextWriter;
import com.jpexs.decompiler.flash.helpers.collections.MyEntry;
import com.jpexs.helpers.utf8.Utf8PrintWriter;

View File

@@ -16,8 +16,18 @@
*/
package com.jpexs.decompiler.flash.abc;
import com.jpexs.decompiler.flash.abc.types.*;
import com.jpexs.decompiler.flash.abc.types.traits.*;
import com.jpexs.decompiler.flash.abc.types.Decimal;
import com.jpexs.decompiler.flash.abc.types.InstanceInfo;
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
import com.jpexs.decompiler.flash.abc.types.Multiname;
import com.jpexs.decompiler.flash.abc.types.Namespace;
import com.jpexs.decompiler.flash.abc.types.ValueKind;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.abc.types.traits.TraitClass;
import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction;
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
import com.jpexs.helpers.utf8.Utf8Helper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View File

@@ -16,8 +16,17 @@
*/
package com.jpexs.decompiler.flash.abc;
import com.jpexs.decompiler.flash.abc.types.*;
import com.jpexs.decompiler.flash.abc.types.traits.*;
import com.jpexs.decompiler.flash.abc.types.Decimal;
import com.jpexs.decompiler.flash.abc.types.InstanceInfo;
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
import com.jpexs.decompiler.flash.abc.types.Multiname;
import com.jpexs.decompiler.flash.abc.types.Namespace;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.abc.types.traits.TraitClass;
import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction;
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
import com.jpexs.helpers.utf8.Utf8Helper;
import java.io.IOException;
import java.io.OutputStream;

View File

@@ -39,27 +39,166 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Si8Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi16Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi1Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi8Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.AddIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.AddIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.DecrementIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.DecrementIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.DivideIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.IncrementIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.IncrementIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.ModuloIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.MultiplyIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.MultiplyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.NegateIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.NegateIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.NotIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.SubtractIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.SubtractIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.BitAndIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.BitNotIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.BitOrIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.BitXorIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.LShiftIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.RShiftIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.URShiftIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.EqualsIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.GreaterEqualsIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.GreaterThanIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.LessEqualsIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.LessThanIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.StrictEqualsIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.ConstructIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.ConstructPropIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.ConstructSuperIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewActivationIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewArrayIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewCatchIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewClassIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewFunctionIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewObjectIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.debug.DebugFileIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.debug.DebugIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.debug.DebugLineIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.*;
import com.jpexs.decompiler.flash.abc.avm2.model.*;
import com.jpexs.decompiler.flash.abc.avm2.model.clauses.*;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallMethodIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallPropLexIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallPropVoidIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallPropertyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallStaticIns;
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.instructions.jumps.IfEqIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfFalseIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfGeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfGtIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfLeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfLtIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNGeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNGtIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNLeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNLtIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictEqIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictNeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfTrueIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.LookupSwitchIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.DecLocalIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.DecLocalIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocal0Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocal1Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocal2Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocal3Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocalIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocalTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.IncLocalIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.IncLocalIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.KillIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal0Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal1Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal2Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal3Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.DeletePropertyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindDefIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrictIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetDescendantsIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetGlobalScopeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetGlobalSlotIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetLexIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetPropertyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetScopeObjectIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetSlotIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetSuperIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.HasNext2Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.HasNextIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.InIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.InitPropertyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.LabelIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.NextNameIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.NextValueIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.NopIns;
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.SetGlobalSlotIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.SetPropertyIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.SetSlotIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.SetSuperIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ThrowIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.DupIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopScopeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushByteIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushDoubleIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushFalseIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushIntIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushNamespaceIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushNanIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushNullIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushScopeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushShortIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushStringIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushTrueIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushUIntIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushUndefinedIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushWithIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.SwapIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ApplyTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.AsTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.AsTypeLateIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceAIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceSIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertBIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertDIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertIIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertOIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertSIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertUIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.InstanceOfIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.IsTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.IsTypeLateIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.TypeOfIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.CheckFilterIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.DXNSIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.DXNSLateIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.EscXAttrIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.EscXElemIns;
import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.HasNextAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.InitPropertyAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.NewFunctionAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.ReturnValueAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.ReturnVoidAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.SetLocalAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.SetPropertyAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.SetSlotAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.WithAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.clauses.DeclarationAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.parser.ASM3Parser;
import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException;
import com.jpexs.decompiler.flash.abc.types.ABCException;

View File

@@ -47,8 +47,8 @@ public final class MethodInfoLexer {
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\11\5\1\3\1\2\1\0\1\3\1\1\16\5\4\0\1\3\1\0"
private static final String ZZ_CMAP_PACKED
= "\11\5\1\3\1\2\1\0\1\3\1\1\16\5\4\0\1\3\1\0"
+ "\1\42\1\0\1\4\2\0\1\56\2\0\1\45\1\37\1\44\1\7"
+ "\1\35\1\0\1\6\3\57\4\40\2\10\1\43\2\0\1\46\3\0"
+ "\4\4\1\36\6\4\1\31\1\4\1\25\1\4\1\17\12\4\1\12"
@@ -145,8 +145,8 @@ public final class MethodInfoLexer {
* Translates DFA states to action switch labels.
*/
private static final int[] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\2\0\2\1\1\2\1\3\1\1\1\3\7\2\1\1"
private static final String ZZ_ACTION_PACKED_0
= "\2\0\2\1\1\2\1\3\1\1\1\3\7\2\1\1"
+ "\1\4\1\5\1\6\1\7\1\10\2\2\1\11\2\12"
+ "\1\1\1\13\1\14\1\0\1\14\2\0\7\2\1\0"
+ "\3\2\1\15\1\16\1\17\1\20\1\21\1\22\1\16"
@@ -165,7 +165,9 @@ public final class MethodInfoLexer {
private static int zzUnpackAction(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -180,8 +182,8 @@ public final class MethodInfoLexer {
* Translates a state to a row index in the transition table
*/
private static final int[] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\60\0\140\0\220\0\300\0\360\0\u0120\0\u0150"
private static final String ZZ_ROWMAP_PACKED_0
= "\0\0\0\60\0\140\0\220\0\300\0\360\0\u0120\0\u0150"
+ "\0\u0180\0\u01b0\0\u01e0\0\u0210\0\u0240\0\u0270\0\u02a0\0\u02d0"
+ "\0\140\0\140\0\140\0\140\0\140\0\u0300\0\u0330\0\u0360"
+ "\0\u0390\0\140\0\u03c0\0\140\0\360\0\u03f0\0\u0420\0\u0450"
@@ -208,7 +210,9 @@ public final class MethodInfoLexer {
private static int zzUnpackRowMap(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
@@ -220,8 +224,8 @@ public final class MethodInfoLexer {
* The transition table of the DFA
*/
private static final int[] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\3\3\1\4\1\5\1\3\1\6\1\7\1\10\1\11"
private static final String ZZ_TRANS_PACKED_0
= "\3\3\1\4\1\5\1\3\1\6\1\7\1\10\1\11"
+ "\2\3\1\12\1\13\1\3\2\5\1\14\1\15\1\5"
+ "\1\16\1\5\1\17\5\5\1\3\1\20\1\5\1\3"
+ "\1\10\1\3\1\21\1\22\1\23\1\24\1\25\1\26"
@@ -388,7 +392,9 @@ public final class MethodInfoLexer {
private static int zzUnpackTrans(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -412,12 +418,11 @@ public final class MethodInfoLexer {
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state
* <code>aState</code>
* ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\2\0\1\11\15\1\5\11\4\1\1\11\1\1\1\11"
private static final String ZZ_ATTRIBUTE_PACKED_0
= "\2\0\1\11\15\1\5\11\4\1\1\11\1\1\1\11"
+ "\1\1\1\0\1\1\2\0\7\1\1\0\3\1\1\11"
+ "\1\1\4\11\1\1\4\11\1\1\4\0\6\1\1\11"
+ "\4\1\1\11\2\0\12\1\1\11\1\0\10\1\1\0"
@@ -433,7 +438,9 @@ public final class MethodInfoLexer {
private static int zzUnpackAttribute(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -553,7 +560,9 @@ public final class MethodInfoLexer {
private static char[] zzUnpackCMap(String packed) {
char[] map = new char[0x10000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 1768) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
@@ -622,6 +631,7 @@ public final class MethodInfoLexer {
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null) {
@@ -821,7 +831,6 @@ public final class MethodInfoLexer {
zzState = ZZ_LEXSTATE[zzLexicalState];
zzForAction:
{
while (true) {

View File

@@ -44,8 +44,14 @@ import com.jpexs.decompiler.flash.action.parser.pcode.ASMParsedSymbol;
import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser;
import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer;
import com.jpexs.decompiler.flash.action.special.ActionEnd;
import com.jpexs.decompiler.flash.action.swf4.*;
import com.jpexs.decompiler.flash.action.swf5.*;
import com.jpexs.decompiler.flash.action.swf4.ActionEquals;
import com.jpexs.decompiler.flash.action.swf4.ActionIf;
import com.jpexs.decompiler.flash.action.swf4.ActionJump;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
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.ActionEquals2;
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.ecma.Null;

View File

@@ -23,11 +23,105 @@ import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.special.ActionDeobfuscatePop;
import com.jpexs.decompiler.flash.action.special.ActionNop;
import com.jpexs.decompiler.flash.action.special.ActionStore;
import com.jpexs.decompiler.flash.action.swf3.*;
import com.jpexs.decompiler.flash.action.swf4.*;
import com.jpexs.decompiler.flash.action.swf5.*;
import com.jpexs.decompiler.flash.action.swf6.*;
import com.jpexs.decompiler.flash.action.swf7.*;
import com.jpexs.decompiler.flash.action.swf3.ActionGetURL;
import com.jpexs.decompiler.flash.action.swf3.ActionGoToLabel;
import com.jpexs.decompiler.flash.action.swf3.ActionGotoFrame;
import com.jpexs.decompiler.flash.action.swf3.ActionNextFrame;
import com.jpexs.decompiler.flash.action.swf3.ActionPlay;
import com.jpexs.decompiler.flash.action.swf3.ActionPrevFrame;
import com.jpexs.decompiler.flash.action.swf3.ActionSetTarget;
import com.jpexs.decompiler.flash.action.swf3.ActionStop;
import com.jpexs.decompiler.flash.action.swf3.ActionStopSounds;
import com.jpexs.decompiler.flash.action.swf3.ActionToggleQuality;
import com.jpexs.decompiler.flash.action.swf3.ActionWaitForFrame;
import com.jpexs.decompiler.flash.action.swf4.ActionAdd;
import com.jpexs.decompiler.flash.action.swf4.ActionAnd;
import com.jpexs.decompiler.flash.action.swf4.ActionAsciiToChar;
import com.jpexs.decompiler.flash.action.swf4.ActionCall;
import com.jpexs.decompiler.flash.action.swf4.ActionCharToAscii;
import com.jpexs.decompiler.flash.action.swf4.ActionCloneSprite;
import com.jpexs.decompiler.flash.action.swf4.ActionDivide;
import com.jpexs.decompiler.flash.action.swf4.ActionEndDrag;
import com.jpexs.decompiler.flash.action.swf4.ActionEquals;
import com.jpexs.decompiler.flash.action.swf4.ActionGetProperty;
import com.jpexs.decompiler.flash.action.swf4.ActionGetTime;
import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2;
import com.jpexs.decompiler.flash.action.swf4.ActionGetVariable;
import com.jpexs.decompiler.flash.action.swf4.ActionGotoFrame2;
import com.jpexs.decompiler.flash.action.swf4.ActionIf;
import com.jpexs.decompiler.flash.action.swf4.ActionJump;
import com.jpexs.decompiler.flash.action.swf4.ActionLess;
import com.jpexs.decompiler.flash.action.swf4.ActionMBAsciiToChar;
import com.jpexs.decompiler.flash.action.swf4.ActionMBCharToAscii;
import com.jpexs.decompiler.flash.action.swf4.ActionMBStringExtract;
import com.jpexs.decompiler.flash.action.swf4.ActionMBStringLength;
import com.jpexs.decompiler.flash.action.swf4.ActionMultiply;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
import com.jpexs.decompiler.flash.action.swf4.ActionOr;
import com.jpexs.decompiler.flash.action.swf4.ActionPop;
import com.jpexs.decompiler.flash.action.swf4.ActionPush;
import com.jpexs.decompiler.flash.action.swf4.ActionRandomNumber;
import com.jpexs.decompiler.flash.action.swf4.ActionRemoveSprite;
import com.jpexs.decompiler.flash.action.swf4.ActionSetProperty;
import com.jpexs.decompiler.flash.action.swf4.ActionSetTarget2;
import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable;
import com.jpexs.decompiler.flash.action.swf4.ActionStartDrag;
import com.jpexs.decompiler.flash.action.swf4.ActionStringAdd;
import com.jpexs.decompiler.flash.action.swf4.ActionStringEquals;
import com.jpexs.decompiler.flash.action.swf4.ActionStringExtract;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLength;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLess;
import com.jpexs.decompiler.flash.action.swf4.ActionSubtract;
import com.jpexs.decompiler.flash.action.swf4.ActionToInteger;
import com.jpexs.decompiler.flash.action.swf4.ActionTrace;
import com.jpexs.decompiler.flash.action.swf4.ActionWaitForFrame2;
import com.jpexs.decompiler.flash.action.swf5.ActionAdd2;
import com.jpexs.decompiler.flash.action.swf5.ActionBitAnd;
import com.jpexs.decompiler.flash.action.swf5.ActionBitLShift;
import com.jpexs.decompiler.flash.action.swf5.ActionBitOr;
import com.jpexs.decompiler.flash.action.swf5.ActionBitRShift;
import com.jpexs.decompiler.flash.action.swf5.ActionBitURShift;
import com.jpexs.decompiler.flash.action.swf5.ActionBitXor;
import com.jpexs.decompiler.flash.action.swf5.ActionCallFunction;
import com.jpexs.decompiler.flash.action.swf5.ActionCallMethod;
import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool;
import com.jpexs.decompiler.flash.action.swf5.ActionDecrement;
import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction;
import com.jpexs.decompiler.flash.action.swf5.ActionDefineLocal;
import com.jpexs.decompiler.flash.action.swf5.ActionDefineLocal2;
import com.jpexs.decompiler.flash.action.swf5.ActionDelete;
import com.jpexs.decompiler.flash.action.swf5.ActionDelete2;
import com.jpexs.decompiler.flash.action.swf5.ActionEnumerate;
import com.jpexs.decompiler.flash.action.swf5.ActionEquals2;
import com.jpexs.decompiler.flash.action.swf5.ActionGetMember;
import com.jpexs.decompiler.flash.action.swf5.ActionIncrement;
import com.jpexs.decompiler.flash.action.swf5.ActionInitArray;
import com.jpexs.decompiler.flash.action.swf5.ActionInitObject;
import com.jpexs.decompiler.flash.action.swf5.ActionLess2;
import com.jpexs.decompiler.flash.action.swf5.ActionModulo;
import com.jpexs.decompiler.flash.action.swf5.ActionNewMethod;
import com.jpexs.decompiler.flash.action.swf5.ActionNewObject;
import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate;
import com.jpexs.decompiler.flash.action.swf5.ActionReturn;
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
import com.jpexs.decompiler.flash.action.swf5.ActionStackSwap;
import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister;
import com.jpexs.decompiler.flash.action.swf5.ActionTargetPath;
import com.jpexs.decompiler.flash.action.swf5.ActionToNumber;
import com.jpexs.decompiler.flash.action.swf5.ActionToString;
import com.jpexs.decompiler.flash.action.swf5.ActionTypeOf;
import com.jpexs.decompiler.flash.action.swf5.ActionWith;
import com.jpexs.decompiler.flash.action.swf6.ActionEnumerate2;
import com.jpexs.decompiler.flash.action.swf6.ActionGreater;
import com.jpexs.decompiler.flash.action.swf6.ActionInstanceOf;
import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals;
import com.jpexs.decompiler.flash.action.swf6.ActionStringGreater;
import com.jpexs.decompiler.flash.action.swf7.ActionCastOp;
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
import com.jpexs.decompiler.flash.action.swf7.ActionExtends;
import com.jpexs.decompiler.flash.action.swf7.ActionImplementsOp;
import com.jpexs.decompiler.flash.action.swf7.ActionThrow;
import com.jpexs.decompiler.flash.action.swf7.ActionTry;
import com.jpexs.decompiler.graph.GraphSourceItemContainer;
import com.jpexs.helpers.Helper;
import java.io.IOException;

View File

@@ -58,8 +58,8 @@ public final class FlasmLexer {
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\11\6\1\4\1\2\1\0\1\4\1\1\16\6\4\0\1\4\1\0"
private static final String ZZ_CMAP_PACKED
= "\11\6\1\4\1\2\1\0\1\4\1\1\16\6\4\0\1\4\1\0"
+ "\1\45\1\0\1\5\2\0\1\47\3\0\1\37\1\0\1\30\1\35"
+ "\1\0\1\33\3\50\4\40\2\11\1\12\1\3\5\0\4\7\1\36"
+ "\3\7\1\31\4\7\1\34\14\7\1\0\1\41\2\0\1\10\1\0"
@@ -178,8 +178,8 @@ public final class FlasmLexer {
* Translates DFA states to action switch labels.
*/
private static final int[] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\3\0\3\1\1\2\1\3\1\4\2\5\1\1\1\6"
private static final String ZZ_ACTION_PACKED_0
= "\3\0\3\1\1\2\1\3\1\4\2\5\1\1\1\6"
+ "\2\7\1\10\1\11\1\12\1\13\5\11\1\1\1\11"
+ "\1\12\1\11\1\1\1\11\1\14\1\0\1\15\1\16"
+ "\1\17\1\20\1\21\1\22\2\23\1\24\1\25\1\26"
@@ -198,7 +198,9 @@ public final class FlasmLexer {
private static int zzUnpackAction(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -213,8 +215,8 @@ public final class FlasmLexer {
* Translates a state to a row index in the transition table
*/
private static final int[] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\51\0\122\0\173\0\244\0\315\0\366\0\173"
private static final String ZZ_ROWMAP_PACKED_0
= "\0\0\0\51\0\122\0\173\0\244\0\315\0\366\0\173"
+ "\0\u011f\0\u0148\0\173\0\u0171\0\173\0\u019a\0\173\0\u01c3"
+ "\0\u01ec\0\u0215\0\173\0\u023e\0\u0267\0\u0290\0\u02b9\0\u02e2"
+ "\0\u030b\0\u0334\0\u035d\0\u0386\0\u03af\0\u03d8\0\173\0\315"
@@ -237,7 +239,9 @@ public final class FlasmLexer {
private static int zzUnpackRowMap(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
@@ -249,8 +253,8 @@ public final class FlasmLexer {
* The transition table of the DFA
*/
private static final int[] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\4\4\1\5\1\6\1\4\1\7\1\6\3\4\1\10"
private static final String ZZ_TRANS_PACKED_0
= "\4\4\1\5\1\6\1\4\1\7\1\6\3\4\1\10"
+ "\13\7\1\4\2\7\1\4\1\7\1\4\1\7\3\4"
+ "\3\7\1\4\1\7\2\4\1\11\1\12\1\13\36\11"
+ "\1\14\3\11\1\15\3\11\1\4\1\16\1\17\1\20"
@@ -394,7 +398,9 @@ public final class FlasmLexer {
private static int zzUnpackTrans(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -418,12 +424,11 @@ public final class FlasmLexer {
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state
* <code>aState</code>
* ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\3\0\1\11\3\1\1\11\2\1\1\11\1\1\1\11"
private static final String ZZ_ATTRIBUTE_PACKED_0
= "\3\0\1\11\3\1\1\11\2\1\1\11\1\1\1\11"
+ "\1\1\1\11\3\1\1\11\13\1\1\11\1\0\6\11"
+ "\2\1\4\11\1\0\7\1\1\0\1\11\4\1\1\11"
+ "\1\1\1\0\5\1\1\0\10\1\1\0\5\1\1\0"
@@ -439,7 +444,9 @@ public final class FlasmLexer {
private static int zzUnpackAttribute(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -557,7 +564,9 @@ public final class FlasmLexer {
private static char[] zzUnpackCMap(String packed) {
char[] map = new char[0x10000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 2206) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
@@ -626,6 +635,7 @@ public final class FlasmLexer {
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null) {
@@ -825,7 +835,6 @@ public final class FlasmLexer {
zzState = ZZ_LEXSTATE[zzLexicalState];
zzForAction:
{
while (true) {

View File

@@ -58,8 +58,8 @@ public final class ActionScriptLexer {
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\14\1\107"
private static final String ZZ_CMAP_PACKED
= "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\14\1\107"
+ "\1\16\1\0\1\6\1\116\1\112\1\30\1\77\1\100\1\5\1\114"
+ "\1\106\1\26\1\11\1\4\1\17\3\23\4\24\2\20\1\10\1\105"
+ "\1\12\1\15\1\13\1\111\1\117\1\61\1\22\1\71\1\72\1\25"
@@ -181,8 +181,8 @@ public final class ActionScriptLexer {
* Translates DFA states to action switch labels.
*/
private static final int[] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\5\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7"
private static final String ZZ_ACTION_PACKED_0
= "\5\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7"
+ "\1\10\1\11\1\12\1\13\1\14\2\15\1\16\1\17"
+ "\26\6\1\20\1\21\1\22\1\23\1\24\1\25\1\26"
+ "\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36"
@@ -232,7 +232,9 @@ public final class ActionScriptLexer {
private static int zzUnpackAction(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -247,8 +249,8 @@ public final class ActionScriptLexer {
* Translates a state to a row index in the transition table
*/
private static final int[] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\120\0\240\0\360\0\u0140\0\u0190\0\u01e0\0\u0190"
private static final String ZZ_ROWMAP_PACKED_0
= "\0\0\0\120\0\240\0\360\0\u0140\0\u0190\0\u01e0\0\u0190"
+ "\0\u0230\0\u0280\0\u02d0\0\u0320\0\u0370\0\u03c0\0\u0410\0\u0460"
+ "\0\u04b0\0\u0190\0\u0500\0\u0550\0\u05a0\0\u0190\0\u05f0\0\u0640"
+ "\0\u0690\0\u06e0\0\u0730\0\u0780\0\u07d0\0\u0820\0\u0870\0\u08c0"
@@ -343,7 +345,9 @@ public final class ActionScriptLexer {
private static int zzUnpackRowMap(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
@@ -355,8 +359,8 @@ public final class ActionScriptLexer {
* The transition table of the DFA
*/
private static final int[] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\6"
private static final String ZZ_TRANS_PACKED_0
= "\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\6"
+ "\1\15\1\16\1\17\1\20\1\11\1\21\1\22\1\23"
+ "\1\24\2\14\2\24\1\14\1\25\1\6\1\26\1\27"
+ "\1\30\1\31\1\32\1\14\1\33\1\34\1\35\1\36"
@@ -919,7 +923,9 @@ public final class ActionScriptLexer {
private static int zzUnpackTrans(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -943,12 +949,11 @@ public final class ActionScriptLexer {
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state
* <code>aState</code>
* ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\5\0\1\11\1\1\1\11\11\1\1\11\3\1\1\11"
private static final String ZZ_ATTRIBUTE_PACKED_0
= "\5\0\1\11\1\1\1\11\11\1\1\11\3\1\1\11"
+ "\26\1\10\11\1\1\2\11\5\1\1\11\2\1\2\11"
+ "\3\1\1\11\2\1\1\11\1\1\1\11\2\1\1\0"
+ "\3\11\2\0\1\1\1\0\1\1\1\11\1\1\1\11"
@@ -967,7 +972,9 @@ public final class ActionScriptLexer {
private static int zzUnpackAttribute(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -1119,7 +1126,9 @@ public final class ActionScriptLexer {
private static char[] zzUnpackCMap(String packed) {
char[] map = new char[0x10000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 2264) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
@@ -1188,6 +1197,7 @@ public final class ActionScriptLexer {
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null) {
@@ -1333,7 +1343,6 @@ public final class ActionScriptLexer {
zzState = ZZ_LEXSTATE[zzLexicalState];
zzForAction:
{
while (true) {

View File

@@ -106,8 +106,10 @@ import com.jpexs.decompiler.flash.action.model.operations.StrictEqActionItem;
import com.jpexs.decompiler.flash.action.model.operations.StrictNeqActionItem;
import com.jpexs.decompiler.flash.action.model.operations.SubtractActionItem;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.swf4.*;
import com.jpexs.decompiler.flash.action.swf5.*;
import com.jpexs.decompiler.flash.action.swf4.ActionIf;
import com.jpexs.decompiler.flash.action.swf4.ConstantIndex;
import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool;
import com.jpexs.decompiler.flash.ecma.Null;
import com.jpexs.decompiler.flash.ecma.Undefined;
import com.jpexs.decompiler.flash.helpers.collections.MyEntry;

View File

@@ -21,7 +21,16 @@ import com.jpexs.helpers.Helper;
import com.jpexs.helpers.utf8.Utf8InputStreamReader;
import com.jpexs.helpers.utf8.Utf8OutputStreamWriter;
import com.jpexs.proxy.Replacement;
import java.io.*;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.security.AccessController;

View File

@@ -29,7 +29,6 @@ import com.jpexs.decompiler.flash.types.RGB;
import com.jpexs.decompiler.flash.types.SHAPE;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.helpers.Cache;
import com.jpexs.helpers.SerializableImage;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -66,19 +65,19 @@ public class BitmapExporter extends ShapeExporterBase implements IShapeExporter
private Color lineColor;
private Stroke lineStroke;
private Stroke defaultStroke;
public static SerializableImage export(SWF swf, SHAPE shape) {
BitmapExporter exporter = new BitmapExporter(swf, shape, null);
exporter.export();
return exporter.getImage();
}
public static SerializableImage export(SWF swf, SHAPE shape, Color defaultColor, boolean putToCache) {
BitmapExporter exporter = new BitmapExporter(swf, shape, defaultColor);
exporter.export();
return exporter.getImage();
}
private BitmapExporter(SWF swf, SHAPE shape, Color defaultColor) {
super(shape);
this.swf = swf;
@@ -350,7 +349,7 @@ public class BitmapExporter extends ShapeExporterBase implements IShapeExporter
@Override
public void curveTo(double controlX, double controlY, double anchorX, double anchorY) {
path.quadTo(controlX / SWF.unitDivisor - deltaX, controlY / SWF.unitDivisor - deltaY,
path.quadTo(controlX / SWF.unitDivisor - deltaX, controlY / SWF.unitDivisor - deltaY,
anchorX / SWF.unitDivisor - deltaX, anchorY / SWF.unitDivisor - deltaY);
}

View File

@@ -16,7 +16,6 @@
*/
package com.jpexs.decompiler.flash.exporters;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.types.MATRIX;
import java.awt.geom.AffineTransform;
@@ -38,7 +37,7 @@ public class Matrix {
mat.scale(scale);
return mat;
}
public Matrix() {
scaleX = 1;
scaleY = 1;
@@ -76,14 +75,14 @@ public class Matrix {
translateX += x;
translateY += y;
}
public void scale(double factor) {
scaleX *= factor;
scaleY *= factor;
rotateSkew0 *= factor;
rotateSkew1 *= factor;
}
public AffineTransform toTransform() {
AffineTransform transform = new AffineTransform(scaleX, rotateSkew0,
rotateSkew1, scaleY,

View File

@@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.exporters;
/**
@@ -22,7 +21,7 @@ package com.jpexs.decompiler.flash.exporters;
* @author JPEXS
*/
public class PointInt {
public int x;
public int y;

View File

@@ -248,7 +248,7 @@ public abstract class ShapeExporterBase implements IShapeExporter {
bounds.yMax = point.y;
}
}
protected void exportFillPath(int groupIndex) {
List<IEdge> path = createPathFromEdgeMap(fillEdgeMaps.get(groupIndex));
PointInt pos = new PointInt(Integer.MAX_VALUE, Integer.MAX_VALUE);
@@ -279,7 +279,7 @@ public abstract class ShapeExporterBase implements IShapeExporter {
matrix = new Matrix(fillStyle.gradientMatrix);
beginGradientFill(
fillStyle.fillStyleType,
fillStyle.gradient.gradientRecords,
fillStyle.gradient.gradientRecords,
matrix,
fillStyle.gradient.spreadMode,
fillStyle.gradient.interpolationMode,

View File

@@ -17,7 +17,12 @@
package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.ApplicationInfo;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;

View File

@@ -18,7 +18,14 @@ package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.graph.Graph;
import com.jpexs.decompiler.graph.GraphPart;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.geom.AffineTransform;
import java.awt.geom.Line2D;
import java.util.HashMap;

View File

@@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.exporters.Matrix;
import com.jpexs.decompiler.flash.gui.player.FlashDisplay;
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
import com.jpexs.decompiler.flash.tags.base.DrawableTag;
import com.jpexs.helpers.Cache;
import com.jpexs.helpers.SerializableImage;
import java.awt.BorderLayout;
import java.awt.Color;

View File

@@ -37,12 +37,25 @@ import com.jpexs.helpers.ProgressListener;
import com.jpexs.helpers.Stopwatch;
import com.jpexs.helpers.streams.SeekableInputStream;
import com.sun.jna.Platform;
import java.awt.*;
import java.awt.AWTException;
import java.awt.Frame;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.*;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.Socket;
import java.text.SimpleDateFormat;

View File

@@ -356,7 +356,6 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
//JRibbonBand otherToolsBand = new JRibbonBand(translate("menu.tools.otherTools"), null);
//otherToolsBand.setResizePolicies(getResizePolicies(otherToolsBand));
return new RibbonTask(translate("menu.tools"), toolsBand, deobfuscationBand/*, otherToolsBand*/);
}

View File

@@ -131,7 +131,6 @@ import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
@@ -1620,7 +1619,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
}
public void renameOneIdentifier(final SWF swf) {
if (swf.fileAttributes!=null && swf.fileAttributes.actionScript3) {
if (swf.fileAttributes != null && swf.fileAttributes.actionScript3) {
final int multiName = abcPanel.decompiledTextArea.getMultinameUnderCursor();
final List<ABCContainerTag> abcList = swf.abcList;
if (multiName > 0) {
@@ -2411,7 +2410,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
}
genericTagPropertiesEditorPane.setText(sb.toString());
}
private void createAndShowTempSwf(Object tagObj) {
SWF swf;
try {

View File

@@ -16,7 +16,9 @@
*/
package com.jpexs.decompiler.flash.gui;
import java.awt.*;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import javax.swing.Icon;
@@ -33,7 +35,9 @@ import org.pushingpixels.lafwidget.animation.effects.GhostingListener;
import org.pushingpixels.substance.api.painter.border.SubstanceBorderPainter;
import org.pushingpixels.substance.api.painter.fill.SubstanceFillPainter;
import org.pushingpixels.substance.flamingo.common.ui.ActionPopupTransitionAwareUI;
import org.pushingpixels.substance.flamingo.utils.*;
import org.pushingpixels.substance.flamingo.utils.CommandButtonBackgroundDelegate;
import org.pushingpixels.substance.flamingo.utils.CommandButtonVisualStateTracker;
import org.pushingpixels.substance.flamingo.utils.RibbonApplicationMenuButtonBackgroundDelegate;
import org.pushingpixels.substance.internal.animation.StateTransitionTracker;
import org.pushingpixels.substance.internal.utils.SubstanceCoreUtilities;

View File

@@ -73,7 +73,7 @@ public class NewVersionDialog extends AppDialog implements ActionListener {
changesStr += translate("version") + " " + v.versionName + "\r\n";
changesStr += "-----------------------\r\n";
String releaseDate = v.releaseDate;
try {
try {
Date date = serverFormatter.parse(releaseDate);
releaseDate = formatter.format(date);
} catch (ParseException ex) {

View File

@@ -212,22 +212,21 @@ public class TagTree extends JTree {
if (t instanceof SWF) {
return TreeNodeType.FLASH;
}
if(t instanceof SWFList) {
SWFList slist = (SWFList)t;
if(slist.name!=null){
if(slist.name.toLowerCase().endsWith(".zip")){
if (t instanceof SWFList) {
SWFList slist = (SWFList) t;
if (slist.name != null) {
if (slist.name.toLowerCase().endsWith(".zip")) {
return TreeNodeType.BUNDLE_ZIP;
}
if(slist.name.toLowerCase().endsWith(".swc")){
if (slist.name.toLowerCase().endsWith(".swc")) {
return TreeNodeType.BUNDLE_SWC;
}
else{
} else {
return TreeNodeType.BUNDLE_BINARY;
}
}
}
if (t instanceof Tag) {
return TreeNodeType.OTHER_TAG;
}

View File

@@ -27,12 +27,6 @@ import com.jpexs.decompiler.flash.gui.treenodes.StringNode;
import com.jpexs.decompiler.flash.gui.treenodes.TagTreeRoot;
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
import com.jpexs.decompiler.flash.tags.FrameLabelTag;
import com.jpexs.decompiler.flash.tags.PlaceObject2Tag;
import com.jpexs.decompiler.flash.tags.PlaceObject3Tag;
import com.jpexs.decompiler.flash.tags.PlaceObject4Tag;
import com.jpexs.decompiler.flash.tags.PlaceObjectTag;
import com.jpexs.decompiler.flash.tags.RemoveObject2Tag;
import com.jpexs.decompiler.flash.tags.RemoveObjectTag;
import com.jpexs.decompiler.flash.tags.ShowFrameTag;
import com.jpexs.decompiler.flash.tags.SoundStreamBlockTag;
import com.jpexs.decompiler.flash.tags.StartSound2Tag;
@@ -110,32 +104,52 @@ public class TagTreeModel implements TreeModel {
List<TreeNode> sounds = new ArrayList<>();
List<TreeNode> binaryData = new ArrayList<>();
List<TreeNode> others = new ArrayList<>();
List<TreeNode> actionScript = SWF.createASTagList(list, null);
List<Tag> actionScriptTags = new ArrayList<>();
SWF.getTagsFromTreeNodes(actionScript, actionScriptTags);
int frameCnt = 0;
for (Tag t : list) {
TreeNodeType ttype = TagTree.getTreeNodeType(t);
switch (ttype) {
case SHOW_FRAME:
case SHOW_FRAME:
ShowFrameTag showFrameTag = (ShowFrameTag) t;
frames.add(new FrameNode(new FrameNodeItem(t.getSwf(), ++frameCnt, parent, true), showFrameTag.innerTags));
frames.add(new FrameNode(new FrameNodeItem(t.getSwf(), ++frameCnt, parent, true), showFrameTag.innerTags));
break;
case SHAPE:
shapes.add(new TagNode(t));
break;
case MORPH_SHAPE:
morphShapes.add(new TagNode(t));
break;
case SPRITE:
sprites.add(new TagNode(t));
break;
case BUTTON:
buttons.add(new TagNode(t));
break;
case IMAGE:
images.add(new TagNode(t));
break;
case FONT:
fonts.add(new TagNode(t));
break;
case TEXT:
texts.add(new TagNode(t));
break;
case MOVIE:
movies.add(new TagNode(t));
break;
case SOUND:
sounds.add(new TagNode(t));
break;
case BINARY_DATA:
binaryData.add(new TagNode(t));
break;
case SHAPE: shapes.add(new TagNode(t)); break;
case MORPH_SHAPE: morphShapes.add(new TagNode(t)); break;
case SPRITE: sprites.add(new TagNode(t)); break;
case BUTTON: buttons.add(new TagNode(t)); break;
case IMAGE: images.add(new TagNode(t)); break;
case FONT: fonts.add(new TagNode(t)); break;
case TEXT: texts.add(new TagNode(t)); break;
case MOVIE: movies.add(new TagNode(t)); break;
case SOUND: sounds.add(new TagNode(t)); break;
case BINARY_DATA: binaryData.add(new TagNode(t)); break;
default:
if (!actionScriptTags.contains(t) && !isFrameInnerTag(t)) {
others.add(new TagNode(t));
others.add(new TagNode(t));
}
break;
}
@@ -250,18 +264,18 @@ public class TagTreeModel implements TreeModel {
List<TreeNode> ret = new ArrayList<>();
List<TreeNode> frames = new ArrayList<>();
List<TreeNode> others = new ArrayList<>();
int frameCnt = 0;
for (Tag t : list) {
TreeNodeType ttype = TagTree.getTreeNodeType(t);
switch (ttype) {
case SHOW_FRAME:
case SHOW_FRAME:
ShowFrameTag showFrameTag = (ShowFrameTag) t;
frames.add(new FrameNode(new FrameNodeItem(t.getSwf(), ++frameCnt, parent, true), showFrameTag.innerTags));
frames.add(new FrameNode(new FrameNodeItem(t.getSwf(), ++frameCnt, parent, true), showFrameTag.innerTags));
break;
default:
if (!actionScriptTags.contains(t) && !isFrameInnerTag(t)) {
others.add(new TagNode(t));
others.add(new TagNode(t));
}
break;
}
@@ -288,7 +302,7 @@ public class TagTreeModel implements TreeModel {
|| t instanceof SoundStreamBlockTag
|| t instanceof SoundStreamHeadTypeTag;
}
private List<TreeNode> searchTag(TreeItem obj, TreeNode parent, List<TreeNode> path) {
List<TreeNode> ret = null;
int cnt = getChildCount(parent);

View File

@@ -51,7 +51,7 @@ public class TimeLinePanel extends JPanel implements MouseListener {
public TimeLinePanel(SWF swf) {
this.swf = swf;
this.timeLine = new TimeLine(swf);
Dimension dim = new Dimension(FRAME_WIDTH * timeLine.getFrameCount()+1, FRAME_HEIGHT * timeLine.getMaxDepth());
Dimension dim = new Dimension(FRAME_WIDTH * timeLine.getFrameCount() + 1, FRAME_HEIGHT * timeLine.getMaxDepth());
setSize(dim);
setPreferredSize(dim);
addMouseListener(this);
@@ -76,11 +76,11 @@ public class TimeLinePanel extends JPanel implements MouseListener {
}
boolean keyfound[] = new boolean[end_d - start_d + 1];
for (int f = start_f; f <= end_f; f++) {
for (int d = start_d; d <= end_d; d++) {
DepthState fl = timeLine.frames.get(f).layers.get(d);
if(fl == null){
if (fl == null) {
g.setColor(emptyFrameColor);
g.fillRect(f * FRAME_WIDTH, d * FRAME_HEIGHT, FRAME_WIDTH, FRAME_HEIGHT);
g.setColor(emptyBorderColor);
@@ -99,7 +99,7 @@ public class TimeLinePanel extends JPanel implements MouseListener {
}
if (selected) {
g.setColor(selectedColor);
g.fillRect(f * FRAME_WIDTH+1, d * FRAME_HEIGHT+1, FRAME_WIDTH-1, FRAME_HEIGHT-1);
g.fillRect(f * FRAME_WIDTH + 1, d * FRAME_HEIGHT + 1, FRAME_WIDTH - 1, FRAME_HEIGHT - 1);
}
if (fl == null) {
@@ -138,12 +138,12 @@ public class TimeLinePanel extends JPanel implements MouseListener {
}
g.setColor(frameColor);
g.fillRect(draw_f * FRAME_WIDTH, d * FRAME_HEIGHT, num_frames * FRAME_WIDTH, FRAME_HEIGHT);
if (selected) {
g.setColor(selectedColor);
g.fillRect(draw_f * FRAME_WIDTH, d * FRAME_HEIGHT, FRAME_WIDTH, FRAME_HEIGHT);
}
g.setColor(borderColor);
g.drawRect(draw_f * FRAME_WIDTH, d * FRAME_HEIGHT, num_frames * FRAME_WIDTH, FRAME_HEIGHT);
g.setColor(keyColor);
@@ -152,10 +152,10 @@ public class TimeLinePanel extends JPanel implements MouseListener {
}
}
}
if(cursor!=null && cursor.x>=start_f && cursor.x<=end_f){
if (cursor != null && cursor.x >= start_f && cursor.x <= end_f) {
g.setColor(timeColor);
g.drawLine(cursor.x*FRAME_WIDTH + FRAME_WIDTH/2, 0, cursor.x*FRAME_WIDTH + FRAME_WIDTH/2, getHeight());
g.drawLine(cursor.x * FRAME_WIDTH + FRAME_WIDTH / 2, 0, cursor.x * FRAME_WIDTH + FRAME_WIDTH / 2, getHeight());
}
}

View File

@@ -16,7 +16,15 @@
*/
package com.jpexs.decompiler.flash.gui;
import java.awt.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;

View File

@@ -63,7 +63,12 @@ import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Insets;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
@@ -72,8 +77,25 @@ import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JToggleButton;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
import javax.swing.tree.TreePath;
import jsyntaxpane.DefaultSyntaxKit;

View File

@@ -29,7 +29,12 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.HashMap;
import javax.swing.*;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.BevelBorder;
/**

View File

@@ -18,7 +18,11 @@ package com.jpexs.decompiler.flash.gui.abc;
import com.jpexs.decompiler.flash.gui.View;
import java.awt.Component;
import javax.swing.*;
import javax.swing.DefaultListCellRenderer;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JList;
public class IconListRenderer extends DefaultListCellRenderer {

View File

@@ -31,7 +31,10 @@ import java.io.StringReader;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;

View File

@@ -33,7 +33,10 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.List;
import javax.swing.*;
import javax.swing.JButton;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
/**
*

View File

@@ -22,7 +22,11 @@ import com.jpexs.decompiler.flash.gui.abc.TreeVisitor;
import com.jpexs.decompiler.flash.treeitems.AS3PackageNodeItem;
import com.jpexs.decompiler.flash.treeitems.TreeElementItem;
import com.jpexs.decompiler.flash.treenodes.TreeNode;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
import javax.swing.tree.TreePath;
public abstract class TreeElement extends TreeNode {

View File

@@ -31,7 +31,12 @@ import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Image;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -40,7 +45,15 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
/**
* Frame with Proxy

View File

@@ -207,7 +207,7 @@ public class DefineMorphShapeTag extends CharacterTag implements BoundedTag, Mor
finalRecords.add(edge2);
break;
}
if (edge1 instanceof CurvedEdgeRecord || edge2 instanceof CurvedEdgeRecord) {
CurvedEdgeRecord cer1 = null;
if (edge1 instanceof CurvedEdgeRecord) {

View File

@@ -90,7 +90,7 @@ public class DefineShapeTag extends CharacterTag implements BoundedTag, ShapeTag
}
return baos.toByteArray();
}
@Override
public int getCharacterId() {
return shapeId;

View File

@@ -27,7 +27,7 @@ import java.util.List;
public class ShowFrameTag extends Tag {
public static final int ID = 1;
public List<Tag> innerTags;
/**

View File

@@ -21,7 +21,16 @@ import com.jpexs.decompiler.flash.tags.base.CharacterTag;
import com.jpexs.decompiler.flash.tags.base.ContainerItem;
import com.jpexs.decompiler.flash.tags.base.Exportable;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import com.jpexs.decompiler.flash.tags.gfx.*;
import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalGradient;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalImage;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalImage2;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalSound;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalStreamSound;
import com.jpexs.decompiler.flash.tags.gfx.DefineGradientMap;
import com.jpexs.decompiler.flash.tags.gfx.DefineSubImage;
import com.jpexs.decompiler.flash.tags.gfx.ExporterInfoTag;
import com.jpexs.decompiler.flash.tags.gfx.FontTextureInfo;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;

View File

@@ -40,7 +40,6 @@ import com.jpexs.decompiler.flash.types.shaperecords.CurvedEdgeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
import com.jpexs.helpers.Cache;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.SerializableImage;
import java.awt.Color;

View File

@@ -51,8 +51,8 @@ public final class TextLexer {
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\12\0\1\15\2\0\1\3\22\0\1\3\1\0\1\13\4\0\1\14"
private static final String ZZ_CMAP_PACKED
= "\12\0\1\15\2\0\1\3\22\0\1\3\1\0\1\13\4\0\1\14"
+ "\10\0\12\1\41\0\1\4\1\5\1\2\1\0\1\1\1\0\1\1"
+ "\1\6\3\1\1\11\7\1\1\10\3\1\1\12\1\1\1\7\6\1"
+ "\uff85\0";
@@ -64,8 +64,8 @@ public final class TextLexer {
* Translates DFA states to action switch labels.
*/
private static final int[] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\3\0\1\1\1\2\1\1\1\3\1\4\1\5\1\3"
private static final String ZZ_ACTION_PACKED_0
= "\3\0\1\1\1\2\1\1\1\3\1\4\1\5\1\3"
+ "\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\15"
+ "\1\16\1\17\1\20\1\21";
@@ -78,7 +78,9 @@ public final class TextLexer {
private static int zzUnpackAction(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -93,8 +95,8 @@ public final class TextLexer {
* Translates a state to a row index in the transition table
*/
private static final int[] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\16\0\34\0\52\0\52\0\70\0\52\0\106"
private static final String ZZ_ROWMAP_PACKED_0
= "\0\0\0\16\0\34\0\52\0\52\0\70\0\52\0\106"
+ "\0\52\0\124\0\142\0\52\0\52\0\52\0\52\0\52"
+ "\0\52\0\52\0\52\0\52\0\52\0\52";
@@ -107,7 +109,9 @@ public final class TextLexer {
private static int zzUnpackRowMap(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
@@ -119,8 +123,8 @@ public final class TextLexer {
* The transition table of the DFA
*/
private static final int[] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\4\4\1\5\1\6\7\4\2\7\1\10\1\11\1\12"
private static final String ZZ_TRANS_PACKED_0
= "\4\4\1\5\1\6\7\4\2\7\1\10\1\11\1\12"
+ "\2\7\5\10\2\7\1\12\2\13\1\11\1\12\11\13"
+ "\1\12\16\0\2\14\1\15\1\14\1\16\1\17\1\20"
+ "\1\21\1\22\1\23\1\24\1\25\1\26\2\0\1\10"
@@ -136,7 +140,9 @@ public final class TextLexer {
private static int zzUnpackTrans(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -160,12 +166,11 @@ public final class TextLexer {
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state
* <code>aState</code>
* ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\3\0\2\11\1\1\1\11\1\1\1\11\2\1\13\11";
private static final String ZZ_ATTRIBUTE_PACKED_0
= "\3\0\2\11\1\1\1\11\1\1\1\11\2\1\13\11";
private static int[] zzUnpackAttribute() {
int[] result = new int[22];
@@ -176,7 +181,9 @@ public final class TextLexer {
private static int zzUnpackAttribute(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
@@ -296,7 +303,9 @@ public final class TextLexer {
private static char[] zzUnpackCMap(String packed) {
char[] map = new char[0x10000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 62) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
@@ -365,6 +374,7 @@ public final class TextLexer {
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null) {
@@ -564,7 +574,6 @@ public final class TextLexer {
zzState = ZZ_LEXSTATE[zzLexicalState];
zzForAction:
{
while (true) {

View File

@@ -16,7 +16,6 @@
*/
package com.jpexs.decompiler.flash.timeline;
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
import com.jpexs.decompiler.flash.types.CXFORM;
import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA;
@@ -31,6 +30,7 @@ import java.util.List;
* @author JPEXS
*/
public class DepthState {
public int characterId;
public MATRIX matrix = null;
public String instanceName = null;
@@ -43,13 +43,13 @@ public class DepthState {
public RGBA backGroundColor = null;
public CLIPACTIONS clipActions = null;
public int ratio;
public boolean key=false;
public DepthState(){
public boolean key = false;
public DepthState() {
}
public DepthState(DepthState obj){
public DepthState(DepthState obj) {
characterId = obj.characterId;
matrix = obj.matrix;
instanceName = obj.instanceName;

View File

@@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.timeline;
import java.util.HashMap;
@@ -25,16 +24,18 @@ import java.util.Map;
* @author JPEXS
*/
public class Frame {
public Map<Integer,DepthState> layers = new HashMap<>();
public Frame(){
public Map<Integer, DepthState> layers = new HashMap<>();
public Frame() {
}
public Frame(Frame obj){
layers = new HashMap<>();
for(int depth:obj.layers.keySet()){
layers.put(depth, new DepthState(obj.layers.get(depth)));
}
public Frame(Frame obj) {
layers = new HashMap<>();
for (int depth : obj.layers.keySet()) {
layers.put(depth, new DepthState(obj.layers.get(depth)));
}
}
}

View File

@@ -34,41 +34,41 @@ import java.util.List;
* @author JPEXS
*/
public class TimeLine {
public List<Frame> frames = new ArrayList<>();
public TimeLine() {
}
public int getMaxDepth()
{
int max_depth=0;
for(Frame f:frames){
for(int depth:f.layers.keySet()){
if(depth>max_depth){
max_depth = depth;
}
public int getMaxDepth() {
int max_depth = 0;
for (Frame f : frames) {
for (int depth : f.layers.keySet()) {
if (depth > max_depth) {
max_depth = depth;
}
}
}
return max_depth;
}
public int getFrameCount(){
public int getFrameCount() {
return frames.size();
}
public TimeLine(SWF swf) {
Frame frame=new Frame();
for(Tag t:swf.tags){
if(t instanceof PlaceObjectTypeTag){
PlaceObjectTypeTag po=(PlaceObjectTypeTag)t;
int depth=po.getDepth();
if(!frame.layers.containsKey(depth)){
Frame frame = new Frame();
for (Tag t : swf.tags) {
if (t instanceof PlaceObjectTypeTag) {
PlaceObjectTypeTag po = (PlaceObjectTypeTag) t;
int depth = po.getDepth();
if (!frame.layers.containsKey(depth)) {
frame.layers.put(depth, new DepthState());
}
DepthState fl = frame.layers.get(depth);
int characterId = po.getCharacterId();
if(characterId!=-1){
fl.characterId = characterId;
if (characterId != -1) {
fl.characterId = characterId;
}
if (po.flagMove()) {
MATRIX matrix2 = po.getMatrix();
@@ -121,12 +121,12 @@ public class TimeLine {
}
fl.key = true;
}
if(t instanceof RemoveTag){
RemoveTag r=(RemoveTag)t;
int depth=r.getDepth();
if (t instanceof RemoveTag) {
RemoveTag r = (RemoveTag) t;
int depth = r.getDepth();
frame.layers.remove(depth);
}
if(t instanceof ShowFrameTag){
if (t instanceof ShowFrameTag) {
frames.add(frame);
frame = new Frame(frame);
}

View File

@@ -14,24 +14,19 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.helpers;
import com.jpexs.decompiler.flash.exporters.BitmapExporter;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;
import java.awt.image.WritableRaster;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
/**
@@ -55,7 +50,7 @@ public class SerializableImage implements Serializable {
public SerializableImage(BufferedImage image) {
this.image = image;
}
public SerializableImage(int i, int i1, int i2) {
image = new BufferedImage(i, i1, i2);
}
@@ -70,13 +65,13 @@ public class SerializableImage implements Serializable {
public BufferedImage getBufferedImage() {
/*try {
ImageIO.write(image, "png", new File("c:\\10\\x\\imageid" + String.format("%03d", imageid++) + ".png"));
} catch (IOException ex) {
Logger.getLogger(BitmapExporter.class.getName()).log(Level.SEVERE, null, ex);
}*/
ImageIO.write(image, "png", new File("c:\\10\\x\\imageid" + String.format("%03d", imageid++) + ".png"));
} catch (IOException ex) {
Logger.getLogger(BitmapExporter.class.getName()).log(Level.SEVERE, null, ex);
}*/
return image;
}
@Override
protected Object clone() throws CloneNotSupportedException {
SerializableImage image = new SerializableImage();
@@ -128,7 +123,7 @@ public class SerializableImage implements Serializable {
public String toString() {
return image.toString();
}
private void writeObject(ObjectOutputStream out) throws IOException {
ImageIO.write(image, "png", out);
}

View File

@@ -21,7 +21,8 @@ import com.jpexs.decompiler.flash.abc.ABCOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import static org.testng.Assert.*;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import org.testng.annotations.Test;
/**

View File

@@ -27,7 +27,9 @@ import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import static org.testng.Assert.*;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -45,14 +47,14 @@ public class ActionScript2AssemblerTest extends ActionStript2TestBase {
@Test
public void testModifiedConstantPools() {
String actionsString = "ConstantPool \"ok\"\n" +
"Jump loc001f\n" +
"loc000d:Push \"ok\" false\n" +
"SetVariable\n" +
"Jump loc002f\n" +
"loc001f:ConstantPool \"wrong\"\n" +
"Jump loc000d\n" +
"loc002f:";
String actionsString = "ConstantPool \"ok\"\n"
+ "Jump loc001f\n"
+ "loc000d:Push \"ok\" false\n"
+ "SetVariable\n"
+ "Jump loc002f\n"
+ "loc001f:ConstantPool \"wrong\"\n"
+ "Jump loc000d\n"
+ "loc002f:";
try {
List<Action> actions = ASMParser.parse(0, 0, true, actionsString, swf.version, false);

View File

@@ -26,7 +26,8 @@ import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import static org.testng.Assert.*;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -44,33 +45,33 @@ public class ActionScript2DeobfuscatorTest extends ActionStript2TestBase {
@Test
public void testRemoveJumpsToTheNextAction() {
String actionsString = "ConstantPool \"a\" \"b\" \"c\"\n" +
"Push false register1\n" +
"StoreRegister 2\n" +
"Pop\n" +
"Push register2\n" +
"StoreRegister 0\n" +
"Push \"a\"\n" +
"StrictEquals\n" +
"If loc005a\n" +
"Push register0 \"b\"\n" +
"StrictEquals\n" +
"If loc0068\n" +
"Jump loc0048;\n" +
"loc0048:Push register0 \"c\"\n" +
"StrictEquals\n" +
"If loc0076\n" +
"Jump loc0084\n" +
"loc005a:Push 1\n" +
"Trace\n" +
"Jump loc0084\n" +
"loc0068:Push 2\n" +
"Trace\n" +
"Jump loc0084\n" +
"loc0076:Push 3\n" +
"Trace\n" +
"Jump loc0084\n" +
"loc0084:";
String actionsString = "ConstantPool \"a\" \"b\" \"c\"\n"
+ "Push false register1\n"
+ "StoreRegister 2\n"
+ "Pop\n"
+ "Push register2\n"
+ "StoreRegister 0\n"
+ "Push \"a\"\n"
+ "StrictEquals\n"
+ "If loc005a\n"
+ "Push register0 \"b\"\n"
+ "StrictEquals\n"
+ "If loc0068\n"
+ "Jump loc0048;\n"
+ "loc0048:Push register0 \"c\"\n"
+ "StrictEquals\n"
+ "If loc0076\n"
+ "Jump loc0084\n"
+ "loc005a:Push 1\n"
+ "Trace\n"
+ "Jump loc0084\n"
+ "loc0068:Push 2\n"
+ "Trace\n"
+ "Jump loc0084\n"
+ "loc0076:Push 3\n"
+ "Trace\n"
+ "Jump loc0084\n"
+ "loc0084:";
try {
List<Action> actions = ASMParser.parse(0, 0, true, actionsString, swf.version, false);

View File

@@ -25,7 +25,9 @@ import com.jpexs.decompiler.flash.tags.Tag;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import static org.testng.Assert.*;
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;
@@ -749,5 +751,5 @@ public class ActionScript2Test extends ActionStript2TestBase {
+ "unloadMovieNum(4);\r\n"
+ "updateAfterEvent();\r\n");
}
}

View File

@@ -29,7 +29,10 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Stack;
import static org.testng.Assert.*;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

View File

@@ -25,7 +25,7 @@ import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import static org.testng.Assert.*;
import static org.testng.Assert.fail;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -83,12 +83,12 @@ public class ExportTest {
public void testDecompileAS(File f) {
testDecompile(f, ExportMode.SOURCE);
}
@Test(dataProvider = "swfFiles")
public void testDecompilePcode(File f) {
testDecompile(f, ExportMode.PCODE);
}
public void testDecompile(File f, ExportMode exportMode) {
try {
SWF swf = new SWF(new FileInputStream(f), false);
@@ -107,7 +107,7 @@ public class ExportTest {
public AbortRetryIgnoreHandler getNewInstance() {
return this;
}
}, fdir.getAbsolutePath(), exportMode, false);
} catch (Exception ex) {
fail();

View File

@@ -18,8 +18,13 @@ package com.jpexs.decompiler.flash;
import com.jpexs.decompiler.flash.abc.NotSameException;
import com.jpexs.decompiler.flash.configuration.Configuration;
import java.io.*;
import static org.testng.Assert.*;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import static org.testng.Assert.fail;
import org.testng.annotations.Test;
/**

View File

@@ -20,7 +20,8 @@ import com.jpexs.decompiler.flash.types.RECT;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import static org.testng.Assert.*;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test;
/**
@@ -156,7 +157,7 @@ public class SWFStreamTest {
assertEquals(ff, sis.readFIXED8());
sis.close();
}
@Test
public void testRECT() throws IOException {
RECT rect;

View File

@@ -60,23 +60,22 @@ public class AS2Generator {
doa = null;
continue;
}
String[] srcs = src.split("[\r\n]+");
String testName="frame"+frame+"_Test";
String pref="trace(\"";
for(String p:srcs){
if(p.trim().matches("trace\\(\"(.*)Test\"\\);")){
testName="frame"+frame+"_"+p.substring(pref.length(),p.length()-3/* "); */);
String testName = "frame" + frame + "_Test";
String pref = "trace(\"";
for (String p : srcs) {
if (p.trim().matches("trace\\(\"(.*)Test\"\\);")) {
testName = "frame" + frame + "_" + p.substring(pref.length(), p.length() - 3/* "); */);
}
}
s.append("@Test\r\npublic void ");
s.append(testName);
s.append("(){\r\ncompareSrc(");
s.append(frame);
s.append(",");
for (int i = 0; i < srcs.length; i++) {
String ss = srcs[i];
s.append("\"");

View File

@@ -42,7 +42,7 @@ public class AS3Generator {
public static void main(String[] args) throws Exception {
Configuration.autoDeobfuscate.set(false);
SWF swf = new SWF(new BufferedInputStream(new FileInputStream("testdata/as3/as3.swf")),false);
SWF swf = new SWF(new BufferedInputStream(new FileInputStream("testdata/as3/as3.swf")), false);
DoABCDefineTag tag = null;
for (Tag t : swf.tags) {
if (t instanceof DoABCDefineTag) {
@@ -63,7 +63,7 @@ public class AS3Generator {
s.append(name);
s.append("\", ");
HilightedTextWriter src = new HilightedTextWriter(false);
abc.findBody(((TraitMethodGetterSetter) t).method_info).toString("", ExportMode.SOURCE, false, -1/*FIX?*/, classId, abc, null,abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, src, new ArrayList<String>(), abc.instance_info[classId].instance_traits);
abc.findBody(((TraitMethodGetterSetter) t).method_info).toString("", ExportMode.SOURCE, false, -1/*FIX?*/, classId, abc, null, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, src, new ArrayList<String>(), abc.instance_info[classId].instance_traits);
String[] srcs = src.toString().split("[\r\n]+");
for (int i = 0; i < srcs.length; i++) {
String ss = srcs[i];