// Token: 0x06003BB5 RID: 15285 RVA: 0x001393C4 File Offset: 0x001375C4 public static object MouseHomeMsgPack(byte[] data, byte[] home, byte[] info, bool isCompress = false) { MiniMessagePacker miniMessagePacker = new MiniMessagePacker(); byte[] buf = CatAndMouseGame.MouseHomeSub(data, home, info, isCompress); return(miniMessagePacker.Unpack(buf)); }
// Token: 0x06003BB6 RID: 15286 RVA: 0x001393EC File Offset: 0x001375EC public static object MouseHomeMaster(byte[] data, byte[] home, byte[] info, bool isCompress = false) { byte[] buf = CatAndMouseGame.MouseHomeSub(data, home, info, isCompress); MasterDataUnpakcer masterDataUnpakcer = new MasterDataUnpakcer(); return(masterDataUnpakcer.Unpack(buf)); }
// Token: 0x06003BB3 RID: 15283 RVA: 0x00139388 File Offset: 0x00137588 public static string MouseHome(byte[] data, byte[] home, byte[] info, bool isCompress = false) { byte[] bytes = CatAndMouseGame.MouseHomeMain(data, home, info, isCompress); string @string = Encoding.UTF8.GetString(bytes); return(@string.TrimEnd(new char[1])); }
static string GetAssetStorage(string assetBundleKey) { string assetStorage = HttpRequest .Get($"https://cdn.data.fate-go.jp/AssetStorages/{assetBundleKey}Android/AssetStorage.txt") .ToText(); return(CatAndMouseGame.MouseGame8(assetStorage)); }
// Token: 0x06003BA4 RID: 15268 RVA: 0x00138D2C File Offset: 0x00136F2C public static object MouseInfoMsgPack(byte[] data) { byte[] array = new byte[data.Length - 32]; CatAndMouseGame.infoData = Encoding.UTF8.GetBytes("*******************************b"); Array.Copy(data, 0, CatAndMouseGame.InfoTop, 0, 32); Array.Copy(data, 32, array, 0, data.Length - 32); return(CatAndMouseGame.MouseHomeMsgPack(array, CatAndMouseGame.infoData, CatAndMouseGame.InfoTop, true)); }
// Token: 0x06003BA1 RID: 15265 RVA: 0x00138C18 File Offset: 0x00136E18 public static string CatGame8(byte[] data) { for (int i = 0; i < data.Length; i++) { data[i] = ~data[i]; } return(CatAndMouseGame.CatHomeZ2(data, CatAndMouseGame.stageData, CatAndMouseGame.stageTop, true)); }
// Token: 0x06003B95 RID: 15253 RVA: 0x00138838 File Offset: 0x00136A38 public static object MouseGame2Unpacker(byte[] data, bool isCompress = false) { Array.Copy(data, 0, CatAndMouseGame.ownerTop, 0, 32); byte[] array = new byte[data.Length - 32]; Array.Copy(data, 32, array, 0, data.Length - 32); CatAndMouseGame.ownerData = Encoding.UTF8.GetBytes("a*******************************"); return(CatAndMouseGame.MouseHomeMaster(array, CatAndMouseGame.ownerData, CatAndMouseGame.ownerTop, true)); }
// Token: 0x06003B92 RID: 15250 RVA: 0x0013873C File Offset: 0x0013693C public static string CatGame2(string str, bool isCompress = false) { if (!Application.isPlaying) { } byte[] bytes = Encoding.UTF8.GetBytes(str); return(CatAndMouseGame.CatHome(bytes, CatAndMouseGame.ownerData, CatAndMouseGame.ownerTop, true)); }
public static string CatGame3(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); for (int i = 0; i < bytes.Length; i++) { bytes[i] = (byte)~bytes[i]; } return(CatAndMouseGame.CatHome(bytes, CatAndMouseGame.stageData, CatAndMouseGame.stageTop, true)); }
public static string CatHome(byte[] data, byte[] home, byte[] info, bool isCompress = false) { byte[] array = CatAndMouseGame.CatHomeMain(data, home, info, isCompress); if (array != null) { return(Convert.ToBase64String(array)); } return(null); }
// Token: 0x06003B9F RID: 15263 RVA: 0x00138B94 File Offset: 0x00136D94 public static byte[] MouseGame7(byte[] data) { byte[] array = CatAndMouseGame.MouseHomeMain(data, CatAndMouseGame.stageData, CatAndMouseGame.stageTop, true); for (int i = 0; i < array.Length; i++) { array[i] = ~array[i]; } return(array); }
// Token: 0x06003B9E RID: 15262 RVA: 0x00138B50 File Offset: 0x00136D50 public static byte[] CatGame7(byte[] data) { byte[] array = new byte[data.Length]; for (int i = 0; i < data.Length; i++) { array[i] = ~data[i]; } return(CatAndMouseGame.CatHomeMain(array, CatAndMouseGame.stageData, CatAndMouseGame.stageTop, true)); }
public static string MouseGame3(string str) { byte[] data = Convert.FromBase64String(str); byte[] array = CatAndMouseGame.MouseHomeMain(data, CatAndMouseGame.stageData, CatAndMouseGame.stageTop, true); if (array == null) { return(null); } for (int i = 0; i < array.Length; i++) { array[i] = (byte)~array[i]; } return(Encoding.UTF8.GetString(array).TrimEnd(new char[1])); }
// Token: 0x06003B9C RID: 15260 RVA: 0x00138A3C File Offset: 0x00136C3C public static string CatGame5(string str) { byte[] array = new byte[CatAndMouseGame.BattleKey.Length]; byte[] array2 = new byte[CatAndMouseGame.BattleIV.Length]; byte[] bytes = Encoding.UTF8.GetBytes(str); for (int i = 0; i < CatAndMouseGame.BattleKey.Length; i++) { array[i] = (CatAndMouseGame.BattleKey[i] ^ 4); } for (int j = 0; j < CatAndMouseGame.BattleIV.Length; j++) { array2[j] = (CatAndMouseGame.BattleIV[j] ^ 8); } return(CatAndMouseGame.CatHome(bytes, array, array2, false)); }
public static byte[] CatGame4(byte[] data) { for (int i = 0; i < data.Length; i += 2) { if (i + 1 >= data.Length) { break; } byte b = data[i]; byte b2 = data[i + 1]; data[i] = (byte)(b2 ^ 206); data[i + 1] = (byte)(b ^ 210); } return(CatAndMouseGame.CatHomeMain(data, CatAndMouseGame.baseData, CatAndMouseGame.baseTop, false)); }
// Token: 0x06003B9D RID: 15261 RVA: 0x00138AC8 File Offset: 0x00136CC8 public static string MouseGame5(string str) { byte[] array = new byte[CatAndMouseGame.BattleKey.Length]; byte[] array2 = new byte[CatAndMouseGame.BattleIV.Length]; byte[] data = Convert.FromBase64String(str); for (int i = 0; i < CatAndMouseGame.BattleKey.Length; i++) { array[i] = (CatAndMouseGame.BattleKey[i] ^ 4); } for (int j = 0; j < CatAndMouseGame.BattleIV.Length; j++) { array2[j] = (CatAndMouseGame.BattleIV[j] ^ 8); } return(CatAndMouseGame.MouseHome(data, array, array2, false)); }
static void DecryptAssetList() { string[] assetStore = File.ReadAllLines(AssetStorageFilePath); Console.WriteLine("Parsing json..."); JArray AudioArray = new JArray(); //JArray MovieArray = new JArray(); JArray AssetArray = new JArray(); for (int i = 2; i < assetStore.Length; ++i) { string[] tmp = assetStore[i].Split(','); string assetName; string fileName; //if (tmp[1] == "SYSTEM") // { // assetName = tmp[tmp.Length - 1].Replace('/', '_'); // fileName = assetName; // AssetArray.Add(new JObject(new JProperty("assetName", assetName), new JProperty("fileName", fileName))); //} if (tmp[4].Contains("Audio")) { assetName = tmp[tmp.Length - 1].Replace('/', '@'); fileName = CatAndMouseGame.GetMD5String(assetName); AudioArray.Add(new JObject(new JProperty("audioName", assetName), new JProperty("fileName", fileName))); } //else if (tmp[4].Contains("Movie")) //{ // assetName = tmp[tmp.Length - 1].Replace('/', '@'); // fileName = CatAndMouseGame.GetMD5String(assetName); // MovieArray.Add(new JObject(new JProperty("movieName", assetName), new JProperty("fileName", fileName))); //} else if (!tmp[4].Contains("Movie")) { assetName = tmp[tmp.Length - 1].Replace('/', '@') + ".unity3d"; fileName = CatAndMouseGame.getShaName(assetName); AssetArray.Add(new JObject(new JProperty("assetName", assetName), new JProperty("fileName", fileName))); } } Console.WriteLine("Writing file to: AudioName.json"); File.WriteAllText(folder.FullName + "AudioName.json", AudioArray.ToString()); //Console.WriteLine("Writing file to: MovieName.json"); //File.WriteAllText(folder.FullName + "MovieName.json", MovieArray.ToString()); Console.WriteLine("Writing file to: AssetName.json"); File.WriteAllText(folder.FullName + "AssetName.json", AssetArray.ToString()); }
// Token: 0x06003B9B RID: 15259 RVA: 0x001389CC File Offset: 0x00136BCC public static byte[] MouseGame4(byte[] data) { byte[] array = CatAndMouseGame.MouseHomeMain(data, CatAndMouseGame.baseData, CatAndMouseGame.baseTop, false); if (array == null) { return(null); } for (int i = 0; i < array.Length; i += 2) { if (i + 1 >= array.Length) { break; } byte b = array[i]; byte b2 = array[i + 1]; array[i] = (b2 ^ 210); array[i + 1] = (b ^ 206); } return(array); }
static void Main(string[] args) { var s = CatAndMouseGame.MouseGame3(new WebClient().DownloadString("https://line3-s2-bili-fate.bilibiligame.net/rongame_beta/rgfate/60_member/network/AssetStorage.txt")); StreamReader streamReader = new StreamReader(new MemoryStream(Encoding.UTF8.GetBytes(s))); string text; while ((text = streamReader.ReadLine()) != null) { if (!text.Contains("FgoDataVersion") && !text.StartsWith("~")) { var array = text.Split(','); if (array[4].Contains("/")) { var name = $"Download\\{array[4].Replace("/", "\\")}"; if (!name.EndsWith(".cpk.bytes") && !name.EndsWith(".mp4")) { name = $"{name}.unity3d"; using (var wclient = new WebClient()) { wclient.BaseAddress = "https://line2-patch-fate.bilibiligame.net/1200/NewResources/Android/"; Directory.CreateDirectory(Path.GetDirectoryName(name)); var address = $"{array[0]}/{getShaName($"{array[4].Replace("/", "@")}.unity3d")}"; Console.WriteLine(name); var array2 = CatAndMouseGame.MouseGame4(wclient.DownloadData(address)); var file = new FileStream(name, FileMode.Create); file.Write(array2, 0, array2.Length); file.Close(); } } } } } }
static void DisplayMenu() { Console.Clear(); try { Console.WriteLine( "1: 加密\t" + "2: 解密\n" + "3: 加密AssetStorage.txt\t" + "4: 解密AssetStorage.txt\t" + "5: 把AssetStorage转换为Json格式\n" + "6: 加密剧情文本(scripts)\n" + "7: 解密剧情文本(scripts)\n" + "8: 把国服文本转换为日服适用\n" + "9: 从服务器下载游戏数据\n" + "0: 导出资源名 - 实际文件名\n" + "11: [gamedata/top]解密master(游戏数据)\n" + "12: [gamedata/top]解密assetbundle(assets文件夹名)\n" + "13: [gamedata/top]解密webview(url)\n" + "69: 切换为美服密钥\n" + "67: 切换为国服密钥\n" + "99: 下载&解密图片资源"); int arg = Convert.ToInt32(Console.ReadLine()); switch (arg) { case 69: { CatAndMouseGame.EN(); break; } case 67: { CatAndMouseGame.CN(); break; } case 1: { foreach (FileInfo file in decrypt.GetFiles("*.bin")) { Console.WriteLine("Encrypt: " + file.FullName); byte[] raw = File.ReadAllBytes(file.FullName); byte[] output = CatAndMouseGame.CatGame4(raw); if (!Directory.Exists(encrypt.FullName)) { Directory.CreateDirectory(encrypt.FullName); } File.WriteAllBytes(encrypt.FullName + file.Name, output); } break; } case 2: { foreach (FileInfo file in folder.GetFiles("*.bin")) { Console.WriteLine("Decrypt: " + file.FullName); byte[] raw = File.ReadAllBytes(file.FullName); byte[] output = CatAndMouseGame.MouseGame4(raw); if (!Directory.Exists(decrypt.FullName)) { Directory.CreateDirectory(decrypt.FullName); } File.WriteAllBytes(decrypt.FullName + file.Name, output); } break; } case 3: { string data = File.ReadAllText(folder.FullName + "AssetStorage_dec.txt"); //string tmp = data; //tmp = tmp.Trim(new char[] //{ // '' //}); //int ri = data.IndexOfAny(new char[] //{ // '\r', // '\n' //}); //if (ri > 1) //{ // string crcString = tmp.Substring(0, ri); // if (crcString.StartsWith("~")) // { // crcString = crcString.Substring(1); // Console.WriteLine("OldAssetStorageCrc: " + crcString); // tmp = tmp.Substring(ri + 1); // byte[] readData = Encoding.UTF8.GetBytes(tmp); // uint crc = Crc32.Compute(readData); // Console.WriteLine("AssetStorageCrc: " + crc); // data = data.Replace(crcString.ToString(), crc.ToString()); // } //} string loadData = CatAndMouseGame.CatGame8(data); File.WriteAllText(folder.FullName + "AssetStorage_enc.txt", loadData); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage_enc.txt"); break; } case 4: { string data = File.ReadAllText(folder.FullName + "AssetStorage.txt"); string loadData = CatAndMouseGame.MouseGame8(data); File.WriteAllText(folder.FullName + "AssetStorage_dec.txt", loadData); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage_dec.txt"); break; } case 5: { Console.WriteLine("Reading file from: " + folder.FullName + "AssetStorage_dec.txt"); string loadData = File.ReadAllText(folder.FullName + "AssetStorage_dec.txt"); string[] listData = null; loadData = loadData.Trim(); int num2 = loadData.IndexOfAny(new char[] { '\r', '\n' }); loadData = loadData.Substring(num2 + 1); byte[] bytes = Encoding.UTF8.GetBytes(loadData); listData = loadData.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); string[] array = listData[0].Split(','); Console.WriteLine("Parsing json..."); int num4; string attrib; int size; uint crc; string name; JArray AssetStorageJson = new JArray(); for (int i = 1; i < listData.Length; i++) { array = listData[i].Split(','); if (array.Length != 5) { break; } num4 = int.Parse(array[0].Trim()); attrib = array[1]; size = int.Parse(array[2].Trim()); crc = uint.Parse(array[3].Trim()); name = array[4]; AssetStorageJson.Add(new JObject( new JProperty("num4", num4.ToString()), new JProperty("attrib", attrib.ToString()), new JProperty("size", size.ToString()), new JProperty("crc", crc.ToString()), new JProperty("name", name) )); } File.WriteAllText(folder.FullName + "AssetStorage.json", AssetStorageJson.ToString()); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage.json"); break; } case 6: { foreach (FileInfo file in decryptScripts.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Encrypting: " + file.FullName); string ScriptsFolderName = Path.GetFileNameWithoutExtension(file.Directory.Name); string txt = File.ReadAllText(file.FullName); string outputTxt = CatAndMouseGame.CatGame3(txt); if (!Directory.Exists(encryptScripts.FullName + ScriptsFolderName)) { Directory.CreateDirectory(encryptScripts.FullName + ScriptsFolderName); } File.WriteAllText(encryptScripts.FullName + ScriptsFolderName + "\\" + file.Name, outputTxt); } break; } case 7: { foreach (FileInfo file in scriptsFolder.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Decrypting: " + file.FullName); string ScriptsFolderName = Path.GetFileNameWithoutExtension(file.Directory.Name); string txt = File.ReadAllText(file.FullName); string outputTxt = CatAndMouseGame.MouseGame3(txt); if (!Directory.Exists(decryptScripts.FullName + ScriptsFolderName)) { Directory.CreateDirectory(decryptScripts.FullName + ScriptsFolderName); } File.WriteAllText(decryptScripts.FullName + ScriptsFolderName + "\\" + file.Name, outputTxt); } break; } case 8: { string jptext = File.ReadAllText(decrypt.FullName + "JP.txt"); jptext = Regex.Replace(jptext, @".*//.*\n", "", RegexOptions.Multiline); jptext = Regex.Replace(jptext, "\"$", "\",", RegexOptions.Multiline); JObject jp = JObject.Parse(jptext); JObject cn = JObject.Parse(File.ReadAllText(decrypt.FullName + "CN.txt")); JObject no = new JObject(); foreach (JProperty jProperty in jp.Properties()) { if (cn[jProperty.Name] != null) { jp[jProperty.Name] = cn[jProperty.Name]; } else { no.Add(jProperty.Name, jProperty.Value); } } File.WriteAllText(decrypt.FullName + "LocalizationJpn.txt", jp.ToString()); File.WriteAllText(decrypt.FullName + "noTranslation.txt", no.ToString()); break; } case 9: { DownloadTopGameData(); break; } case 0: { DecryptAssetList(); break; } case 11: { //游戏数据 string data = File.ReadAllText(gamedata.FullName + "master"); if (!Directory.Exists(gamedata.FullName + "unpack_master")) { Directory.CreateDirectory(gamedata.FullName + "unpack_master"); } Dictionary <string, byte[]> masterData = (Dictionary <string, byte[]>)MasterDataUnpacker.MouseGame2Unpacker(Convert.FromBase64String(data)); JObject job = new JObject(); MiniMessagePacker miniMessagePacker = new MiniMessagePacker(); foreach (KeyValuePair <string, byte[]> item in masterData) { List <object> unpackeditem = (List <object>)miniMessagePacker.Unpack(item.Value); string json = JsonConvert.SerializeObject(unpackeditem, Formatting.Indented); File.WriteAllText(gamedata.FullName + "unpack_master/" + item.Key, json); Console.WriteLine("Writing file to: " + gamedata.FullName + "unpack_master/" + item.Key); } break; } case 12: { DecryptAssetBundle(); break; } case 13: { string data = File.ReadAllText(gamedata.FullName + "webview"); Dictionary <string, object> dictionary = (Dictionary <string, object>)MasterDataUnpacker.MouseGame2MsgPack(Convert.FromBase64String(data)); string str = "baseURL: " + dictionary["baseURL"].ToString() + "\r\ncontactURL: " + dictionary["contactURL"].ToString() + "\r\n"; Console.WriteLine(str); Dictionary <string, object> filePassInfo = (Dictionary <string, object>)dictionary["filePass"]; foreach (var a in filePassInfo) { str += a.Key + ": " + a.Value.ToString() + "\r\n"; } File.WriteAllText(gamedata.FullName + "webview.txt", str); Console.WriteLine("Writing file to: " + gamedata.FullName + "webview.txt"); break; } case 99: DownloadAssets(); break; default: { Console.WriteLine("请输入一个可接受的选项"); break; } } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); Console.ReadKey(true); } }
// Token: 0x06003BA7 RID: 15271 RVA: 0x00138F14 File Offset: 0x00137114 public static string CatGame6(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); return(CatAndMouseGame.CatHome(bytes, CatAndMouseGame.sideData, CatAndMouseGame.sideTop, false)); }
// Token: 0x06003BA8 RID: 15272 RVA: 0x00138F40 File Offset: 0x00137140 public static string CatGame6_UWA(object obj) { return(CatAndMouseGame.CatHome_UWA(obj, CatAndMouseGame.sideData, CatAndMouseGame.sideTop, false)); }
// Token: 0x06003BAA RID: 15274 RVA: 0x00138F7C File Offset: 0x0013717C public static byte[] MouseGame6_UWA(string str) { byte[] data = Convert.FromBase64String(str); return(CatAndMouseGame.MouseHome_UWA(data, CatAndMouseGame.sideData, CatAndMouseGame.sideTop, false)); }
static void DisplayMenu() { Console.Clear(); try { Console.WriteLine( "1: 加密\t" + "2: 解密\n" + "3: 加密AssetStorage.txt\t" + "4: 解密AssetStorage.txt\t" + "5: 把AssetStorage转换为Json格式\n" + "6: 加密剧情文本(scripts)\n" + "7: 解密剧情文本(scripts)\n" + "8: 把国服文本转换为日服适用\n" + "9: 从服务器下载游戏数据\n" + "0: 导出资源名 - 实际文件名\n" + "11: [gamedata/top]解密master(游戏数据)\n" + "12: [gamedata/top]解密assetbundle(assets文件夹名)\n" + "13: [gamedata/top]解密webview(url)\n" + "69: 切换为美服密钥\n" + "67: 切换为国服密钥"); int arg = Convert.ToInt32(Console.ReadLine()); string path = Directory.GetCurrentDirectory(); DirectoryInfo folder = new DirectoryInfo(path + @"\Android\"); DirectoryInfo scriptsFolder = new DirectoryInfo(path + @"\Android\Scripts"); DirectoryInfo gamedata = new DirectoryInfo(path + @"\Android\gamedata\"); DirectoryInfo decrypt = new DirectoryInfo(path + @"\Decrypt\"); DirectoryInfo encrypt = new DirectoryInfo(path + @"\Encrypt\"); DirectoryInfo decryptScripts = new DirectoryInfo(path + @"\DecryptScripts\"); DirectoryInfo encryptScripts = new DirectoryInfo(path + @"\EncryptScripts\"); switch (arg) { case 69: { CatAndMouseGame.EN(); break; } case 67: { CatAndMouseGame.CN(); break; } case 1: { foreach (FileInfo file in decrypt.GetFiles("*.bin")) { Console.WriteLine("Encrypt: " + file.FullName); byte[] raw = File.ReadAllBytes(file.FullName); byte[] output = CatAndMouseGame.CatGame4(raw); if (!Directory.Exists(encrypt.FullName)) { Directory.CreateDirectory(encrypt.FullName); } File.WriteAllBytes(encrypt.FullName + file.Name, output); } break; } case 2: { foreach (FileInfo file in folder.GetFiles("*.bin")) { Console.WriteLine("Decrypt: " + file.FullName); byte[] raw = File.ReadAllBytes(file.FullName); byte[] output = CatAndMouseGame.MouseGame4(raw); if (!Directory.Exists(decrypt.FullName)) { Directory.CreateDirectory(decrypt.FullName); } File.WriteAllBytes(decrypt.FullName + file.Name, output); } break; } case 3: { string data = File.ReadAllText(folder.FullName + "AssetStorage_dec.txt"); //string tmp = data; //tmp = tmp.Trim(new char[] //{ // '' //}); //int ri = data.IndexOfAny(new char[] //{ // '\r', // '\n' //}); //if (ri > 1) //{ // string crcString = tmp.Substring(0, ri); // if (crcString.StartsWith("~")) // { // crcString = crcString.Substring(1); // Console.WriteLine("OldAssetStorageCrc: " + crcString); // tmp = tmp.Substring(ri + 1); // byte[] readData = Encoding.UTF8.GetBytes(tmp); // uint crc = Crc32.Compute(readData); // Console.WriteLine("AssetStorageCrc: " + crc); // data = data.Replace(crcString.ToString(), crc.ToString()); // } //} string loadData = CatAndMouseGame.CatGame8(data); File.WriteAllText(folder.FullName + "AssetStorage_enc.txt", loadData); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage_enc.txt"); break; } case 4: { string data = File.ReadAllText(folder.FullName + "AssetStorage.txt"); string loadData = CatAndMouseGame.MouseGame8(data); File.WriteAllText(folder.FullName + "AssetStorage_dec.txt", loadData); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage_dec.txt"); break; } case 5: { Console.WriteLine("Reading file from: " + folder.FullName + "AssetStorage_dec.txt"); string loadData = File.ReadAllText(folder.FullName + "AssetStorage_dec.txt"); string[] listData = null; loadData = loadData.Trim(); int num2 = loadData.IndexOfAny(new char[] { '\r', '\n' }); loadData = loadData.Substring(num2 + 1); byte[] bytes = Encoding.UTF8.GetBytes(loadData); listData = loadData.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); string[] array = listData[0].Split(','); Console.WriteLine("Parsing json..."); int num4; string attrib; int size; uint crc; string name; JArray AssetStorageJson = new JArray(); for (int i = 1; i < listData.Length; i++) { array = listData[i].Split(','); if (array.Length != 5) { break; } num4 = int.Parse(array[0].Trim()); attrib = array[1]; size = int.Parse(array[2].Trim()); crc = uint.Parse(array[3].Trim()); name = array[4]; AssetStorageJson.Add(new JObject( new JProperty("num4", num4.ToString()), new JProperty("attrib", attrib.ToString()), new JProperty("size", size.ToString()), new JProperty("crc", crc.ToString()), new JProperty("name", name) )); } File.WriteAllText(folder.FullName + "AssetStorage.json", AssetStorageJson.ToString()); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage.json"); break; } case 6: { foreach (FileInfo file in decryptScripts.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Encrypting: " + file.FullName); string ScriptsFolderName = Path.GetFileNameWithoutExtension(file.Directory.Name); string txt = File.ReadAllText(file.FullName); string outputTxt = CatAndMouseGame.CatGame3(txt); if (!Directory.Exists(encryptScripts.FullName + ScriptsFolderName)) { Directory.CreateDirectory(encryptScripts.FullName + ScriptsFolderName); } File.WriteAllText(encryptScripts.FullName + ScriptsFolderName + "\\" + file.Name, outputTxt); } break; } case 7: { foreach (FileInfo file in scriptsFolder.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Decrypting: " + file.FullName); string ScriptsFolderName = Path.GetFileNameWithoutExtension(file.Directory.Name); string txt = File.ReadAllText(file.FullName); string outputTxt = CatAndMouseGame.MouseGame3(txt); if (!Directory.Exists(decryptScripts.FullName + ScriptsFolderName)) { Directory.CreateDirectory(decryptScripts.FullName + ScriptsFolderName); } File.WriteAllText(decryptScripts.FullName + ScriptsFolderName + "\\" + file.Name, outputTxt); } break; } case 8: { string jptext = File.ReadAllText(decrypt.FullName + "JP.txt"); jptext = Regex.Replace(jptext, @".*//.*\n", "", RegexOptions.Multiline); jptext = Regex.Replace(jptext, "\"$", "\",", RegexOptions.Multiline); JObject jp = JObject.Parse(jptext); JObject cn = JObject.Parse(File.ReadAllText(decrypt.FullName + "CN.txt")); JObject no = new JObject(); foreach (JProperty jProperty in jp.Properties()) { if (cn[jProperty.Name] != null) { jp[jProperty.Name] = cn[jProperty.Name]; } else { no.Add(jProperty.Name, jProperty.Value); } } File.WriteAllText(decrypt.FullName + "LocalizationJpn.txt", jp.ToString()); File.WriteAllText(decrypt.FullName + "noTranslation.txt", no.ToString()); break; } case 9: { string result = HttpRequest.PhttpReq("https://game.fate-go.jp/gamedata/top", "appVer=2.13.2"); JObject res = JObject.Parse(result); if (res["response"][0]["fail"]["action"] != null) { if (res["response"][0]["fail"]["action"].ToString() == "app_version_up") { string tmp = res["response"][0]["fail"]["detail"].ToString(); tmp = Regex.Replace(tmp, @".*新ver.:(.*)、現.*", "$1", RegexOptions.Singleline); Console.WriteLine("new version: " + tmp.ToString()); result = HttpRequest.PhttpReq("https://game.fate-go.jp/gamedata/top", "appVer=" + tmp.ToString()); res = JObject.Parse(result); } else { break; } } if (!Directory.Exists(gamedata.FullName)) { Directory.CreateDirectory(gamedata.FullName); } File.WriteAllText(gamedata.FullName + "raw", result); File.WriteAllText(gamedata.FullName + "assetbundle", res["response"][0]["success"]["assetbundle"].ToString()); Console.WriteLine("Writing file to: " + gamedata.FullName + "assetbundle"); File.WriteAllText(gamedata.FullName + "master", res["response"][0]["success"]["master"].ToString()); Console.WriteLine("Writing file to: " + gamedata.FullName + "master"); File.WriteAllText(gamedata.FullName + "webview", res["response"][0]["success"]["webview"].ToString()); Console.WriteLine("Writing file to: " + gamedata.FullName + "webview"); break; } case 0: { string[] assetStore = File.ReadAllLines(folder.FullName + "AssetStorage_dec.txt"); Console.WriteLine("Parsing json..."); JArray AudioArray = new JArray(); //JArray MovieArray = new JArray(); JArray AssetArray = new JArray(); for (int i = 2; i < assetStore.Length; ++i) { string[] tmp = assetStore[i].Split(','); string assetName; string fileName; if (tmp[4].Contains("Audio")) { assetName = tmp[tmp.Length - 1].Replace('/', '@'); fileName = CatAndMouseGame.GetMD5String(assetName); AudioArray.Add(new JObject(new JProperty("audioName", assetName), new JProperty("fileName", fileName))); } //else if (tmp[4].Contains("Movie")) //{ // assetName = tmp[tmp.Length - 1].Replace('/', '@'); // fileName = CatAndMouseGame.GetMD5String(assetName); // MovieArray.Add(new JObject(new JProperty("movieName", assetName), new JProperty("fileName", fileName))); //} else if (!tmp[4].Contains("Movie")) { assetName = tmp[tmp.Length - 1].Replace('/', '@') + ".unity3d"; fileName = CatAndMouseGame.getShaName(assetName); AssetArray.Add(new JObject(new JProperty("assetName", assetName), new JProperty("fileName", fileName))); } } Console.WriteLine("Writing file to: AudioName.json"); File.WriteAllText(folder.FullName + "AudioName.json", AudioArray.ToString()); //Console.WriteLine("Writing file to: MovieName.json"); //File.WriteAllText(folder.FullName + "MovieName.json", MovieArray.ToString()); Console.WriteLine("Writing file to: AssetName.json"); File.WriteAllText(folder.FullName + "AssetName.json", AssetArray.ToString()); break; } case 11: { //游戏数据 string data = File.ReadAllText(gamedata.FullName + "master"); if (!Directory.Exists(gamedata.FullName + "unpack_master")) { Directory.CreateDirectory(gamedata.FullName + "unpack_master"); } Dictionary <string, byte[]> masterData = (Dictionary <string, byte[]>)MasterDataUnpacker.MouseGame2Unpacker(Convert.FromBase64String(data)); JObject job = new JObject(); MiniMessagePacker miniMessagePacker = new MiniMessagePacker(); foreach (KeyValuePair <string, byte[]> item in masterData) { List <object> unpackeditem = (List <object>)miniMessagePacker.Unpack(item.Value); string json = JsonConvert.SerializeObject(unpackeditem, Formatting.Indented); File.WriteAllText(gamedata.FullName + "unpack_master/" + item.Key, json); Console.WriteLine("Writing file to: " + gamedata.FullName + "unpack_master/" + item.Key); } break; } case 12: { string data = File.ReadAllText(gamedata.FullName + "assetbundle"); Dictionary <string, object> dictionary = (Dictionary <string, object>)MasterDataUnpacker.MouseInfoMsgPack(Convert.FromBase64String(data)); string str = null; foreach (var a in dictionary) { str += a.Key + ": " + a.Value.ToString() + "\r\n"; } File.WriteAllText(gamedata.FullName + "assetbundle.txt", str); Console.WriteLine("folder name: " + dictionary["folderName"].ToString()); break; } case 13: { string data = File.ReadAllText(gamedata.FullName + "webview"); Dictionary <string, object> dictionary = (Dictionary <string, object>)MasterDataUnpacker.MouseGame2MsgPack(Convert.FromBase64String(data)); string str = "baseURL: " + dictionary["baseURL"].ToString() + "\r\ncontactURL: " + dictionary["contactURL"].ToString() + "\r\n"; Console.WriteLine(str); Dictionary <string, object> filePassInfo = (Dictionary <string, object>)dictionary["filePass"]; foreach (var a in filePassInfo) { str += a.Key + ": " + a.Value.ToString() + "\r\n"; } File.WriteAllText(gamedata.FullName + "webview.txt", str); Console.WriteLine("Writing file to: " + gamedata.FullName + "webview.txt"); break; } default: { Console.WriteLine("请输入一个可接受的选项"); break; } } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); Console.ReadKey(true); } }
static void displayMenu() { Console.Clear(); try { Console.WriteLine( "1: 加密\t" + "2: 解密\n" + "3: 加密AssetStorage.txt\t" + "4: 解密AssetStorage.txt\t" + "5: 把AssetStorage转换为Json格式\n" + "6: 加密剧情文本(scripts)\n" + "7: 解密剧情文本(scripts)\n" + "8: 把国服文本转换为日服适用\n" + "9: 计算CRC值\n" + "0: 导出资源名 - 实际文件名\n" + "11: [gamedata/top]解密master(卡池信息)\n" + "12: [gamedata/top]解密assetbundle(文件夹名)\n" + "13: [gamedata/top]解密webview(url)\n" + "69: 切换为美服密钥\n" + "67: 切换为国服密钥"); int arg = Convert.ToInt32(Console.ReadLine()); string path = System.IO.Directory.GetCurrentDirectory(); DirectoryInfo folder = new DirectoryInfo(path + @"\Android\"); DirectoryInfo decrypt = new DirectoryInfo(path + @"\Decrypt\"); DirectoryInfo encrypt = new DirectoryInfo(path + @"\Encrypt\"); DirectoryInfo decryptScripts = new DirectoryInfo(path + @"\DecryptScripts\"); DirectoryInfo encryptScripts = new DirectoryInfo(path + @"\EncryptScripts\"); byte[] raw; byte[] output; switch (arg) { case 69: { CatAndMouseGame.EN(); displayMenu(); break; } case 67: { CatAndMouseGame.CN(); displayMenu(); break; } case 1: { foreach (FileInfo file in decrypt.GetFiles("*.bin")) { Console.WriteLine("Encrypt: " + file.FullName); raw = File.ReadAllBytes(file.FullName); output = CatAndMouseGame.CatGame4(raw); if (!Directory.Exists(encrypt.FullName)) { Directory.CreateDirectory(encrypt.FullName); } File.WriteAllBytes(encrypt.FullName + file.Name, output); } break; } case 2: { foreach (FileInfo file in folder.GetFiles("*.bin")) { Console.WriteLine("Decrypt: " + file.FullName); raw = File.ReadAllBytes(file.FullName); output = CatAndMouseGame.MouseGame4(raw); if (!Directory.Exists(decrypt.FullName)) { Directory.CreateDirectory(decrypt.FullName); } File.WriteAllBytes(decrypt.FullName + file.Name, output); } break; } case 3: { string data = File.ReadAllText(folder.FullName + "AssetStorage_dec.txt"); //string tmp = data; //tmp = tmp.Trim(new char[] //{ // '' //}); //int ri = data.IndexOfAny(new char[] //{ // '\r', // '\n' //}); //if (ri > 1) //{ // string crcString = tmp.Substring(0, ri); // if (crcString.StartsWith("~")) // { // crcString = crcString.Substring(1); // Console.WriteLine("OldAssetStorageCrc: " + crcString); // tmp = tmp.Substring(ri + 1); // byte[] readData = Encoding.UTF8.GetBytes(tmp); // uint crc = Crc32.Compute(readData); // Console.WriteLine("AssetStorageCrc: " + crc); // data = data.Replace(crcString.ToString(), crc.ToString()); // } //} string loadData = CatAndMouseGame.CatGame8(data); File.WriteAllText(folder.FullName + "AssetStorage_enc.txt", loadData); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage_enc.txt"); break; } case 4: { string data = File.ReadAllText(folder.FullName + "AssetStorage.txt"); string loadData = CatAndMouseGame.MouseGame8(data); File.WriteAllText(folder.FullName + "AssetStorage_dec.txt", loadData); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage_dec.txt"); break; } case 5: { Console.WriteLine("Reading file from: " + folder.FullName + "AssetStorage_dec.txt"); string loadData = File.ReadAllText(folder.FullName + "AssetStorage_dec.txt"); string[] listData = null; loadData = loadData.Trim(); int num2 = loadData.IndexOfAny(new char[] { '\r', '\n' }); loadData = loadData.Substring(num2 + 1); byte[] bytes = Encoding.UTF8.GetBytes(loadData); listData = loadData.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); string[] array = listData[0].Split(','); Console.WriteLine("Parsing json..."); StringBuilder stringBuilder = new StringBuilder("{"); int num4; string attrib; int size; uint crc; string name; for (int i = 1; i < listData.Length; i++) { array = listData[i].Split(','); if (array.Length != 5) { break; } num4 = int.Parse(array[0].Trim()); stringBuilder.Append("{\"num4\":\"" + num4.ToString() + "\","); attrib = array[1]; stringBuilder.Append("\"attrib\":\"" + attrib.ToString() + "\","); size = int.Parse(array[2].Trim()); stringBuilder.Append("\"size\":\"" + size.ToString() + "\","); crc = uint.Parse(array[3].Trim()); stringBuilder.Append("\"crc\":\"" + crc.ToString() + "\","); name = array[4]; stringBuilder.Append("\"name\":\"" + name + "\"},"); } stringBuilder.Remove(stringBuilder.Length - 1, 1); stringBuilder.Append("}"); File.WriteAllText(folder.FullName + "AssetStorage.json", stringBuilder.ToString()); Console.WriteLine("Writing file to: " + folder.FullName + "AssetStorage.json"); break; } case 6: { foreach (FileInfo file in decryptScripts.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Encrypting: " + file.FullName); string dePath = Path.GetFileNameWithoutExtension(file.Directory.Name); string txt = File.ReadAllText(file.FullName); string outputTxt = CatAndMouseGame.CatGame3(txt); if (!Directory.Exists(encryptScripts.FullName + dePath)) { Directory.CreateDirectory(encryptScripts.FullName + dePath); } File.WriteAllText(encryptScripts.FullName + dePath + "\\" + file.Name, outputTxt); } break; } case 7: { foreach (FileInfo file in encryptScripts.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Decrypting: " + file.FullName); string dePath = Path.GetFileNameWithoutExtension(file.Directory.Name); string txt = File.ReadAllText(file.FullName); string outputTxt = CatAndMouseGame.MouseGame3(txt); if (!Directory.Exists(encryptScripts.FullName + dePath)) { Directory.CreateDirectory(encryptScripts.FullName + dePath); } File.WriteAllText(encryptScripts.FullName + dePath + "\\" + file.Name, outputTxt); } break; } case 8: { JObject jp = JObject.Parse(File.ReadAllText(decrypt.FullName + "JP.txt")); JObject cn = JObject.Parse(File.ReadAllText(decrypt.FullName + "CN.txt")); JObject no = new JObject(); foreach (JProperty jProperty in jp.Properties()) { if (cn[jProperty.Name] != null) { jp[jProperty.Name] = cn[jProperty.Name]; } else { no.Add(jProperty.Name, jProperty.Value); } } File.WriteAllText(decrypt.FullName + "LocalizationJpn.txt", jp.ToString()); File.WriteAllText(decrypt.FullName + "noTranslation.txt", no.ToString()); break; } case 9: { foreach (FileInfo file in encrypt.GetFiles("*.bin")) { Console.WriteLine(file.Name + "\r\nsize: " + file.Length + "\r\ncrc: " + Crc32.Compute(File.ReadAllBytes(file.FullName))); Console.WriteLine("======================================"); } break; } case 0: { string[] assetStore = File.ReadAllLines(folder.FullName + "AssetStorage_dec.txt"); Console.WriteLine("Parsing json..."); JArray jarray = new JArray(); for (int i = 2; i < assetStore.Length; ++i) { string[] tmp = assetStore[i].Split(','); string assetName = tmp[tmp.Length - 1].Replace('/', '@') + ".unity3d"; string fileName = CatAndMouseGame.getShaName(assetName); jarray.Add(new JObject(new JProperty("assetName", assetName), new JProperty("fileName", fileName))); } JsonSerializerSettings serializerSettings = new JsonSerializerSettings(); String jsonWithConverter = JsonConvert.SerializeObject(jarray, serializerSettings); File.WriteAllText(folder.FullName + "AssetStorageName.json", jsonWithConverter.ToString()); break; } case 11: { //卡池信息 string data = File.ReadAllText(folder.FullName + "master"); Dictionary <string, byte[]> masterData = (Dictionary <string, byte[]>)MasterDataUnpacker.MouseGame2Unpacker(Convert.FromBase64String(data)); JObject job = new JObject(); MiniMessagePacker miniMessagePacker = new MiniMessagePacker(); List <Object> unpackeditem = (List <Object>)miniMessagePacker.Unpack(masterData["mstGacha"]); string json = JsonConvert.SerializeObject(unpackeditem, Formatting.Indented); File.WriteAllText(folder.FullName + "masterData.txt", json); Console.WriteLine("Writing file to: " + folder.FullName + "masterData.txt"); break; } case 12: { string data = File.ReadAllText(folder.FullName + "assetbundle"); Dictionary <string, object> dictionary = (Dictionary <string, object>)MasterDataUnpacker.MouseInfoMsgPack(Convert.FromBase64String(data)); string str = null; foreach (var a in dictionary) { str += a.Key + ": " + a.Value.ToString() + "\r\n"; } File.WriteAllText(folder.FullName + "assetbundle.txt", str); Console.WriteLine("folder name: " + dictionary["folderName"].ToString()); break; } case 13: { string data = File.ReadAllText(folder.FullName + "webview"); Dictionary <string, object> dictionary = (Dictionary <string, object>)MasterDataUnpacker.MouseGame2MsgPack(Convert.FromBase64String(data)); string str = "baseURL: " + dictionary["baseURL"].ToString() + "\r\ncontactURL: " + dictionary["contactURL"].ToString() + "\r\n"; Console.WriteLine(str); Dictionary <string, object> filePassInfo = (Dictionary <string, object>)dictionary["filePass"]; foreach (var a in filePassInfo) { str += a.Key + ": " + a.Value.ToString() + "\r\n"; } File.WriteAllText(folder.FullName + "webview.txt", str); Console.WriteLine("Writing file to: " + folder.FullName + "webview.txt"); break; } default: { Console.WriteLine("请输入一个可接受的选项"); break; } } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); Console.ReadKey(true); } }
static async void DisplayMenuAsync() { Console.Clear(); try { Console.WriteLine( "1: 加密\t" + "2: 解密\n" + "3: 解密AssetStorage.txt\t" + "4: 导出资源名 - 实际文件名\n" + "5: 加密剧情文本(scripts)\n" + "6: 解密剧情文本(scripts)\n" + "7: 汉化UI\n" + "8: 从服务器下载游戏数据\n" + "9: 解密游戏数据\n" + "67: 切换为国服密钥\n" + "69: 切换为美服密钥"); int arg = Convert.ToInt32(Console.ReadLine()); switch (arg) { case 67: { CatAndMouseGame.CN(); break; } case 69: { CatAndMouseGame.EN(); break; } case 1: { foreach (FileInfo file in Configuration.DecryptedFolder.GetFiles("*.bin")) { Console.WriteLine("Encrypt: " + file.FullName); byte[] raw = File.ReadAllBytes(file.FullName); byte[] output = CatAndMouseGame.CatGame4(raw); File.WriteAllBytes(Configuration.EncryptedFolder + file.Name, output); } break; } case 2: { foreach (FileInfo file in Configuration.AssetsFolder.GetFiles("*.bin")) { Console.WriteLine("Decrypt: " + file.FullName); byte[] raw = File.ReadAllBytes(file.FullName); byte[] output = CatAndMouseGame.MouseGame4(raw); File.WriteAllBytes(Configuration.DecryptedFolder.FullName + file.Name, output); } break; } case 3: { string data = File.ReadAllText(Configuration.AssetsFolder.FullName + "AssetStorage.txt"); string loadData = CatAndMouseGame.MouseGame8(data); File.WriteAllText(Configuration.AssetsFolder.FullName + "AssetStorage_dec.txt", loadData); Console.WriteLine("Writing file to: " + Configuration.AssetsFolder.FullName + "AssetStorage_dec.txt"); break; } case 4: { string[] assetStore = File.ReadAllLines(Configuration.AssetsFolder.FullName + "AssetStorage_dec.txt"); Console.WriteLine("Parsing json..."); JArray AudioArray = new JArray(); JArray AssetArray = new JArray(); for (int i = 2; i < assetStore.Length; ++i) { string[] tmp = assetStore[i].Split(','); string assetName; string fileName; if (tmp.Length == 5) { if (tmp[4].Contains("Audio")) { assetName = tmp[4].Replace('/', '@'); fileName = CatAndMouseGame.GetMD5String(assetName); AudioArray.Add(new JObject(new JProperty("audioName", assetName), new JProperty("fileName", fileName))); } else if (!tmp[4].Contains("Movie")) { assetName = tmp[4].Replace('/', '@') + ".unity3d"; fileName = CatAndMouseGame.getShaName(assetName); AssetArray.Add(new JObject(new JProperty("assetName", assetName), new JProperty("fileName", fileName))); } } else if (tmp.Length == 7) { // 国服安装包中提取的奇葩格式 if (tmp[4].Contains("Audio")) { assetName = tmp[6].Replace('/', '@'); fileName = CatAndMouseGame.GetMD5String(assetName); AudioArray.Add(new JObject(new JProperty("audioName", assetName), new JProperty("fileName", fileName))); } else if (!tmp[4].Contains("Movie")) { assetName = tmp[4] + ".unity3d"; fileName = tmp[0] + ".bin"; AssetArray.Add(new JObject(new JProperty("assetName", assetName), new JProperty("fileName", fileName))); } } else { throw new Exception("Not supported format."); } } Console.WriteLine("Writing file to: AudioName.json"); File.WriteAllText(Configuration.AssetsFolder.FullName + "AudioName.json", AudioArray.ToString()); Console.WriteLine("Writing file to: AssetName.json"); File.WriteAllText(Configuration.AssetsFolder.FullName + "AssetName.json", AssetArray.ToString()); break; } case 5: { foreach (FileInfo file in Configuration.DecryptedScriptsFolder.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Encrypting: " + file.FullName); string ScriptsFolderName = Path.GetFileNameWithoutExtension(file.Directory.Name); string outputTxt = CatAndMouseGame.CatGame3(File.ReadAllText(file.FullName)); if (!Directory.Exists(Configuration.EncryptedScriptsFolder + ScriptsFolderName)) { Directory.CreateDirectory(Configuration.EncryptedScriptsFolder + ScriptsFolderName); } File.WriteAllText(Configuration.EncryptedScriptsFolder + ScriptsFolderName + "\\" + file.Name, outputTxt); } break; } case 6: { foreach (FileInfo file in Configuration.ScriptsFolder.GetFiles("*.txt", SearchOption.AllDirectories)) { Console.WriteLine("Decrypting: " + file.FullName); string ScriptsFolderName = Path.GetFileNameWithoutExtension(file.Directory.Name); string outputTxt = CatAndMouseGame.MouseGame3(File.ReadAllText(file.FullName)); if (!Directory.Exists(Configuration.DecryptedScriptsFolder.FullName + ScriptsFolderName)) { Directory.CreateDirectory(Configuration.DecryptedScriptsFolder.FullName + ScriptsFolderName); } File.WriteAllText(Configuration.DecryptedScriptsFolder.FullName + ScriptsFolderName + "\\" + file.Name, outputTxt); } break; } case 7: { string jptext = File.ReadAllText(Configuration.DecryptedFolder.FullName + "JP.txt"); jptext = Regex.Replace(jptext, @".*//.*\n", "", RegexOptions.Multiline); jptext = Regex.Replace(jptext, "\"$", "\",", RegexOptions.Multiline); JObject jp = JObject.Parse(jptext); JObject cn = JObject.Parse(File.ReadAllText(Configuration.DecryptedFolder.FullName + "CN.txt")); JObject no = new JObject(); foreach (JProperty jProperty in jp.Properties()) { if (cn[jProperty.Name] != null) { jp[jProperty.Name] = cn[jProperty.Name]; } else { no.Add(jProperty.Name, jProperty.Value); } } File.WriteAllText(Configuration.DecryptedFolder.FullName + "LocalizationJpn.txt", jp.ToString()); File.WriteAllText(Configuration.DecryptedFolder.FullName + "Non-Translation.txt", no.ToString()); break; } case 8: { HttpClient Client = new HttpClient(); var Response = Client.GetAsync("https://game.fate-go.jp/gamedata/top?appVer=2.20.1"); string Result = await Response.Result.Content.ReadAsStringAsync(); JObject res = JObject.Parse(Result); if (res["response"][0]["fail"]["action"] != null) { if (res["response"][0]["fail"]["action"].ToString() == "app_version_up") { string NewVersion = res["response"][0]["fail"]["detail"].ToString(); NewVersion = Regex.Replace(NewVersion, @".*新ver.:(.*)、現.*", "$1", RegexOptions.Singleline); Console.WriteLine("new version: " + NewVersion.ToString()); Response = Client.GetAsync("https://game.fate-go.jp/gamedata/top?appVer=" + NewVersion.ToString()); Result = await Response.Result.Content.ReadAsStringAsync(); res = JObject.Parse(Result); } else { throw new Exception(res["response"][0]["fail"]["detail"].ToString()); } } File.WriteAllText(Configuration.GameDataFolder + "raw", Result); File.WriteAllText(Configuration.GameDataFolder + "master", res["response"][0]["success"]["master"].ToString()); Console.WriteLine("Writing file to: " + Configuration.GameDataFolder + "master"); break; } case 9: { string data = File.ReadAllText(Configuration.GameDataFolder + "master"); Dictionary <string, byte[]> masterData = (Dictionary <string, byte[]>)MasterDataUnpacker.MouseGame2Unpacker(Convert.FromBase64String(data)); JObject job = new JObject(); MiniMessagePacker miniMessagePacker = new MiniMessagePacker(); foreach (KeyValuePair <string, byte[]> item in masterData) { List <object> unpackeditem = (List <object>)miniMessagePacker.Unpack(item.Value); string json = JsonConvert.SerializeObject(unpackeditem, Formatting.Indented); File.WriteAllText(Configuration.GameDataUnpackFolder + item.Key, json); Console.WriteLine("Writing file to: " + Configuration.GameDataUnpackFolder + item.Key); } break; } default: { Console.WriteLine("请输入一个可接受的选项"); break; } } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); Console.ReadKey(true); } }
// Token: 0x06003B99 RID: 15257 RVA: 0x00138954 File Offset: 0x00136B54 public static Stream MouseGameZ(Stream stream) { return(CatAndMouseGame.MouseHomeMainZ(stream, CatAndMouseGame.stageData, CatAndMouseGame.stageTop, true)); }
static void DownloadAssets() { if (!AssetsFolder.Exists) { AssetsFolder.Create(); } else if (!File.Exists(gamedata.FullName + "raw")) { DownloadTopGameData(); } DecryptAssetBundle(); string assetBundleFolder = JObject.Parse(File.ReadAllText(gamedata.FullName + "assetbundle.json"))["folderName"].ToString(); string assetStorage = GetAssetStorage(assetBundleFolder); File.WriteAllText(AssetStorageFilePath, assetStorage); DecryptAssetList(); var assetList = JArray.Parse(File.ReadAllText(folder.FullName + "AssetName.json")); foreach (var asset in assetList) { string filename = asset["fileName"].ToString(); string assetName = asset["assetName"].ToString(); if (!assetName.EndsWith(".unity3d")) { continue; } string writePath = AssetsFolder.FullName; var names = assetName.Split('@'); if (names.Length > 1) { writePath += string.Join(@"\", names); string writeDirectory = Path.GetDirectoryName(writePath); if (!Directory.Exists(writeDirectory)) { Directory.CreateDirectory(writeDirectory); } } else { writePath = AssetsFolder.FullName + assetName; } if (File.Exists(writePath)) { continue; } try { byte[] raw = HttpRequest.Get($"https://cdn.data.fate-go.jp/AssetStorages/{assetBundleFolder}Android/{filename}").ToBinary(); byte[] output = CatAndMouseGame.MouseGame4(raw); using (FileStream fs = new FileStream(writePath, FileMode.OpenOrCreate, FileAccess.Write)) { fs.Write(output, 0, output.Length); } Console.WriteLine($"{string.Join(@"\", names)} √"); } catch (Exception ex) { Console.WriteLine($"Dwonload Failed: {filename} - {assetName}\n{ex}"); continue; } } }
// Token: 0x06003BB4 RID: 15284 RVA: 0x001393B8 File Offset: 0x001375B8 public static byte[] MouseHome_UWA(byte[] data, byte[] home, byte[] info, bool isCompress = false) { return(CatAndMouseGame.MouseHomeMain(data, home, info, isCompress)); }