Giter Club home page Giter Club logo

hambycomb's Introduction

Hambycomb

Hambycomb is an ActionScript 3 project that allows runtime modifictaion of the game Draw My Thing on OMGPOP.

It is the inspiration for both SWFWire and SketchPort.

The idea is simple. We load the OMGPOP SWF and a custom SWF into the same ApplicationDomain, and the custom SWF can modify the OMGPOP SWF at runtime.

This gives us two parts:

The container

A.K.A. Hambycomb.as / Hambycomb.swf

The container loads OMGPOP and the injection. Depending on the TESTING flag, it will either:

  • Embed the injection for quick loading.
  • Load it dynamically for easy testing. A green dot appears in the top left, which you can click to reload the hack.

The injection

A.K.A. HambycombInjection.as / HambycombInjection.swf

The injection contains the code that interacts with the OMGPOP SWF. You can modify it during game play to quickly figure out your hack. In this case, it adds keyboard shortcuts that can modify the brush while drawing.

Unfortunately, like most SWFs, the main class of the OMGPOP SWF depends on the stage being immediately accessible. That means when you try to load it using a Loader, you get a null object reference error. This is where being able to read the SWF file format becomes necessary. We want to find the ShowFrame tag that would usually cause Flash Player to start executing code, and remove it. This way we can access all of the classes in the SWF, and initialize it in our own way.

So how can we remove the correct ShowFrame tag? The SWF file format is pretty organized, and we can read tags without knowing anything about them.

The things we need to handle are:

  • Removing file compression
  • Getting past variable length fields in the SWF header
  • Removing the unwanted tags
  • Updating the file size field in the SWF header
  • Updating the frame count field in the SWF header

All of this is taken care of in the read method. Now that we can load the SWF without error, we can directly instantiate the necessary objects (iilwy.versions.website.Website in this case) and add them to the stage.

All that's left now is a little code to disable and cleanup the current injection (deactivate) when you want to load a new one, and everything should be working.

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.