From 51ed011911064707fe85eec98513f14e149130ff Mon Sep 17 00:00:00 2001 From: scientificworld Date: Sat, 3 Jan 2026 11:38:41 +0800 Subject: [PATCH] feat: improve ASAR detection method --- ArcFormats/ArcASAR.cs | 4 +++- ArcFormats/ArcFormats.csproj | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ArcFormats/ArcASAR.cs b/ArcFormats/ArcASAR.cs index 824491fe..9d677de1 100644 --- a/ArcFormats/ArcASAR.cs +++ b/ArcFormats/ArcASAR.cs @@ -48,7 +48,7 @@ namespace GameRes.Formats.Chromium { public override string Tag { get { return "ASAR"; } } public override string Description { get { return "Electron/Atom Shell archive format"; } } - public override uint Signature { get { return 0; } } + public override uint Signature { get { return 0x00000004; } } public override bool IsHierarchic { get { return true; } } public override bool CanWrite { get { return false; } } @@ -59,6 +59,8 @@ namespace GameRes.Formats.Chromium public override ArcFile TryOpen (ArcView file) { + if (file.View.ReadUInt32 (4) != file.View.ReadUInt32 (8) + 4) + return null; uint index_size = file.View.ReadUInt32 (0x0C); string json = file.View.ReadString (0x10, index_size, Encoding.UTF8); var dict = JsonConvert.DeserializeObject (json); diff --git a/ArcFormats/ArcFormats.csproj b/ArcFormats/ArcFormats.csproj index 3b8ecdb6..0b37488c 100644 --- a/ArcFormats/ArcFormats.csproj +++ b/ArcFormats/ArcFormats.csproj @@ -280,6 +280,7 @@ +