fbpx
维基百科

复合二进制文档

复合二进制文档(CFBF),簡称复合文档[1]英文全名 Composite Document File V2 Document[2],是微软开发、用於实现COM结构化存储的文件格式,用于把多个对象内容存放在同一个硬盘文件。[3][4][5]

Microsoft已经开放了这个文件格式。广泛用于Microsoft WordMicrosoft Access。也是Advanced Authoring Format英语Advanced Authoring Format的基础。[6]

文件结构

CFBF文件头部是512字节,随后跟着是保存数据的扇区。扇区的长度在文件头部指定,通常是512字节或4096字节。

CFBF的扇区类型:

  • FAT扇区
  • MiniFAT扇区:用于Mini-Stream
  • Double-Indirect FAT (DIFAT)扇区 - 包含FAT扇区索引的链表数据
  • Directory扇区
  • Stream扇区 - 包含数据内容
  • Range Lock扇区 - 包含大文件的上锁的字节范围

CFBF文件头

CFBF头是该文件的最前的512字节。对应于C语言数据结构为:

 typedef unsigned long ULONG; // 4 Bytes  typedef unsigned short USHORT; // 2 Bytes  typedef short OFFSET; // 2 Bytes  typedef ULONG SECT; // 4 Bytes  typedef ULONG FSINDEX; // 4 Bytes  typedef USHORT FSOFFSET; // 2 Bytes  typedef USHORT WCHAR; // 2 Bytes  typedef ULONG DFSIGNATURE; // 4 Bytes  typedef unsigned char BYTE; // 1 Byte  typedef unsigned short WORD; // 2 Bytes  typedef unsigned long DWORD; // 4 Bytes  typedef ULONG SID; // 4 Bytes  typedef GUID CLSID; // 16 Bytes  struct StructuredStorageHeader { // [offset from start (bytes), length (bytes)]  BYTE _abSig[8]; // [00H,08] {0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1,  // 0x1a, 0xe1} for current version  CLSID _clsid; // [08H,16] reserved must be zero (WriteClassStg/  // GetClassFile uses root directory class id)  USHORT _uMinorVersion; // [18H,02] minor version of the format: 33 is  // written by reference implementation  USHORT _uDllVersion; // [1AH,02] major version of the dll/format: 3 for  // 512-byte sectors, 4 for 4 KB sectors  USHORT _uByteOrder; // [1CH,02] 0xFFFE: indicates Intel byte-ordering  USHORT _uSectorShift; // [1EH,02] size of sectors in power-of-two;  // typically 9 indicating 512-byte sectors  USHORT _uMiniSectorShift; // [20H,02] size of mini-sectors in power-of-two;  // typically 6 indicating 64-byte mini-sectors  USHORT _usReserved; // [22H,02] reserved, must be zero  ULONG _ulReserved1; // [24H,04] reserved, must be zero  FSINDEX _csectDir; // [28H,04] must be zero for 512-byte sectors,  // number of SECTs in directory chain for 4 KB  // sectors  FSINDEX _csectFat; // [2CH,04] number of SECTs in the FAT chain  SECT _sectDirStart; // [30H,04] first SECT in the directory chain  DFSIGNATURE _signature; // [34H,04] signature used for transactions; must  // be zero. The reference implementation  // does not support transactions  ULONG _ulMiniSectorCutoff; // [38H,04] maximum size for a mini stream;  // typically 4096 bytes  SECT _sectMiniFatStart; // [3CH,04] first SECT in the MiniFAT chain  FSINDEX _csectMiniFat; // [40H,04] number of SECTs in the MiniFAT chain  SECT _sectDifStart; // [44H,04] first SECT in the DIFAT chain  FSINDEX _csectDif; // [48H,04] number of SECTs in the DIFAT chain  SECT _sectFat[109]; // [4CH,436] the SECTs of first 109 FAT sectors  }; 

FAT扇区

