summaryrefslogtreecommitdiffstats
path: root/usr.bin/file
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-09-21 20:10:52 +0000
committerjoerg <joerg@FreeBSD.org>1995-09-21 20:10:52 +0000
commite394e6cc8dea4510ea22b43f05398ff3cd742961 (patch)
treea2081aefd40608e754507aab26b8b4e19e70bf75 /usr.bin/file
parent1dee1ca9d463e73e44f7b0b7fa26c2d61872f68c (diff)
downloadFreeBSD-src-e394e6cc8dea4510ea22b43f05398ff3cd742961.zip
FreeBSD-src-e394e6cc8dea4510ea22b43f05398ff3cd742961.tar.gz
Implement a rather gross hack to identify i386 a.out core files.
Takes advantage of some bytes in our current tss structure that reliably have particular values (due to our current architecture or CPU requirements).
Diffstat (limited to 'usr.bin/file')
-rw-r--r--usr.bin/file/Magdir/freebsd10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.bin/file/Magdir/freebsd b/usr.bin/file/Magdir/freebsd
index 28ad615..79471d7 100644
--- a/usr.bin/file/Magdir/freebsd
+++ b/usr.bin/file/Magdir/freebsd
@@ -14,3 +14,13 @@
0 lelong 000000407 impure format
>16 lelong >0 not stripped
+# XXX gross hack to identify core files
+# cores start with a struct tss; we take advantage of the following:
+# byte 7: highest byte of the kernel stack pointer, always 0xfe
+# 8/9: kernel (ring 0) ss value, always 0x0010
+# 10 - 27: ring 1 and 2 ss/esp, unused, thus always 0
+# 28: low order byte of the current PTD entry, always 0 since the
+# PTD is page-aligned
+#
+7 string \357\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 i386 a.out core file
+>1047 string >\0 from "%s"
OpenPOWER on IntegriCloud