Archive for the ‘Flash’ Category

AMF3 reference deserializer in Java updated

Saturday, December 23rd, 2006

Thanks to bug reports from Patrick Mineault from AMFPHP, I have fixed some more AMF3 parsing bugs in Charles (currently in beta). With that comes an updated release of the AMF3 reference deserializer. This update includes object parsing improvements (externalisable and dynamic types now properly identified), mixed arrays (string keys) and reference bug fixes.

Thanks to everyone who has reported bugs or otherwise done work on uncovering AMF3.

Download the source code here: AMF3Deserializer.zip

AMF3 integer parsing

Saturday, May 6th, 2006

Martin Schnabel has done some work on further reverse engineering the integer format in AMF 3, and discovering the undefined type. I have updated my reference AMF 3 implementation accordingly. Including a simpler parse integer algorithm, which I’ve pasted below:


private int readAMF3Integer() throws IOException {
    int n = 0;
    int b = in.readUnsignedByte();
    int result = 0;

    while ((b & 0x80) != 0 && n < 3) {
        result <<= 7;
        result |= (b & 0x7f);
        b = in.readUnsignedByte();
        n++;
    }
    if (n < 3) {
        result <<= 7;
        result |= b;
    } else {
    	/* Use all 8 bits from the 4th byte */
    	result <<= 8;
    	result |= b;

    	/* Check if the integer should be negative */
    	if ((result & 0x10000000) != 0) {
    		/* and extend the sign bit */
    		result |= 0xe0000000;
    	}
    }

    return result;
}

AMF3 reference deserializer in Java

Friday, April 28th, 2006

I’ve released some source code into the Public Domain, from my work in adding AMF3 deserialization support to Charles, as a reference for and compliment to the AMF3 specification.

The source code is a single Java file containing all of the AMF3 specific implementation. You can download it here as a zip file: AMF3Deserializer.zip.

UPDATE 6 May 2006: The reference implementation has been updated to include the newly discovered Undefined type and to correct the integer parsing (including negative integer parsing, credit to Martin Schnabel).

UPDATE 23 December 2006: Another update released here.

Charles v2.4 released with AMF 3 support

Monday, April 24th, 2006

This morning I’ve released version 2.4 of Charles including the AMF 3 support. This will enable early adopters of Flex 2 Beta to debug their Flex 2 applications. The AMF 3 implementation in Charles is based upon the AMF 3 spec from Kevin Langdon. There are several additional details that I’m hoping to add to the spec with this week.

This release of Charles also coincides with the addition of a Documentation Wiki for Charles and the beginnings of some proper documentation on the various features in Charles. I’ll be adding to and improving the documentation in the next few weeks.

AMF 3 support in Charles

Sunday, April 23rd, 2006

This weekend I’ve implemented AMF 3 support in Charles, with help from the AMF 3 spec from Kevin Langdon. AMF 3 is the next version of the AMF (Flash Remoting) protocol as used in the new Flex beta from Adobe.

The AMF 3 support in Charles is currently beta but will be released tomorrow with luck. There are bound to be bugs in the parsing as there isn’t a lot of AMF 3 around at the moment so please send feedback if you have successes or failures with it.