in reply to indirection
Each pair in @japh (I reformatted $q into @japh for convenience) encodes two or three pieces of information. Each number is split as a nibble and a byte. If the nibble in the first number is non-zero then the byte from the second number is an offset into $data to find a two byte hex encoded character. If the nibble was zero then each byte specifies an index into $data to retrieve the two nibbles of the two byte hex encoded character. The first number's byte is the most significant nibble in that value.
The de-obfuscated source
#!/usr/bin/perl -w use strict; my $c = sub {substr shift(), 0, 2 }; my $d = sub {substr shift(), 0, 1 }; my $f = sub { $_[1] ->( $_[0] ) }; my $data = join '', map sprintf( '%02x', $_ & 1 ? $_ : 255 - $_ ), 0 .. 255; my @japh = ( [qw[082 15E]], [qw[258 0B1]], [qw[258 071]], [qw[258 091]], [qw[042 002]], [qw[258 0C2]], [qw[124 028]], [qw[258 0DE]], [qw[258 16F]], [qw[0C2 0F0]], [qw[258 0CA]], [qw[258 051]], [qw[1A0 00A]], [qw[258 015]], [qw[258 134]], [qw[258 1AF]], [qw[0C2 064]], [qw[1A4 1F4]], [qw[0D6 116]], [qw[258 13C]], [qw[258 0C6]], [qw[258 0D6]], [qw[0C2 1EB]], [qw[1F1 1A0]], [qw[258 042]], [qw[1F4 0A0]]); while (my $chr = shift @japh) { my ($l, $r) = map hex(), @$chr; print chr hex ($l >= 501 ? substr($data, $r, 2) : substr($data, $l, 1) . substr($data, $r, 1) ); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: indirection
by iamcal (Friar) on Mar 31, 2003 at 11:12 UTC |