#!/usr/bin/perl # decompress firmware files $hb="PK\x03\x04"; $he="PK\x05\x06"; undef $/; $bulk = <>; (@f)= ($bulk =~ m/(?:($hb.*?$he.{18}).*?)+/sg); for(@f) { $i++; open F, ">fw$i.zip"; print F $_ }