每个FAT条目长度4字节,包含下个FAT链表条目的扇区号,或下述特定值:

  • FREESECT (0xFFFFFFFF) - 未用扇区
  • ENDOFCHAIN (0xFFFFFFFE) - FAT链表最后一个扇区
  • FATSECT (0xFFFFFFFD) - 用于FAT数据存储
  • DIFSECT (0xFFFFFFFC) - 用于DIFAT数据存储

词汇表

  • FAT - 文件分配表,也称 SAT - 扇区分配表
  • DIFAT - Double-Indirect File Allocation Table
  • FAT Chain - 一群FAT条目指出分配给一个流的那些扇区
  • Stream - 一个数据对象的内容
  • Sector - 扇区,占据512或4096个字节

参见

参考文献

  1. ^ . POI Project. [10 May 2011]. (原始内容存档于2011-04-26). 
  2. ^ . [25 Nov 2016]. (原始内容存档于2019-09-21). 
  3. ^ Compound Files (Windows). Microsoft Developers Network (MSDN) library – COM SDK. Microsoft Corporation. 20 November 2008 [23 September 2009]. (原始内容于2016-03-07). 
  4. ^ Containers: Compound Files. Microsoft Developers Network (MSDN) library – Visual Studio 2008 documentation. Microsoft Corporation. [23 September 2009]. (原始内容于2012-10-18). 
  5. ^ Understand Compound Files. Microsoft Developers Network (MSDN) library – ActiveDirectory Rights Management. 25 June 2009 [23 September 2009]. (原始内容于2016-03-09). 
  6. ^ AMW Association (formerly AAF Association) 互联网档案馆的,存档日期15 August 2000.

外部链接

  • Microsoft Compound Document File Format (PDF). OpenOffice.org CFBF description. [2006-05-22]. (原始内容存档 (PDF)于2011-10-12). 
  • (PDF). Microsoft Structured Storage version 3 specification (PDF). [2006-05-22]. (原始内容 (PDF)存档于2011-08-09). 

