From ffb997345556b5a8008b959271e0fb46cf66bb8b Mon Sep 17 00:00:00 2001 From: Maidd <25988046+Maidd@users.noreply.github.com> Date: Wed, 12 Nov 2025 03:22:47 +0700 Subject: [PATCH] Added support for Global's encrypted DB --- Assets/Scripts/Config.cs | 17 +++++++++++++++++ .../UmaDatabase/UmaDatabaseController.cs | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Config.cs b/Assets/Scripts/Config.cs index ccf24c2..20f8c6a 100644 --- a/Assets/Scripts/Config.cs +++ b/Assets/Scripts/Config.cs @@ -17,6 +17,9 @@ public class Config public string DBKeyTip = "Key to read game database files"; public string DBKeyText; + public string GlobalDBKeyTip = "Key to read game database files (for Global)"; + public string GlobalDBKeyText; + public string ABKeyTip = "Key to read asset bundles"; public string ABKeyText; @@ -122,6 +125,13 @@ public class Config 0x37, 0x34, 0x53, 0x29, 0x73, 0x43, 0x36, 0x33 }; + + [NonSerialized] + public byte[] GlobalDBKey = new byte[] + { + 0x56, 0x63, 0x6B, 0x63, 0x42, 0x72, 0x37, 0x76, 0x65, 0x70, 0x41, 0x62, + }; + [NonSerialized] public byte[] ABKey = new byte[] { @@ -180,6 +190,13 @@ public class Config { ABKey = HexToByteArray(ABKeyText); } + if (string.IsNullOrEmpty(GlobalDBKeyText)) + { + GlobalDBKeyText = ByteArrayToHex(GlobalDBKey); + } else + { + GlobalDBKey = HexToByteArray(GlobalDBKeyText); + } File.WriteAllText(configPath, JsonUtility.ToJson(this, true)); } catch (Exception ex) diff --git a/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs b/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs index 0c071f3..b815698 100644 --- a/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs +++ b/Assets/Scripts/UmaDatabase/UmaDatabaseController.cs @@ -59,6 +59,11 @@ public class UmaDatabaseController { try { + var dbKey = Config.Instance.DBKey; + if (Config.Instance.Region == Region.Global) + { + dbKey = Config.Instance.GlobalDBKey; + } if (Config.Instance.WorkMode == WorkMode.Standalone) { if (!File.Exists($@"{Config.Instance.MainPath}/meta_umaviewer")) throw new Exception(); @@ -82,7 +87,7 @@ public class UmaDatabaseController try { var dbPath = $@"{Config.Instance.MainPath}/meta"; - var key = GenFinalKey(Config.Instance.DBKey); + var key = GenFinalKey(dbKey); MetaEntries = ReadMetaFromEncryptedDb(dbPath, key, 3); } catch (Exception)