/usr/bin
NameSizeModeActions
aa-enabled187440755editdlrm
aa-exec187440755editdlrm
aa-features-abi187360755editdlrm
acpidbg16220755editdlrm
acpi_listen149200755editdlrm
add-apt-repository164220755editdlrm
addpart147200755editdlrm
apport-bug23220755editdlrm
apport-cli136250755editdlrm
apport-collect23220755editdlrm
apport-unpack37900755editdlrm
appstreamcli1415440755editdlrm
apropos484160755editdlrm
apt188240755editdlrm
apt-add-repository164220755editdlrm
apt-cache885440755editdlrm
apt-cdrom271040755editdlrm
apt-config311200755editdlrm
apt-extracttemplates230080755editdlrm
apt-ftparchive2278160755editdlrm
apt-get516800755editdlrm
apt-key286640755editdlrm
apt-mark557760755editdlrm
apt-sortpkgs516080755editdlrm
arch353360755editdlrm
automat-visualize39840755editdlrm
awk7398400755editdlrm
b2sum558160755editdlrm
base32394320755editdlrm
base64394320755editdlrm
basename353360755editdlrm
basenc476240755editdlrm
bash14460240755editdlrm
bashbug69880755editdlrm
bc930000755editdlrm
boltctl1257920755editdlrm
bpftrace22505760755editdlrm
bpftrace-aotrt10090160755editdlrm
btrfs10252800755editdlrm
btrfs-convert5901280755editdlrm
btrfs-find-root5327840755editdlrm
btrfs-image5655520755editdlrm
btrfs-map-logical5327840755editdlrm
btrfs-select-super5286880755editdlrm
btrfsck10252800755editdlrm
btrfstune5573600755editdlrm
busctl968640755editdlrm
busybox21246080755editdlrm
byobu87030755editdlrm
byobu-config9960755editdlrm
byobu-ctrl-a47740755editdlrm
byobu-disable12950755editdlrm
byobu-disable-prompt13410755editdlrm
byobu-enable11820755editdlrm
byobu-enable-prompt14530755editdlrm
byobu-export14210755editdlrm
byobu-janitor72090755editdlrm
byobu-keybindings15060755editdlrm
byobu-launch33290755editdlrm
byobu-launcher19100755editdlrm
byobu-launcher-install25290755editdlrm
byobu-launcher-uninstall15610755editdlrm
byobu-layout33480755editdlrm
byobu-prompt11560755editdlrm
byobu-quiet14100755editdlrm
byobu-reconnect-sockets32980755editdlrm
byobu-screen87030755editdlrm
byobu-select-backend14520755editdlrm
byobu-select-profile51800755editdlrm
byobu-select-session10120755editdlrm
byobu-shell16970755editdlrm
byobu-silent13060755editdlrm
byobu-status60150755editdlrm
byobu-status-detail12070755editdlrm
byobu-tmux87030755editdlrm
byobu-ugraph46670755editdlrm
byobu-ulevel119960755editdlrm
captoinfo925840755editdlrm
cat393840755editdlrm
catman315040755editdlrm
certbot9580755editdlrm
cftp32240755editdlrm
cgi-fcgi185840755editdlrm
chage721842755editdlrm
chardet2210755editdlrm
chardetect2210755editdlrm
chattr146560755editdlrm
chcon599120755editdlrm
chfn727924755editdlrm
chgrp599120755editdlrm
chmod558160755editdlrm
choom229120755editdlrm
chown599120755editdlrm
chronyc933920755editdlrm
chrt311040755editdlrm
chsh447604755editdlrm
chvt147120755editdlrm
cifsiostat270800755editdlrm
ckbcomp1506740755editdlrm
ckeygen32270755editdlrm
cksum1049840755editdlrm
clear146560755editdlrm
clear_console145680755editdlrm
cloud-id9660755editdlrm
cloud-init9700755editdlrm
cloud-init-per21080755editdlrm
cmp434080755editdlrm
codepage146400755editdlrm
col229200755editdlrm
col19630755editdlrm
col29630755editdlrm
col39630755editdlrm
col49630755editdlrm
col59630755editdlrm
col69630755editdlrm
col79630755editdlrm
col89630755editdlrm
col99630755editdlrm
colcrt147280755editdlrm
colrm147280755editdlrm
column393040755editdlrm
comm394400755editdlrm
conch32250755editdlrm
corelist153750755editdlrm
cp1418480755editdlrm
cpan83600755editdlrm
cpan5.38-x86_64-linux-gnu83810755editdlrm
cpio1409280755editdlrm
cpupower16220755editdlrm
crontab396642755editdlrm
csplit517200755editdlrm
ctail9600755editdlrm
ctstat232000755editdlrm
curl2972880755editdlrm
cut394320755editdlrm
cvtsudoers3288080755editdlrm
c_rehash68410755editdlrm
dash1297840755editdlrm
date1090640755editdlrm
dbus-cleanup-sockets146320755editdlrm
dbus-daemon2361760755editdlrm
dbus-monitor269280755editdlrm
dbus-run-session146400755editdlrm
dbus-send310160755editdlrm
dbus-update-activation-environment146320755editdlrm
dbus-uuidgen146320755editdlrm
dbxtool310240755editdlrm
dd722320755editdlrm
deallocvt147120755editdlrm
deb-systemd-helper243580755editdlrm
deb-systemd-invoke71350755editdlrm
debconf28700755editdlrm
debconf-apt-progress118460755editdlrm
debconf-communicate6230755editdlrm
debconf-copydb17180755editdlrm
debconf-escape6680755editdlrm
debconf-set-selections32160755editdlrm
debconf-show18250755editdlrm
debian-distro-info316960755editdlrm
delpart147200755editdlrm
delv464080755editdlrm
df891680755editdlrm
dh_bash-completion45270755editdlrm
dh_installxmlcatalogs94440755editdlrm
diff1377760755editdlrm
diff3599200755editdlrm
dig1544480755editdlrm
dir1423120755editdlrm
dircolors476320755editdlrm
dirmngr4851360755editdlrm
dirmngr-client562400755editdlrm
dirname352080755editdlrm
distro-info275360755editdlrm
dmesg702880755editdlrm
dnsdomainname227600755editdlrm
do-release-upgrade106750755editdlrm
domainname227600755editdlrm
dpkg3181760755editdlrm
dpkg-deb1460000755editdlrm
dpkg-divert1214160755editdlrm
dpkg-maintscript-helper212050755editdlrm
dpkg-query1377920755editdlrm
dpkg-realpath41850755editdlrm
dpkg-split1008960755editdlrm
dpkg-statoverride515920755editdlrm
dpkg-trigger435520755editdlrm
du1008720755editdlrm
dumpkeys1667600755editdlrm
eatmydata28060755editdlrm
ec2metadata85830755editdlrm
echo352080755editdlrm
ed599600755editdlrm
editor2790400755editdlrm
efibootdump228400755editdlrm
efibootmgr488320755editdlrm
egrep410755editdlrm
eject432400755editdlrm
enable-ec2-spot-hibernation2370755editdlrm
enc2xs419470755editdlrm
encguess30690755editdlrm
env480720755editdlrm
envsubst352000755editdlrm
eqn1929680755editdlrm
ex41306400755editdlrm
expand353600755editdlrm
expiry271522755editdlrm
expr434320755editdlrm
factor640080755editdlrm
faillog231680755editdlrm
fallocate270080755editdlrm
false269360755editdlrm
fgconsole147120755editdlrm
fgrep410755editdlrm
file313360755editdlrm
finalrd21120755editdlrm
find2042640755editdlrm
findmnt692800755editdlrm
flock230240755editdlrm
fmt394320755editdlrm
fold353360755editdlrm
free270080755editdlrm
ftp1872880755editdlrm
funzip269280755editdlrm
fuser402880755editdlrm
fusermount392964755editdlrm
fusermount3392964755editdlrm
fwupdmgr1211360755editdlrm
fwupdtool1129440755editdlrm
gapplication229200755editdlrm
gawk7398400755editdlrm
gawkbug69030755editdlrm
gdbus515920755editdlrm
geqn1929680755editdlrm
getconf269920755editdlrm
getent396480755editdlrm
getkeycodes147120755editdlrm
getopt229120755editdlrm
gettext352000755editdlrm
gettext.sh51880755editdlrm
ginstall-info483760755editdlrm
gio1048560755editdlrm
gio-querymodules187440755editdlrm
git40662320755editdlrm
git-receive-pack40662320755editdlrm
git-shell6398080755editdlrm
git-upload-archive40662320755editdlrm
git-upload-pack40662320755editdlrm
glib-compile-schemas556080755editdlrm
gpasswd762484755editdlrm
gpg11478000755editdlrm
gpg-agent3660960755editdlrm
gpg-connect-agent894000755editdlrm
gpg-wks-client1427120755editdlrm
gpgconf1181280755editdlrm
gpgparsemail352000755editdlrm
gpgsm5134000755editdlrm
gpgsplit272560755editdlrm
gpgtar694560755editdlrm
gpgv3104160755editdlrm
gpic2007680755editdlrm
grep1868240755editdlrm
gresource228400755editdlrm
groff967760755editdlrm
grog191950755editdlrm
grops1664560755editdlrm
grotty1213520755editdlrm
groups353360755editdlrm
growpart298950755editdlrm
grub-editenv4026000755editdlrm
grub-file7596880755editdlrm
grub-fstest8840400755editdlrm
grub-glue-efi1053520755editdlrm
grub-kbdcomp16810755editdlrm
grub-menulst2cfg851920755editdlrm
grub-mkfont1346000755editdlrm
grub-mkimage3863120755editdlrm
grub-mklayout1057040755editdlrm
grub-mknetdir4400880755editdlrm
grub-mkpasswd-pbkdf21139920755editdlrm
grub-mkrelpath2660240755editdlrm
grub-mkrescue10443120755editdlrm
grub-mkstandalone5224080755editdlrm
grub-mount6985840755editdlrm
grub-ntldr-img393120755editdlrm
grub-render-label7682320755editdlrm
grub-script-check1298000755editdlrm
grub-syslinux2cfg7154800755editdlrm
gsettings310320755editdlrm
gtbl1377040755editdlrm
gunzip23460755editdlrm
gzexe64800755editdlrm
gzip934240755editdlrm
h2ph292270755editdlrm
h2xs609340755editdlrm
hardlink476000755editdlrm
hd475040755editdlrm
head435280755editdlrm
helpztags25140755editdlrm
hexdump475040755editdlrm
hibagent244730755editdlrm
hibinit-agent183980755editdlrm
host1216720755editdlrm
hostid353360755editdlrm
hostname227600755editdlrm
hostnamectl311840755editdlrm
htop3792160755editdlrm
hwe-support-status115110755editdlrm
i386272880755editdlrm
ibd2sdi2690480755editdlrm
iconv680720755editdlrm
id394320755editdlrm
inetutils-telnet1821200755editdlrm
info2475360755editdlrm
infobrowser2475360755editdlrm
infocmp679680755editdlrm
infotocap925840755editdlrm
innochecksum1755040755editdlrm
install1459440755editdlrm
install-info483760755editdlrm
instmodsh43730755editdlrm
ionice188160755editdlrm
iostat557440755editdlrm
ip7729200755editdlrm
ipcmk229840755editdlrm
ipcrm188160755editdlrm
ipcs392960755editdlrm
iptables-xml951760755editdlrm
ischroot148240755editdlrm
iscsiadm3793200755editdlrm
join517600755editdlrm
journalctl808000755editdlrm
jq308720755editdlrm
json-patch-jsondiff10040755editdlrm
jsondiff10040755editdlrm
jsonpatch38590755editdlrm
jsonpointer18380755editdlrm
jsonschema2130755editdlrm
json_pp49920755editdlrm
kbdinfo188080755editdlrm
kbd_mode150160755editdlrm
kbxutil643360755editdlrm
keep-one-running35920755editdlrm
kernel-install559840755editdlrm
kill229120755editdlrm
killall320960755editdlrm
kmod1743280755editdlrm
kmodsign188880755editdlrm
landscape-sysinfo6460755editdlrm
last352000755editdlrm
lastb352000755editdlrm
lastlog284560755editdlrm
lcf77840755editdlrm
ld.so2366160755editdlrm
ldd53820755editdlrm
less1949520755editdlrm
lessecho146560755editdlrm
lessfile90470755editdlrm
lesskey242720755editdlrm
lesspipe90470755editdlrm
letsencrypt9580755editdlrm
lexgrog1018960755editdlrm
libnetcfg157780755editdlrm
link353360755editdlrm
linux-boot-prober15770755editdlrm
linux-check-removal40900755editdlrm
linux-update-symlinks63200755editdlrm
linux-version26980755editdlrm
linux32272880755editdlrm
linux64272880755editdlrm
ln558160755editdlrm
lnstat232000755editdlrm
loadkeys2077680755editdlrm
loadunimap352880755editdlrm
locale508240755editdlrm
locale-check144880755editdlrm
localectl270800755editdlrm
localedef3267520755editdlrm
logger399040755editdlrm
login530560755editdlrm
loginctl681760755editdlrm
logname353360755editdlrm
look188240755editdlrm
lowntfs-3g1218320755editdlrm
ls1423120755editdlrm
lsattr146560755editdlrm
lsblk1498960755editdlrm
lsb_release26510755editdlrm
lscpu1130320755editdlrm
lshw9801680755editdlrm
lsinitramfs7350755editdlrm
lsipc515840755editdlrm
lslocks315040755editdlrm
lslogins515840755editdlrm
lsmem392960755editdlrm
lsmod1743280755editdlrm
lsns434000755editdlrm
lsof1757840755editdlrm
lspci1025120755editdlrm
lspgpot10810755editdlrm
lspower12070755editdlrm
lsusb2524320755editdlrm
lzcat890080755editdlrm
lzcmp74220755editdlrm
lzdiff74220755editdlrm
lzegrep103330755editdlrm
lzfgrep103330755editdlrm
lzgrep103330755editdlrm
lzless18130755editdlrm
lzma890080755editdlrm
lzmainfo147200755editdlrm
lzmore21900755editdlrm
mailmail32270755editdlrm
man1284160755editdlrm
man-recode362480755editdlrm
mandb1471200755editdlrm
manifest19420755editdlrm
manpath274240755editdlrm
mapscrn311920755editdlrm
markdown-it2200755editdlrm
mawk1707680755editdlrm
mbim-network113420755editdlrm
mbimcli2219440755editdlrm
mcookie270800755editdlrm
md5sum393360755editdlrm
md5sum.textutils393360755editdlrm
mdig516080755editdlrm
memhog147680755editdlrm
mesg147200755editdlrm
migrate-pubring-from-classic-gpg30930755editdlrm
migratepages147200755editdlrm
migspeed146480755editdlrm
mkdir762960755editdlrm
mkfifo435280755editdlrm
mknod435280755editdlrm
mksquashfs2938320755editdlrm
mktemp353360755editdlrm
mk_modmap161630755editdlrm
mmcli2805120755editdlrm
mokutil609040755editdlrm
more474960755editdlrm
mount515844755editdlrm
mountpoint188160755editdlrm
mpstat516560755editdlrm
mt724320755editdlrm
mt-gnu724320755editdlrm
mtr780800755editdlrm
mtr-packet351200755editdlrm
mv1377520755editdlrm
myisamchk68592720755editdlrm
myisamlog66770320755editdlrm
myisampack67073440755editdlrm
myisam_ftdump66448320755editdlrm
mysql69124080755editdlrm
mysqladmin67502880755editdlrm
mysqlanalyze67591520755editdlrm
mysqlbinlog70760640755editdlrm
mysqlcheck67591520755editdlrm
mysqldump68388000755editdlrm
mysqldumpslow77190755editdlrm
mysqld_multi273670755editdlrm
mysqld_safe291370755editdlrm
mysqlimport67422720755editdlrm
mysqloptimize67591520755editdlrm
mysqlpump71580160755editdlrm
mysqlrepair67591520755editdlrm
mysqlreport390160755editdlrm
mysqlshow67450400755editdlrm
mysqlslap67598720755editdlrm
mysql_config_editor1608000755editdlrm
mysql_migrate_keyring68053440755editdlrm
mysql_secure_installation67302720755editdlrm
mysql_ssl_rsa_setup2077680755editdlrm
mysql_tzinfo_to_sql767120755editdlrm
mysql_upgrade68179200755editdlrm
my_print_defaults1753520755editdlrm
namei229120755editdlrm
nano2790400755editdlrm
nawk7398400755editdlrm
nc395600755editdlrm
nc.openbsd395600755editdlrm
neqn9130755editdlrm
netaddr9590755editdlrm
netcat395600755editdlrm
networkctl1255200755editdlrm
networkd-dispatcher203620755editdlrm
newgrp406644755editdlrm
NF9630755editdlrm
ngettext352000755editdlrm
nice353360755editdlrm
nisdomainname227600755editdlrm
nl395280755editdlrm
nohup352400755editdlrm
nproc353360755editdlrm
nroff57180755editdlrm
nsenter313360755editdlrm
nslookup1257680755editdlrm
nstat311040755editdlrm
nsupdate763440755editdlrm
ntfs-3g1628240755editdlrm
ntfs-3g.probe147200755editdlrm
ntfscat270080755editdlrm
ntfscluster393040755editdlrm
ntfscmp311040755editdlrm
ntfsdecrypt434000755editdlrm
ntfsfallocate270160755editdlrm
ntfsfix352080755editdlrm
ntfsinfo556880755editdlrm
ntfsls281120755editdlrm
ntfsmove311120755editdlrm
ntfsrecover1048320755editdlrm
ntfssecaudit807520755editdlrm
ntfstruncate269360755editdlrm
ntfsusermap187360755editdlrm
ntfswipe480320755editdlrm
numactl360800755editdlrm
numastat364160755editdlrm
numfmt599440755editdlrm
od722000755editdlrm
oem-getlogs85040755editdlrm
on_ac_power37880755editdlrm
openssl10053680755editdlrm
openvt232720755editdlrm
os-prober45270755editdlrm
pager1949520755editdlrm
partx638800755editdlrm
passwd641524755editdlrm
paste393360755editdlrm
pastebinit167060755editdlrm
patch1868960755editdlrm
pathchk353360755editdlrm
pbget25690755editdlrm
pbput25690755editdlrm
pbputs25690755editdlrm
pdb3694590755editdlrm
pdb3.12694590755editdlrm
peekfd146400755editdlrm
perf16220755editdlrm
perl40234080755editdlrm
perl5.38-x86_64-linux-gnu146480755editdlrm
perl5.38.240234080755editdlrm
perlbug455930755editdlrm
perldoc1250755editdlrm
perlivp108670755editdlrm
perlthanks455930755editdlrm
perror15343920755editdlrm
pgrep352960755editdlrm
phar148850755editdlrm
phar.phar148850755editdlrm
phar.phar7.4148850755editdlrm
phar7.4148850755editdlrm
phar7.4.phar148850755editdlrm
php48139360755editdlrm
php7.448139360755editdlrm
pic2007680755editdlrm
pico2790400755editdlrm
piconv83600755editdlrm
pidof268560755editdlrm
pidstat516560755editdlrm
pidwait352960755editdlrm
pinentry600560755editdlrm
pinentry-curses600560755editdlrm
ping898000755editdlrm
ping4898000755editdlrm
ping6898000755editdlrm
pinky393360755editdlrm
pkaction187360755editdlrm
pkcheck228320755editdlrm
pkcon556080755editdlrm
pkill352960755editdlrm
pkmon228400755editdlrm
pkttyagent228320755editdlrm
pl2pm45360755editdlrm
pldd229760755editdlrm
plymouth474080755editdlrm
pmap352240755editdlrm
pod2html40410755editdlrm
pod2man188980755editdlrm
pod2text131120755editdlrm
pod2usage41070755editdlrm
podchecker36580755editdlrm
pollinate87440755editdlrm
pr722720755editdlrm
preconv598800755editdlrm
printenv352080755editdlrm
printf557440755editdlrm
prlimit275360755editdlrm
pro10030755editdlrm
prove136590755editdlrm
prtstat188160755editdlrm
ps1464240755editdlrm
psfaddtable229040755editdlrm
psfgettable229040755editdlrm
psfstriptable229040755editdlrm
psfxtable229040755editdlrm
pslog146400755editdlrm
pstree361680755editdlrm
pstree.x11361680755editdlrm
ptar35660755editdlrm
ptardiff26450755editdlrm
ptargrep43950755editdlrm
ptx558480755editdlrm
purge-old-kernels11490755editdlrm
pwd353360755editdlrm
pwdx147200755editdlrm
py3clean78160755editdlrm
py3compile133140755editdlrm
py3versions128160755editdlrm
pybabel9560755editdlrm
pybabel-python39560755editdlrm
pydoc3800755editdlrm
pydoc3.12800755editdlrm
pygettext3242240755editdlrm
pygettext3.12242240755editdlrm
pygmentize2150755editdlrm
pyhtmlizer32220755editdlrm
pyserial-miniterm9750755editdlrm
pyserial-ports9690755editdlrm
python380209280755editdlrm
python3.1280209280755editdlrm
pzstd7071120755editdlrm
qmi-firmware-update1721280755editdlrm
qmi-network164280755editdlrm
qmicli6009280755editdlrm
rbash14460240755editdlrm
rdma1049760755editdlrm
readlink434320755editdlrm
realpath434320755editdlrm
red890755editdlrm
rename.ul229120755editdlrm
renice147200755editdlrm
rescan-scsi-bus.sh389640755editdlrm
reset269440755editdlrm
resizecons270960755editdlrm
resizepart229120755editdlrm
resolvectl1624800755editdlrm
rev147200755editdlrm
rgrep300755editdlrm
rm599120755editdlrm
rmdir475280755editdlrm
rnano2790400755editdlrm
routel16580755editdlrm
rrsync126390755editdlrm
rsync5346800755editdlrm
rsync-ssl51360755editdlrm
rtla16220755editdlrm
rtstat232000755editdlrm
run-one35920755editdlrm
run-one-constantly35920755editdlrm
run-one-until-failure35920755editdlrm
run-one-until-success35920755editdlrm
run-parts274640755editdlrm
run-this-one35920755editdlrm
runcon353360755editdlrm
rview41306400755editdlrm
rvim41306400755editdlrm
sadf3914880755editdlrm
sar1406800755editdlrm
sar.sysstat1406800755editdlrm
savelog104870755editdlrm
sbattach230800755editdlrm
sbkeysync355760755editdlrm
sbsiglist149520755editdlrm
sbsign355360755editdlrm
sbvarsign232800755editdlrm
sbverify313440755editdlrm
scalar6849920755editdlrm
scandeps66230755editdlrm
scp1378160755editdlrm
screen4897200755editdlrm
screendump146400755editdlrm
script556800755editdlrm
scriptlive433920755editdlrm
scriptreplay352000755editdlrm
scsi_logging_level85850755editdlrm
scsi_mandat36020755editdlrm
scsi_readcap13270755editdlrm
scsi_ready11210755editdlrm
scsi_satl38300755editdlrm
scsi_start12850755editdlrm
scsi_stop14740755editdlrm
scsi_temperature9360755editdlrm
sdiff516000755editdlrm
sed1132240755editdlrm
select-editor24500755editdlrm
sensible-browser15830755editdlrm
sensible-editor15560755editdlrm
sensible-pager9210755editdlrm
sensible-terminal11760755editdlrm
seq517200755editdlrm
setarch272880755editdlrm
setfont557680755editdlrm
setkeycodes147120755editdlrm
setleds188720755editdlrm
setlogcons147120755editdlrm
setmetamode147520755editdlrm
setpci311120755editdlrm
setpriv393040755editdlrm
setsid147200755editdlrm
setterm352000755editdlrm
setupcon410250755editdlrm
sftp1542800755editdlrm
sg406644755editdlrm
sginfo778320755editdlrm
sgm_dd351360755editdlrm
sgp_dd474240755editdlrm
sg_bg_ctl148560755editdlrm
sg_compare_and_write275600755editdlrm
sg_copy_results238560755editdlrm
sg_dd556320755editdlrm
sg_decode_sense151120755editdlrm
sg_emc_trespass146480755editdlrm
sg_format402960755editdlrm
sg_get_config362240755editdlrm
sg_get_elem_status274320755editdlrm
sg_get_lba_status234960755editdlrm
sg_ident149520755editdlrm
sg_inq1183840755editdlrm
sg_logs1504560755editdlrm
sg_luns233360755editdlrm
sg_map187440755editdlrm
sg_map26273440755editdlrm
sg_modes471840755editdlrm
sg_opcodes358480755editdlrm
sg_persist369440755editdlrm
sg_prevent148560755editdlrm
sg_raw275600755editdlrm
sg_rbuf232720755editdlrm
sg_rdac187440755editdlrm
sg_read269440755editdlrm
sg_readcap233360755editdlrm
sg_read_attr375280755editdlrm
sg_read_block_limits148880755editdlrm
sg_read_buffer282240755editdlrm
sg_read_long150480755editdlrm
sg_reassign191120755editdlrm
sg_referrals150160755editdlrm
sg_rep_pip149200755editdlrm
sg_rep_zones274400755editdlrm
sg_requests233040755editdlrm
sg_reset150160755editdlrm
sg_reset_wp149520755editdlrm
sg_rmsn148560755editdlrm
sg_rtpg149520755editdlrm
sg_safte232400755editdlrm
sg_sanitize276560755editdlrm
sg_sat_identify191760755editdlrm
sg_sat_phy_event194640755editdlrm
sg_sat_read_gplog191760755editdlrm
sg_sat_set_features191440755editdlrm
sg_scan188240755editdlrm
sg_seek193360755editdlrm
sg_senddiag278480755editdlrm
sg_ses1228480755editdlrm
sg_ses_microcode280160755editdlrm
sg_start193040755editdlrm
sg_stpg232720755editdlrm
sg_stream_ctl191440755editdlrm
sg_sync150160755editdlrm
sg_test_rwbuf190480755editdlrm
sg_timestamp233760755editdlrm
sg_turs273360755editdlrm
sg_unmap233040755editdlrm
sg_verify234640755editdlrm
sg_vpd1212640755editdlrm
sg_write_buffer278880755editdlrm
sg_write_long151120755editdlrm
sg_write_same275920755editdlrm
sg_write_verify274320755editdlrm
sg_write_x569360755editdlrm
sg_wr_mode232720755editdlrm
sg_xcopy433360755editdlrm
sg_zone152160755editdlrm
sh1297840755editdlrm
sha1sum393360755editdlrm
sha224sum393360755editdlrm
sha256sum393360755editdlrm
sha384sum393360755editdlrm
sha512sum393360755editdlrm
shasum99820755editdlrm
showconsolefont188080755editdlrm
showkey188080755editdlrm
shred558160755editdlrm
shuf476240755editdlrm
skill270480755editdlrm
slabtop229760755editdlrm
sleep353360755editdlrm
slogin8468880755editdlrm
snap226930160755editdlrm
snapctl79431600755editdlrm
snapfuse391440755editdlrm
snice270480755editdlrm
soelim353040755editdlrm
sort1052720755editdlrm
sos6120755editdlrm
sos-collector10620755editdlrm
sosreport10540755editdlrm
splain194490755editdlrm
split562560755editdlrm
splitfont146400755editdlrm
sqfscat1514480755editdlrm
sqfstar2938320755editdlrm
ss1321680755editdlrm
ssh8468880755editdlrm
ssh-add3014880755editdlrm
ssh-agent3096882755editdlrm
ssh-argv014550755editdlrm
ssh-copy-id130780755editdlrm
ssh-import-id9850755editdlrm
ssh-import-id-gh7850755editdlrm
ssh-import-id-lp7850755editdlrm
ssh-keygen4530560755editdlrm
ssh-keyscan3383680755editdlrm
stat885920755editdlrm
static-sh21246080755editdlrm
stdbuf517200755editdlrm
strace20874320755editdlrm
strace-log-merge18210755editdlrm
streamzip80610755editdlrm
stty804080755editdlrm
su556804755editdlrm
sudo2779364755editdlrm
sudoedit2779364755editdlrm
sudoreplay982560755editdlrm
sum352400755editdlrm
sync352400755editdlrm
systemctl15013040755editdlrm
systemd1008160755editdlrm
systemd-ac-power147920755editdlrm
systemd-analyze2036240755editdlrm
systemd-ask-password190240755editdlrm
systemd-cat188960755editdlrm
systemd-cgls231120755editdlrm
systemd-cgtop393920755editdlrm
systemd-confext559520755editdlrm
systemd-creds437440755editdlrm
systemd-cryptenroll726240755editdlrm
systemd-cryptsetup808400755editdlrm
systemd-delta270800755editdlrm
systemd-detect-virt188880755editdlrm
systemd-escape229840755editdlrm
systemd-firstboot602320755editdlrm
systemd-hwdb1584560755editdlrm
systemd-id128229840755editdlrm
systemd-inhibit230080755editdlrm
systemd-machine-id-setup190720755editdlrm
systemd-mount520000755editdlrm
systemd-notify273040755editdlrm
systemd-path188880755editdlrm
systemd-repart1999120755editdlrm
systemd-run683920755editdlrm
systemd-socket-activate311760755editdlrm
systemd-stdio-bridge229920755editdlrm
systemd-sysext559520755editdlrm
systemd-sysusers682240755editdlrm
systemd-tmpfiles1174480755editdlrm
systemd-tty-ask-password-agent352720755editdlrm
systemd-umount520000755editdlrm
tabs187440755editdlrm
tac393360755editdlrm
tail640320755editdlrm
tapestat270720755editdlrm
tar4402640755editdlrm
taskset311040755editdlrm
tbl1377040755editdlrm
tclsh144880755editdlrm
tclsh8.6144880755editdlrm
tcpdump12739760755editdlrm
tee394320755editdlrm
telnet1821200755editdlrm
tempfile146480755editdlrm
test475520755editdlrm
tic925840755editdlrm
time271600755editdlrm
timedatectl475600755editdlrm
timeout398800755editdlrm
tkconch32270755editdlrm
tload229280755editdlrm
tmux11026080755editdlrm
tnftp1872880755editdlrm
toe228400755editdlrm
top1348640755editdlrm
touch967760755editdlrm
tput269680755editdlrm
tr476240755editdlrm
trace-cmd4458560755editdlrm
tracepath185840755editdlrm
trial32190755editdlrm
troff7440560755editdlrm
true269360755editdlrm
truncate394320755editdlrm
tset269440755editdlrm
tsort476240755editdlrm
tty353360755editdlrm
turbostat16220755editdlrm
twist32390755editdlrm
twistd32200755editdlrm
tzselect153780755editdlrm
ua10030755editdlrm
ubuntu-advantage10030755editdlrm
ubuntu-bug23220755editdlrm
ubuntu-distro-info275360755editdlrm
ubuntu-security-status227830755editdlrm
ucf416570755editdlrm
ucfq193670755editdlrm
ucfr111110755editdlrm
uclampset311040755editdlrm
udevadm14436320755editdlrm
udisksctl638720755editdlrm
ul229200755editdlrm
umount392964755editdlrm
uname353360755editdlrm
unattended-upgrade995470755editdlrm
unattended-upgrades995470755editdlrm
uncompress23460755editdlrm
unexpand394560755editdlrm
unicode_start27720755editdlrm
unicode_stop5280755editdlrm
uniq394320755editdlrm
unlink353360755editdlrm
unlzma890080755editdlrm
unmkinitramfs37880755editdlrm
unshare436240755editdlrm
unsquashfs1514480755editdlrm
unxz890080755editdlrm
unzip1786080755editdlrm
unzipsfx762080755editdlrm
unzstd10227600755editdlrm
update-alternatives597840755editdlrm
update-microcode-initrd11740755editdlrm
update-mime-database761120755editdlrm
uptime147200755editdlrm
usb-devices49440755editdlrm
usbhid-dump311120755editdlrm
usbip16220755editdlrm
usbipd16220755editdlrm
usbreset146400755editdlrm
users353360755editdlrm
utmpdump229120755editdlrm
uuidgen188160755editdlrm
uuidparse229120755editdlrm
varlinkctl311760755editdlrm
vcs-run69120755editdlrm
vdir1423120755editdlrm
VGAuthService1336720755editdlrm
vi41306400755editdlrm
view41306400755editdlrm
vigpg26400755editdlrm
vim41306400755editdlrm
vim.basic41306400755editdlrm
vim.tiny17363920755editdlrm
vimdiff41306400755editdlrm
vimtutor21540755editdlrm
vm-support100660755editdlrm
vmhgfs-fuse478480755editdlrm
vmstat397120755editdlrm
vmtoolsd763520755editdlrm
vmware-alias-import435440755editdlrm
vmware-checkvm147200755editdlrm
vmware-hgfsclient147200755editdlrm
vmware-namespace-cmd228400755editdlrm
vmware-rpctool187440755editdlrm
vmware-toolbox-cmd559040755editdlrm
vmware-vgauth-cmd187440755editdlrm
vmware-vmblock-fuse233280755editdlrm
vmware-xferlogs331040755editdlrm
w270080755editdlrm
wall229120755editdlrm
watch315840755editdlrm
watchgnupg228400755editdlrm
wc558240755editdlrm
wdctl352240755editdlrm
wget4700320755editdlrm
whatis484160755editdlrm
whereis315760755editdlrm
which10800755editdlrm
which.debianutils10800755editdlrm
whiptail308880755editdlrm
who599280755editdlrm
whoami353360755editdlrm
wifi-status21070755editdlrm
write229200755editdlrm
x86_64272880755editdlrm
x86_energy_perf_policy16220755editdlrm
xargs639120755editdlrm
xauth562800755editdlrm
xdg-user-dir2340755editdlrm
xdg-user-dirs-update268560755editdlrm
xsubpp51670755editdlrm
xxd228160755editdlrm
xz890080755editdlrm
xzcat890080755editdlrm
xzcmp74220755editdlrm
xzdiff74220755editdlrm
xzegrep103330755editdlrm
xzfgrep103330755editdlrm
xzgrep103330755editdlrm
xzless18130755editdlrm
xzmore21900755editdlrm
yes352080755editdlrm
ypdomainname227600755editdlrm
zcat19840755editdlrm
zcmp16780755editdlrm
zdiff64470755editdlrm
zdump310080755editdlrm
zegrep290755editdlrm
zfgrep290755editdlrm
zforce20810755editdlrm
zgrep81030755editdlrm
zipdetails701930755editdlrm
zipgrep29590755editdlrm
zipinfo1786080755editdlrm
zless22060755editdlrm
zmore18420755editdlrm
znew45770755editdlrm
zstd10227600755editdlrm
zstdcat10227600755editdlrm
zstdgrep38690755editdlrm
zstdless1970755editdlrm
zstdmt10227600755editdlrm
[557440755editdlrm
Edit: /usr/bin/zipdetails (70193B)
#!/usr/bin/perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; # ^ Run only under a shell #!/usr/bin/perl # zipdetails # # Display info on the contents of a Zip file # use 5.010; # for unpack "Q<" BEGIN { # Check for a 32-bit Perl if (!eval { pack "Q", 1 }) { warn "zipdetails requires 64 bit integers, ", "this Perl has 32 bit integers.\n"; exit(1); } } BEGIN { pop @INC if $INC[-1] eq '.' } use strict; use warnings ; no warnings 'portable'; # for unpacking > 2^32 use feature 'state'; use IO::File; use Encode; use Getopt::Long; my $VERSION = "2.104" ; use constant MAX32 => 0xFFFFFFFF ; # Compression types use constant ZIP_CM_STORE => 0 ; use constant ZIP_CM_IMPLODE => 6 ; use constant ZIP_CM_DEFLATE => 8 ; use constant ZIP_CM_BZIP2 => 12 ; use constant ZIP_CM_LZMA => 14 ; use constant ZIP_CM_PPMD => 98 ; # General Purpose Flag use constant ZIP_GP_FLAG_ENCRYPTED_MASK => (1 << 0) ; use constant ZIP_GP_FLAG_STREAMING_MASK => (1 << 3) ; use constant ZIP_GP_FLAG_PATCHED_MASK => (1 << 5) ; use constant ZIP_GP_FLAG_STRONG_ENCRYPTED_MASK => (1 << 6) ; use constant ZIP_GP_FLAG_LZMA_EOS_PRESENT => (1 << 1) ; use constant ZIP_GP_FLAG_LANGUAGE_ENCODING => (1 << 11) ; # Internal File Attributes use constant ZIP_IFA_TEXT_MASK => 1; # Signatures for each of the headers use constant ZIP_LOCAL_HDR_SIG => 0x04034b50; use constant ZIP_DATA_HDR_SIG => 0x08074b50; use constant ZIP_CENTRAL_HDR_SIG => 0x02014b50; use constant ZIP_END_CENTRAL_HDR_SIG => 0x06054b50; use constant ZIP64_END_CENTRAL_REC_HDR_SIG => 0x06064b50; use constant ZIP64_END_CENTRAL_LOC_HDR_SIG => 0x07064b50; use constant ZIP_ARCHIVE_EXTRA_DATA_SIG => 0x08064b50; use constant ZIP_DIGITAL_SIGNATURE_SIG => 0x05054b50; use constant ZIP_ARCHIVE_EXTRA_DATA_RECORD_SIG => 0x08064b50; # Extra sizes use constant ZIP_EXTRA_HEADER_SIZE => 2 ; use constant ZIP_EXTRA_MAX_SIZE => 0xFFFF ; use constant ZIP_EXTRA_SUBFIELD_ID_SIZE => 2 ; use constant ZIP_EXTRA_SUBFIELD_LEN_SIZE => 2 ; use constant ZIP_EXTRA_SUBFIELD_HEADER_SIZE => ZIP_EXTRA_SUBFIELD_ID_SIZE + ZIP_EXTRA_SUBFIELD_LEN_SIZE; use constant ZIP_EXTRA_SUBFIELD_MAX_SIZE => ZIP_EXTRA_MAX_SIZE - ZIP_EXTRA_SUBFIELD_HEADER_SIZE; my %ZIP_CompressionMethods = ( 0 => 'Stored', 1 => 'Shrunk', 2 => 'Reduced compression factor 1', 3 => 'Reduced compression factor 2', 4 => 'Reduced compression factor 3', 5 => 'Reduced compression factor 4', 6 => 'Imploded', 7 => 'Reserved for Tokenizing compression algorithm', 8 => 'Deflated', 9 => 'Enhanced Deflating using Deflate64(tm)', 10 => 'PKWARE Data Compression Library Imploding', 11 => 'Reserved by PKWARE', 12 => 'BZIP2', 13 => 'Reserved by PKWARE', 14 => 'LZMA', 15 => 'Reserved by PKWARE', 16 => 'IBM z/OS CMPSC Compression', 17 => 'Reserved by PKWARE', 18 => 'File is compressed using IBM TERSE (new)', 19 => 'IBM LZ77 z Architecture (PFS)', 93 => 'Zstandard', 94 => 'MP3', 95 => 'XZ', 96 => 'WinZip JPEG Compression', 97 => 'WavPack compressed data', 98 => 'PPMd version I, Rev 1', 99 => 'AES Encryption', ); my %OS_Lookup = ( 0 => "MS-DOS", 1 => "Amiga", 2 => "OpenVMS", 3 => "Unix", 4 => "VM/CMS", 5 => "Atari ST", 6 => "HPFS (OS/2, NT 3.x)", 7 => "Macintosh", 8 => "Z-System", 9 => "CP/M", 10 => "Windows NTFS or TOPS-20", 11 => "MVS or NTFS", 12 => "VSE or SMS/QDOS", 13 => "Acorn RISC OS", 14 => "VFAT", 15 => "alternate MVS", 16 => "BeOS", 17 => "Tandem", 18 => "OS/400", 19 => "OS/X (Darwin)", 30 => "AtheOS/Syllable", ); my %Lookup = ( ZIP_LOCAL_HDR_SIG, \&LocalHeader, ZIP_DATA_HDR_SIG, \&DataHeader, ZIP_CENTRAL_HDR_SIG, \&CentralHeader, ZIP_END_CENTRAL_HDR_SIG, \&EndCentralHeader, ZIP64_END_CENTRAL_REC_HDR_SIG, \&Zip64EndCentralHeader, ZIP64_END_CENTRAL_LOC_HDR_SIG, \&Zip64EndCentralLocator, # TODO - Archive Encryption Headers & digital signature #ZIP_ARCHIVE_EXTRA_DATA_RECORD_SIG #ZIP_DIGITAL_SIGNATURE_SIG #ZIP_ARCHIVE_EXTRA_DATA_SIG ); my %Extras = ( 0x0001, ['ZIP64', \&decode_Zip64], 0x0007, ['AV Info', undef], 0x0008, ['Extended Language Encoding', undef], 0x0009, ['OS/2 extended attributes', undef], 0x000a, ['NTFS FileTimes', \&decode_NTFS_Filetimes], 0x000c, ['OpenVMS', undef], 0x000d, ['Unix', undef], 0x000e, ['Stream & Fork Descriptors', undef], 0x000f, ['Patch Descriptor', undef], 0x0014, ['PKCS#7 Store for X.509 Certificates', undef], 0x0015, ['X.509 Certificate ID and Signature for individual file', undef], 0x0016, ['X.509 Certificate ID for Central Directory', undef], 0x0017, ['Strong Encryption Header', undef], 0x0018, ['Record Management Controls', undef], 0x0019, ['PKCS#7 Encryption Recipient Certificate List', undef], 0x0020, ['Reserved for Timestamp record', undef], 0x0021, ['Policy Decryption Key Record', undef], 0x0022, ['Smartcrypt Key Provider Record', undef], 0x0023, ['Smartcrypt Policy Key Data Record', undef], # The Header ID mappings defined by Info-ZIP and third parties are: 0x0065, ['IBM S/390 attributes - uncompressed', \&decodeMVS], 0x0066, ['IBM S/390 attributes - compressed', undef], 0x07c8, ['Info-ZIP Macintosh (old, J. Lee)', undef], 0x2605, ['ZipIt Macintosh (first version)', undef], 0x2705, ['ZipIt Macintosh v 1.3.5 and newer (w/o full filename)', undef], 0x2805, ['ZipIt Macintosh v 1.3.5 and newer', undef], 0x334d, ["Info-ZIP Macintosh (new, D. Haase's 'Mac3' field)", undef], 0x4154, ['Tandem NSK', undef], 0x4341, ['Acorn/SparkFS (David Pilling)', undef], 0x4453, ['Windows NT security descriptor', \&decode_NT_security], 0x4690, ['POSZIP 4690', undef], 0x4704, ['VM/CMS', undef], 0x470f, ['MVS', undef], 0x4854, ['Theos, old inofficial port', undef], 0x4b46, ['FWKCS MD5 (see below)', undef], 0x4c41, ['OS/2 access control list (text ACL)', undef], 0x4d49, ['Info-ZIP OpenVMS (obsolete)', undef], 0x4d63, ['Macintosh SmartZIP, by Macro Bambini', undef], 0x4f4c, ['Xceed original location extra field', undef], 0x5356, ['AOS/VS (binary ACL)', undef], 0x5455, ['Extended Timestamp', \&decode_UT], 0x554e, ['Xceed unicode extra field', \&decode_Xceed_unicode], 0x5855, ['Info-ZIP Unix (original; also OS/2, NT, etc.)', \&decode_UX], 0x5a4c, ['ZipArchive Unicode Filename', undef], 0x5a4d, ['ZipArchive Offsets Array', undef], 0x6375, ['Info-ZIP Unicode Comment', \&decode_up ], 0x6542, ['BeOS (BeBox, PowerMac, etc.)', undef], 0x6854, ['Theos', undef], 0x7075, ['Info-ZIP Unicode Path', \&decode_up ], 0x756e, ['ASi Unix', undef], 0x7441, ['AtheOS (AtheOS/Syllable attributes)', undef], 0x7855, ['Unix Extra type 2', \&decode_Ux], 0x7875, ['Unix Extra Type 3', \&decode_ux], 0x9901, ['AES Encryption', \&decode_AES], 0xa11e, ['Data Stream Alignment', \&decode_DataStreamAlignment], 0xA220, ['Open Packaging Growth Hint', \&decode_GrowthHint ], 0xCAFE, ['Java Executable', \&decode_Java_exe], 0xfb4a, ['SMS/QDOS', undef], ); my $FH; my $ZIP64 = 0 ; my $NIBBLES = 8; my $LocalHeaderCount = 0; my $CentralHeaderCount = 0; my $START; my $OFFSET = 0 ; my $TRAILING = 0 ; my $PAYLOADLIMIT = 256; my $ZERO = 0 ; my $APK = 0 ; my $START_APK = 0; my $APK_LEN = 0; my $SEEN = Seen->new(); sub prOff { my $offset = shift; my $s = offset($OFFSET); $OFFSET += $offset; return $s; } sub offset { my $v = shift ; sprintf("%0${NIBBLES}X", $v); } my ($OFF, $LENGTH, $CONTENT, $TEXT, $VALUE) ; my $FMT1 ; my $FMT2 ; sub setupFormat { my $wantVerbose = shift ; my $nibbles = shift; my $width = '@' . ('>' x ($nibbles -1)); my $space = " " x length($width); my $fmt ; if ($wantVerbose) { $FMT1 = " format STDOUT = $width $width ^<<<<<<<<<<<^<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< \$OFF, \$LENGTH, \$CONTENT, \$TEXT, \$VALUE $space $space ^<<<<<<<<<<<^<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ \$CONTENT, \$TEXT, \$VALUE . "; $FMT2 = " format STDOUT = $width $width ^<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< \$OFF, \$LENGTH, \$CONTENT, \$TEXT, \$VALUE $space $space ^<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ \$CONTENT, \$TEXT, \$VALUE . " ; } else { $FMT1 = " format STDOUT = $width ^<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< \$OFF, \$TEXT, \$VALUE $space ^<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ \$TEXT, \$VALUE . "; $FMT2 = " format STDOUT = $width ^<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< \$OFF, \$TEXT, \$VALUE $space ^<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ \$TEXT, \$VALUE . " ; } eval "$FMT1"; $| = 1; } sub mySpr { my $format = shift ; return "" if ! defined $format; return $format unless @_ ; return sprintf $format, @_ ; } sub out0 { my $size = shift; my $text = shift; my $format = shift; $OFF = prOff($size); $LENGTH = offset($size) ; $CONTENT = '...'; $TEXT = $text; $VALUE = mySpr $format, @_; write; skip($FH, $size); } sub xDump { my $input = shift; $input =~ tr/\0-\37\177-\377/./; return $input; } sub hexDump { my $input = shift; my $out = unpack('H*', $input) ; $out =~ s#(..)# $1#g ; $out =~ s/^ //; $out = uc $out; return $out; } sub hexValue { return sprintf("%X", $_[0]); } sub out { my $data = shift; my $text = shift; my $format = shift; my $size = length($data) ; $OFF = prOff($size); $LENGTH = offset($size) ; $CONTENT = hexDump($data); $TEXT = $text; $VALUE = mySpr $format, @_; no warnings; write; } sub out1 { my $text = shift; my $format = shift; $OFF = ''; $LENGTH = '' ; $CONTENT = ''; $TEXT = $text; $VALUE = mySpr $format, @_; write; } sub out2 { my $data = shift ; my $text = shift ; my $format = shift; my $size = length($data) ; $OFF = prOff($size); $LENGTH = offset($size); $CONTENT = hexDump($data); $TEXT = $text; $VALUE = mySpr $format, @_; no warnings; eval "$FMT2"; write ; eval "$FMT1"; } sub Value { my $letter = shift; my @value = @_; if ($letter eq 'C') { return Value_C(@value) } elsif ($letter eq 'v') { return Value_v(@value) } elsif ($letter eq 'V') { return Value_V(@value) } elsif ($letter eq 'Q<') { return Value_Q(@value) } else { die "here letter $letter"} } sub outer { my $name = shift ; my $unpack = shift ; my $size = shift ; my $cb1 = shift ; my $cb2 = shift ; myRead(my $buff, $size); my (@value) = unpack $unpack, $buff; my $hex = Value($unpack, @value); if (defined $cb1) { my $v ; if (ref $cb1 eq 'CODE') { $v = $cb1->(@value) ; } else { $v = $cb1 ; } $v = "'" . $v unless $v =~ /^'/; $v .= "'" unless $v =~ /'$/; $hex .= " $v" ; } out $buff, $name, $hex ; $cb2->(@value) if defined $cb2 ; return $value[0]; } sub out_C { my $name = shift ; my $cb1 = shift ; my $cb2 = shift ; outer($name, 'C', 1, $cb1, $cb2); } sub out_v { my $name = shift ; my $cb1 = shift ; my $cb2 = shift ; outer($name, 'v', 2, $cb1, $cb2); } sub out_V { my $name = shift ; my $cb1 = shift ; my $cb2 = shift ; outer($name, 'V', 4, $cb1, $cb2); } sub out_Q { my $name = shift ; my $cb1 = shift ; my $cb2 = shift ; outer($name, 'Q<', 8, $cb1, $cb2); } sub outSomeData { my $size = shift; my $message = shift; my $redact = shift ; if ($size > 0) { if ($size > $PAYLOADLIMIT) { my $before = $FH->tell(); out0 $size, $message; } else { myRead(my $buffer, $size ); $buffer = "X" x $size if $redact; out $buffer, $message, xDump $buffer ; } } } sub unpackValue_C { Value_v(unpack "C", $_[0]); } sub Value_C { sprintf "%02X", $_[0]; } sub unpackValue_v { Value_v(unpack "v", $_[0]); } sub Value_v { sprintf "%04X", $_[0]; } sub unpackValue_V { Value_V(unpack "V", $_[0]); } sub Value_V { my $v = defined $_[0] ? $_[0] : 0; sprintf "%08X", $v; } sub unpackValue_Q { my $v = unpack ("Q<", $_[0]); Value_Q($v); } sub Value_Q { my $v = shift ; sprintf "%016X", $v; } sub read_Q { my $b ; myRead($b, 8); return ($b, unpack ("Q<" , $b)); } sub read_V { my $b ; myRead($b, 4); return ($b, unpack ("V", $b)); } sub read_v { my $b ; myRead($b, 2); return ($b, unpack "v", $b); } sub read_C { my $b ; myRead($b, 1); return ($b, unpack "C", $b); } sub seekTo { my $offset = shift ; my $loc = shift ; $loc = SEEK_SET if ! defined $loc ; $FH->seek($offset, $loc); $OFFSET = $FH->tell(); } sub scanForSignature { my %sigs = map { $_ => 1 } map { substr $_, 2, 2 } # don't want the initial "PK" map { pack "V", $_ } ( ZIP_LOCAL_HDR_SIG , ZIP_DATA_HDR_SIG , ZIP_CENTRAL_HDR_SIG , ZIP_END_CENTRAL_HDR_SIG , ZIP64_END_CENTRAL_REC_HDR_SIG , ZIP64_END_CENTRAL_LOC_HDR_SIG , # ZIP_ARCHIVE_EXTRA_DATA_SIG , # ZIP_DIGITAL_SIGNATURE_SIG , # ZIP_ARCHIVE_EXTRA_DATA_RECORD_SIG , ); my $start = $FH->tell(); my $last = ''; my $offset = 0; my $buffer ; BUFFER: while ($FH->read($buffer, 1024 * 1000)) { my $combine = $last . $buffer ; my $ix = 0; while (1) { $ix = index($combine, "PK", $ix) ; if ($ix == -1) { $last = ''; next BUFFER; } my $rest = substr($combine, $ix + 2, 2); if (! $sigs{$rest}) { $ix += 2; next; } # possible match my $here = $FH->tell(); seekTo($here - length($combine) + $ix); return 1; } $last = substr($combine, $ix+4); } return 0; } my $is64In32 = 0; my $opt_verbose = 0; my $opt_scan = 0; my $opt_Redact = 0; my $opt_utc = 0; $Getopt::Long::bundling = 1 ; GetOptions("h" => \&Usage, "v" => \$opt_verbose, "scan" => \$opt_scan, "redact" => \$opt_Redact, "utc" => \$opt_utc, "version" => sub { print "$VERSION\n"; exit }, ) or Usage("Invalid command line option\n"); Usage("No zipfile") unless @ARGV == 1; my $filename = shift @ARGV; die "$filename does not exist\n" unless -e $filename ; die "$filename not a standard file\n" unless -f $filename ; $FH = IO::File->new( "<$filename" ) or die "Cannot open $filename: $!\n"; my $FILELEN = -s $filename ; $TRAILING = -s $filename ; $NIBBLES = nibbles(-s $filename) ; die "$filename too short to be a zip file\n" if $FILELEN < 22 ; setupFormat($opt_verbose, $NIBBLES); if(0) { # Sanity check that this is a Zip file my ($buffer, $signature) = read_V(); warn "$filename doesn't look like a zip file\n" if $signature != ZIP_LOCAL_HDR_SIG ; $FH->seek(0, SEEK_SET) ; } my @Messages = (); if ($opt_scan) { my $foundCentralHeader = 0; my $lastEndsAt = 0; while(scanForSignature()) { my $here = $FH->tell(); my ($buffer, $signature) = read_V(); # check for an APK header directly before the first central header if ($signature == ZIP_CENTRAL_HDR_SIG && $foundCentralHeader == 0) { $foundCentralHeader = 1; ($START_APK, $APK, $APK_LEN) = chckForAPKSigningBlock($FH, $here) ; if ($START_APK) { seekTo($lastEndsAt+4); scanApkBlock(); seekTo($here); next; } seekTo($here + 4); } my $handler = $Lookup{$signature}; $handler->($signature, $buffer); $lastEndsAt = $FH->tell(); seekTo($here + 4) ; } dislayMessages(); exit; } our ($CdExists, $CdOffset, @CentralDirectory) = scanCentralDirectory($FH); die "No Central Directory records found\n" if ! $CdExists ; $OFFSET = 0 ; $FH->seek(0, SEEK_SET) ; outSomeData($START, "PREFIX DATA") if defined $START && $START > 0 ; my $skippedFrom = 0 ; my $skippedContent = 0 ; while (1) { last if $FH->eof(); my $here = $FH->tell(); if ($here >= $TRAILING) { print "\n" ; outSomeData($FILELEN - $TRAILING, "TRAILING DATA"); last; } my ($buffer, $signature) = read_V(); my $handler = $Lookup{$signature}; if (!defined $handler) { if (@CentralDirectory) { # Should be at offset that central directory says my $locOffset = $CentralDirectory[0][0]; my $delta = $locOffset - $here ; if ($here + 4 == $locOffset ) { for (0 .. 3) { $FH->ungetc(ord(substr($buffer, $_, 1))) } outSomeData($delta, "UNEXPECTED PADDING"); next; } } if ($here < $CdOffset) { if ($APK) { scanApkBlock(); next; } # next # if scanForSignature() ; $skippedFrom = $FH->tell() ; $skippedContent = $CdOffset - $skippedFrom ; printf "\nWARNING!\nZip local header not found at offset 0x%X\n", $skippedFrom; printf "Skipping 0x%x bytes to Central Directory...\n", $skippedContent; push @Messages, sprintf("Expected Zip header not found at offset 0x%X, ", $skippedFrom) . sprintf("skipped 0x%X bytes\n", $skippedContent); seekTo($CdOffset); next; } else { printf "\n\nUnexpected END at offset %08X, value %s\n", $here, Value_V($signature); last; } } $ZIP64 = 0 if $signature != ZIP_DATA_HDR_SIG ; $handler->($signature, $buffer); } dislayMessages(); exit ; sub dislayMessages { $SEEN->short_summary(); $SEEN->summary(); if (@Messages) { my $count = scalar @Messages ; print "\nWARNINGS\n\n"; print "* $_\n" for @Messages ; } print "Done\n"; } sub compressionMethod { my $id = shift ; Value_v($id) . " '" . ($ZIP_CompressionMethods{$id} || "Unknown Method") . "'" ; } sub LocalHeader { my $signature = shift ; my $data = shift ; my $from_offset = $FH->tell() - 4; print "\n"; ++ $LocalHeaderCount; my $hexHdrCount = sprintf("%X", $LocalHeaderCount) ; out $data, "LOCAL HEADER #$hexHdrCount" , Value_V($signature); my $buffer; my ($loc, $CDcompressedLength, $cdZip64, $zip64Sizes, $cdIndex, $cdEntryOffset) ; if (! $opt_scan) { ($loc, $CDcompressedLength, $cdZip64, $zip64Sizes, $cdIndex, $cdEntryOffset) = @{ shift @CentralDirectory } ; # my $cdi = sprintf("%X", $cdIndex) ; # out1 "CENTRAL HEADER #$cdi", sprintf "Offset %s\n", Value_Q($cdEntryOffset); } out_C "Extract Zip Spec", \&decodeZipVer; out_C "Extract OS", \&decodeOS; my ($bgp, $gpFlag) = read_v(); my ($bcm, $compressedMethod) = read_v(); out $bgp, "General Purpose Flag", Value_v($gpFlag) ; GeneralPurposeBits($compressedMethod, $gpFlag); out $bcm, "Compression Method", compressionMethod($compressedMethod) ; out_V "Last Mod Time", sub { getTime(_dosToUnixTime($_[0])) }; my $crc = out_V "CRC"; my $compressedLength = out_V "Compressed Length"; my $uncompressedLength = out_V "Uncompressed Length"; my $filenameLength = out_v "Filename Length"; my $extraLength = out_v "Extra Length"; my $filename ; myRead($filename, $filenameLength); outputFilename($filename); my $cl64 = $compressedLength; my %ExtraContext = (); if ($extraLength) { my @z64 = ($uncompressedLength, $compressedLength, 1, 1); $ExtraContext{Zip64} = \@z64 ; $ExtraContext{InCentralDir} = 0; walkExtra($extraLength, \%ExtraContext); } my @msg ; # if ($cdZip64 && ! $ZIP64) # { # # Central directory said this was Zip64 # # some zip files don't have the Zip64 field in the local header # # seems to be a streaming issue. # push @msg, "Missing Zip64 extra field in Local Header #$hexHdrCount\n"; # if (! $zip64Sizes) # { # # Central has a ZIP64 entry that doesn't have sizes # # Local doesn't have a Zip 64 at all # push @msg, "Unzip may complain about 'overlapped components' #$hexHdrCount\n"; # } # else # { # $ZIP64 = 1 # } # } my $size = 0; $size = printAes(\%ExtraContext) if $compressedMethod == 99 ; $size += printLzmaProperties() if $compressedMethod == ZIP_CM_LZMA ; $CDcompressedLength = $compressedLength if $opt_scan ; $CDcompressedLength -= $size; if ($CDcompressedLength) { outSomeData($CDcompressedLength, "PAYLOAD", $opt_Redact) ; } if ($compressedMethod == 99) { my $auth ; myRead($auth, 10); out $auth, "AES Auth", hexDump($auth); } print "WARNING: $_" for @msg; push @Messages, @msg ; # $SEEN->save("LOCAL HEADER #" . sprintf("%X", $LocalHeaderCount), $filename, $from_offset, $from_offset + $CDcompressedLength); } sub redactFilename { my $filename = shift; # Redact everything apart from directory seperators $filename =~ s([^/])(X)g if $opt_Redact; return $filename; } sub outputFilename { my $filename = shift; $filename = redactFilename($filename) ; if (length $filename > 256) { my $f = substr($filename, 0, 256) ; out $f, "Filename", "'". $f . "' ..."; } else { out $filename, "Filename", "'". $filename . "'"; } } sub CentralHeader { my $signature = shift ; my $data = shift ; my $from_offset = $FH->tell() - 4; ++ $CentralHeaderCount; print "\n"; out $data, "CENTRAL HEADER #" . sprintf("%X", $CentralHeaderCount) . "", Value_V($signature); my $buffer; out_C "Created Zip Spec", \&decodeZipVer; out_C "Created OS", \&decodeOS; out_C "Extract Zip Spec", \&decodeZipVer; out_C "Extract OS", \&decodeOS; my ($bgp, $gpFlag) = read_v(); my ($bcm, $compressedMethod) = read_v(); out $bgp, "General Purpose Flag", Value_v($gpFlag) ; GeneralPurposeBits($compressedMethod, $gpFlag); out $bcm, "Compression Method", compressionMethod($compressedMethod) ; out_V "Last Mod Time", sub { getTime(_dosToUnixTime($_[0])) }; my $crc = out_V "CRC"; my $compressedLength = out_V "Compressed Length"; my $uncompressedLength = out_V "Uncompressed Length"; my $filenameLength = out_v "Filename Length"; my $extraLength = out_v "Extra Length"; my $comment_length = out_v "Comment Length"; my $disk_start = out_v "Disk Start"; my $int_file_attrib = out_v "Int File Attributes"; out1 "[Bit 0]", $int_file_attrib & 1 ? "1 Text Data" : "0 'Binary Data'"; my $ext_file_attrib = out_V "Ext File Attributes"; out1 "[Bit 0]", "Read-Only" if $ext_file_attrib & 0x01 ; out1 "[Bit 1]", "Hidden" if $ext_file_attrib & 0x02 ; out1 "[Bit 2]", "System" if $ext_file_attrib & 0x04 ; out1 "[Bit 3]", "Label" if $ext_file_attrib & 0x08 ; out1 "[Bit 4]", "Directory" if $ext_file_attrib & 0x10 ; out1 "[Bit 5]", "Archive" if $ext_file_attrib & 0x20 ; my $lcl_hdr_offset = out_V "Local Header Offset"; my $filename ; myRead($filename, $filenameLength); outputFilename($filename); my %ExtraContext = ( CRC => $crc, LocalHdrOffset => $lcl_hdr_offset, CompressedLength => $compressedLength); if ($extraLength) { my @z64 = ($uncompressedLength, $compressedLength, $lcl_hdr_offset, $disk_start); $ExtraContext{Zip64} = \@z64 ; $ExtraContext{InCentralDir} = 1; walkExtra($extraLength, \%ExtraContext); } if ($comment_length) { my $comment ; myRead($comment, $comment_length); out $comment, "Comment", "'". $comment . "'"; } $SEEN->save("CENTRAL HEADER ref Local #" . sprintf("%X", $CentralHeaderCount), $filename, \%ExtraContext) ; } sub decodeZipVer { my $ver = shift ; my $sHi = int($ver /10) ; my $sLo = $ver % 10 ; #out1 "Zip Spec", "$sHi.$sLo"; "$sHi.$sLo"; } sub decodeOS { my $ver = shift ; $OS_Lookup{$ver} || "Unknown" ; } sub Zip64EndCentralHeader { my $signature = shift ; my $data = shift ; print "\n"; out $data, "ZIP64 END CENTRAL DIR RECORD", Value_V($signature); my $buff; myRead($buff, 8); out $buff, "Size of record", unpackValue_Q($buff); my $size = unpack "Q<", $buff; out_C "Created Zip Spec", \&decodeZipVer; out_C "Created OS", \&decodeOS; out_C "Extract Zip Spec", \&decodeZipVer; out_C "Extract OS", \&decodeOS; out_V "Number of this disk"; out_V "Central Dir Disk no"; out_Q "Entries in this disk"; out_Q "Total Entries"; out_Q "Size of Central Dir"; out_Q "Offset to Central dir"; # TODO - if ($size != 44) { push @Messages, "Unsupported Size field in Zip64EndCentralHeader: should be 44, got $size\n" } } sub Zip64EndCentralLocator { my $signature = shift ; my $data = shift ; print "\n"; out $data, "ZIP64 END CENTRAL DIR LOCATOR", Value_V($signature); out_V "Central Dir Disk no"; out_Q "Offset to Central dir"; out_V "Total no of Disks"; } sub EndCentralHeader { my $signature = shift ; my $data = shift ; print "\n"; out $data, "END CENTRAL HEADER", Value_V($signature); out_v "Number of this disk"; out_v "Central Dir Disk no"; out_v "Entries in this disk"; out_v "Total Entries"; out_V "Size of Central Dir"; out_V "Offset to Central Dir"; my $comment_length = out_v "Comment Length"; if ($comment_length) { my $comment ; myRead($comment, $comment_length); out $comment, "Comment", "'$comment'"; } } sub DataHeader { my $signature = shift ; my $data = shift ; print "\n"; out $data, "STREAMING DATA HEADER", Value_V($signature); out_V "CRC"; if ($ZIP64) { out_Q "Compressed Length" ; out_Q "Uncompressed Length" ; } else { out_V "Compressed Length" ; out_V "Uncompressed Length" ; } } sub GeneralPurposeBits { my $method = shift; my $gp = shift; out1 "[Bit 0]", "1 'Encryption'" if $gp & ZIP_GP_FLAG_ENCRYPTED_MASK; my %lookup = ( 0 => "Normal Compression", 1 => "Maximum Compression", 2 => "Fast Compression", 3 => "Super Fast Compression"); if ($method == ZIP_CM_DEFLATE) { my $mid = ($gp >> 1) & 0x03 ; out1 "[Bits 1-2]", "$mid '$lookup{$mid}'"; } if ($method == ZIP_CM_LZMA) { if ($gp & ZIP_GP_FLAG_LZMA_EOS_PRESENT) { out1 "[Bit 1]", "1 'LZMA EOS Marker Present'" ; } else { out1 "[Bit 1]", "0 'LZMA EOS Marker Not Present'" ; } } if ($method == ZIP_CM_IMPLODE) # Imploding { out1 "[Bit 1]", ($gp & (1 << 1) ? "1 '8k" : "0 '4k") . " Sliding Dictionary'" ; out1 "[Bit 2]", ($gp & (2 << 1) ? "1 '3" : "0 '2" ) . " Shannon-Fano Trees'" ; } out1 "[Bit 3]", "1 'Streamed'" if $gp & ZIP_GP_FLAG_STREAMING_MASK; out1 "[Bit 4]", "1 'Enhanced Deflating'" if $gp & 1 << 4; out1 "[Bit 5]", "1 'Compressed Patched'" if $gp & 1 << 5 ; out1 "[Bit 6]", "1 'Strong Encryption'" if $gp & ZIP_GP_FLAG_STRONG_ENCRYPTED_MASK; out1 "[Bit 11]", "1 'Language Encoding'" if $gp & ZIP_GP_FLAG_LANGUAGE_ENCODING; out1 "[Bit 12]", "1 'Pkware Enhanced Compression'" if $gp & 1 <<12 ; out1 "[Bit 13]", "1 'Encrypted Central Dir'" if $gp & 1 <<13 ; return (); } sub seekSet { my $fh = $_[0] ; my $size = $_[1]; use Fcntl qw(SEEK_SET); seek($fh, $size, SEEK_SET); } sub skip { my $fh = $_[0] ; my $size = $_[1]; use Fcntl qw(SEEK_CUR); seek($fh, $size, SEEK_CUR); } sub myRead { my $got = \$_[0] ; my $size = $_[1]; my $wantSize = $size; $$got = ''; if ($size == 0) { return ; } if ($size > 0) { my $buff ; my $status = $FH->read($buff, $size); return $status if $status < 0; $$got .= $buff ; } my $len = length $$got; die "Truncated file (got $len, wanted $wantSize): $!\n" if length $$got != $wantSize; } sub walkExtra { my $XLEN = shift; my $context = shift; my $buff ; my $offset = 0 ; my $id; my $subLen; my $payload ; my $count = 0 ; while ($offset < $XLEN) { ++ $count; # Detect if there is not enough data for an extra ID and length. # Android zipalign and zipflinger are prime candidates for these # non-standard extra sub-fields. my $remaining = $XLEN - $offset; if ($remaining < ZIP_EXTRA_SUBFIELD_HEADER_SIZE) { # There is not enough left. # Consume whatever is there and return so parsing # can continue. myRead($payload, $remaining); my $data = hexDump($payload); if ($payload =~ /^\x00+$/) { out $payload, "Null Padding in Extra"; } else { out $payload, "Malformed Extra Data", $data; } return undef; } myRead($id, ZIP_EXTRA_SUBFIELD_ID_SIZE); $offset += ZIP_EXTRA_SUBFIELD_ID_SIZE; my $lookID = unpack "v", $id ; if ($lookID == 0) { # check for null padding at end of extra my $here = $FH->tell(); my $rest; myRead($rest, $XLEN - $offset); if ($rest =~ /^\x00+$/) { out $id . $rest, "Null Padding in Extra"; return undef; } seekTo($here); } my ($who, $decoder) = @{ $Extras{$lookID} // ['', undef ] }; $who = "$id: $who" if $id =~ /\w\w/ ; $who = "'$who'"; out $id, "Extra ID #" . Value_v($count), unpackValue_v($id) . " $who" ; myRead($buff, ZIP_EXTRA_SUBFIELD_LEN_SIZE); $offset += ZIP_EXTRA_SUBFIELD_LEN_SIZE; $subLen = unpack("v", $buff); out2 $buff, "Length", Value_v($subLen) ; return undef if $offset + $subLen > $XLEN ; if (! defined $decoder) { if ($subLen) { myRead($payload, $subLen); my $data = hexDump($payload); out2 $payload, "Extra Payload", $data; } } else { $decoder->($subLen, $context) ; } $offset += $subLen ; } return undef ; } sub full32 { return $_[0] == MAX32 ; } sub decode_Zip64 { my $len = shift; my $context = shift; my $z64Data = $context->{Zip64}; my $inCentralHdr = $context->{InCentralDir} ; my $inLocalHdr = ! $inCentralHdr ; $ZIP64 = 1; if ($inLocalHdr || full32 $z64Data->[0]) { out_Q " Uncompressed Size"; } if ($inLocalHdr || full32 $z64Data->[1]) { $context->{CompressedLength} = out_Q " Compressed Size"; } if (full32 $z64Data->[2] ) { $context->{LocalHdrOffset} = out_Q " Offset to Local Dir"; } if ($z64Data->[3] == 0xFFFF ) { out_V " Disk Number"; } } sub Ntfs2Unix { my $m = shift; my $v = shift; # NTFS offset is 19DB1DED53E8000 my $hex = Value_Q($v) ; $v -= 0x19DB1DED53E8000 ; my $ns = ($v % 10000000) * 100; my $elapse = int ($v/10000000); return "$hex '" . getT($elapse) . " " . sprintf("%0dns'", $ns); } sub decode_NTFS_Filetimes { my $len = shift; my $context = shift; out_V " Reserved"; out_v " Tag1"; out_v " Size1" ; my ($m, $s1) = read_Q; out $m, " Mtime", Ntfs2Unix($m, $s1); my ($a, $s3) = read_Q; out $m, " Atime", Ntfs2Unix($m, $s3); my ($c, $s2) = read_Q; out $c, " Ctime", Ntfs2Unix($m, $s2); } sub getT { my $time = shift ; if ($opt_utc) { return scalar gmtime($time) } else { return scalar localtime($time) } } sub getTime { my $time = shift ; return "'" . getT($time) . "'"; } sub decode_UT { my $len = shift; my $context = shift; my ($data, $flags) = read_C(); my $f = Value_C $flags; $f .= " mod" if $flags & 1; $f .= " access" if $flags & 2; $f .= " change" if $flags & 4; out $data, " Flags", "'$f'"; -- $len; if ($flags & 1) { my ($data, $time) = read_V(); out2 $data, "Mod Time", Value_V($time) . " " . getTime($time) ; $len -= 4 ; } if ($flags & 2 && $len > 0 ) { my ($data, $time) = read_V(); out2 $data, "Access Time", Value_V($time) . " " . getTime($time) ; $len -= 4 ; } if ($flags & 4 && $len > 0) { my ($data, $time) = read_V(); out2 $data, "Change Time", Value_V($time) . " " . getTime($time) ; } } sub decode_AES { # ref https://www.winzip.com/win/es/aes_info.html my $len = shift; my $context = shift; return if $len == 0 ; my %lookup = ( 1 => "AE-1", 2 => "AE-2"); out_v " Vendor Version", sub { $lookup{$_[0]} || "Unknown" } ; my $id ; myRead($id, 2); out $id, " Vendor ID", unpackValue_v($id) . " '$id'"; my %strengths = (1 => "128-bit encryption key", 2 => "192-bit encryption key", 3 => "256-bit encryption key", ); my $strength = out_C " Encryption Strength", sub {$strengths{$_[0]} || "Unknown" } ; my ($bmethod, $method) = read_v(); out $bmethod, " Compression Method", compressionMethod($method) ; $context->{AesStrength} = $strength ; } sub decode_GrowthHint { my $len = shift; my $context = shift; my $inCentralHdr = $context->{InCentralDir} ; return if $len == 0 ; out_v " Signature" ; out_v " Initial Value"; my $padding; myRead($padding, $len - 4); my $data = hexDump($padding); out2 $padding, "Padding", $data; } sub decode_DataStreamAlignment { my $len = shift; my $context = shift; my $inCentralHdr = $context->{InCentralDir} ; return if $len == 0 ; my ($data, $alignment) = read_v(); out $data, " Alignment", Value_v($alignment) ; my $recompress_value = $alignment & 0x8000 ? 1 : 0; my $recompressing = $recompress_value ? "True" : "False"; $alignment &= 0x7FFF ; my $hexAl = sprintf("%X", $alignment); out1 " [Bit 15]", "$recompress_value 'Recompress $recompressing'"; out1 " [Bits 0-14]", "$hexAl 'Minimal Alignment $alignment'"; if (! $inCentralHdr && $len - 2 > 0) { my $padding; myRead($padding, $len - 2); out2 $padding, "Padding", hexDump($padding); } } sub decode_UX { my $len = shift; my $context = shift; my $inCentralHdr = $context->{InCentralDir} ; return if $len == 0 ; my ($data, $time) = read_V(); out2 $data, "Access Time", Value_V($time) . " " . getTime($time) ; ($data, $time) = read_V(); out2 $data, "Mod Time", Value_V($time) . " " . getTime($time) ; if (! $inCentralHdr ) { out_v " UID" ; out_v " GID"; } } sub decode_Ux { my $len = shift; my $context = shift; return if $len == 0 ; out_v " UID" ; out_v " GID"; } sub decodeLitteEndian { my $value = shift ; if (length $value == 4) { return Value_V unpack ("V", $value) } else { # TODO - fix this die "unsupported\n"; } my $got = 0 ; my $shift = 0; #hexDump #reverse #my @a =unpack "C*", $value; #@a = reverse @a; #hexDump(@a); for (reverse unpack "C*", $value) { $got = ($got << 8) + $_ ; } return $got ; } sub decode_ux { my $len = shift; my $context = shift; return if $len == 0 ; out_C " Version" ; my $uidSize = out_C " UID Size"; myRead(my $data, $uidSize); out2 $data, "UID", decodeLitteEndian($data); my $gidSize = out_C " GID Size"; myRead($data, $gidSize); out2 $data, "GID", decodeLitteEndian($data); } sub decode_Java_exe { my $len = shift; my $context = shift; } sub decode_up { my $len = shift; my $context = shift; out_C " Version"; out_V " NameCRC32"; myRead(my $data, $len - 5); out $data, " UnicodeName", $data; } sub decode_Xceed_unicode { my $len = shift; my $context = shift; my $data ; # No public definition available, so guess the fields used for this one # Data analysis based on output from Fiddler (https://www.telerik.com/fiddler), # which uses this field # First 4 bytes appear to be "NUCX" all the time myRead($data, 4); out $data, " ID", $data; # Next 2 bytes contains a count of the remaining bytes/2 # Probably the number of UTF-16 characters, including the # optional NULL prefix out_v " Length"; # next is a UTF16 encode filename # sometimes preceeded by a two Null bytes myRead($data, $len - 6); my $prefix = substr($data, 0, 2); if ($prefix eq "\x00\x00") { # Found the Null prefix out $prefix, " Null", '0000'; substr($data, 0, 2) = ''; } out $data, " UTF16LE Name", decode("UTF16LE", $data); } sub decode_NT_security { my $len = shift; my $context = shift; my $inCentralHdr = $context->{InCentralDir} ; out_V " Uncompressed Size" ; if (! $inCentralHdr) { out_C " Version" ; out_v " Type"; out_V " NameCRC32" ; my $plen = $len - 4 - 1 - 2 - 4; myRead(my $payload, $plen); out $plen, " Extra Payload", hexDump($payload); } } sub decodeMVS { my $len = shift; my $context = shift; # data in Big-Endian myRead(my $data, $len); my $ID = unpack("N", $data); if ($ID == 0xE9F3F9F0) { out($data, " ID", "'Z390'"); substr($data, 0, 4) = ''; } out($data, " Extra Payload", hexDump($data)); } sub printAes { # ref https://www.winzip.com/win/es/aes_info.html my $context = shift ; my %saltSize = ( 1 => 8, 2 => 12, 3 => 16, ); myRead(my $salt, $saltSize{$context->{AesStrength} }); out $salt, "AES Salt", hexDump($salt); myRead(my $pwv, 2); out $pwv, "AES Pwd Ver", hexDump($pwv); return $saltSize{$context->{AesStrength}} + 2 + 10; } sub printLzmaProperties { my $len = 0; my $b1; my $b2; my $buffer; myRead($b1, 2); my ($verHi, $verLow) = unpack ("CC", $b1); out $b1, "LZMA Version", sprintf("%02X%02X", $verHi, $verLow) . " '$verHi.$verLow'"; my $LzmaPropertiesSize = out_v "LZMA Properties Size"; $len += 4; my $LzmaInfo = out_C "LZMA Info", sub { $_[0] == 93 ? "(Default)" : ""}; my $PosStateBits = 0; my $LiteralPosStateBits = 0; my $LiteralContextBits = 0; $PosStateBits = int($LzmaInfo / (9 * 5)); $LzmaInfo -= $PosStateBits * 9 * 5; $LiteralPosStateBits = int($LzmaInfo / 9); $LiteralContextBits = $LzmaInfo - $LiteralPosStateBits * 9; out1 " PosStateBits", $PosStateBits; out1 " LiteralPosStateBits", $LiteralPosStateBits; out1 " LiteralContextBits", $LiteralContextBits; out_V "LZMA Dictionary Size"; # TODO - assumption that this is 5 $len += $LzmaPropertiesSize; skip($FH, $LzmaPropertiesSize - 5) if $LzmaPropertiesSize != 5 ; return $len; } sub readFromOffset { # my $fh = shift; my $offset = shift; my $len = shift; seekTo($offset) ; my $buffer; myRead($buffer, $len); # $fh->read($buffer, $len) == $len length $buffer == $len or return ''; return $buffer; } sub chckForAPKSigningBlock { my $fh = shift; my $cdOffset = shift; # APK Signing Block comes directy before the Central directory # If offset less than # # len1 8 # id 4 # kv with zero len 8 # len1 8 # magic 16 # ---------- # 44 return (0, 0, '') if $cdOffset < 44; # Step 1 - 16 bytes before CD is literal string "APK Sig Block 42" my $magicOffset = $cdOffset - 16; my $buffer = readFromOffset($magicOffset, 16); return (0, 0, '') if $buffer ne "APK Sig Block 42" ; # Step 2 - read the two length fields # and check they are identical $buffer = readFromOffset($cdOffset - 16 - 8, 8); my $len2 = unpack("Q<", $buffer); return (0, 0, '') if $len2 == 0 ; my $startApkOffset = $cdOffset - 8 - $len2 ; $buffer = readFromOffset($startApkOffset, 8); my $len1 = unpack("Q<", $buffer); return (0, 0, '') if $len1 != $len2; return ($startApkOffset, $cdOffset - 16 - 8, $buffer); } sub scanApkBlock { state $IDs = { 0x7109871a => "APK Signature v2", 0xf05368c0 => "APK Signature v3", 0x42726577 => "Verity Padding Block", # from https://android.googlesource.com/platform/tools/apksig/+/master/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java 0x6dff800d => "Source Stamp", 0x504b4453 => "Dependency Info", 0x71777777 => "APK Channel Block", 0xff3b5998 => "Zero Block", 0x2146444e => "Play Metadata", } ; seekTo($FH->tell() - 4) ; print "\nAPK SIGNING BLOCK\n"; scanApkPadding(''); out_Q "Block Length Copy #1"; my $ix = 1; while ($FH->tell() < $APK - 8) { my ($bytes, $id, $len); ($bytes, $len) = read_Q ; out $bytes, "ID/Value Length #" . sprintf("%X", $ix), Value_Q($len); ($bytes, $id) = read_V; out $bytes, " ID", Value_V($id) . " '" . ($IDs->{$id} // 'Unknown ID') . "'"; outSomeData($len-4, " Value"); ++ $ix; } out_Q "Block Length Copy #2"; my $magic ; myRead($magic, 16); out $magic, "Magic", qq['$magic']; } sub scanApkPadding { my $bytes = shift ; # padding my $here = $FH->tell(); my $got; myRead($got, $APK - $here); $got = $bytes . $got; if ($got =~ /^(\x00+)($APK_LEN)?/) { my $len = length $1 ; seekTo($here - length($bytes)); outSomeData($len, "Null Padding"); } else { seekTo($here); } } sub scanCentralDirectory { my $fh = shift; my $here = $fh->tell(); # Use cases # 1 32-bit CD # 2 64-bit CD my @CD = (); my $offset = findCentralDirectoryOffset($fh); return () if ! defined $offset; $fh->seek($offset, SEEK_SET) ; # Now walk the Central Directory Records my $buffer ; my $cdIndex = 0; while ($fh->read($buffer, 46) == 46 && unpack("V", $buffer) == ZIP_CENTRAL_HDR_SIG) { my $cdEntryOffset = $fh->tell() - 46; ++ $cdIndex ; my $compressedLength = unpack("V", substr($buffer, 20, 4)); my $uncompressedLength = unpack("V", substr($buffer, 24, 4)); my $filename_length = unpack("v", substr($buffer, 28, 2)); my $extra_length = unpack("v", substr($buffer, 30, 2)); my $comment_length = unpack("v", substr($buffer, 32, 2)); my $locHeaderOffset = unpack("V", substr($buffer, 42, 4)); my $cdZip64 = 0; my $zip64Sizes = 0; skip($fh, $filename_length ) ; if ($extra_length) { $fh->read(my $extraField, $extra_length) ; # $self->smartReadExact(\$extraField, $extra_length); # Check for Zip64 # my SizesExtended = findID("\x01\x00", $extraField); my $zip64Extended = findID(0x0001, $extraField); if ($zip64Extended) { $cdZip64 = 1; if ($uncompressedLength == MAX32) { $uncompressedLength = unpack "Q<", substr($zip64Extended, 0, 8, ""); $zip64Sizes = 1; } if ($compressedLength == MAX32) { $compressedLength = unpack "Q<", substr($zip64Extended, 0, 8, ""); $zip64Sizes = 1; } if ($locHeaderOffset == MAX32) { $locHeaderOffset = unpack "Q<", substr($zip64Extended, 0, 8, ""); } } } my $got = [$locHeaderOffset, $compressedLength, $cdZip64, $zip64Sizes, $cdIndex, $cdEntryOffset] ; skip($fh, $comment_length ) ; push @CD, $got ; } $fh->seek($here, SEEK_SET) ; # @CD = sort { $a->[0]->cmp($b->[0]) } @CD ; @CD = sort { $a->[0] <=> $b->[0] } @CD ; # Set the first Local File Header offset. $START = $CD[0]->[0] if @CD ; return (1, $offset, @CD); } sub offsetFromZip64 { my $fh = shift ; my $here = shift; $fh->seek($here - 20, SEEK_SET) # TODO - fix this or die "xx $!" ; my $buffer; my $got = 0; ($got = $fh->read($buffer, 20)) == 20 # TODO - fix this or die "xxx $here $got $!" ; if ( unpack("V", $buffer) == ZIP64_END_CENTRAL_LOC_HDR_SIG ) { my $cd64 = unpack "Q<", substr($buffer, 8, 8); $fh->seek($cd64, SEEK_SET) ; $fh->read($buffer, 4) == 4 # TODO - fix this or die "xxx" ; if ( unpack("V", $buffer) == ZIP64_END_CENTRAL_REC_HDR_SIG ) { $fh->read($buffer, 8) == 8 # TODO - fix this or die "xxx" ; my $size = unpack "Q<", $buffer; $fh->read($buffer, $size) == $size # TODO - fix this or die "xxx" ; my $cd64 = unpack "Q<", substr($buffer, 36, 8); return $cd64 ; } die "Cannot find 'Zip64 end of central directory record': 0x06054b50\nTry running with --scan option.\n" ; } die "Cannot find signature for 'Zip64 end of central directory locator': 0x07064b50 \nTry running with --scan option.\n" ; } use constant Pack_ZIP_END_CENTRAL_HDR_SIG => pack("V", ZIP_END_CENTRAL_HDR_SIG); sub findCentralDirectoryOffset { my $fh = shift ; # Most common use-case is where there is no comment, so # know exactly where the end of central directory record # should be. $fh->seek(-22, SEEK_END) ; my $here = $fh->tell(); my $is64bit = $here > MAX32; my $over64bit = $here & (~ MAX32); my $buffer; $fh->read($buffer, 22) == 22 # TODO - fix this or die "xxx" ; my $zip64 = 0; my $centralDirOffset ; if ( unpack("V", $buffer) == ZIP_END_CENTRAL_HDR_SIG ) { $centralDirOffset = unpack("V", substr($buffer, 16, 4)); } else { $fh->seek(0, SEEK_END) ; my $fileLen = $fh->tell(); my $want = 0 ; while(1) { $want += 1024 * 32; my $seekTo = $fileLen - $want; if ($seekTo < 0 ) { $seekTo = 0; $want = $fileLen ; } $fh->seek( $seekTo, SEEK_SET) # TODO - fix this or die "xxx $!" ; my $got; ($got = $fh->read($buffer, $want)) == $want # TODO - fix this or die "xxx $got $!" ; my $pos = rindex( $buffer, Pack_ZIP_END_CENTRAL_HDR_SIG); if ($pos >= 0 && $want - $pos > 22) { $here = $seekTo + $pos ; $centralDirOffset = unpack("V", substr($buffer, $pos + 16, 4)); my $commentLength = unpack("V", substr($buffer, $pos + 20, 2)); $commentLength = 0 if ! defined $commentLength ; my $expectedEof = $fileLen - $want + $pos + 22 + $commentLength ; # check for trailing data after end of zip if ($expectedEof < $fileLen ) { $TRAILING = $expectedEof ; } last ; } return undef if $want == $fileLen; } } if (full32 $centralDirOffset) { $centralDirOffset = offsetFromZip64($fh, $here) } elsif ($is64bit) { # use-case is where a 64-bit zip file doesn't use the 64-bit # extensions. print "EOCD not 64-bit $centralDirOffset ($here)\n" ; push @Messages, sprintf "Zip file > 4Gig. Expected 'Offset to Central Dir' to be 0xFFFFFFFF, got 0x%X\n", $centralDirOffset; $centralDirOffset += $over64bit; $is64In32 = 1; } ($START_APK, $APK, $APK_LEN) = chckForAPKSigningBlock($fh, $centralDirOffset); return $centralDirOffset ; } sub findID { my $id_want = shift ; my $data = shift; my $XLEN = length $data ; my $offset = 0 ; while ($offset < $XLEN) { return undef if $offset + ZIP_EXTRA_SUBFIELD_HEADER_SIZE > $XLEN ; my $id = substr($data, $offset, ZIP_EXTRA_SUBFIELD_ID_SIZE); $id = unpack("v", $id); $offset += ZIP_EXTRA_SUBFIELD_ID_SIZE; my $subLen = unpack("v", substr($data, $offset, ZIP_EXTRA_SUBFIELD_LEN_SIZE)); $offset += ZIP_EXTRA_SUBFIELD_LEN_SIZE ; return undef if $offset + $subLen > $XLEN ; return substr($data, $offset, $subLen) if $id eq $id_want ; $offset += $subLen ; } return undef ; } sub _dosToUnixTime { my $dt = shift; my $year = ( ( $dt >> 25 ) & 0x7f ) + 80; my $mon = ( ( $dt >> 21 ) & 0x0f ) - 1; my $mday = ( ( $dt >> 16 ) & 0x1f ); my $hour = ( ( $dt >> 11 ) & 0x1f ); my $min = ( ( $dt >> 5 ) & 0x3f ); my $sec = ( ( $dt << 1 ) & 0x3e ); use POSIX 'mktime'; # Force mktime to return a UTC time local $ENV{TZ} = "UTC"; my $time_t = mktime( $sec, $min, $hour, $mday, $mon, $year, 0, 0, -1 ); return 0 if ! defined $time_t; return $time_t; } sub nibbles { my @nibbles = ( [ 16 => 0x1000000000000000 ], [ 15 => 0x100000000000000 ], [ 14 => 0x10000000000000 ], [ 13 => 0x1000000000000 ], [ 12 => 0x100000000000 ], [ 11 => 0x10000000000 ], [ 10 => 0x1000000000 ], [ 9 => 0x100000000 ], [ 8 => 0x10000000 ], [ 7 => 0x1000000 ], [ 6 => 0x100000 ], [ 5 => 0x10000 ], [ 4 => 0x1000 ], [ 4 => 0x100 ], [ 4 => 0x10 ], [ 4 => 0x1 ], ); my $value = shift ; for my $pair (@nibbles) { my ($count, $limit) = @{ $pair }; return $count if $value >= $limit ; } } { package Seen; sub new { my $class = shift ; my %object = ( overlaps => [], duplicates => [], detail => [], duplicate_count => 0, overlap_count => 0, ) ; bless \%object, $class; } sub save { my $self = shift ; my $hdrId = shift; my $name = shift; my $extras = shift; my $from_offset = $extras->{LocalHdrOffset}; my $to_offset = $from_offset ; $to_offset += $extras->{CompressedLength} - 1 ; my $crc = $extras->{CRC}; $name = ::redactFilename($name) ; for my $entry ( @{ $self->{detail} } ) { if ( $from_offset == $entry->{from} && $to_offset == $entry->{to} && $crc == $entry->{crc}) { $self->{duplicate_count} ++; print "$hdrId: '$name' matches with $entry->{str}\n" } elsif ( ($from_offset >= $entry->{from} && $from_offset <= $entry->{to} ) || ($to_offset >= $entry->{from} && $to_offset <= $entry->{to} ) ) { # die "overlap!" # push @{ $self->{overlap} }, $self->{overlap_count} ++; print "$hdrId: '$name' overlaps with $entry->{str}\n"; } } # warn "ADD $from_offset $to_offset $hdrId: $name\n"; push @{ $self->{detail} }, { from => $from_offset, to => $to_offset, length => $extras->{CompressedLength}, id => $hdrId, crc => $crc, name => $name, str => "$hdrId: '$name'", } ; } sub short_summary { my $self = shift; my $duplicates = $self->{duplicate_count}; push @Messages, "$duplicates duplicate entries" if $duplicates; my $overlaps = $self->{overlap_count}; push @Messages, "$overlaps overlap entries" if $overlaps; } sub summary { my $self = shift ; # disable for now return; print "\n"; for my $entry ( sort { $a->{from}->cmp($b->{from}) } @{ $self->{detail} } ) { my $from_offset = $entry->{from}; my $to_offset = $entry->{to}; my $hdrId = $entry->{id}; my $name = $entry->{name}; print "$hdrId\t" . $entry->{from} . "\n"; } } } sub Usage { if (@_) { warn "$_\n" for @_ ; warn "\n"; } die < file at hand to help understand the output from this program. =head2 Default Behaviour By default the program expects to be given a well-formed zip file. It will navigate the Zip file by first parsing the zip central directory at the end of the file. If that is found, it will then walk through the zip records starting at the beginning of the file. Any badly formed zip data structures encountered are likely to terminate the program. If the program finds any structural problems with the zip file it will print a summary at the end of the output report. The set of error cases reported is very much a work in progress, so don't rely on this feature to find all the possible errors in a zip file. If you have suggestions for use-cases where this could be enhanced please consider creating an enhancement request (see L<"SUPPORT">). Date/time fields are found in zip files are displayed in local time. Use the C<--utc> option to display these fields in Coordinated Universal Time (UTC). =head2 Scan-Mode If you do have a potentially corrupt zip file, particulatly where the central directory at the end of the file is absent/incomplete, you can try usng the C<--scan> option to search for zip records that are still present. When Scan-mode is enabled, the program will walk the zip file from the start, blindly looking for the 4-byte signatures that preceed each of the zip data structures. If it finds any of the recognised signatures it will attempt to dump the associated zip record. For very large zip files, this operation can take a long time to run. Note that the 4-byte signatures used in zip files can sometimes match with random data stored in the zip file, so care is needed interpreting the results. =head2 OPTIONS =over 5 =item -h Display help =item --redact Obscure filenames in the output. Handy for the use case where the zip files contains sensitive data that cannot be shared. =item --scan Walk the zip file loking for possible zip records. Can be error-prone. See L<"Scan-Mode"> =item --utc By default, date/time fields are displayed in local time. Use this option to display them in in Coordinated Universal Time (UTC). =item -v Enable Verbose mode. See L<"Verbose Output">. =item --version Display version number of the program and exit. =back =head2 Default Output By default zipdetails will output the details of the zip file in three columns. =over 5 =item Column 1 This contains the offset from the start of the file in hex. =item Column 2 This contains a textual description of the field. =item Column 3 If the field contains a numeric value it will be displayed in hex. Zip stores most numbers in little-endian format - the value displayed will have the little-endian encoding removed. Next, is an optional description of what the value means. =back For example, assuming you have a zip file with two entries, like this $ unzip -l test.zip Archive: setup/test.zip Length Date Time Name --------- ---------- ----- ---- 6 2021-03-23 18:52 latters.txt 6 2021-03-23 18:52 numbers.txt --------- ------- 12 2 files Running C will gives this output $ zipdetails test.zip 0000 LOCAL HEADER #1 04034B50 0004 Extract Zip Spec 0A '1.0' 0005 Extract OS 00 'MS-DOS' 0006 General Purpose Flag 0000 0008 Compression Method 0000 'Stored' 000A Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 000E CRC 0F8A149C 0012 Compressed Length 00000006 0016 Uncompressed Length 00000006 001A Filename Length 000B 001C Extra Length 0000 001E Filename 'letters.txt' 0029 PAYLOAD abcde. 002F LOCAL HEADER #2 04034B50 0033 Extract Zip Spec 0A '1.0' 0034 Extract OS 00 'MS-DOS' 0035 General Purpose Flag 0000 0037 Compression Method 0000 'Stored' 0039 Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 003D CRC 261DAFE6 0041 Compressed Length 00000006 0045 Uncompressed Length 00000006 0049 Filename Length 000B 004B Extra Length 0000 004D Filename 'numbers.txt' 0058 PAYLOAD 12345. 005E CENTRAL HEADER #1 02014B50 0062 Created Zip Spec 1E '3.0' 0063 Created OS 03 'Unix' 0064 Extract Zip Spec 0A '1.0' 0065 Extract OS 00 'MS-DOS' 0066 General Purpose Flag 0000 0068 Compression Method 0000 'Stored' 006A Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 006E CRC 0F8A149C 0072 Compressed Length 00000006 0076 Uncompressed Length 00000006 007A Filename Length 000B 007C Extra Length 0000 007E Comment Length 0000 0080 Disk Start 0000 0082 Int File Attributes 0001 [Bit 0] 1 Text Data 0084 Ext File Attributes 81B40000 0088 Local Header Offset 00000000 008C Filename 'letters.txt' 0097 CENTRAL HEADER #2 02014B50 009B Created Zip Spec 1E '3.0' 009C Created OS 03 'Unix' 009D Extract Zip Spec 0A '1.0' 009E Extract OS 00 'MS-DOS' 009F General Purpose Flag 0000 00A1 Compression Method 0000 'Stored' 00A3 Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 00A7 CRC 261DAFE6 00AB Compressed Length 00000006 00AF Uncompressed Length 00000006 00B3 Filename Length 000B 00B5 Extra Length 0000 00B7 Comment Length 0000 00B9 Disk Start 0000 00BB Int File Attributes 0001 [Bit 0] 1 Text Data 00BD Ext File Attributes 81B40000 00C1 Local Header Offset 0000002F 00C5 Filename 'numbers.txt' 00D0 END CENTRAL HEADER 06054B50 00D4 Number of this disk 0000 00D6 Central Dir Disk no 0000 00D8 Entries in this disk 0002 00DA Total Entries 0002 00DC Size of Central Dir 00000072 00E0 Offset to Central Dir 0000005E 00E4 Comment Length 0000 Done =head2 Verbose Output If the C<-v> option is present, column 1 is expanded to include =over 5 =item * The offset from the start of the file in hex. =item * The length of the field in hex. =item * A hex dump of the bytes in field in the order they are stored in the zip file. =back Here is the same zip file dumped using the C C<-v> option: $ zipdetails -v test.zip 0000 0004 50 4B 03 04 LOCAL HEADER #1 04034B50 0004 0001 0A Extract Zip Spec 0A '1.0' 0005 0001 00 Extract OS 00 'MS-DOS' 0006 0002 00 00 General Purpose Flag 0000 0008 0002 00 00 Compression Method 0000 'Stored' 000A 0004 3D 98 77 52 Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 000E 0004 9C 14 8A 0F CRC 0F8A149C 0012 0004 06 00 00 00 Compressed Length 00000006 0016 0004 06 00 00 00 Uncompressed Length 00000006 001A 0002 0B 00 Filename Length 000B 001C 0002 00 00 Extra Length 0000 001E 000B 6C 65 74 74 Filename 'letters.txt' 65 72 73 2E 74 78 74 0029 0006 61 62 63 64 PAYLOAD abcde. 65 0A 002F 0004 50 4B 03 04 LOCAL HEADER #2 04034B50 0033 0001 0A Extract Zip Spec 0A '1.0' 0034 0001 00 Extract OS 00 'MS-DOS' 0035 0002 00 00 General Purpose Flag 0000 0037 0002 00 00 Compression Method 0000 'Stored' 0039 0004 3D 98 77 52 Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 003D 0004 E6 AF 1D 26 CRC 261DAFE6 0041 0004 06 00 00 00 Compressed Length 00000006 0045 0004 06 00 00 00 Uncompressed Length 00000006 0049 0002 0B 00 Filename Length 000B 004B 0002 00 00 Extra Length 0000 004D 000B 6E 75 6D 62 Filename 'numbers.txt' 65 72 73 2E 74 78 74 0058 0006 31 32 33 34 PAYLOAD 12345. 35 0A 005E 0004 50 4B 01 02 CENTRAL HEADER #1 02014B50 0062 0001 1E Created Zip Spec 1E '3.0' 0063 0001 03 Created OS 03 'Unix' 0064 0001 0A Extract Zip Spec 0A '1.0' 0065 0001 00 Extract OS 00 'MS-DOS' 0066 0002 00 00 General Purpose Flag 0000 0068 0002 00 00 Compression Method 0000 'Stored' 006A 0004 3D 98 77 52 Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 006E 0004 9C 14 8A 0F CRC 0F8A149C 0072 0004 06 00 00 00 Compressed Length 00000006 0076 0004 06 00 00 00 Uncompressed Length 00000006 007A 0002 0B 00 Filename Length 000B 007C 0002 00 00 Extra Length 0000 007E 0002 00 00 Comment Length 0000 0080 0002 00 00 Disk Start 0000 0082 0002 01 00 Int File Attributes 0001 [Bit 0] 1 Text Data 0084 0004 00 00 B4 81 Ext File Attributes 81B40000 0088 0004 00 00 00 00 Local Header Offset 00000000 008C 000B 6C 65 74 74 Filename 'letters.txt' 65 72 73 2E 74 78 74 0097 0004 50 4B 01 02 CENTRAL HEADER #2 02014B50 009B 0001 1E Created Zip Spec 1E '3.0' 009C 0001 03 Created OS 03 'Unix' 009D 0001 0A Extract Zip Spec 0A '1.0' 009E 0001 00 Extract OS 00 'MS-DOS' 009F 0002 00 00 General Purpose Flag 0000 00A1 0002 00 00 Compression Method 0000 'Stored' 00A3 0004 3D 98 77 52 Last Mod Time 5277983D 'Tue Mar 23 19:01:58 2021' 00A7 0004 E6 AF 1D 26 CRC 261DAFE6 00AB 0004 06 00 00 00 Compressed Length 00000006 00AF 0004 06 00 00 00 Uncompressed Length 00000006 00B3 0002 0B 00 Filename Length 000B 00B5 0002 00 00 Extra Length 0000 00B7 0002 00 00 Comment Length 0000 00B9 0002 00 00 Disk Start 0000 00BB 0002 01 00 Int File Attributes 0001 [Bit 0] 1 Text Data 00BD 0004 00 00 B4 81 Ext File Attributes 81B40000 00C1 0004 2F 00 00 00 Local Header Offset 0000002F 00C5 000B 6E 75 6D 62 Filename 'numbers.txt' 65 72 73 2E 74 78 74 00D0 0004 50 4B 05 06 END CENTRAL HEADER 06054B50 00D4 0002 00 00 Number of this disk 0000 00D6 0002 00 00 Central Dir Disk no 0000 00D8 0002 02 00 Entries in this disk 0002 00DA 0002 02 00 Total Entries 0002 00DC 0004 72 00 00 00 Size of Central Dir 00000072 00E0 0004 5E 00 00 00 Offset to Central Dir 0000005E 00E4 0002 00 00 Comment Length 0000 Done =head1 LIMITATIONS The following zip file features are not supported by this program: =over 5 =item * Multi-part archives. =item * The strong encryption features defined in the L document. =back =head1 TODO Error handling is a work in progress. If the program encounters a problem reading a zip file it is likely to terminate with an unhelpful error message. =head1 SUPPORT General feedback/questions/bug reports should be sent to L. =head1 SEE ALSO The primary reference for Zip files is L. An alternative reference is the Info-Zip appnote. This is available from L For details of WinZip AES encryption see L. The C program that comes with the info-zip distribution (L) can also display details of the structure of a zip file. =head1 AUTHOR Paul Marquess F. =head1 COPYRIGHT Copyright (c) 2011-2022 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.