--- In vmu-dev@egroups.com, "Marcus Comstedt" <marcus@i...> wrote:
>
> First of all, it's great to see you here Alex. Welcome.
>
> Had it just been the modified base64, it wouldn't have been a
problem
> to crack the format, but there's obviuosly more to this than that.
>
>
> // Marcus
Then maybe they are using technology similar to other decoding
routines I have seen. Sonic adventure does some weird decryption of
the data before it gets outputted.
Do the Base64 decoding first. The other base64 encoding scheme is
used for VMU Uploads through web pages. Since that is not the method
they are using for e-mails, then try this code. Replace $dc-
>decode_base64 with your own routine. Change the length of the $i
for loop to be equal to the length of the data you are encoding
divided by 4. The following routine decodes 80 bytes. I don't have
any information about this, since the data was never designed to be
decoded by users. Let me know if any of this helps.
my (@XOR_CODE) = (65,84,69,90); # 0x5A455441
my (@PLUS_VAL) = (65,78,65,78); # 0x4E414E41
# BASE64Decode
@BINDATA = ();
@BINDATA = $dc->decode_base64($srcdata);
my @tmp_val = (0,0,0,0);
for(my $i=0;$i<20;$i++) {
my $tmp_val2 = 0;
for(my $j=0;$j<4;$j++) {
$BINDATA[$i*4+$j] ^= ($tmp_val[$j] ^ $XOR_CODE[$j]);
$tmp_val[$j] = ($tmp_val[$j] + $PLUS_VAL[$j] + $tmp_val2);
$tmp_val2 = $tmp_val[$j]>>8;
$tmp_val[$j] &= 255;
}
}
Alexander Villagran
VMU Developer