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

Annotation of /fw-info.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21 - (hide annotations)
Mon Apr 23 20:49:47 2007 UTC (17 years ago) by dpavlin
File MIME type: text/plain
File size: 518 byte(s)
output formatted version number and path
1 dpavlin 5 #!/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 dpavlin 6 my $path = shift @ARGV || '/srv/tftp/BANT-R'; # die "Usage: $0 firmware.bin\n";
11 dpavlin 5
12 dpavlin 18 my $magic = 'BLI223QH0';
13    
14 dpavlin 5 open(my $fh, $path) || die "Can't open $path: $!";
15 dpavlin 18 my $b;
16     read($fh, $b, length($magic));
17     die "# $path not a firmware image\n" unless ($b eq $magic);
18 dpavlin 5 seek($fh, 32, 0) || die "can't seek to 32: $!";
19 dpavlin 18 read($fh, $b, 4);
20 dpavlin 21 printf("%8s %s\n", join('.',unpack('CCCC', $b)), $path);
21 dpavlin 5

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26