1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*898496eeSXin LI# $File: linux,v 1.85 2023/07/17 14:40:09 christos Exp $ 4b6cee71dSXin LI# linux: file(1) magic for Linux files 5b6cee71dSXin LI# 6b6cee71dSXin LI# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com> 7b6cee71dSXin LI# The following basic Linux magic is useful for reference, but using 8b6cee71dSXin LI# "long" magic is a better practice in order to avoid collisions. 9b6cee71dSXin LI# 10b6cee71dSXin LI# 2 leshort 100 Linux/i386 11b6cee71dSXin LI# >0 leshort 0407 impure executable (OMAGIC) 12b6cee71dSXin LI# >0 leshort 0410 pure executable (NMAGIC) 13b6cee71dSXin LI# >0 leshort 0413 demand-paged executable (ZMAGIC) 14b6cee71dSXin LI# >0 leshort 0314 demand-paged executable (QMAGIC) 15b6cee71dSXin LI# 16b6cee71dSXin LI0 lelong 0x00640107 Linux/i386 impure executable (OMAGIC) 17b6cee71dSXin LI>16 lelong 0 \b, stripped 18b6cee71dSXin LI0 lelong 0x00640108 Linux/i386 pure executable (NMAGIC) 19b6cee71dSXin LI>16 lelong 0 \b, stripped 20b6cee71dSXin LI0 lelong 0x0064010b Linux/i386 demand-paged executable (ZMAGIC) 21b6cee71dSXin LI>16 lelong 0 \b, stripped 22b6cee71dSXin LI0 lelong 0x006400cc Linux/i386 demand-paged executable (QMAGIC) 23b6cee71dSXin LI>16 lelong 0 \b, stripped 24b6cee71dSXin LI# 25b6cee71dSXin LI0 string \007\001\000 Linux/i386 object file 26b6cee71dSXin LI>20 lelong >0x1020 \b, DLL library 27b6cee71dSXin LI# Linux-8086 stuff: 28b6cee71dSXin LI0 string \01\03\020\04 Linux-8086 impure executable 29b6cee71dSXin LI>28 long !0 not stripped 30b6cee71dSXin LI0 string \01\03\040\04 Linux-8086 executable 31b6cee71dSXin LI>28 long !0 not stripped 32b6cee71dSXin LI# 33b6cee71dSXin LI0 string \243\206\001\0 Linux-8086 object file 34b6cee71dSXin LI# 35b6cee71dSXin LI0 string \01\03\020\20 Minix-386 impure executable 36b6cee71dSXin LI>28 long !0 not stripped 37b6cee71dSXin LI0 string \01\03\040\20 Minix-386 executable 38b6cee71dSXin LI>28 long !0 not stripped 39b6cee71dSXin LI0 string \01\03\04\20 Minix-386 NSYM/GNU executable 40b6cee71dSXin LI>28 long !0 not stripped 41b6cee71dSXin LI# core dump file, from Bill Reynolds <bill@goshawk.lanl.gov> 42b6cee71dSXin LI216 lelong 0421 Linux/i386 core file 43b6cee71dSXin LI!:strength / 2 44b6cee71dSXin LI>220 string >\0 of '%s' 45b6cee71dSXin LI>200 lelong >0 (signal %d) 46b6cee71dSXin LI# 47b6cee71dSXin LI# LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com> 48b6cee71dSXin LI# this can be overridden by the DOS executable (COM) entry 49b6cee71dSXin LI2 string LILO Linux/i386 LILO boot/chain loader 50b6cee71dSXin LI# 51b6cee71dSXin LI# Linux make config build file, from Ole Aamot <oka@oka.no> 52b6cee71dSXin LI# Updated by Ken Sharp 53b6cee71dSXin LI28 string make\ config Linux make config build file (old) 54b6cee71dSXin LI49 search/70 Kernel\ Configuration Linux make config build file 55b6cee71dSXin LI 56b6cee71dSXin LI# 57b6cee71dSXin LI# PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com> 58b6cee71dSXin LI# Updated by Adam Buchbinder <adam.buchbinder@gmail.com> 5948c779cdSXin LI# See: https://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html 60b6cee71dSXin LI0 leshort 0x0436 Linux/i386 PC Screen Font v1 data, 61b6cee71dSXin LI>2 byte&0x01 0 256 characters, 62b6cee71dSXin LI>2 byte&0x01 !0 512 characters, 63b6cee71dSXin LI>2 byte&0x02 0 no directory, 64b6cee71dSXin LI>2 byte&0x02 !0 Unicode directory, 65b6cee71dSXin LI>3 byte >0 8x%d 66b6cee71dSXin LI0 string \x72\xb5\x4a\x86\x00\x00 Linux/i386 PC Screen Font v2 data, 67b6cee71dSXin LI>16 lelong x %d characters, 68b6cee71dSXin LI>12 lelong&0x01 0 no directory, 69b6cee71dSXin LI>12 lelong&0x01 !0 Unicode directory, 70*898496eeSXin LI>28 lelong x %d 71*898496eeSXin LI>24 lelong x \bx%d 72b6cee71dSXin LI 732726a701SXin LI# Linux swap and hibernate files 742726a701SXin LI# Linux kernel: include/linux/swap.h 752726a701SXin LI# util-linux: libblkid/src/superblocks/swap.c 762726a701SXin LI 772726a701SXin LI# format v0, unsupported since 2002 782726a701SXin LI0xff6 string SWAP-SPACE Linux old swap file, 4k page size 792726a701SXin LI0x1ff6 string SWAP-SPACE Linux old swap file, 8k page size 802726a701SXin LI0x3ff6 string SWAP-SPACE Linux old swap file, 16k page size 812726a701SXin LI0x7ff6 string SWAP-SPACE Linux old swap file, 32k page size 822726a701SXin LI0xfff6 string SWAP-SPACE Linux old swap file, 64k page size 832726a701SXin LI 842726a701SXin LI# format v1, supported since 1998 852726a701SXin LI0 name linux-swap 862726a701SXin LI>0x400 lelong 1 little endian, version %u, 872726a701SXin LI>>0x404 lelong x size %u pages, 882726a701SXin LI>>0x408 lelong x %u bad pages, 892726a701SXin LI>0x400 belong 1 big endian, version %u, 902726a701SXin LI>>0x404 belong x size %u pages, 912726a701SXin LI>>0x408 belong x %u bad pages, 922726a701SXin LI>0x41c string \0 no label, 932726a701SXin LI>0x41c string >\0 LABEL=%s, 9443a5ec4eSXin LI>0x40c ubelong x UUID=%08x 9543a5ec4eSXin LI>0x410 ubeshort x \b-%04x 9643a5ec4eSXin LI>0x412 ubeshort x \b-%04x 9743a5ec4eSXin LI>0x414 ubeshort x \b-%04x 9843a5ec4eSXin LI>0x416 ubelong x \b-%08x 9943a5ec4eSXin LI>0x41a ubeshort x \b%04x 1002726a701SXin LI 1012726a701SXin LI0xff6 string SWAPSPACE2 Linux swap file, 4k page size, 1022726a701SXin LI>0 use linux-swap 1032726a701SXin LI0x1ff6 string SWAPSPACE2 Linux swap file, 8k page size, 1042726a701SXin LI>0 use linux-swap 1052726a701SXin LI0x3ff6 string SWAPSPACE2 Linux swap file, 16k page size, 1062726a701SXin LI>0 use linux-swap 1072726a701SXin LI0x7ff6 string SWAPSPACE2 Linux swap file, 32k page size, 1082726a701SXin LI>0 use linux-swap 1092726a701SXin LI0xfff6 string SWAPSPACE2 Linux swap file, 64k page size, 1102726a701SXin LI>0 use linux-swap 1112726a701SXin LI 1122726a701SXin LI0 name linux-hibernate 1132726a701SXin LI>0 string S1SUSPEND \b, with SWSUSP1 image 1142726a701SXin LI>0 string S2SUSPEND \b, with SWSUSP2 image 1152726a701SXin LI>0 string ULSUSPEND \b, with uswsusp image 1162726a701SXin LI>0 string LINHIB0001 \b, with compressed hibernate image 1172726a701SXin LI>0 string \xed\xc3\x02\xe9\x98\x56\xe5\x0c \b, with tuxonice image 1182726a701SXin LI>0 default x \b, with unknown hibernate image 1192726a701SXin LI 1202726a701SXin LI0xfec string SWAPSPACE2 Linux swap file, 4k page size, 1212726a701SXin LI>0 use linux-swap 1222726a701SXin LI>0xff6 use linux-hibernate 1232726a701SXin LI0x1fec string SWAPSPACE2 Linux swap file, 8k page size, 1242726a701SXin LI>0 use linux-swap 1252726a701SXin LI>0x1ff6 use linux-hibernate 1262726a701SXin LI0x3fec string SWAPSPACE2 Linux swap file, 16k page size, 1272726a701SXin LI>0 use linux-swap 1282726a701SXin LI>0x3ff6 use linux-hibernate 1292726a701SXin LI0x7fec string SWAPSPACE2 Linux swap file, 32k page size, 1302726a701SXin LI>0 use linux-swap 1312726a701SXin LI>0x7ff6 use linux-hibernate 1322726a701SXin LI0xffec string SWAPSPACE2 Linux swap file, 64k page size, 1332726a701SXin LI>0 use linux-swap 1342726a701SXin LI>0xfff6 use linux-hibernate 1352726a701SXin LI 136b6cee71dSXin LI# 137b6cee71dSXin LI# Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu> 138b6cee71dSXin LI# and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de> 139b6cee71dSXin LI# and Nicolas Lichtmaier <nick@debian.org> 140b6cee71dSXin LI# All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29 141b6cee71dSXin LI# Linux kernel boot images (i386 arch) (Wolfram Kleff) 14248c779cdSXin LI# URL: https://www.kernel.org/doc/Documentation/x86/boot.txt 143b6cee71dSXin LI514 string HdrS Linux kernel 144b6cee71dSXin LI!:strength + 55 14548c779cdSXin LI# often no extension like in linux, vmlinuz, bzimage or memdisk but sometimes 14648c779cdSXin LI# Acronis Recovery kernel64.dat and Plop Boot Manager plpbtrom.bin 14748c779cdSXin LI# DamnSmallLinux 1.5 damnsmll.lnx 14848c779cdSXin LI!:ext /dat/bin/lnx 149b6cee71dSXin LI>510 leshort 0xAA55 x86 boot executable 150b6cee71dSXin LI>>518 leshort >0x1ff 151b6cee71dSXin LI>>>529 byte 0 zImage, 152b6cee71dSXin LI>>>529 byte 1 bzImage, 153b6cee71dSXin LI>>>526 lelong >0 154b6cee71dSXin LI>>>>(526.s+0x200) string >\0 version %s, 155b6cee71dSXin LI>>498 leshort 1 RO-rootFS, 156b6cee71dSXin LI>>498 leshort 0 RW-rootFS, 15743a5ec4eSXin LI>>508 leshort >0 root_dev %#X, 15843a5ec4eSXin LI>>502 leshort >0 swap_dev %#X, 159b6cee71dSXin LI>>504 leshort >0 RAMdisksize %u KB, 160b6cee71dSXin LI>>506 leshort 0xFFFF Normal VGA 161b6cee71dSXin LI>>506 leshort 0xFFFE Extended VGA 162b6cee71dSXin LI>>506 leshort 0xFFFD Prompt for Videomode 163b6cee71dSXin LI>>506 leshort >0 Video mode %d 164b6cee71dSXin LI# This also matches new kernels, which were caught above by "HdrS". 165b6cee71dSXin LI0 belong 0xb8c0078e Linux kernel 166b6cee71dSXin LI>0x1e3 string Loading version 1.3.79 or older 167b6cee71dSXin LI>0x1e9 string Loading from prehistoric times 168b6cee71dSXin LI 169b6cee71dSXin LI# System.map files - Nicolas Lichtmaier <nick@debian.org> 170b6cee71dSXin LI8 search/1 \ A\ _text Linux kernel symbol map text 171b6cee71dSXin LI 172b6cee71dSXin LI# LSM entries - Nicolas Lichtmaier <nick@debian.org> 173b6cee71dSXin LI0 search/1 Begin3 Linux Software Map entry text 174b6cee71dSXin LI0 search/1 Begin4 Linux Software Map entry text (new format) 175b6cee71dSXin LI 176b6cee71dSXin LI# From Matt Zimmerman, enhanced for v3 by Matthew Palmer 177b6cee71dSXin LI0 belong 0x4f4f4f4d User-mode Linux COW file 178b6cee71dSXin LI>4 belong <3 \b, version %d 179b6cee71dSXin LI>>8 string >\0 \b, backing file %s 180b6cee71dSXin LI>4 belong >2 \b, version %d 181b6cee71dSXin LI>>32 string >\0 \b, backing file %s 182b6cee71dSXin LI 183b6cee71dSXin LI############################################################################ 184b6cee71dSXin LI# Linux kernel versions 185b6cee71dSXin LI 186b6cee71dSXin LI0 string \xb8\xc0\x07\x8e\xd8\xb8\x00\x90 Linux 187b6cee71dSXin LI>497 leshort 0 x86 boot sector 188b6cee71dSXin LI>>514 belong 0x8e of a kernel from the dawn of time! 189b6cee71dSXin LI>>514 belong 0x908ed8b4 version 0.99-1.1.42 190b6cee71dSXin LI>>514 belong 0x908ed8b8 for memtest86 191b6cee71dSXin LI 192b6cee71dSXin LI>497 leshort !0 x86 kernel 193b6cee71dSXin LI>>504 leshort >0 RAMdisksize=%u KB 19443a5ec4eSXin LI>>502 leshort >0 swap=%#X 19543a5ec4eSXin LI>>508 leshort >0 root=%#X 196b6cee71dSXin LI>>>498 leshort 1 \b-ro 197b6cee71dSXin LI>>>498 leshort 0 \b-rw 198b6cee71dSXin LI>>506 leshort 0xFFFF vga=normal 199b6cee71dSXin LI>>506 leshort 0xFFFE vga=extended 200b6cee71dSXin LI>>506 leshort 0xFFFD vga=ask 201b6cee71dSXin LI>>506 leshort >0 vga=%d 202b6cee71dSXin LI>>514 belong 0x908ed881 version 1.1.43-1.1.45 203b6cee71dSXin LI>>514 belong 0x15b281cd 204b6cee71dSXin LI>>>0xa8e belong 0x55AA5a5a version 1.1.46-1.2.13,1.3.0 205b6cee71dSXin LI>>>0xa99 belong 0x55AA5a5a version 1.3.1,2 206b6cee71dSXin LI>>>0xaa3 belong 0x55AA5a5a version 1.3.3-1.3.30 207b6cee71dSXin LI>>>0xaa6 belong 0x55AA5a5a version 1.3.31-1.3.41 208b6cee71dSXin LI>>>0xb2b belong 0x55AA5a5a version 1.3.42-1.3.45 209b6cee71dSXin LI>>>0xaf7 belong 0x55AA5a5a version 1.3.46-1.3.72 210b6cee71dSXin LI>>514 string HdrS 211b6cee71dSXin LI>>>518 leshort >0x1FF 212b6cee71dSXin LI>>>>529 byte 0 \b, zImage 213b6cee71dSXin LI>>>>529 byte 1 \b, bzImage 214b6cee71dSXin LI>>>>(526.s+0x200) string >\0 \b, version %s 215b6cee71dSXin LI 216b6cee71dSXin LI# Linux boot sector thefts. 217b6cee71dSXin LI0 belong 0xb8c0078e Linux 218b6cee71dSXin LI>0x1e6 belong 0x454c4b53 ELKS Kernel 219b6cee71dSXin LI>0x1e6 belong !0x454c4b53 style boot sector 220b6cee71dSXin LI 221b6cee71dSXin LI############################################################################ 222b6cee71dSXin LI# Linux S390 kernel image 223b6cee71dSXin LI# Created by: Jan Kaluza <jkaluza@redhat.com> 224b6cee71dSXin LI8 string \x02\x00\x00\x18\x60\x00\x00\x50\x02\x00\x00\x68\x60\x00\x00\x50\x40\x40\x40\x40\x40\x40\x40\x40 Linux S390 225b6cee71dSXin LI>0x00010000 search/b/4096 \x00\x0a\x00\x00\x8b\xad\xcc\xcc 226b6cee71dSXin LI# 64bit 227b6cee71dSXin LI>>&0 string \xc1\x00\xef\xe3\xf0\x68\x00\x00 Z10 64bit kernel 228b6cee71dSXin LI>>&0 string \xc1\x00\xef\xc3\x00\x00\x00\x00 Z9-109 64bit kernel 229b6cee71dSXin LI>>&0 string \xc0\x00\x20\x00\x00\x00\x00\x00 Z990 64bit kernel 230b6cee71dSXin LI>>&0 string \x00\x00\x00\x00\x00\x00\x00\x00 Z900 64bit kernel 231b6cee71dSXin LI# 32bit 232b6cee71dSXin LI>>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z10 32bit kernel 233b6cee71dSXin LI>>&0 string \x81\x00\xc8\x80\x00\x00\x00\x00 Z9-109 32bit kernel 234b6cee71dSXin LI>>&0 string \x80\x00\x20\x00\x00\x00\x00\x00 Z990 32bit kernel 235b6cee71dSXin LI>>&0 string \x80\x00\x00\x00\x00\x00\x00\x00 Z900 32bit kernel 236b6cee71dSXin LI 2372726a701SXin LI############################################################################ 238b6cee71dSXin LI# Linux ARM compressed kernel image 239b6cee71dSXin LI# From: Kevin Cernekee <cernekee@gmail.com> 24048c779cdSXin LI# Update: Joerg Jenderek 2412726a701SXin LI0x24 lelong 0x016f2818 Linux kernel ARM boot executable zImage 24243a5ec4eSXin LI# There are three possible situations: LE, BE with LE bootloader and pure BE. 2432726a701SXin LI# In order to aid telling these apart a new endian flag was added. In order 2442726a701SXin LI# to support kernels before the flag and BE with LE bootloader was added we'll 2452726a701SXin LI# do a negative check against the BE variant of the flag when we see a LE magic. 2462726a701SXin LI>0x30 belong !0x04030201 (little-endian) 24748c779cdSXin LI# raspian "kernel7.img", Vu+ Ultimo4K "kernel_auto.bin" 24848c779cdSXin LI!:ext img/bin 24943a5ec4eSXin LI>0x30 belong 0x04030201 (big-endian) 2502726a701SXin LI0x24 belong 0x016f2818 Linux kernel ARM boot executable zImage (big-endian) 2512726a701SXin LI 2522726a701SXin LI############################################################################ 2532726a701SXin LI# Linux AARCH64 kernel image 2542726a701SXin LI0x38 lelong 0x644d5241 Linux kernel ARM64 boot executable Image 2552726a701SXin LI>0x18 lelong ^1 \b, little-endian 2562726a701SXin LI>0x18 lelong &1 \b, big-endian 2572726a701SXin LI>0x18 lelong &2 \b, 4K pages 2582726a701SXin LI>0x18 lelong &4 \b, 16K pages 2592726a701SXin LI>0x18 lelong &6 \b, 32K pages 260b6cee71dSXin LI 261b6cee71dSXin LI############################################################################ 262b6cee71dSXin LI# Linux 8086 executable 263b6cee71dSXin LI0 lelong&0xFF0000FF 0xC30000E9 Linux-Dev86 executable, headerless 264b6cee71dSXin LI>5 string . 265b6cee71dSXin LI>>4 string >\0 \b, libc version %s 266b6cee71dSXin LI 267b6cee71dSXin LI0 lelong&0xFF00FFFF 0x4000301 Linux-8086 executable 268b6cee71dSXin LI>2 byte&0x01 !0 \b, unmapped zero page 269b6cee71dSXin LI>2 byte&0x20 0 \b, impure 270b6cee71dSXin LI>2 byte&0x20 !0 271b6cee71dSXin LI>>2 byte&0x10 !0 \b, A_EXEC 272b6cee71dSXin LI>2 byte&0x02 !0 \b, A_PAL 273b6cee71dSXin LI>2 byte&0x04 !0 \b, A_NSYM 274b6cee71dSXin LI>2 byte&0x08 !0 \b, A_STAND 275b6cee71dSXin LI>2 byte&0x40 !0 \b, A_PURE 276b6cee71dSXin LI>2 byte&0x80 !0 \b, A_TOVLY 277b6cee71dSXin LI>28 long !0 \b, not stripped 278b6cee71dSXin LI>37 string . 279b6cee71dSXin LI>>36 string >\0 \b, libc version %s 280b6cee71dSXin LI 281b6cee71dSXin LI# 0 lelong&0xFF00FFFF 0x10000301 ld86 I80386 executable 282b6cee71dSXin LI# 0 lelong&0xFF00FFFF 0xB000301 ld86 M68K executable 283b6cee71dSXin LI# 0 lelong&0xFF00FFFF 0xC000301 ld86 NS16K executable 284b6cee71dSXin LI# 0 lelong&0xFF00FFFF 0x17000301 ld86 SPARC executable 285b6cee71dSXin LI 286b6cee71dSXin LI# SYSLINUX boot logo files (from 'ppmtolss16' sources) 28748c779cdSXin LI# https://www.syslinux.org/wiki/index.php/SYSLINUX#Display_graphic_from_filename: 288b6cee71dSXin LI# file extension .lss .16 289b6cee71dSXin LI0 lelong =0x1413f33d SYSLINUX' LSS16 image data 290b6cee71dSXin LI# syslinux-4.05/mime/image/x-lss16.xml 291b6cee71dSXin LI!:mime image/x-lss16 292b6cee71dSXin LI>4 leshort x \b, width %d 293b6cee71dSXin LI>6 leshort x \b, height %d 294b6cee71dSXin LI 295b6cee71dSXin LI0 string OOOM User-Mode-Linux's Copy-On-Write disk image 296b6cee71dSXin LI>4 belong x version %d 297b6cee71dSXin LI 298b6cee71dSXin LI# SE Linux policy database 299b6cee71dSXin LI# From: Mike Frysinger <vapier@gentoo.org> 300b6cee71dSXin LI0 lelong 0xf97cff8c SE Linux policy 301b6cee71dSXin LI>16 lelong x v%d 302b6cee71dSXin LI>20 lelong 1 MLS 303b6cee71dSXin LI>24 lelong x %d symbols 304b6cee71dSXin LI>28 lelong x %d ocons 305b6cee71dSXin LI 306b6cee71dSXin LI# Linux Logical Volume Manager (LVM) 307b6cee71dSXin LI# Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net> 308b6cee71dSXin LI# 309b6cee71dSXin LI# System ID, UUID and volume group name are 128 bytes long 310b6cee71dSXin LI# but they should never be full and initialized with zeros... 311b6cee71dSXin LI# 312b6cee71dSXin LI# LVM1 313b6cee71dSXin LI# 3142726a701SXin LI0x0 string/b HM\001 LVM1 (Linux Logical Volume Manager), version 1 3152726a701SXin LI>0x12c string/b >\0 , System ID: %s 316b6cee71dSXin LI 3172726a701SXin LI0x0 string/b HM\002 LVM1 (Linux Logical Volume Manager), version 2 3182726a701SXin LI>0x12c string/b >\0 , System ID: %s 319b6cee71dSXin LI 320b6cee71dSXin LI# LVM2 321b6cee71dSXin LI# 322b6cee71dSXin LI# It seems that the label header can be in one the four first sector 323b6cee71dSXin LI# of the disk... (from _find_labeller in lib/label/label.c of LVM2) 324b6cee71dSXin LI# 325b6cee71dSXin LI# 0x200 seems to be the common case 3262726a701SXin LI0 name lvm2 3272726a701SXin LI# display UUID in LVM format + display all 32 bytes (instead of max string length: 31) 3282726a701SXin LI>0x0 string >\x2f \b, UUID: %.6s 3292726a701SXin LI>0x6 string >\x2f \b-%.4s 3302726a701SXin LI>0xa string >\x2f \b-%.4s 3312726a701SXin LI>0xe string >\x2f \b-%.4s 3322726a701SXin LI>0x12 string >\x2f \b-%.4s 3332726a701SXin LI>0x16 string >\x2f \b-%.4s 3342726a701SXin LI>0x1a string >\x2f \b-%.6s 3352726a701SXin LI>0x20 lequad x \b, size: %lld 336b6cee71dSXin LI 3372726a701SXin LI 338b6cee71dSXin LI# read the offset to add to the start of the header, and the header 339b6cee71dSXin LI# start in 0x200 3402726a701SXin LI0x218 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) 3412726a701SXin LI>&(&-12.l-0x20) use lvm2 342b6cee71dSXin LI 3432726a701SXin LI0x018 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) 3442726a701SXin LI>&(&-12.l-0x20) use lvm2 345b6cee71dSXin LI 3462726a701SXin LI0x418 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) 3472726a701SXin LI>&(&-12.l-0x20) use lvm2 348b6cee71dSXin LI 3492726a701SXin LI0x618 string/b LVM2\ 001 LVM2 PV (Linux Logical Volume Manager) 3502726a701SXin LI>&(&-12.l-0x20) use lvm2 351b6cee71dSXin LI 352b6cee71dSXin LI# LVM snapshot 353b6cee71dSXin LI# from Jason Farrel 354b6cee71dSXin LI0 string SnAp LVM Snapshot (CopyOnWrite store) 355b6cee71dSXin LI>4 lelong !0 - valid, 356b6cee71dSXin LI>4 lelong 0 - invalid, 357b6cee71dSXin LI>8 lelong x version %d, 358b6cee71dSXin LI>12 lelong x chunk_size %d 359b6cee71dSXin LI 360b6cee71dSXin LI# SE Linux policy database 361b6cee71dSXin LI0 lelong 0xf97cff8c SE Linux policy 362b6cee71dSXin LI>16 lelong x v%d 363b6cee71dSXin LI>20 lelong 1 MLS 364b6cee71dSXin LI>24 lelong x %d symbols 365b6cee71dSXin LI>28 lelong x %d ocons 366b6cee71dSXin LI 367b6cee71dSXin LI# Summary: Xen saved domain file 368b6cee71dSXin LI# Created by: Radek Vokal <rvokal@redhat.com> 369b6cee71dSXin LI0 string LinuxGuestRecord Xen saved domain 370b6cee71dSXin LI>20 search/256 (name 371b6cee71dSXin LI>>&1 string x (name %s) 372b6cee71dSXin LI 373b6cee71dSXin LI# Type: Xen, the virtual machine monitor 374b6cee71dSXin LI# From: Radek Vokal <rvokal@redhat.com> 375b6cee71dSXin LI0 string LinuxGuestRecord Xen saved domain 376b6cee71dSXin LI#>2 regex \(name\ [^)]*\) %s 377b6cee71dSXin LI>20 search/256 (name (name 378b6cee71dSXin LI>>&1 string x %s...) 379b6cee71dSXin LI 380b6cee71dSXin LI# Systemd journald files 38148c779cdSXin LI# See https://www.freedesktop.org/wiki/Software/systemd/journal-files/. 382b6cee71dSXin LI# From: Zbigniew Jedrzejewski-Szmek <zbyszek@in.waw.pl> 383*898496eeSXin LI# Update: Joerg Jenderek 384*898496eeSXin LI# URL: https://systemd.io/JOURNAL_FILE_FORMAT/ 385*898496eeSXin LI# Reference: http://mark0.net/download/triddefs_xml.7z/defs/j/journal-sysd.trid.xml 386*898496eeSXin LI# Note: called "systemd journal" by TrID 387*898496eeSXin LI# verified by `journalctl --file=user-1000.journal` 388*898496eeSXin LI# check magic signature[8] 389b6cee71dSXin LI0 string LPKSHHRH 390b6cee71dSXin LI# check that state is one of known values 391*898496eeSXin LI# STATE_OFFLINE~0 STATE_ONLINE~1 STATE_ARCHIVED~2 392b6cee71dSXin LI>16 ubyte&252 0 393b6cee71dSXin LI# check that each half of three unique id128s is non-zero 394*898496eeSXin LI# file_id 395b6cee71dSXin LI>>24 ubequad >0 396b6cee71dSXin LI>>>32 ubequad >0 397*898496eeSXin LI# machine_id 398b6cee71dSXin LI>>>>40 ubequad >0 399b6cee71dSXin LI>>>>>48 ubequad >0 400*898496eeSXin LI# boot_id; last writer 401b6cee71dSXin LI>>>>>>56 ubequad >0 402b6cee71dSXin LI>>>>>>>64 ubequad >0 Journal file 403*898496eeSXin LI#!:mime application/octet-stream 404*898496eeSXin LI!:mime application/x-linux-journal 405b6cee71dSXin LI# provide more info 406*898496eeSXin LI# head_entry_realtime; contains a POSIX timestamp stored in microseconds 407*898496eeSXin LI>>>>>>>>184 leqdate/1000000 !0 \b, %s 408b6cee71dSXin LI>>>>>>>>184 leqdate 0 empty 409*898496eeSXin LI# If a file is closed after writing the state field should be set to STATE_OFFLINE 410*898496eeSXin LI>>>>>>>>16 ubyte 0 \b, 411*898496eeSXin LI# for offline and empty only journal~ extension found 412*898496eeSXin LI>>>>>>>>>184 leqdate 0 offline 413*898496eeSXin LI# https://man7.org/linux/man-pages/man8/systemd-journald.service.8.html 414*898496eeSXin LI# GRR: add char ~ inside parse_ext in ../../src/apprentice.c to avoid in file version 5.44 error like: 415*898496eeSXin LI# Magdir/linux, 463: Warning: EXTENSION type ` journal~' has bad char '~' 416*898496eeSXin LI!:ext journal~ 417*898496eeSXin LI# for offline and non empty often *.journal~ but also user-1001.journal 418*898496eeSXin LI>>>>>>>>>184 leqdate !0 offline 419*898496eeSXin LI!:ext journal/journal~ 420*898496eeSXin LI# if a file is opened for writing the state field should be set to STATE_ONLINE 421*898496eeSXin LI>>>>>>>>16 ubyte 1 \b, 422*898496eeSXin LI# for online and empty only journal~ extension found 423*898496eeSXin LI>>>>>>>>>184 leqdate 0 online 424*898496eeSXin LI# system@0005febee06e2ff2-f7ea54d10e4346ff.journal~ 425*898496eeSXin LI!:ext journal~ 426*898496eeSXin LI# for online and non empty only journal extension found 427*898496eeSXin LI>>>>>>>>>184 leqdate !0 online 428*898496eeSXin LI# system.journal user-1000.journal 429*898496eeSXin LI!:ext journal 430*898496eeSXin LI# after a file has been rotated it should be set to STATE_ARCHIVED 431b6cee71dSXin LI>>>>>>>>16 ubyte 2 \b, archived 432*898496eeSXin LI!:ext journal 433*898496eeSXin LI# no *.journal~ found 434*898496eeSXin LI#!:ext journal/journal~ 435*898496eeSXin LI# compatible_flags 436b6cee71dSXin LI>>>>>>>>8 ulelong&1 1 \b, sealed 437*898496eeSXin LI# incompatible_flags; COMPRESSED_XZ~1 COMPRESSED_LZ4~2 KEYED_HASH~4 COMPRESSED_ZSTD~8 COMPACT~16 438*898496eeSXin LI#>>>>>>>>12 ulelong x FLAGS=%#x 439b6cee71dSXin LI>>>>>>>>12 ulelong&1 1 \b, compressed 440*898496eeSXin LI>>>>>>>>12 ulelong&2 !0 \b, compressed lz4 441*898496eeSXin LI>>>>>>>>12 ulelong&4 !0 \b, keyed hash siphash24 442*898496eeSXin LI>>>>>>>>12 ulelong&8 !0 \b, compressed zstd 443*898496eeSXin LI>>>>>>>>12 ulelong&16 !0 \b, compact 444*898496eeSXin LI# uint8_t reserved[7]; apparently nil 445*898496eeSXin LI#>>17 long !0 \b, reserved %#8.8x 446*898496eeSXin LI# seqnum_id; like: 0 e623691afec94b5aa968ae2d726c49cc f98b2af481924b29 8d6816ca3639edc6 447*898496eeSXin LI#>>>>>>>>72 ubequad x \b, seqnum_id %#16.16llx 448*898496eeSXin LI#>>>>>>>>80 ubequad x b%16.16llx 449*898496eeSXin LI# header_size like: 100h 450*898496eeSXin LI>>>>>>>>88 ulequad !0x100h \b, header size %#llx 451*898496eeSXin LI# arena_size like: 0 7fff00h ffff00h 17fff00h 452*898496eeSXin LI#>>>>>>>>96 ulequad >0 \b, arena size %#llx 453*898496eeSXin LI# data_hash_table_offset like: 0 15f0h 15f0h 454*898496eeSXin LI#>>>>>>>>104 ulequad >0 \b, hash table offset %#llx 455*898496eeSXin LI# data_hash_table_size like: 0 38e380h 456*898496eeSXin LI#>>>>>>>>112 ulequad >0 \b, hash table size %#llx 457*898496eeSXin LI# field_hash_table_offset like: 0 110h 458*898496eeSXin LI#>>>>>>>>120 ulequad >0 \b, field hash table offset %#llx 459*898496eeSXin LI# field_hash_table_size like: 0 14d0h 460*898496eeSXin LI#>>>>>>>>128 ulequad >0 \b, field hash table size %#llx 461*898496eeSXin LI# tail_object_offset like: 0 43edd8h 511278h c68968h d487d0h efaa98h 462*898496eeSXin LI#>>>>>>>>136 ulequad >0 \b, tail object offset %#llx 463*898496eeSXin LI# n_objects like: 0 1032h 5a2eh 92bdh a8b5h aa75h 112adh 40c23h 4714eh 464*898496eeSXin LI#>>>>>>>>144 ulequad >0 \b, objects %#llx 465*898496eeSXin LI# n_entries like: 0 3aeh 235ah 2dc4h 3125h 16129h 187a1h 466*898496eeSXin LI>>>>>>>>152 ulequad >0 \b, entries %#llx 467*898496eeSXin LI# tail_entry_seqnum like: 0 1988h 16249h 24c12h 24c12h 41e64h 9fefdh 468*898496eeSXin LI#>>>>>>>>160 ulequad >0 \b, tail entry seqnum %#llx 469*898496eeSXin LI# head_entry_seqnum like: 0 1h 15dbh 6552h 213bfh 213bfh 3e672h 9a28ah 470*898496eeSXin LI#>>>>>>>>168 ulequad >0 \b, head entry seqnum %#llx 471*898496eeSXin LI# entry_array_offset like: 0 390058h 3909d8h 3909e0h 472*898496eeSXin LI#>>>>>>>>176 ulequad >0 \b, entry array offset %#llx 473b6cee71dSXin LI 474b6cee71dSXin LI# BCache backing and cache devices 475b6cee71dSXin LI# From: Gabriel de Perthuis <g2p.code@gmail.com> 476b6cee71dSXin LI0x1008 lequad 8 477b6cee71dSXin LI>0x1018 string \xc6\x85\x73\xf6\x4e\x1a\x45\xca\x82\x65\xf5\x7f\x48\xba\x6d\x81 BCache 478b6cee71dSXin LI>>0x1010 ulequad 0 cache device 479b6cee71dSXin LI>>0x1010 ulequad 1 backing device 480b6cee71dSXin LI>>0x1010 ulequad 3 cache device 481b6cee71dSXin LI>>0x1010 ulequad 4 backing device 482b6cee71dSXin LI>>0x1048 string >0 \b, label "%.32s" 483b6cee71dSXin LI>>0x1028 ubelong x \b, uuid %08x 484b6cee71dSXin LI>>0x102c ubeshort x \b-%04x 485b6cee71dSXin LI>>0x102e ubeshort x \b-%04x 486b6cee71dSXin LI>>0x1030 ubeshort x \b-%04x 487b6cee71dSXin LI>>0x1032 ubelong x \b-%08x 488b6cee71dSXin LI>>0x1036 ubeshort x \b%04x 489b6cee71dSXin LI>>0x1038 ubelong x \b, set uuid %08x 490b6cee71dSXin LI>>0x103c ubeshort x \b-%04x 491b6cee71dSXin LI>>0x103e ubeshort x \b-%04x 492b6cee71dSXin LI>>0x1040 ubeshort x \b-%04x 493b6cee71dSXin LI>>0x1042 ubelong x \b-%08x 494b6cee71dSXin LI>>0x1046 ubeshort x \b%04x 495b6cee71dSXin LI 496b6cee71dSXin LI# Linux device tree: 497b6cee71dSXin LI# File format description can be found in the Linux kernel sources at 498b6cee71dSXin LI# Documentation/devicetree/booting-without-of.txt 499b6cee71dSXin LI# From Christoph Biedl 500b6cee71dSXin LI0 belong 0xd00dfeed 50143a5ec4eSXin LI# structure must be within blob, strings are omitted to handle devicetrees > 1M 502b6cee71dSXin LI>&(8.L) byte x 50343a5ec4eSXin LI>>20 belong >1 Device Tree Blob version %d 50443a5ec4eSXin LI>>>4 belong x \b, size=%d 50543a5ec4eSXin LI>>>20 belong >1 50643a5ec4eSXin LI>>>>28 belong x \b, boot CPU=%d 50743a5ec4eSXin LI>>>20 belong >2 50843a5ec4eSXin LI>>>>32 belong x \b, string block size=%d 50943a5ec4eSXin LI>>>20 belong >16 51043a5ec4eSXin LI>>>>36 belong x \b, DT structure block size=%d 511b6cee71dSXin LI 512c2931133SXin LI# glibc locale archive as defined in glibc locale/locarchive.h 513c2931133SXin LI0 lelong 0xde020109 locale archive 514c2931133SXin LI>24 lelong x %d strings 515c2931133SXin LI 5169ce06829SXin LI# Linux Software RAID (mdadm) 5179ce06829SXin LI# Russell Coker <russell@coker.com.au> 5189ce06829SXin LI0 name linuxraid 5199ce06829SXin LI>16 belong x UUID=%8x: 5209ce06829SXin LI>20 belong x \b%8x: 5219ce06829SXin LI>24 belong x \b%8x: 5229ce06829SXin LI>28 belong x \b%8x 5239ce06829SXin LI>32 string x name=%s 5249ce06829SXin LI>72 lelong x level=%d 5259ce06829SXin LI>92 lelong x disks=%d 5269ce06829SXin LI 5279ce06829SXin LI4096 lelong 0xa92b4efc Linux Software RAID 5289ce06829SXin LI>4100 lelong x version 1.2 (%d) 5299ce06829SXin LI>4096 use linuxraid 5309ce06829SXin LI 5319ce06829SXin LI0 lelong 0xa92b4efc Linux Software RAID 5329ce06829SXin LI>4 lelong x version 1.1 (%d) 5339ce06829SXin LI>0 use linuxraid 5349ce06829SXin LI 535c2931133SXin LI# Summary: Database file for mlocate 536c2931133SXin LI# Description: A database file as used by mlocate, a fast implementation 537c2931133SXin LI# of locate/updatedb. It uses merging to reuse the existing 538c2931133SXin LI# database and avoid rereading most of the filesystem. It's 539c2931133SXin LI# the default version of locate on Arch Linux (and others). 540c2931133SXin LI# File path: /var/lib/mlocate/mlocate.db by default (but configurable) 541c2931133SXin LI# Site: https://fedorahosted.org/mlocate/ 54248c779cdSXin LI# Format docs: https://linux.die.net/man/5/mlocate.db 543c2931133SXin LI# Type: mlocate database file 544c2931133SXin LI# URL: https://fedorahosted.org/mlocate/ 545c2931133SXin LI# From: Wander Nauta <info@wandernauta.nl> 546c2931133SXin LI0 string \0mlocate mlocate database 547c2931133SXin LI>12 byte x \b, version %d 548c2931133SXin LI>13 byte 1 \b, require visibility 549c2931133SXin LI>16 string x \b, root %s 5505f0216bdSXin LI 5515f0216bdSXin LI# Dump files for iproute2 tool. Generated by the "ip r|a save" command. URL: 5525f0216bdSXin LI# https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 5535f0216bdSXin LI# From: Pavel Emelyanov <xemul@parallels.com> 5545f0216bdSXin LI0 lelong 0x45311224 iproute2 routes dump 5555f0216bdSXin LI0 lelong 0x47361222 iproute2 addresses dump 5565f0216bdSXin LI 5575f0216bdSXin LI# Image and service files for CRIU tool. 55848c779cdSXin LI# URL: https://criu.org 5595f0216bdSXin LI# From: Pavel Emelyanov <xemul@parallels.com> 5605f0216bdSXin LI0 lelong 0x54564319 CRIU image file v1.1 5615f0216bdSXin LI0 lelong 0x55105940 CRIU service file 5625f0216bdSXin LI0 lelong 0x58313116 CRIU inventory 5635f0216bdSXin LI 5645f0216bdSXin LI# Kdump compressed dump files 565*898496eeSXin LI# https://github.com/makedumpfile/makedumpfile/blob/master/IMPLEMENTATION 5665f0216bdSXin LI 567*898496eeSXin LI0 string KDUMP\x20\x20\x20 Kdump compressed dump 568*898496eeSXin LI>0 use kdump-compressed-dump 569*898496eeSXin LI 570*898496eeSXin LI0 name kdump-compressed-dump 5715f0216bdSXin LI>8 long x v%d 5725f0216bdSXin LI>12 string >\0 \b, system %s 5735f0216bdSXin LI>77 string >\0 \b, node %s 5745f0216bdSXin LI>142 string >\0 \b, release %s 5755f0216bdSXin LI>207 string >\0 \b, version %s 5765f0216bdSXin LI>272 string >\0 \b, machine %s 5775f0216bdSXin LI>337 string >\0 \b, domain %s 578d38c30c0SXin LI 579*898496eeSXin LI# Flattened format 580*898496eeSXin LI0 string makedumpfile 581*898496eeSXin LI>16 bequad 1 582*898496eeSXin LI>>0x1010 string KDUMP\x20\x20\x20 Flattened kdump compressed dump 583*898496eeSXin LI>>>0x1010 use kdump-compressed-dump 584*898496eeSXin LI 585d38c30c0SXin LI# Device Tree files 586d38c30c0SXin LI0 search/1024 /dts-v1/ Device Tree File (v1) 587d38c30c0SXin LI# beat c code 588d38c30c0SXin LI!:strength +14 58943a5ec4eSXin LI 59043a5ec4eSXin LI 59143a5ec4eSXin LI# e2fsck undo file 59243a5ec4eSXin LI# David Gilman <davidgilman1@gmail.com> 59343a5ec4eSXin LI0 string E2UNDO02 e2fsck undo file, version 2 59443a5ec4eSXin LI>44 lelong x \b, undo file is 59543a5ec4eSXin LI>>44 lelong&1 0 not finished 59643a5ec4eSXin LI>>44 lelong&1 1 finished 59743a5ec4eSXin LI>48 lelong x \b, undo file features: 59843a5ec4eSXin LI>>48 lelong&1 0 lacks filesystem offset 59943a5ec4eSXin LI>>48 lelong&1 1 has filesystem offset 60043a5ec4eSXin LI>>>64 lequad x at %#llx 60143a5ec4eSXin LI 60243a5ec4eSXin LI# ansible vault (does not really belong here) 60343a5ec4eSXin LI0 string $ANSIBLE_VAULT; Ansible Vault 604a4d6d3b8SXin LI>&0 regex [0-9]+\\.[0-9]+ \b, version %s 60543a5ec4eSXin LI>>&0 string ; 606a4d6d3b8SXin LI>>>&0 regex [A-Z0-9]+ \b, encryption %s 607a2dfb722SXin LI 608a2dfb722SXin LI# From: Joerg Jenderek 609a2dfb722SXin LI# URL: https://www.gnu.org/software/grub 610a2dfb722SXin LI# Reference: https://ftp.gnu.org/gnu/grub/grub-2.06.tar.gz 611a2dfb722SXin LI# grub-2.06/include/grub/keyboard_layouts.h 612a2dfb722SXin LI# grub-2.06/grub-core/commands/keylayouts.c 613a2dfb722SXin LI# GRUB_KEYBOARD_LAYOUTS_FILEMAGIC 614a2dfb722SXin LI0 string GRUBLAYO GRUB Keyboard 615a2dfb722SXin LI!:mime application/x-grub-keyboard 616a2dfb722SXin LI!:ext gkb 617a2dfb722SXin LI# GRUB_KEYBOARD_LAYOUTS_VERSION like: 10 618a2dfb722SXin LI>8 ulelong !10 \b, version %u 619a2dfb722SXin LI# 4 grub_uint32_t grub_keyboard_layout[160] 620a2dfb722SXin LI# for normal french keyboard this is letter a 621a2dfb722SXin LI>92 ubyte !0x71 622a2dfb722SXin LI>>92 ubyte >0x40 \b, english q is %c 623a2dfb722SXin LI#>732 ubyte x \b, english Q is %c 624a2dfb722SXin LI# for normal german keyboard this is letter z 625a2dfb722SXin LI>124 ubyte !0x79 626a2dfb722SXin LI>>124 ubyte >0x40 \b, english y is %c 627a2dfb722SXin LI#>764 ubyte x \b, english Y is %c 628