comwrg
V2EX  ›  编程

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

  •  
  •   comwrg · Mar 23, 2021 · 2030 views
    This topic created in 1877 days ago, the information mentioned may be changed or developed.

    比如像这种:

    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 replies    2021-03-24 08:22:58 +08:00
    imn1
        1
    imn1  
       Mar 23, 2021
    搜 file signatrue,或 file fingerprint
    工具的话一般都是截至到某个时期的,因为新文件格式(其特征)是不断创新的,每天都有新的格式
    omph
        2
    omph  
       Mar 23, 2021
    哪里麻烦?生成格式的表吗?
    comwrg
        3
    comwrg  
    OP
       Mar 23, 2021
    @omph 是的,表框这种`+---+---+---+---+---+---+---+---+`对齐感觉麻烦
    omph
        4
    omph  
       Mar 24, 2021
    要不试试这个
    https://textik.com
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5709 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 01:36 · PVG 09:36 · LAX 18:36 · JFK 21:36
    ♥ Do have faith in what you're doing.