/[mdap]/fw-info.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /fw-info.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 16 by dpavlin, Mon Apr 23 17:41:34 2007 UTC revision 18 by dpavlin, Mon Apr 23 18:04:04 2007 UTC
# Line 9  use Data::Dump qw/dump/; Line 9  use Data::Dump qw/dump/;
9    
10  my $path = shift @ARGV || '/srv/tftp/BANT-R'; # die "Usage: $0 firmware.bin\n";  my $path = shift @ARGV || '/srv/tftp/BANT-R'; # die "Usage: $0 firmware.bin\n";
11    
12    my $magic = 'BLI223QH0';
13    
14  open(my $fh, $path) || die "Can't open $path: $!";  open(my $fh, $path) || die "Can't open $path: $!";
15  my $ver;  my $b;
16    read($fh, $b, length($magic));
17    die "# $path not a firmware image\n" unless ($b eq $magic);
18  seek($fh, 32, 0) || die "can't seek to 32: $!";  seek($fh, 32, 0) || die "can't seek to 32: $!";
19  read($fh, $ver, 4);  read($fh, $b, 4);
20  print join('.',unpack('CCCC', $ver)),"\t$path\n";  print join('.',unpack('CCCC', $b)),"\t$path\n";
21    

Legend:
Removed from v.16  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.26