技术解析

看不懂自定义 magic 文件的规则,求指点.
0
2021-07-21 09:17:24
idczone

对 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


man 5 magic
有详细的 manual:
https://linux.die.net/man/5/magic

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服