HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/root/usr/share/doc/perl-Image-Info-1.33/exifdump
#!/usr/bin/perl -w

use lib 'lib';
use strict;
use Image::Info qw(image_info);

my $i=image_info($ARGV[0]);

foreach (sort keys %$i) {
    if ($i->{$_} =~ /[\001-\037\177-\377]/ && !/error/) {
        printf "%s ->\n" ,$_;
        hex_print($i->{$_});
	next;
    }
    $i->{$_} =~ s/\000//g;
    printf "%s -> %s\n" ,$_, ref($i->{$_}) ? deref(@{$i->{$_}}) : $i->{$_}
};

sub deref {
   my @args;
   if (ref($_[0]) eq 'ARRAY') {
     foreach my $ref (@_) {  
       push(@args, deref(@{$ref}))
     } 
   } else {
     @args = @_;
   }
   '[' . join(',',@args) . ']';
}

sub hex_print {
    for (my $i=0; $i<length $_[0];$i+=16) {
       my $ss = substr($_[0],$i,16);
       printf "  %04x: %s ", $i, join(' ',grep !/^$/,split(/(..)/,unpack("H*",$ss)));
       $ss =~ tr /\000-\037\177-\377/./;
       print $ss,"\n";
    }
}