#!/usr/bin/perl -w # shift_decode.pl - Don Yang (uguu.org) # # Decode text using constants found with shift_constants.c use strict; use constant BOUNDARY => 40; use constant MUL1 => 3; use constant MUL2 => 255; use constant SHIFT => 158; # Decode input my $input = join '', <>; foreach my $c (unpack 'C*', $input) { print chr(($c * ($c < BOUNDARY ? MUL1 : MUL2) + SHIFT) % 256); }