I am forwarding becayse MiKatp (who originally wrote this) seems to be 
having trouble sending to the mailing list... sorry if it manages to be 
send after all and you get it twice!

Great job btw! :) Congratulations!

Vivia

---------- Forwarded message ----------
Date: Tue, 24 Jan 2006 01:36:22 +0100 (CET)
From: Reinoso G. <[EMAIL PROTECTED]>
To: [email protected]
Cc: [EMAIL PROTECTED]
Subject: Workaround for Inkdraw in windows with journal
Resent-Date: Tue, 24 Jan 2006 14:10:09 +0100 (CET)
Resent-From: "Reinoso G." <[EMAIL PROTECTED]>
Resent-To: [EMAIL PROTECTED]
Resent-Subject: Workaround for Inkdraw in windows with journal


Hi all!

First of all I apologize for my bad english. I think I have got a way to show
the inkdraw gifs in windows that have journal viewver installed.

I just captured some gif's from a windows msn client and studied them. First I
sniffed the conversation using ethereal and saved it as raw. Then I extracted
gifs using the perl script attached (tcp2gif). It should work on most cases.

In order to study what's the difference between the usual gif and the
microsoft format I "convert" them:

convert gif1.gif gif1_converted.gif

This process removes all extra things inserted by MS in its format.

I use then khexedit to see what changed. And I saw that the converted gif
lacks some bytes. I named that code "gif patch". Some bytes at the middle of
the file changed too, but seem unimportant. See gif1.gif, and
gif1.gif.convert.gif attachments.

I insulated some of theese "patchs" and seem very similar one to another. So I
tried to append the gif1's patch to the gif3 converted file. And it works. So
patch code is no so important since be there.

Then I made a gif with gimp and append the gif1's patch, AND IT WORKS too. :)

So it seem that if you take any usual inkdrak (B/W gif) and yo append the any
patch, then MSN7.5 will display it.


Modifying gif file:

When you open a gif file with an hexadecimal editor you can see it ends with a
semicolon ";". Well the patch starts with an admiration mark "!". You have to
remove semicolon and paste the whole patch into the end of the file. No matter
what file patch is from, but it have to be there to work.


We have to research what is the mean of the extra bytes and which of them are
really neccesary, but it is a good workaround by now.

I'll be out of my house some time so I can't answer until next tuesday.


I hope it helps.

MiKatp (and Corellian).

Attachment: gif1.patch
Description: Binary data

Attachment: gif1.gif.convert.gif
Description: GIF image

Attachment: gif1.gif
Description: GIF image

#!/usr/bin/perl
# by MiKatp ([EMAIL PROTECTED])

use MIME::Base64;

if ( @ARGV < 2)
{
                print "Sintax: $0 file.tcp prefix\n";
                exit;
}

$| = 1;
$archivo = shift @ARGV;
$prefijo = shift @ARGV;

open f1, "< $archivo" or die "Cannot open $archivo\n";

@b = <f1>;
$b = join "\n",@b;

$b =~ tr/\x0//d;                                        # me cargo los ceros 
intercalados
$b =~ tr/<\003\035/\015\012\012/;       # abracadabra
$b =~ tr/\015/*/;                                       # pata de cabra

@b = split /\n/,$b;
@b = grep(!/[^0-9+\/:=A-Za-z]/,@b);     # quitamos lineas con caracteres no b64

$b = join "",@b;
@b = split /base64:/,$b;
shift @b;                                                       # el primero es 
una en blanco

close f1;

$i=0;
foreach ( @b )
{
        $i++;
        print "Decoding file $i... ";
        (length $_) % 4 == 0 or print "(W: unexpected end of data) ";
        $d = decode_base64($_);
        open f1, "> $prefijo$i.gif";
                print f1 $d;
        close f1;
        print "saved as $prefijo$i.gif\n"; 
}

Reply via email to