Added support for Global's encrypted DB

This commit is contained in:
Maidd
2025-11-12 03:22:47 +07:00
parent 3cb3239316
commit ffb9973455
2 changed files with 23 additions and 1 deletions
+17
View File
@@ -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)
@@ -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)