[File] [PATCH] commands: php: More magic for PHP related files

Anatol Belski ab at php.net
Wed Apr 20 15:41:46 UTC 2022


Signed-off-by: Anatol Belski <ab at php.net>
---
 magic/Magdir/commands | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/magic/Magdir/commands b/magic/Magdir/commands
index 7265ebb1..d7e4adca 100644
--- a/magic/Magdir/commands
+++ b/magic/Magdir/commands
@@ -153,6 +153,32 @@
 
 0	string		Zend\x00		PHP script Zend Optimizer data
 
+# From: Anatol Belski <ab at php.net>
+0	string		OPCACHE
+>7	ubyte		0			PHP opcache filecache data
+
+0	search/64	--TEST--
+>16	search/64	--FILE--
+>24	search/8192	--EXPECT		PHP core test
+!:ext	phpt
+
+# https://www.php.net/manual/en/phar.fileformat.signature.php
+-4	string		GBMB			PHP phar archive
+>-8	ubyte		0x1			with MD5 signature
+!:ext	phar
+>-8	ubyte		0x2			with SHA1 signature
+!:ext	phar
+>-8	ubyte		0x3			with SHA256 signature
+!:ext	phar
+>-8	ubyte		0x4			with SHA512 signature
+!:ext	phar
+>-8	ubyte		0x10			with OpenSSL signature
+!:ext	phar
+>-8	ubyte		0x11			with OpenSSL SHA256 signature
+!:ext	phar
+>-8	ubyte		0x12			with OpenSSL SHA512 signature
+!:ext	phar
+
 0	string/t	$!			DCL command file
 
 # Type: Pdmenu
-- 
2.35.3



More information about the File mailing list