在PowerPoint中使用宏实现批量修改公式的打印颜色

USBOOT.PAK文件格式研究

Δ posted @ 2008年8月01日 19:43 in 非linux with tags Perl w32 USBOOT , 4014 阅读

我打算制作linux和dos双启动U盘,但很多dos启动U盘用USBOOT安装,它们的文件都存放在一个叫做USBOOT.PAK中。这个文件好像不是开放文件格式,要想提取出来必须使用USBOOT还得用到U盘,把U盘根目录搞的乱乱的,还可能把引导区给覆盖了,十分不方便。于是拿起十六进制编辑工具,研究了一下USBOOT.PAK的文件格式,写了一个perl脚本从中提取文件。(进入查看更多)USBOOT.PAK的文件格式

#开头4个字节

########

55 53 42 54          USBT

 

#接下来是文件,这里只写一个文件,每个文件格式是相同的,好像没有记录文件个数的字节

#一个文件开始的标志(1个字节)

########

cf

 

#文件名的长度(1个字节)

########

xx

 

#4个字节(不知道作用,但对提取文件无影响)

########

xx xx xx xx

 

#文件的大小(4个字节little endian)

########

xx xx xx xx

 

#6个字节(不知道作用,但对提取文件无影响)

########

xx xx xx xx xx xx

#文件名

 

#文件内容

 

###其他文件,格式相同###

 

下面是提取的代码.提取到当前目录.

unpak.pl

 

#!/usr/bin/perl
use strict;
use warnings;
use Carp;

my $PAK;
my $buf;
my $OUT;

open $PAK,"<","USBOOT.PAK";
binmode($PAK);

# TODO: Error Handle
read $PAK,$buf,4;
croak "This is not a USBOOT.PAK file. " unless $buf eq "USBT";

while (!eof($PAK)){
  read $PAK,$buf,1; # 0xCF
  croak "This file may be broken at the position " . tell($PAK) ."." unless  $buf eq pack("H2","cf");

  read $PAK,$buf,1; # read the lenth of file name
  my $nlen=unpack("C",$buf);

  seek $PAK,4,1;    # jump over 4 bytes

  read $PAK,$buf,4; # read the lenth of file
  my $flen=unpack("V",$buf);

  seek $PAK,6,1;    # jump 6 bytes

  read $PAK,$buf,$nlen; # read the file name
  my $name=unpack("a$nlen",$buf);

  open $OUT,">",$name;
  binmode $OUT;
  read $PAK,$buf,$flen; # read the file
  print $OUT $buf;
  close $OUT;
  #print "hello:",$name,"\n";
}
 

 

 

 

Avatar_small
How To Improve CIBIL 说:
2022年8月07日 12:44

As you might already know that CIBIL score is just a 3 digit number which is used to explain your past financial and credit history that is taken into consideration by loan facilities, banks and everyone when you look to fetch for a loan, credit and more. How To Improve CIBIL Score Immediately If you check CIBIL Score range valued from 300 to 900 where having 300 will expect you for rejection for a loan or credit card you might apply for. If you simply improve your score to near 900 then your chances of getting better credit out in the market will improve vastly.

Avatar_small
CG Board 12th Import 说:
2022年8月18日 14:36

CGBSE 12th Question Paper 2023 Download – CG Board 12th Important Question Paper 2023 PDF, Chhattisgarh Board CGBSE 12 Question Paper 2023, CG Board 12th Important Question Paper 2023 PDF Chhattisgarh HSC & Class 12th exam Previous Question Paper has been declared. Good news for the students who are eagerly looking for the Chhattisgarh Board Class 12th exams of the 2023 academic year.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter