Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
use strict;
use warnings;
use Compress::Zlib;
++$|;
open IN, 'test.exe' or die $!;
binmode IN;
read IN, my $data, 1e8;
my $piecenum=0;
my $progress = progress(length $data);
my $piecedata;
for (0..length($data)-1) {
$progress->($_);
$piecedata = uncompress("\x78\x9c" . substr $data, $_);
if (defined $piecedata) {
print "\nFound piece at $_\n";
open OUT, sprintf('>piece_%03d.txt', $piecenum++) or die $!; b
+inmode OUT;
print OUT $piecedata ^ chr(0xAA) x length $piecedata;
}
}
sub progress {
my $max = $_[0];
my $last = 0;
return sub { print $last = int(100*$_[0]/$max), "%... " if $last !
+= int(100*$_[0]/$max) };
}