March 2017
Mo Tu We Th Fr Sa Su
<< >>


More File Formats

Posted on Dec 24 2008

The hxFormat library that I was talking about a few months ago have been upgraded !

This library contains several file formats support for Haxe. There was already FLV, AMF0, PDF, ZIP, TAR, GZ and PBJ, the new formats are SWF and ABC :

  • SWF is the flash file format. The hxformat library contains a SWF reader/writer but only few SWF "tags" are recognized and decompiled. In particular, the ABC tag (named TActionScript3) is recognized but its content is not directly decompiled.
  • ABC : this is the ActionScript Bytecode that is generated by Flash9+ compilers such as MXMLC or Haxe. It's embedded into some tags of the SWF, so this format can be used together with SWF to decompile or dynamically generate SWF files.

ABC support includes the work I have been doing on hxASM, and complete several things that were not supported before, so it means that hxASM is now deprecated and that further development will focus on the hxformat ABC support instead.

The good point is that since only Haxe crossplatform API such as and are used to implement these different file formats, it means that they will compile and work the same on all Haxe-supported platforms !

Since some platforms were lacking the ZLIB algorithm that is used to read compressed data, I also ported some code I wrote before in OCaml to Haxe. That's the class that can be used on all platforms which don't have the ZLIB support (such as JavaScript for instance). There is currently no deflate (compression) support, but it's not mandatory so far.

Anyway, it's nice to see people using these libraries, such as for example Gust and Gilles Coomans using hxASM to compile haxeScript and have it run natively instead of being interpreted, or Ian Liu contributing a TAR Writer to hxFormat. And of course all other enthusiastic people on the Haxe mailing list :

Merry Christmas to everybody !

  • Leo
    Feb 11, 2009 at 18:48

    Adding a superclass to the Main class in the example fails (1107 error, ABC data broken, trying to read out of bounds)

    ctx.beginClass("Main").superclass = ctx.type("");

    How can I register a superclass??

    thank u!!!

  • Apr 13, 2009 at 00:47

    Very good AS3 bytecode manipulator

Name : Email : Website : Message :