读取具有给定格式/结构的二进制文件

时间:2019-06-13 17:06:05

标签: python

我需要阅读给定格式/结构的二进制文件: 例如: 00000000000000004d4400010000010001060605040302010e0f0e0d0c0b0a090000000000000001544d502c564252473b00004d44000253070ed700007e083c000000000000000208f0d6000080080ed7000080084bd7000080085ad700008000000000000000030080083cd70000800869d7000080080ed70000800878d7000000000000000004d70000810894d600008008ffd600008008e0d600008108780000000000000005081dd7000081082cd700008008d1d600008108ffd60000800000000000000006008108ffd6000081080ed7000081081dd700008108f0d6000000000000000007d7000081082cd7000081081dd7000080082cd7000081086900000000000000080897d700007e08b5d70000

这是格式/结构:

  • 0x00 0x00 0x00 0x00 MARKER--GAP
  • 0x4D 0x44 0x00 0x01 MARKER--HEADER
  • 0x00 0x01-VERS
  • 0x4D 0x44 0x00 0x02标记-文本元数据
  • 0x06字节中的ID长度
  • 0x10..ID(MSB优先)
  • 0x0E XPID LEN在字节中
  • 0x00 ... XPID(MSB优先)
  • 0-X NAME LEN BY BYTES
  • 0-X名称(PRESS1,INCL1,LOADC1 ...)-未终止nul

0 个答案:

没有答案