⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checksumiso.pl

📁 linux内核
💻 PL
字号:
#!/usr/bin/perl## Construct a checksum for isolinux*.bin, compatible# with an mkisofs boot-info-table#use bytes;use integer;($file) = @ARGV;open(FILE, '+<', $file) or die "$0: Cannot open $file: $!\n";binmode FILE;if ( !seek(FILE,64,0) ) {    die "$0: Cannot seek past header\n";}$csum  = 0;$bytes = 64;while ( ($n = read(FILE, $dw, 4)) > 0 ) {    $dw .= "\0\0\0\0";		# Pad to at least 32 bits    ($v) = unpack("V", $dw);    $csum  = ($csum + $v) & 0xffffffff;    $bytes += $n;}if ( !seek(FILE,16,0) ) {    die "$0: Cannot seek to header\n";}print FILE pack("VV", $bytes, $csum);close(FILE);exit 0;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -