V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
comwrg
V2EX  ›  编程

想问一下二进制协议格式说明的注释有没有什么好用的生成工具吗

  •  
  •   comwrg · 2021-03-23 14:30:35 +08:00 · 1150 次点击
    这是一个创建于 1102 天前的主题,其中的信息可能已经有所发展或是发生改变。

    比如像这种:

    gzip 头的格式:
    
    +---+---+---+---+---+---+---+---+---+---+
    |ID1|ID2|CM |FLG|     MTIME     |XFL|OS | (more-->)
    +---+---+---+---+---+---+---+---+---+---+
    
    (if FLG.FEXTRA set)
    
    +---+---+=================================+
    | XLEN  |...XLEN bytes of "extra field"...| (more-->)
    +---+---+=================================+
    
    (if FLG.FNAME set)
    
    +=========================================+
    |...original file name, zero-terminated...| (more-->)
    +=========================================+
    
    (if FLG.FCOMMENT set)
    
    +===================================+
    |...file comment, zero-terminated...| (more-->)
    +===================================+
    
    (if FLG.FHCRC set)
    
    +---+---+
    | CRC16 |
    +---+---+
    
    +=======================+
    |...compressed blocks...| (more-->)
    +=======================+
    
     0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
    |     CRC32     |     ISIZE     |
    +---+---+---+---+---+---+---+---+
    

    纯手工感觉有点麻烦,Google 上找了一圈似乎没有现成的工具。

    4 条回复    2021-03-24 08:22:58 +08:00
    imn1
        1
    imn1  
       2021-03-23 14:56:47 +08:00
    搜 file signatrue,或 file fingerprint
    工具的话一般都是截至到某个时期的,因为新文件格式(其特征)是不断创新的,每天都有新的格式
    omph
        2
    omph  
       2021-03-23 18:08:08 +08:00
    哪里麻烦?生成格式的表吗?
    comwrg
        3
    comwrg  
    OP
       2021-03-23 19:05:05 +08:00
    @omph 是的,表框这种`+---+---+---+---+---+---+---+---+`对齐感觉麻烦
    omph
        4
    omph  
       2021-03-24 08:22:58 +08:00
    要不试试这个
    https://textik.com
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4468 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 10:02 · PVG 18:02 · LAX 03:02 · JFK 06:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.