static void Main(string[] args) { MBN mbnFile = new MBN("1.mbn"); foreach (MBN.Section item in mbnFile.Sections) { //item.Extract(item, "csc"); } }
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(); }