Added support for Global's encrypted DB
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user