/[mdap]/bin/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 /bin/fw-info.pl

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

revision 5 by dpavlin, Sun Apr 22 14:42:56 2007 UTC revision 21 by dpavlin, Mon Apr 23 20:49:47 2007 UTC
# Line 7  Line 7 
7  use strict;  use strict;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9    
10  my $path = shift @ARGV || 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, 5);  read($fh, $b, 4);
20  print dump( $ver ), dump( unpack 'CCCCC', $ver ),$/;  printf("%8s %s\n", join('.',unpack('CCCC', $b)), $path);
21    

Legend:
Removed from v.5  
changed lines
  Added in v.21

  ViewVC Help
Powered by ViewVC 1.1.26