Examples of SWFFile


Examples of tv.porst.swfretools.parser.structures.SWFFile

    if (outputFile == null) {
      throw new IllegalArgumentException("Output file argument must not be null.");
    }

    try {
      final SWFFile swfFile = SWFParser.parse(new File(inputFile));

      if (!swfFile.getWasCompressed()) {
        System.out.println("Input file is already decompressed");
        return;
      }

      try {
        FileHelpers.writeFile(new File(outputFile), swfFile.getDecompressedData());
      } catch (final IOException e) {
        System.out.println("Error: Could not write to output file");
      }
    } catch (final IOException e) {
      System.out.println("Error: Could not read input file");
View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SWFFile

    final UINT16 frameRate = parser.readUInt16();
    final UINT16 frameCount = parser.readUInt16();

    final TagParserResult tags = TagParser.parse(parser, version.value());

    return new SWFFile(parserInputData, wasCompressed, signature1, signature2, signature3, version, fileLength, frameSize, frameRate, frameCount, tags.getTags());
  }
View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SWFFile

   * @throws IOException Thrown if the file could not be read.
   * @throws SWFParserException Thrown if the file could not be parsed.
   */
  public LoadedFile openFile(final File file) throws IOException, SWFParserException {

    final SWFFile swfFile = SWFParser.parse(file);

    final LoadedFile loadedFile = new LoadedFile(file, swfFile);

    openFiles.add(loadedFile);

View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SWFFile

    int iterationCounter = lastIteration;

    // Outer loop: Repeat until any change produces a crash
    while (hasChanged)
    {
      SWFFile parsedFile;

      try {
        parsedFile = SWFParser.parse(inputFile);
      } catch (final IOException e) {
        throw new MinimizerException("SWF input file could not be read");
      } catch (final SWFParserException e) {
        throw new MinimizerException("SWF input file could not be parsed");
      }

      final byte[] fileData = parsedFile.getDecompressedData();

      // For each run of the minimizer loop, this list stores
      // the functions that can be removed with the input file
      // crashing.
      final List<AS3Code> removableCode = new ArrayList<AS3Code>();
View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SWFFile

    int iterationCounter = 0;

    // Outer loop: Repeat until any change produces a crash
    while (hasChanged)
    {
      SWFFile parsedFile;

      try {
        parsedFile = SWFParser.parse(inputFile);
      } catch (final IOException e) {
        throw new MinimizerException("SWF input file could not be read");
      } catch (final SWFParserException e) {
        throw new MinimizerException("SWF input file could not be parsed");
      }

      final byte[] fileData = parsedFile.getDecompressedData();

      // For each run of the minimizer loop, this list stores
      // the tags that can be removed without the input file
      // crashing.
      final List<Tag> removableTags = new ArrayList<Tag>();

      final TagList tags = parsedFile.getTags();

      int tagCounter = 1;

      // Inner loop: Remove one tag at a time and then check
      // whether the modified file still crashes.
View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SWFFile

        }

        System.out.println("Parsing " + file.getAbsolutePath());

        try {
          final SWFFile parsedFile = SWFParser.parse(file);

          for (final Tag tag : parsedFile.getTags()) {

            final int tagCode = tag.getHeader().getTagCode();

            if (!tagCounts.containsKey(tagCode)) {
              tagCounts.put(tagCode, 1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.