コード例 #1
0
 public bool Load()
 {
     if (_io.Stream.Length < 0x60)
     {
         return(false);
     }
     _io.Stream.Position = 0;
     Header = (MBINHeader)NMSTemplate.DeserializeBinaryTemplate(_io.Reader, "MBINHeader");
     return(true);
 }
コード例 #2
0
        //public bool Load(bool getVersion = false)
        public bool Load()
        {
            _io.Stream.Position = 0;
            Header = (MBINHeader)NMSTemplate.DeserializeBinaryTemplate(_io.Reader, "MBINHeader");
            //if (getVersion)
            //{
            //    string mbinVer = Header.GetMBINVersion();
            //    Console.WriteLine(mbinVer.Substring(8));
            //}

            /*else
             * {
             *  if (Header.Tag == 0x726576434E49424D)        // check whether the file has been generated by MBINCompiler basically
             *  {
             *      string ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
             *      if (Header.Tag != String.Format("MBINCver{0}", ver.Substring(0, ver.Length - 2)))
             *      {
             *          Console.WriteLine("Incorrect version");
             *          return false;
             *      }
             *  }
             * }*/
            return(true);
        }