From 93058ee12b49d32c15f7457da156132f7e24afcd Mon Sep 17 00:00:00 2001 From: ballway Date: Wed, 2 Jul 2025 15:57:37 +0800 Subject: [PATCH 1/2] update reference of GCK File Signature Table --- FileExtensionValidation/FileExtensionValidator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FileExtensionValidation/FileExtensionValidator.cs b/FileExtensionValidation/FileExtensionValidator.cs index bba4c6c..bb3b9c1 100644 --- a/FileExtensionValidation/FileExtensionValidator.cs +++ b/FileExtensionValidation/FileExtensionValidator.cs @@ -10,7 +10,8 @@ public static class FileExtensionValidator { //https://en.wikipedia.org/wiki/List_of_file_signatures //https://www.filesignatures.net/index.php - //https://www.garykessler.net/library/file_sigs.html + //https://www.garykessler.net/library/file_sigs.html (作者已退休,於 2025 轉交 SEARCH 團隊維護 https://filesig.search.org/) + //https://www.garykessler.net/library/file_sigs_GCK_latest.html //https://asecuritysite.com/forensics/magic private static Dictionary> fileSignature = new Dictionary>() { From b5685732b61b6b6c122f14e7fd61c042baa0add8 Mon Sep 17 00:00:00 2001 From: ballway Date: Wed, 2 Jul 2025 15:59:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20.PNG=20=E7=9A=84=20Fil?= =?UTF-8?q?e=20Signautre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FileExtensionValidation/FileExtensionValidator.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/FileExtensionValidation/FileExtensionValidator.cs b/FileExtensionValidation/FileExtensionValidator.cs index bb3b9c1..f73196e 100644 --- a/FileExtensionValidation/FileExtensionValidator.cs +++ b/FileExtensionValidation/FileExtensionValidator.cs @@ -31,11 +31,7 @@ public static class FileExtensionValidator (new byte[] { 0x57, 0x69, 0x6E, 0x5A, 0x69, 0x70 }, 0, 0, new byte[] { }) } }, - { ".PNG", new List<(byte[], int, int, byte[])> { (new byte[] { 0x89, 0x50, 0x4E, 0x47 }, 0, 0, new byte[] { }), - (new byte[] { 0xFF, 0xD8, 0xFF, 0xE0 }, 0, 0, new byte[] { }), - (new byte[] { 0xFF, 0xD8, 0xFF, 0xE1 }, 0, 0, new byte[] { }), - (new byte[] { 0xFF, 0xD8, 0xFF, 0xE8 }, 0, 0, new byte[] { }) - } }, + { ".PNG", new List<(byte[], int, int, byte[])> { (new byte[] { 0x89, 0x50, 0x4E, 0x47 }, 0, 0, new byte[] { })} }, { ".JPG", new List<(byte[], int, int, byte[])> { (new byte[] { 0xFF, 0xD8, 0xFF, 0xE0 }, 0, 0, new byte[] { }),