Git Product home page Git Product logo

swf_ruby's Introduction

SwfRuby

endorse

SwfRuby is a utilities to dump or manipulate a SWF with Ruby.

  • features
    • SwfRuby::SwfDumper
      • Analysing the structure of specified SWF.
      • Used from 'swf_dump' command.
    • SwfRuby::SwfTamperer
      • Manipulating(replagcing) resources in SWF.
      • Used from 'swf_jpeg_replace', 'swf_lossless_replace', 'swf_as_var_replace' and 'swf_sprite_replace' command.
    • compatible on ruby-1.8.7 and ruby-1.9.3.

Dependencies

  • RMagick >= 2.13.0 (ImageMagick >= 6.5.7)

Installation

$ gem install swf_ruby

or

$ git clone git://github.com/tmtysk/swf_ruby.git
$ cd swf_ruby
$ rake install

Command-Line Tool Usage

Analysing the structure of SWF

$ swf_dump samples/sample.swf
SetBackgroundColor, offset: 20, length: 5
DefineFont2, offset: 25, length: 34
DefineEditText, offset: 59, length: 50
PlaceObject2, offset: 109, length: 11
DefineBitsLossless2, offset: 120, length: 178
DefineShape, offset: 298, length: 55
:
DefineBitsJPEG2, offset: 623, length: 10986
:

Replacing Jpeg in SWF

$ swf_jpeg_replace samples/sample.swf 623 samples/bg.jpg > samples/sample2.swf
# <623> is offset to DefineBitsJPEG2 resource getting by 'swf_dump'.

Replacing GIF/PNG in SWF

$ swf_lossless_replace samples/sample.swf 120 samples/icon.gif > samples/sample3.swf
# <120> is offset to DefineBitsLossless2 resource getting by 'swf_dump'.

Replacing ActionScript Variable in SWF

$ swf_as_var_replace foo.swf bar piyo > foo2.swf
# <bar> is variable name. <piyo> is new value to the variable.

Replacing Sprite(internal movieclip) in SWF

$ swf_sprite_replace foo.swf bar piyo.swf > foo2.swf
# <bar> is instance variable name of movieclip. <piyo.swf> is new movieclip file to replace.

Thanks

  • Sample GIF image is provided by ICHIGO-APORO.

Copyright (c) 2011 tmtysk. released under the GNU GENERAL PUBLIC LICENSE Version 2. See COPYING for details.

swf_ruby's People

Contributors

tmtysk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.