Пример #1
0
 public static InnerFileStructure getInstance()
 {
     if (InnerFileStructure.m_instance == null)
     {
         InnerFileStructure.m_instance = new InnerFileStructure();
     }
     return(InnerFileStructure.m_instance);
 }
Пример #2
0
        //private static void HandleXDBF(byte[] file)
        //{
        //    XDBF xDBF = new XDBF(file);
        //    xDBF.Open();
        //    xDBF.Read();
        //    xDBF.ExtractEntryData();
        //    xDBF.Close();
        //    FileEntry[] files = InnerFileStructure.getInstance().getFiles("XDBF", "Bins");
        //    for (int i = 0; i < (int)files.Length; i++)
        //    {
        //        if (files[i].fileName.ToLower().EndsWith("xitb"))
        //        {
        //            XITB xITB = new XITB(files[i].Data);
        //            xITB.Open();
        //            xITB.Read();
        //            xITB.Close();
        //        }
        //    }
        //    for (int j = 0; j < (int)files.Length; j++)
        //    {
        //        if (files[j].fileName.ToLower().EndsWith("xach"))
        //        {
        //            FileEntry[] fileEntryArray = InnerFileStructure.getInstance().getFiles("XDBF", "Strings");
        //            for (int k = 0; k < (int)fileEntryArray.Length; k++)
        //            {
        //                XSTR xSTR = new XSTR(fileEntryArray[k].Data);
        //                xSTR.Open();
        //                xSTR.Read(true, "");
        //                XACH xACH = new XACH(files[j].Data);
        //                xACH.Open();
        //                xACH.Read(xSTR, fileEntryArray[k].fileName);
        //                xACH.Close();
        //                xSTR.Close();
        //            }
        //        }
        //    }
        //}

        private static void HandleXEX2(byte[] file, string fileName)
        {
            XEX2 xEX2 = new XEX2(file);

            xEX2.Open();
            xEX2.Read();
            xEX2.DecryptBaseFile();
            FileEntry fileEntry = new FileEntry()
            {
                Data     = xEX2.getBaseFile(),
                type     = "Base File",
                fileName = string.Concat(fileName, ".exe")
            };

            InnerFileStructure.getInstance().AddFileEntry(fileEntry);
            xEX2.ExtractAllRessource();
            xEX2.Close();
        }