public ActionGetURL2(int actionLength, SWFInputStream sis) throws IOException {
   super(0x9A, actionLength);
   loadVariablesFlag = sis.readUB(1, "loadVariablesFlag") == 1;
   loadTargetFlag = sis.readUB(1, "loadTargetFlag") == 1;
   reserved = (int) sis.readUB(4, "reserved");
   sendVarsMethod =
       (int) sis.readUB(2, "sendVarsMethod"); // This is first in documentation, which is WRONG!
 }
 public ActionDefineFunction(int actionLength, SWFInputStream sis, int version)
     throws IOException {
   super(0x9B, actionLength);
   this.version = version;
   functionName = sis.readString("functionName");
   int numParams = sis.readUI16("numParams");
   for (int i = 0; i < numParams; i++) {
     paramNames.add(sis.readString("paramName"));
   }
   codeSize = sis.readUI16("codeSize");
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   buttonId = sis.readUI16("buttonId");
   buttonColorTransform = sis.readCXFORM("buttonColorTransform");
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   streamID = sis.readUI16("streamID");
   frameNum = sis.readUI16("frameNum");
   videoData = sis.readByteRangeEx(sis.available(), "videoData"); // TODO: Parse video packets
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   int numGradients = sis.readUI16("numGradients");
   indices = new int[numGradients];
   for (int i = 0; i < numGradients; i++) {
     indices[i] = sis.readUI16("index");
   }
 }
 public ActionWaitForFrame2(int actionLength, SWFInputStream sis) throws IOException {
   super(0x8D, actionLength);
   skipCount = sis.readUI8("skipCount");
   skipped = new ArrayList<>();
   /*for (int i = 0; i < skipCount; i++) {
   Action a = sis.readAction(cpool);
   if (a instanceof ActionEnd) {
   skipCount = i;
   break;
   }
   if (a == null) {
   skipCount = i;
   break;
   }
   skipped.add(a);
   }
   boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
   if (deobfuscate) {
   ByteArrayOutputStream baos = new ByteArrayOutputStream();
   for (int i = 0; i < skipCount; i++) {
   baos.write(skipped.get(i).getBytes(sis.getVersion()));
   }
   baos.write(new ActionEnd().getBytes(sis.getVersion()));
   SWFInputStream sis2 = new SWFInputStream(new ByteArrayInputStream(baos.toByteArray()), sis.getVersion());
   skipped = sis2.readActionList(new ArrayList<DisassemblyListener>(), 0, "");
   if (!skipped.isEmpty()) {
   if (skipped.get(skipped.size() - 1) instanceof ActionEnd) {
   skipped.remove(skipped.size() - 1);
   }
   }
   skipCount = skipped.size();
   }*/
 }
  @Override
  public final void readData(
      SWFInputStream sis,
      ByteArrayRange data,
      int level,
      boolean parallel,
      boolean skipUnusualTags,
      boolean lazy)
      throws IOException {
    fontId = sis.readUI16("fontId");
    glyphShapeTable = new ArrayList<>();

    if (sis.available() > 0) {
      long pos = sis.getPos();
      int firstOffset = sis.readUI16("firstOffset");
      int nGlyphs = firstOffset / 2;

      long[] offsetTable = new long[nGlyphs];
      offsetTable[0] = firstOffset;
      for (int i = 1; i < nGlyphs; i++) {
        offsetTable[i] = sis.readUI16("offset");
      }
      for (int i = 0; i < nGlyphs; i++) {
        sis.seek(pos + offsetTable[i]);
        glyphShapeTable.add(sis.readSHAPE(1, false, "shape"));
      }
    }
  }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException, InterruptedException {
   spriteId = sis.readUI16("spriteId");
   frameCount = sis.readUI16("frameCount");
   List<Tag> subTags = sis.readTagList(this, level + 1, parallel, skipUnusualTags, true, lazy);
   if (subTags.size() > 0 && subTags.get(subTags.size() - 1).getId() == EndTag.ID) {
     hasEndTag = true;
     subTags.remove(subTags.size() - 1);
   }
   this.subTags = subTags;
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   int numSymbols = sis.readUI16("numSymbols");
   tags = new ArrayList<>(numSymbols);
   names = new ArrayList<>(numSymbols);
   for (int i = 0; i < numSymbols; i++) {
     int tagID = sis.readUI16("tagID");
     String className = sis.readString("className");
     tags.add(tagID);
     names.add(className);
   }
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   if (sis.available() > 0) {
     reserved = sis.readUI16("reserved");
   } else {
     reserved = 0;
   }
   if (sis.available() > 0) {
     passwordHash = sis.readString("passwordHash");
   } else {
     passwordHash = null;
   }
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   characterId = sis.readUI32("characterId");
   bitmapFormat = sis.readUI16("bitmapFormat");
   targetWidth = sis.readUI16("targetWidth");
   targetHeight = sis.readUI16("targetHeight");
   exportName = sis.readNetString("exportName");
   fileName = sis.readNetString("fileName");
   if (sis.available() > 0) { // there is usually one zero byte, bod knows why
     extraData = sis.readBytesEx(sis.available(), "extraData");
   }
 }
 /**
  * Constructor
  *
  * @param sis
  * @param data
  * @throws IOException
  */
 public DefineButtonCxformTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
   super(sis.getSwf(), ID, NAME, data);
   readData(sis, data, 0, false, false, false);
 }
 /**
  * Constructor
  *
  * @param sis
  * @param data
  * @throws IOException
  */
 public EnableDebuggerTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
   super(sis.getSwf(), ID, NAME, data);
   readData(sis, data, 0, false, false, false);
 }
 public ActionDefineFunction2(int actionLength, SWFInputStream sis, int version)
     throws IOException {
   super(0x8E, actionLength);
   this.version = version;
   functionName = sis.readString("functionName");
   int numParams = sis.readUI16("numParams");
   registerCount = sis.readUI8("registerCount");
   preloadParentFlag = sis.readUB(1, "preloadParentFlag") == 1;
   preloadRootFlag = sis.readUB(1, "preloadRootFlag") == 1;
   suppressSuperFlag = sis.readUB(1, "suppressSuperFlag") == 1;
   preloadSuperFlag = sis.readUB(1, "preloadSuperFlag") == 1;
   suppressArgumentsFlag = sis.readUB(1, "suppressArgumentsFlag") == 1;
   preloadArgumentsFlag = sis.readUB(1, "preloadArgumentsFlag") == 1;
   suppressThisFlag = sis.readUB(1, "suppressThisFlag") == 1;
   preloadThisFlag = sis.readUB(1, "preloadThisFlag") == 1;
   reserved = (int) sis.readUB(7, "reserved");
   preloadGlobalFlag = sis.readUB(1, "preloadGlobalFlag") == 1;
   for (int i = 0; i < numParams; i++) {
     paramRegisters.add(sis.readUI8("paramRegister"));
     paramNames.add(sis.readString("paramName"));
   }
   codeSize = sis.readUI16("codeSize");
 }
 /**
  * Constructor
  *
  * @param sis
  * @param data
  * @param level
  * @param parallel
  * @param skipUnusualTags
  * @throws IOException
  * @throws java.lang.InterruptedException
  */
 public DefineSpriteTag(
     SWFInputStream sis, int level, ByteArrayRange data, boolean parallel, boolean skipUnusualTags)
     throws IOException, InterruptedException {
   super(sis.getSwf(), ID, NAME, data);
   readData(sis, data, level, parallel, skipUnusualTags, false);
 }
 /**
  * Constructor
  *
  * @param sis
  * @param data
  * @throws IOException
  */
 public ExporterInfoTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
   super(sis.getSwf(), ID, "ExporterInfo", data);
   this.version = sis.readUI16("version");
   if (this.version >= 0x10a) {
     flags = sis.readUI32("flags");
   }
   bitmapFormat = sis.readUI16("bitmapFormat");
   int prefixLen = sis.readUI8("prefixLen");
   prefix = sis.readBytesEx(prefixLen, "prefix");
   int swfNameLen = sis.readUI8("swfNameLen");
   swfName = new String(sis.readBytesEx(swfNameLen, "swfName"));
   if (sis.available() > 0) // (version >= 0x401) //?
   {
     codeOffsets = new ArrayList<>();
     int numCodeOffsets = sis.readUI16("numCodeOffsets");
     for (int i = 0; i < numCodeOffsets; i++) {
       codeOffsets.add(sis.readUI32("codeOffset"));
     }
   }
 }
 @Override
 public final void readData(
     SWFInputStream sis,
     ByteArrayRange data,
     int level,
     boolean parallel,
     boolean skipUnusualTags,
     boolean lazy)
     throws IOException {
   fontId = sis.readUI16("fontId");
   if (swf.version >= 6) {
     fontName = sis.readNetString("fontName", Utf8Helper.charset);
   } else {
     fontName = sis.readNetString("fontName");
   }
   reserved = (int) sis.readUB(2, "reserved");
   fontFlagsSmallText = sis.readUB(1, "fontFlagsSmallText") == 1;
   fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1;
   fontFlagsANSI = sis.readUB(1, "fontFlagsANSI") == 1;
   fontFlagsItalic = sis.readUB(1, "fontFlagsItalic") == 1;
   fontFlagsBold = sis.readUB(1, "fontFlagsBold") == 1;
   fontFlagsWideCodes = sis.readUB(1, "fontFlagsWideCodes") == 1;
   codeTable = new ArrayList<>();
   while (sis.available() > 0) {
     if (fontFlagsWideCodes) {
       codeTable.add(sis.readUI16("code"));
     } else {
       codeTable.add(sis.readUI8("code"));
     }
   }
 }
 /**
  * Constructor
  *
  * @param sis
  * @param data
  * @throws IOException
  */
 public DefineGradientMap(SWFInputStream sis, ByteArrayRange data) throws IOException {
   super(sis.getSwf(), ID, NAME, data);
   readData(sis, data, 0, false, false, false);
 }
 public ActionWaitForFrame(int actionLength, SWFInputStream sis) throws IOException {
   super(0x8A, actionLength);
   frame = sis.readUI16("frame");
   skipCount = sis.readUI8("skipCount");
   skipped = new ArrayList<>();
 }
 /**
  * Constructor
  *
  * @param sis
  * @param data
  * @throws IOException
  */
 public DefineExternalImage2(SWFInputStream sis, ByteArrayRange data) throws IOException {
   super(sis.getSwf(), ID, NAME, data);
   readData(sis, data, 0, false, false, false);
 }
 public ActionStoreRegister(int actionLength, SWFInputStream sis) throws IOException {
   super(0x87, actionLength);
   registerNumber = sis.readUI8("registerNumber");
 }
 public SymbolClassTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
   super(sis.getSwf(), ID, NAME, data);
   readData(sis, data, 0, false, false, false);
 }
  /**
   * Constructor
   *
   * @param sis
   * @param data
   * @throws IOException
   */
  public PlaceObject2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
    super(sis.getSwf(), ID, "PlaceObject2", data);
    placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1;
    placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1;
    placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1;
    placeFlagHasRatio = sis.readUB(1, "placeFlagHasRatio") == 1;
    placeFlagHasColorTransform = sis.readUB(1, "placeFlagHasColorTransform") == 1;
    placeFlagHasMatrix = sis.readUB(1, "placeFlagHasMatrix") == 1;
    placeFlagHasCharacter = sis.readUB(1, "placeFlagHasCharacter") == 1;
    placeFlagMove = sis.readUB(1, "placeFlagMove") == 1;

    depth = sis.readUI16("depth");
    if (placeFlagHasCharacter) {
      characterId = sis.readUI16("characterId");
    }
    if (placeFlagHasMatrix) {
      matrix = sis.readMatrix("matrix");
    }
    if (placeFlagHasColorTransform) {
      colorTransform = sis.readCXFORMWITHALPHA("colorTransform");
    }
    if (placeFlagHasRatio) {
      ratio = sis.readUI16("ratio");
    }
    if (placeFlagHasName) {
      name = sis.readString("name");
    }
    if (placeFlagHasClipDepth) {
      clipDepth = sis.readUI16("clipDepth");
    }
    if (placeFlagHasClipActions) {
      clipActions = sis.readCLIPACTIONS(swf, this, "clipActions");
    }
  }
Example #24
0
 public ActionWith(int actionLength, SWFInputStream sis, int version) throws IOException {
   super(0x94, actionLength);
   codeSize = sis.readUI16("codeSize");
   this.version = version;
 }