复合二进制文档, cfbf, 簡称复合文档, 英文全名, composite, document, file, document, 是微软开发, 用於实现com结构化存储的文件格式, 用于把多个对象内容存放在同一个硬盘文件, microsoft已经开放了这个文件格式, 广泛用于microsoft, word与microsoft, access, 也是advanced, authoring, format, 英语, advanced, authoring, format, 的基础, 目录, 文件结构, cfbf文件头. 复合二进制文档 CFBF 簡称复合文档 1 英文全名 Composite Document File V2 Document 2 是微软开发 用於实现COM结构化存储的文件格式 用于把多个对象内容存放在同一个硬盘文件 3 4 5 Microsoft已经开放了这个文件格式 广泛用于Microsoft Word与Microsoft Access 也是Advanced Authoring Format 英语 Advanced Authoring Format 的基础 6 目录 1 文件结构 1 1 CFBF文件头 1 2 FAT扇区 1 3 词汇表 2 参见 3 参考文献 4 外部链接文件结构 编辑CFBF文件头部是512字节 随后跟着是保存数据的扇区 扇区的长度在文件头部指定 通常是512字节或4096字节 CFBF的扇区类型 FAT扇区 MiniFAT扇区 用于Mini Stream Double Indirect FAT DIFAT 扇区 包含FAT扇区索引的链表数据 Directory扇区 Stream扇区 包含数据内容 Range Lock扇区 包含大文件的上锁的字节范围CFBF文件头 编辑 CFBF头是该文件的最前的512字节 对应于C语言数据结构为 typedef unsigned long ULONG 4 Bytes typedef unsigned short USHORT 2 Bytes typedef short OFFSET 2 Bytes typedef ULONG SECT 4 Bytes typedef ULONG FSINDEX 4 Bytes typedef USHORT FSOFFSET 2 Bytes typedef USHORT WCHAR 2 Bytes typedef ULONG DFSIGNATURE 4 Bytes typedef unsigned char BYTE 1 Byte typedef unsigned short WORD 2 Bytes typedef unsigned long DWORD 4 Bytes typedef ULONG SID 4 Bytes typedef GUID CLSID 16 Bytes struct StructuredStorageHeader offset from start bytes length bytes BYTE abSig 8 00H 08 0xd0 0xcf 0x11 0xe0 0xa1 0xb1 0x1a 0xe1 for current version CLSID clsid 08H 16 reserved must be zero WriteClassStg GetClassFile uses root directory class id USHORT uMinorVersion 18H 02 minor version of the format 33 is written by reference implementation USHORT uDllVersion 1AH 02 major version of the dll format 3 for 512 byte sectors 4 for 4 KB sectors USHORT uByteOrder 1CH 02 0xFFFE indicates Intel byte ordering USHORT uSectorShift 1EH 02 size of sectors in power of two typically 9 indicating 512 byte sectors USHORT uMiniSectorShift 20H 02 size of mini sectors in power of two typically 6 indicating 64 byte mini sectors USHORT usReserved 22H 02 reserved must be zero ULONG ulReserved1 24H 04 reserved must be zero FSINDEX csectDir 28H 04 must be zero for 512 byte sectors number of SECTs in directory chain for 4 KB sectors FSINDEX csectFat 2CH 04 number of SECTs in the FAT chain SECT sectDirStart 30H 04 first SECT in the directory chain DFSIGNATURE signature 34H 04 signature used for transactions must be zero The reference implementation does not support transactions ULONG ulMiniSectorCutoff 38H 04 maximum size for a mini stream typically 4096 bytes SECT sectMiniFatStart 3CH 04 first SECT in the MiniFAT chain FSINDEX csectMiniFat 40H 04 number of SECTs in the MiniFAT chain SECT sectDifStart 44H 04 first SECT in the DIFAT chain FSINDEX csectDif 48H 04 number of SECTs in the DIFAT chain SECT sectFat 109 4CH 436 the SECTs of first 109 FAT sectors FAT扇区 编辑 每个FAT条目长度4字节 包含下个FAT链表条目的扇区号 或下述特定值 FREESECT 0xFFFFFFFF 未用扇区 ENDOFCHAIN 0xFFFFFFFE FAT链表最后一个扇区 FATSECT 0xFFFFFFFD 用于FAT数据存储 DIFSECT 0xFFFFFFFC 用于DIFAT数据存储词汇表 编辑 FAT 文件分配表 也称 SAT 扇区分配表 DIFAT Double Indirect File Allocation Table FAT Chain 一群FAT条目指出分配给一个流的那些扇区 Stream 一个数据对象的内容 Sector 扇区 占据512或4096个字节参见 编辑COM结构化存储参考文献 编辑 Apache POI POIFS POI Project 10 May 2011 原始内容存档于2011 04 26 How to convert documents between LibreOffice and Microsoft Office file formats on Linux 25 Nov 2016 原始内容存档于2019 09 21 Compound Files Windows Microsoft Developers Network MSDN library COM SDK Microsoft Corporation 20 November 2008 23 September 2009 原始内容存档于2016 03 07 Containers Compound Files Microsoft Developers Network MSDN library Visual Studio 2008 documentation Microsoft Corporation 23 September 2009 原始内容存档于2012 10 18 Understand Compound Files Microsoft Developers Network MSDN library ActiveDirectory Rights Management 25 June 2009 23 September 2009 原始内容存档于2016 03 09 AMW Association formerly AAF Association 互联网档案馆的存檔 存档日期15 August 2000 外部链接 编辑Microsoft Compound Document File Format PDF OpenOffice org CFBF description 2006 05 22 原始内容存档 PDF 于2011 10 12 Advanced Authoring Format Low Level Container Specification PDF Microsoft Structured Storage version 3 specification PDF 2006 05 22 原始内容 PDF 存档于2011 08 09 取自 https zh wikipedia org w index php title 复合二进制文档 amp oldid 69893927, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。