Encoded/Encrypted Data Help.
Posted: Sun Apr 30, 2006 12:11 pm
I'm trying to parse the image data i get back from a flash file (ffART, used on Bebo.com).
I do not have access to any documentation about this ffART thingy.
And i have tried every possible way i could think of to try and use this data.
The data I get back from the swf file is:
CANVASCOLOUR i have allready figured out is a hex converted to dec (simple dechex() to get back)
HEIGHT and WIDTH are pretty self explanitary
X i have no idea what this is for... but when i dont put any data on the image (other than the canvas) it is set to 0 and i dont have the X0 argument.
X0 is the image data... the part i can't figure out.
I suspect its been pack()'ed but ive tried loads of unpack() methods and not got any data.
I tried base64_decode, it looked promising but didnt actualy get me anywhere because it had no headers... i tried appending it to the bottom of a gif file using this code:
(hex2rgb is a small function to turn the hex code into RGB.)
This didn't work (I didn't expect it too)
But it did generate a valid image... that had the correct background color.
If you have any hints please let me know! (or if you know of any other flash whiteboards that use a php backend, with docs!)
I do not have access to any documentation about this ffART thingy.
And i have tried every possible way i could think of to try and use this data.
The data I get back from the swf file is:
Code: Select all
array(5) {
["X0"]=>
string(10) "3a0a58a126"
["X"]=>
string(1) "1"
["CANVASCOLOUR"]=>
string(5) "13158"
["HEIGHT"]=>
string(3) "401"
["WIDTH"]=>
string(3) "601"
}HEIGHT and WIDTH are pretty self explanitary
X i have no idea what this is for... but when i dont put any data on the image (other than the canvas) it is set to 0 and i dont have the X0 argument.
X0 is the image data... the part i can't figure out.
I suspect its been pack()'ed but ive tried loads of unpack() methods and not got any data.
I tried base64_decode, it looked promising but didnt actualy get me anywhere because it had no headers... i tried appending it to the bottom of a gif file using this code:
Code: Select all
header("Content-type: image/gif");
$im = imagecreate($_REQUEST['WIDTH'], $_REQUEST['HEIGHT']);
$cols = hex2rgb($canvascolor, false);
$bg = imagecolorallocate($im, $cols[0],$cols[1],$cols[2]);
imagegif($im);
echo base64_decode($_REQUEST['X0']);This didn't work (I didn't expect it too)
But it did generate a valid image... that had the correct background color.
If you have any hints please let me know! (or if you know of any other flash whiteboards that use a php backend, with docs!)