Esempio n. 1
0
        bool ReadInternal()
        {
            bool result = true;

            if (ProgressOutput != null)
            {
                ProgressOutput.WriteLine("Trying to read source listing {0}...", mSourceFile);
            }

            if (!File.Exists(mSourceFile))
            {
                result = false;
            }
            else
            {
                mEraFile = new EraFile();
                mEraFile.BuildModeDefaultTimestamp = EraFile.GetMostRecentTimeStamp(mSourceFile);

                using (var xml = new IO.XmlElementStream(mSourceFile, FA.Read, this))
                {
                    xml.InitializeAtRootElement();
                    result &= mEraFile.ReadDefinition(xml);
                }
            }

            if (result == false)
            {
                if (ProgressOutput != null)
                {
                    ProgressOutput.WriteLine("\tFailed!");
                }
            }

            return(result);
        }
Esempio n. 2
0
        bool ReadEraFromStream()
        {
            bool result = true;

            result = EraFileHeader.VerifyIsEraAndDecrypted(mEraStream.Reader);
            if (!result)
            {
                if (VerboseOutput != null)
                {
                    VerboseOutput.WriteLine("\tFailed: File is either not decrypted, corrupt, or not even an ERA");
                }
            }
            else
            {
                mEraStream.VirtualAddressTranslationInitialize(Shell.ProcessorSize.x32);

                mEraFile          = new EraFile();
                mEraFile.FileName = mSourceFile;
                mEraFile.Serialize(mEraStream);
                mEraFile.ReadPostprocess(mEraStream);
            }

            return(result);
        }