Esempio n. 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);
 }
Esempio n. 2
0
 public bool Load(bool getVersion = false)
 {
     _io.Stream.Position = 0;
     Header = (MBINHeader)NMSTemplate.DeserializeBinaryTemplate(_io.Reader, "MBINHeader");
     if (getVersion)
     {
         string mbinVer = Header.Tag;
         Console.WriteLine(mbinVer.Substring(8));
     }
     else
     {
         if (Header.Tag.Contains("MBIN"))        // 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);
 }
Esempio n. 3
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);
        }
Esempio n. 4
0
 public NMSTemplate GetData()
 {
     _io.Stream.Position = 0x60;
     return(NMSTemplate.DeserializeBinaryTemplate(_io.Reader, Header.GetXMLTemplateName()));
 }
Esempio n. 5
0
 public bool Load()
 {
     _io.Stream.Position = 0;
     Header = (MBINHeader)NMSTemplate.DeserializeBinaryTemplate(_io.Reader, "MBINHeader");
     return(true);
 }