Example #1
0
        // Token: 0x06000758 RID: 1880 RVA: 0x0003045C File Offset: 0x0002E65C
        public static void Extract(string folderPath)
        {
            YSExport.Reset();
            YSExport._folderPath = folderPath;
            FileUtils.FindFile(folderPath, "*.*", delegate(FileInfo f)
            {
                string fullName = f.FullName;
                string text     = Path.GetExtension(fullName).ToLower();
                if (fullName.Contains("asset_index"))
                {
                    YSExport._blkInfo = YSAssetIndex.Read(fullName);
                    return;
                }
                if (text.Equals(".blk"))
                {
                    YSExport._unityList.Add(fullName);
                }
            });
            Console.WriteLine("Start Unpacking");
            if (YSExport._blkInfo.Count == 0)
            {
                Console.WriteLine("Error->The asset_index file was not found, please make sure that the asset_index and blocks folders are in the same directory");
                Console.WriteLine("Unpacking Failure");
            }
            else
            {
                foreach (string filePath in YSExport._unityList)
                {
                    byte[]             data        = FileUtils.ReadAllBytes(filePath);
                    TaskAwaiter <bool> taskAwaiter = YSExport.ExportUnityAsset(filePath, data).GetAwaiter();
                    if (!taskAwaiter.IsCompleted)
                    {
                        TaskAwaiter <bool> taskAwaiter2;
                        taskAwaiter2 = taskAwaiter;
                        taskAwaiter2 = default(TaskAwaiter <bool>);
                    }
                    if (taskAwaiter.GetResult())
                    {
                        Console.WriteLine(string.Format("Export->Success {0} Files Failure {1} Files {2}", ExportInfo.SuccessCount, ExportInfo.ErrorCount, Path.GetFileName(filePath)));
                    }
                }
                List <string> .Enumerator enumerator = default(List <string> .Enumerator);
                Console.WriteLine(string.Format("Decrypt->Success {0} Files Failure {1} Files\n", ExportInfo.SuccessCount, ExportInfo.ErrorCount));
//                await Task.Delay(500);
                Console.WriteLine("Export Path->" + Path.Combine(YSExport._folderPath, "blocks_export"));
                Console.WriteLine("Decryption completed, please use AssetStudio to extract resources");
            }
        }
Example #2
0
 // Token: 0x06000871 RID: 2161 RVA: 0x000100DB File Offset: 0x0000E2DB
 public static void FindFile(string dirPath, Action <FileInfo> doWork)
 {
     FileUtils.FindFile(dirPath, "*.*", doWork);
 }