Skip to content
Snippets Groups Projects
Select Git revision
  • 5b7f8cbe7cda336b3a23c1b16fa36ef282b13803
  • master default protected
2 results

sign.pl

Blame
  • sign.pl 363 B
    #!/usr/bin/perl
    
    open(SIG, $ARGV[0]) || die "open $ARGV[0]: $!";
    
    $n = sysread(SIG, $buf, 1000);
    
    if($n > 510){
      print STDERR "boot block too large: $n bytes (max 510)\n";
      exit 1;
    }
    
    print STDERR "boot block is $n bytes (max 510)\n";
    
    $buf .= "\0" x (510-$n);
    $buf .= "\x55\xAA";
    
    open(SIG, ">$ARGV[0]") || die "open >$ARGV[0]: $!";
    print SIG $buf;
    close SIG;