Example #1
0
        static void Main(string[] args)
        {
            MBN mbnFile = new MBN("1.mbn");

            foreach (MBN.Section item in mbnFile.Sections)
            {
                //item.Extract(item, "csc");
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            string filename, folder;

            if (HasFlag(args, "/info"))
            {
                filename = GetArg(args, "/info", null);
                MBN mbn = new MBN(filename);
                Console.WriteLine("Firmware version: " + mbn.Version);
                Console.WriteLine("Firmware subversion: " + mbn.SubVersion);
                Console.WriteLine("Sections count: " + mbn.Sections.Count.ToString());
                //Sections
                foreach (MBN.Section section in mbn.Sections)
                {
                    Console.WriteLine("Section name: " + section.Name);
                    Console.WriteLine("Files count: " + section.Files.Count().ToString());
                    //Files
                    foreach (MBN.File file in section.Files)
                    {
                        Console.WriteLine("File: " + file.Name);
                        Console.WriteLine("Length: " + file.Length.ToString());
                    }
                }
                return;
            }
            if (HasFlag(args, "/u"))
            {
                filename = GetArg(args, "/u", null);
                folder   = GetArg(args, "/d", "csc");
                MBN mbn = new MBN(filename);
                mbn.Extract(folder);
                return;
            }
            if (HasFlag(args, "/p"))
            {
                string ver, subver;
                folder   = GetArg(args, "/p", null);
                filename = GetArg(args, "/f", folder + ".mbn");
                ver      = GetArg(args, "/ver", "I8750OXXCMK2");
                subver   = GetArg(args, "/subver", "OXX");
                if (!MBN.Pack(filename, folder, ver, subver))
                {
                    PrintError("No such directory");
                }
                return;
            }
            //usage
            PrintUsage();
        }
Example #3
0
        public static file load(string fileName)
        {
            switch (Path.GetExtension(fileName).ToLower())
            {
            case ".mbn": return(new file {
                    data = MBN.load(fileName), type = formatType.model
                });

            case ".xml": return(new file {
                    data = NLP.load(fileName), type = formatType.model
                });

            default: return(load(new FileStream(fileName, FileMode.Open)));
            }
        }
Example #4
0
        public static file load(string fileName)
        {
            FileLockCheckerHelper.FileReadCheck(fileName);

            switch (Path.GetExtension(fileName).ToLower())
            {
            case ".mbn": return(new file {
                    data = MBN.load(fileName), type = formatType.model
                });

            case ".xml": return(new file {
                    data = NLP.load(fileName), type = formatType.model
                });

            default: return(load(new FileStream(fileName, FileMode.Open, FileAccess.Read)));
            }
        }