/[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

Contents of /bin/fw-info.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21 - (show annotations)
Mon Apr 23 20:49:47 2007 UTC (16 years, 11 months ago) by dpavlin
Original Path: fw-info.pl
File MIME type: text/plain
File size: 518 byte(s)
output formatted version number and path
1 #!/usr/bin/perl -w
2
3 # fw-info.pl
4 #
5 # 04/22/07 16:33:13 CEST Dobrica Pavlinusic <dpavlin@rot13.org>
6
7 use strict;
8 use Data::Dump qw/dump/;
9
10 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: $!";
15 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: $!";
19 read($fh, $b, 4);
20 printf("%8s %s\n", join('.',unpack('CCCC', $b)), $path);
21

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26