Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
ruiyi1994
V2EX  ›  Linux

看不懂自定义 magic 文件的规则,求指点.

  •  
  •   ruiyi1994 · Jul 21, 2021 · 2084 views
    This topic created in 1778 days ago, the information mentioned may be changed or developed.

    对 file 命令识别文件类型感兴趣,查了下资料, 发现是有系统内置了 magic 文件,相当于数据库,定义了一些通过文件头的内容来识别文件类型的规则, 不过苦于里面的一些规则看不懂, 还望指点. 就是图片上的 *0x18, >*0x3c , >+54

    0   short	0x5AD4	DOS executable
    *0x18	Short	0x40
    >*0x3c	Short	0x6584C OS/2 linear executable
    >*0x3C	Short	0x454e
    >+54byte	1	OS/2 format
    >+54byte	2	Windows format
    0   short	0xFDF0	DOS library
    0   string	AH	Halo bitmapped font file
    0   short	0x601A	Atara ST contiguous executable
    

    1 replies    2021-07-21 16:23:47 +08:00
    bigfei
        1
    bigfei  
       Jul 21, 2021
    man 5 magic
    有详细的 manual:
    https://linux.die.net/man/5/magic
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5857 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 02:00 · PVG 10:00 · LAX 19:00 · JFK 22:00
    ♥ Do have faith in what you're doing.