Archive for May, 2006

Charles v2.4.1 released

Saturday, May 6th, 2006

I’ve released an upgrade to Charles today that includes a few useful improvements. The main improvement is to the Firefox autoconfiguration extension. It should now be much more reliable at finding and configuring Firefox. Also the extension now adds a Charles menu to the Tools menu, and shows the current status of the connection to Charles as well as providing a few useful tools. Please let me know if Charles fails to work with your Firefox now!

This release also includes the improvements to AMF 3 parsing as documented in previous posts in this blog.

Look and feel improvements are also in this release. There are several Charles look and feels available in the Preferences, these are now Small, Default, Medium and Large. The font size change is now much greater in these. The display font size now works a bit more consistently as well.

Thanks to those people who helped by reporting and or testing these issues. Please download the latest version.

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;
}