UcfbHelper.cs
/// <summary>
/// Returns the path to the extraction folder
/// </summary>
/// <returns></returns>
Returns the path to the extraction folder
Returns the path to the extraction folder
public string ExtractContents()
        {
            mCurrentPos = 0;
            string retVal =  CreateExtractDir();
            if (!BinUtils.BinCompare(UCFB, mData, mCurrentPos))
            {
                Program.MessageUser("ERROR! This is not a UCF file: "+ FileName);
                return null;
            }
            uint bytesLeftInFile = InitializeRead();
            if (mData.Length - (mCurrentPos + bytesLeftInFile) != 0)
            {
                Program.MessageUser("WARNING! ucfb length data kinda sketchy: " + FileName);
            }
            mManifest.Clear();
            try
            {
                while (RipChunk(true) != null) ;
            }
            catch (System.IndexOutOfRangeException) { }
            WriteManifest();
            if (FileName.EndsWith(".lvl"))
            {
                string reqFileName = FileName.Replace(".lvl", ".req");
                int lastSlash = reqFileName.LastIndexOf("\\");
                reqFileName = reqFileName.Substring(lastSlash+1);
                reqFileName = retVal + reqFileName;
                string req = ReqMaker.GetReq(retVal);
                File.WriteAllText(reqFileName, req);
            }
            return retVal;
        }
public string ExtractContents ( ) { mCurrentPos = 0 ; string retVal = CreateExtractDir ( ) ; if ( ! BinUtils . BinCompare ( UCFB , mData , mCurrentPos ) ) { Program . MessageUser ( " " + FileName ) ; return null ; } uint bytesLeftInFile = InitializeRead ( ) ; if ( mData . Length - ( mCurrentPos + bytesLeftInFile ) != 0 ) { Program . MessageUser ( " " + FileName ) ; } mManifest . Clear ( ) ; try { while ( RipChunk ( true ) != null ) ; } catch ( System . IndexOutOfRangeException ) { } WriteManifest ( ) ; if ( FileName . EndsWith ( " " ) ) { string reqFileName = FileName . Replace ( " " , " " ) ; int lastSlash = reqFileName . LastIndexOf ( " \\ " ) ; reqFileName = reqFileName . Substring ( lastSlash + 1 ) ; reqFileName = retVal + reqFileName ; string req = ReqMaker . GetReq ( retVal ) ; File . WriteAllText ( reqFileName , req ) ; } return retVal ; }
Returns the path to the extraction folder
Returns the path to the extraction folder
//mPlanFileCount = 0; //read file header //ConsumeBytes(4); // advance past ucfb header
None