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

Contents of /fw-info.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 34 - (show annotations)
Tue Apr 24 20:43:36 2007 UTC (16 years, 11 months ago) by dpavlin
File MIME type: text/plain
File size: 543 byte(s)
support multiple firmware images as argument(s)
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 @images = @ARGV;
11 push @images, '/srv/tftp/BANT-R' unless @images;
12
13 my $magic = 'BLI223QH0';
14
15 for my $path ( @images ) {
16 open(my $fh, $path) || die "Can't open $path: $!";
17 my $b;
18 read($fh, $b, length($magic));
19 warn "# $path not a firmware image\n" unless ($b eq $magic);
20 seek($fh, 32, 0) || die "can't seek to 32: $!";
21 read($fh, $b, 4);
22 printf("%8s %s\n", join('.',unpack('CCCC', $b)), $path);
23 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26