From dad2d9c841f7c490ca4c08de340002680c5ed238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Sun, 15 Sep 2024 16:19:42 +0100 Subject: [PATCH] [kwm] fix: magic header detection --- um_crypto/kuwo/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/um_crypto/kuwo/src/lib.rs b/um_crypto/kuwo/src/lib.rs index 04dc1a7..1136243 100644 --- a/um_crypto/kuwo/src/lib.rs +++ b/um_crypto/kuwo/src/lib.rs @@ -91,8 +91,8 @@ impl Header { let mut format_name = [0u8; 0x0C]; cursor.read_exact(&mut format_name)?; - if magic != Self::MAGIC_1 || magic != Self::MAGIC_2 { - Err(KuwoCryptoError::InvalidHeaderMagic(magic))?; + if magic != Self::MAGIC_1 && magic != Self::MAGIC_2 { + Err(KuwoCryptoError::InvalidHeaderMagic(HeaderMagicBytes(magic)))?; } Ok(Self {