From a74a13d699b4c788c085f646ccd7eb1a21ed7eac Mon Sep 17 00:00:00 2001 From: Huawei bootloader research Date: Sat, 13 Apr 2024 21:56:54 +0300 Subject: [PATCH] V33 --- HuaweiUnlock/DIAGNOS/OemInfoTool.cs | 20 +- HuaweiUnlock/English.ini | 5 +- HuaweiUnlock/FlashTool/FlashToolQClegacy.cs | 4 +- HuaweiUnlock/HuaweiUnlock.csproj | 3 +- HuaweiUnlock/LangProc.cs | 11 +- HuaweiUnlock/Properties/Resources.Designer.cs | 24 +- HuaweiUnlock/Russian.ini | 12 +- HuaweiUnlock/TOOLS/Fastboot.cs | 2 +- HuaweiUnlock/TOOLS/HISI.cs | 9 +- HuaweiUnlock/TOOLS/ImageFlasher.cs | 3 +- HuaweiUnlock/UI/Language.cs | 8 +- HuaweiUnlock/Window.Designer.cs | 333 +++++++++--------- HuaweiUnlock/Window.cs | 263 +++++++------- HuaweiUnlock/Window.resx | 2 +- HuaweiUnlock/app.config | 11 +- 15 files changed, 345 insertions(+), 365 deletions(-) diff --git a/HuaweiUnlock/DIAGNOS/OemInfoTool.cs b/HuaweiUnlock/DIAGNOS/OemInfoTool.cs index 7273c58..d394fcd 100644 --- a/HuaweiUnlock/DIAGNOS/OemInfoTool.cs +++ b/HuaweiUnlock/DIAGNOS/OemInfoTool.cs @@ -71,6 +71,7 @@ public static void Decompile(string path, string Header = "4F454D5F494E464F") LOG(0, "DATA:", Encoding.ASCII.GetString(data)); } } + FileAll = null; } public static List GetOffsets(byte[] file, string pattr) { @@ -94,26 +95,21 @@ public static List GetOffsets(byte[] file, string pattr) public static void Compile(string intpath, string outpath) { //NOT WORK - FileStream outfile = new FileStream(outpath, FileMode.OpenOrCreate); - outfile.Seek(0, SeekOrigin.Begin); //ТУТ нужно было все файлы из папки в .img //а я вот такую поеботу сделал 0_) - DirectoryInfo hdDirectoryInWhichToSearch = new DirectoryInfo("UnlockFiles/OemInfoData/"); + DirectoryInfo hdDirectoryInWhichToSearch = new DirectoryInfo(intpath); FileInfo[] filesInDir = hdDirectoryInWhichToSearch.GetFiles("*.header"); + FileStream outfile = new FileStream(outpath, FileMode.OpenOrCreate); foreach (var dfile in filesInDir) { - byte[] filebts = File.ReadAllBytes(dfile.FullName); + outfile.Seek(0, SeekOrigin.Begin); + LOG(0, "Adding: " + dfile.Name); + byte[] filebts = File.ReadAllBytes(intpath + dfile.Name); outfile.Write(filebts, 0, filebts.Length); - foreach (var aoffset in Offsets) - { - LOG(0, "Adding: OEM_INFO_" + aoffset + ".header"); - filebts = File.ReadAllBytes(intpath + "/OEM_INFO_" + aoffset + ".header"); - outfile.Write(filebts, 0, filebts.Length); - } - outfile.Close(); - outfile.Dispose(); } + outfile.Close(); + outfile.Dispose(); } } } diff --git a/HuaweiUnlock/English.ini b/HuaweiUnlock/English.ini index afb17f6..51e48cc 100644 --- a/HuaweiUnlock/English.ini +++ b/HuaweiUnlock/English.ini @@ -9,6 +9,7 @@ Success,SUCCESS Done,DONE Percent,Please wait: File,File: +FileWrong,Wrong File Canceled,Canceled MAIN1,Its free noo need to pay for that MAIN2,Author: moongamer @@ -32,8 +33,8 @@ SelPathToFGB,Select Path To Firmware: SelPathToGPTXML,Select path for save rawprogram0.xml: SelPathToGPT,Select path to gpt.bin: UnlockBTN,Unlock FRP -DdBtn,Download BootLoader And Unlock [factory BL] -DdBtnE,Unlock Dev [factory BL] +DdBtn,Download BootLoader And Unlock [Factory BL] +DdBtnE,Unlock Device [Factory BL] FlBtn,Flash Firmware UnpBtn,Extract Firmware FlashUnpBtn,Extract and Flash diff --git a/HuaweiUnlock/FlashTool/FlashToolQClegacy.cs b/HuaweiUnlock/FlashTool/FlashToolQClegacy.cs index 7add310..23ac249 100644 --- a/HuaweiUnlock/FlashTool/FlashToolQClegacy.cs +++ b/HuaweiUnlock/FlashTool/FlashToolQClegacy.cs @@ -74,10 +74,8 @@ public static async void Unlock(string loader, string path) { if (fileName.EndsWith(".xml")) continue; string partname = fileName.Split('\\').Last().Split('.').First(); - LOG(0, "Writer", partname + newline); subcommand = "-p " + DeviceInfo.Port.ComName + " -f " + '"' + loader + '"' + " -b " + partname + " " + '"' + fileName + '"'; - if (DeviceInfo.Partitions.ContainsKey(partname)) - CurPartLenght = int.Parse(DeviceInfo.Partitions[partname].BlockNumSectors); + LOG(0, "Writer", partname + newline); if (!SyncRUN(command, subcommand)) LOG(2, "FailUnl"); else Progress(50); diff --git a/HuaweiUnlock/HuaweiUnlock.csproj b/HuaweiUnlock/HuaweiUnlock.csproj index 355b994..8a68451 100644 --- a/HuaweiUnlock/HuaweiUnlock.csproj +++ b/HuaweiUnlock/HuaweiUnlock.csproj @@ -12,7 +12,7 @@ Properties HuaweiUnlocker HuaweiUnlock - v4.7.1 + v4.8 512 @@ -145,6 +145,7 @@ True + diff --git a/HuaweiUnlock/LangProc.cs b/HuaweiUnlock/LangProc.cs index 0586d1f..3d9f21e 100644 --- a/HuaweiUnlock/LangProc.cs +++ b/HuaweiUnlock/LangProc.cs @@ -18,9 +18,9 @@ namespace HuaweiUnlocker { public static class LangProc { - public const string APP_VERSION = "32F"; + public const string APP_VERSION = "33F"; public static TextBox LOGGBOX; - public static string log, loge, newline = Environment.NewLine, PrevFolder = "c:\\"; + public static string log, loge, newline = Environment.NewLine, PrevFolder = "UnlockFiles"; public static StreamWriter se; public static NProgressBar PRG; public static TabControl Tab; @@ -175,14 +175,14 @@ public static bool LOG(int o, object i, object j = null, string sepa = " ") try { - i = string.Join("", Regex.Split((string)i, @"(?:\r\n|\n|\r)")); - j = string.Join("", Regex.Split((string)j, @"(?:\r\n|\n|\r)")); + i = string.Join(newline, Regex.Split((string)i, @"(?:\r\n|\n|\r)")); + j = string.Join(newline, Regex.Split((string)j, @"(?:\r\n|\n|\r)")); } catch { } - string line = (newline + state + i + sepa + j).Replace("/n", newline).Replace("\n", newline); + string line = (newline + state + i + sepa + j); action = () => LOGGBOX.AppendText(line); if (LOGGBOX.InvokeRequired) LOGGBOX.Invoke(action); @@ -234,6 +234,7 @@ public static List GETPORTLIST() reqq.ComName = DEVICEname.Split(' ').Last().Replace("(", "").Replace(")", ""); reqq.FullName = DEVICEname; req.Add(reqq); + Thread.Sleep(10); } } catch (Exception) diff --git a/HuaweiUnlock/Properties/Resources.Designer.cs b/HuaweiUnlock/Properties/Resources.Designer.cs index 1667e7a..24d4afc 100644 --- a/HuaweiUnlock/Properties/Resources.Designer.cs +++ b/HuaweiUnlock/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Этот код создан программой. -// Исполняемая версия:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае -// повторной генерации кода. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace HuaweiUnlocker.Properties { /// - /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Этот класс создан автоматически классом StronglyTypedResourceBuilder - // с помощью такого средства, как ResGen или Visual Studio. - // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen - // с параметром /str или перестройте свой проект VS. + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Resources() { } /// - /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Перезаписывает свойство CurrentUICulture текущего потока для всех - /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { diff --git a/HuaweiUnlock/Russian.ini b/HuaweiUnlock/Russian.ini index 8afb904..989a770 100644 --- a/HuaweiUnlock/Russian.ini +++ b/HuaweiUnlock/Russian.ini @@ -4,11 +4,13 @@ NotFoundF,Файл не найден: NoRights,Нет прав. Попробуйте от имени админа Info,[ЛОГ] Error,[Ошибка] +Action,Действия: Warning,[Предупреждение] Success,Успешно Done,Завершено Percent,Подождите: File,Файл: +FileWrong,Говно Файл.(Не правильный) Canceled,Отменено/Очищенно MAIN1,Это бесплатное ПО. Не нужно за него платить MAIN2,Автор: moongamer @@ -32,8 +34,8 @@ SelPathToFGB,Выберите путь к прошивке: SelPathToGPTXML,Выберите путь для сохранения файла rawprogram0.xml: SelPathToGPT,Выберите путь к gpt.bin: UnlockBTN,Разблокировать FRP -DdBtn,Загрузить загрузчик и разблокировать [factory BL] -DdBtnE,Разблокировать устройство [factory BL] +DdBtn,Загрузить загрузчик и разблокировать [Factory BL] +DdBtnE,Разблокировать устройство [Factory BL] FlBtn,Прошить прошивку UnpBtn,Распаковать прошивку FlashUnpBtn,Распаковать и прошить @@ -144,8 +146,8 @@ WarnUnl,Разблокированное ядро для этого устрой [HISI] HISIGPTtagSimpl,[HISI] Разделы HISISelectCpu,Выберите процессор -HISIInitFB,Записать ключ разблокировки устройства -HISIWriteKirinBL,Записать ключа разблокировки устройства +HISIInitFB,Записать информацию и ключ разблокировки устройства +HISIWriteKirinBL,Прочитать ключ разблокировки устройства HISIWriteKirinBLD,Загрузить заводской загрузчик и прочитать информацию HISIWriteKirinBLD2,Загрузить заводской загрузчик и войти в Fastboot HISIInfoS,*** FBLOCK заблокирован! ***/nВ этом состоянии FBLOCK ничего не сделать @@ -153,5 +155,5 @@ HISINewKey,[FASTBOOT] Новый ключ USERLOCK: HISIOldKey,[FASTBOOT] Считанный код USERLOCK: HISINewKeyErr,[Fastboot] Ошибка при записи/считывании кода разблокировки HISIVerifyHash, Проверка изображений...[HISI] -HISI TryULTag, разблокируйте WARN. Может быть бутлуп. +HISITryULTag, разблокируйте WARN. Может быть бутлуп. HISITryUnlock, заводской загрузчик будет прошит в качестве основного загрузчика. Если заводской загрузчик показывает черный экран - нажмите НЕТ! В противном случае вы получите устройство с черным экраном. Ваше устройство может загружаться только с черным экраном! \ No newline at end of file diff --git a/HuaweiUnlock/TOOLS/Fastboot.cs b/HuaweiUnlock/TOOLS/Fastboot.cs index e232b80..dc077b0 100644 --- a/HuaweiUnlock/TOOLS/Fastboot.cs +++ b/HuaweiUnlock/TOOLS/Fastboot.cs @@ -77,8 +77,8 @@ public bool Connect(int waittime = 100) return false; } - Thread.Sleep(500); counter++; + Thread.Sleep(64); Application.DoEvents(); } diff --git a/HuaweiUnlock/TOOLS/HISI.cs b/HuaweiUnlock/TOOLS/HISI.cs index 03fd096..cd959a9 100644 --- a/HuaweiUnlock/TOOLS/HISI.cs +++ b/HuaweiUnlock/TOOLS/HISI.cs @@ -43,16 +43,15 @@ public static void FlashBootloader(Bootloader bootloader, string port) { if (!image.IsValid) { - throw new Exception($"Image `{image.Role}` is not valid!"); + LOG(2, "Image " + image.Role + " is not valid!"); + return; } asize += image.Size; } - - LOG(0, "CPort", port); flasher.Open(port); - LOG(0, "Writer", bootloader.Name); + LOG(0, "Writer", bootloader.Name.Replace("NVME", "NVE")); foreach (var image in bootloader.Images) { @@ -216,7 +215,7 @@ public static string ReadIndentifier() var res = fb.Command("oem get_identifier_token"); var match = Regex.Match(res.Payload, @"[\w\d]{16}"); - return match.Success ? match.Value : "NaN"; + return match.Success ? match.Value : res.Payload; } public static void UnlockFBLOCK() { diff --git a/HuaweiUnlock/TOOLS/ImageFlasher.cs b/HuaweiUnlock/TOOLS/ImageFlasher.cs index cf68768..e5d6c7b 100644 --- a/HuaweiUnlock/TOOLS/ImageFlasher.cs +++ b/HuaweiUnlock/TOOLS/ImageFlasher.cs @@ -127,7 +127,8 @@ private void SendFrame(byte[] data) if (_ack != 0xAA) { - throw new Exception(string.Format("ACK is invalid! ACK={0:X2}; Excepted={1:X2}", _ack, 0xAA)); + LangProc.LOG(2, string.Format("ACK is invalid! ACK={0:X2}; Excepted={1:X2}", _ack, 0xAA), " :FAIL TO FLASH:"); + return; } } } diff --git a/HuaweiUnlock/UI/Language.cs b/HuaweiUnlock/UI/Language.cs index 67e9bd3..c954b07 100644 --- a/HuaweiUnlock/UI/Language.cs +++ b/HuaweiUnlock/UI/Language.cs @@ -13,20 +13,20 @@ public static bool ReadLngFile() StreamReader readerL = new StreamReader(File.OpenRead("Languages\\" + CURRENTlanguage + ".ini")); string line; while ((line = readerL.ReadLine()) != null) - if (!line.StartsWith("[") && !line.StartsWith("#")) LanguageStrs.Add(line.Split(',')[0], line.Split(',')[1]); + if (!line.StartsWith("[") && !line.StartsWith("#")) LanguageStrs.Add(line.Split(',')[0].ToLower(), line.Split(',')[1]); readerL.Close(); readerL.Dispose(); return LanguageStrs.Count > 0; } public static string Get(string name) { - if (isExist(name)) - return LanguageStrs[name]; + if (isExist(name.ToLower())) + return LanguageStrs[name.ToLower()]; else return "LANG_ERROR"; } public static bool isExist(string name) { - return LanguageStrs.ContainsKey(name); + return LanguageStrs.ContainsKey(name.ToLower()); } } } diff --git a/HuaweiUnlock/Window.Designer.cs b/HuaweiUnlock/Window.Designer.cs index 8e4593b..7af8f34 100644 --- a/HuaweiUnlock/Window.Designer.cs +++ b/HuaweiUnlock/Window.Designer.cs @@ -18,12 +18,12 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Window)); this.pather = new System.Windows.Forms.TextBox(); this.DETECTED = new System.Windows.Forms.Label(); @@ -36,7 +36,6 @@ private void InitializeComponent() this.AutoLdr = new System.Windows.Forms.CheckBox(); this.Tab = new System.Windows.Forms.TabControl(); this.MA = new System.Windows.Forms.TabPage(); - this.label4 = new System.Windows.Forms.Label(); this.TUTR2 = new System.Windows.Forms.Label(); this.groupBox9 = new System.Windows.Forms.GroupBox(); this.button1 = new System.Windows.Forms.Button(); @@ -45,10 +44,6 @@ private void InitializeComponent() this.DBB = new System.Windows.Forms.CheckBox(); this.LBOX = new System.Windows.Forms.ComboBox(); this.QCOM1 = new System.Windows.Forms.TabPage(); - this.GLOADER = new System.Windows.Forms.GroupBox(); - this.UFSChk = new System.Windows.Forms.CheckBox(); - this.LoaderBox = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); this.ACTBOX = new System.Windows.Forms.GroupBox(); this.GPfir = new System.Windows.Forms.GroupBox(); this.groupBox10 = new System.Windows.Forms.GroupBox(); @@ -109,6 +104,11 @@ private void InitializeComponent() this.CompileOemInfBTN = new System.Windows.Forms.Button(); this.TrimOrNCHK = new System.Windows.Forms.CheckBox(); this.ReadOemBTN = new System.Windows.Forms.Button(); + this.Dbg = new System.Windows.Forms.TabPage(); + this.GLOADER = new System.Windows.Forms.GroupBox(); + this.UFSChk = new System.Windows.Forms.CheckBox(); + this.LoaderBox = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); this.Gbox = new System.Windows.Forms.GroupBox(); this.PORTBOX = new System.Windows.Forms.ComboBox(); this.DEVICER = new System.Windows.Forms.ComboBox(); @@ -133,6 +133,7 @@ private void InitializeComponent() this.PortFindUpd = new System.Windows.Forms.Timer(this.components); this.IdentifyBTN = new System.Windows.Forms.Button(); this.SLDEV = new System.Windows.Forms.GroupBox(); + this.label4 = new System.Windows.Forms.Label(); this.SelectLOADER = new HuaweiUnlocker.UI.NButton(); this.SelLanguage = new HuaweiUnlocker.UI.NButton(); this.SelPth = new HuaweiUnlocker.UI.NButton(); @@ -164,7 +165,6 @@ private void InitializeComponent() this.groupBox9.SuspendLayout(); this.groupBox6.SuspendLayout(); this.QCOM1.SuspendLayout(); - this.GLOADER.SuspendLayout(); this.ACTBOX.SuspendLayout(); this.GPfir.SuspendLayout(); this.groupBox10.SuspendLayout(); @@ -188,6 +188,7 @@ private void InitializeComponent() this.groupBox4.SuspendLayout(); this.OeRrd.SuspendLayout(); this.groupBox13.SuspendLayout(); + this.GLOADER.SuspendLayout(); this.Gbox.SuspendLayout(); this.CpuHISIBox.SuspendLayout(); this.BURG.SuspendLayout(); @@ -332,6 +333,7 @@ private void InitializeComponent() this.Tab.Controls.Add(this.KRIN2); this.Tab.Controls.Add(this.MTK); this.Tab.Controls.Add(this.OeRrd); + this.Tab.Controls.Add(this.Dbg); this.Tab.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); this.Tab.Location = new System.Drawing.Point(78, 145); this.Tab.Multiline = true; @@ -354,20 +356,6 @@ private void InitializeComponent() this.MA.TabIndex = 5; this.MA.Text = "MAIN"; // - // label4 - // - this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); - this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.label4.ForeColor = System.Drawing.Color.MintCream; - this.label4.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label4.Location = new System.Drawing.Point(293, 82); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(434, 38); - this.label4.TabIndex = 36; - this.label4.Text = "Bootloader status On:\r\nhttps://github.com/werasik2aa/UnlockedHuaweiBootloader"; - this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; - this.label4.Click += new System.EventHandler(this.label4_Click); - // // TUTR2 // this.TUTR2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); @@ -423,7 +411,7 @@ private void InitializeComponent() this.ClrFoldersBTN.TabIndex = 32; this.ClrFoldersBTN.Text = "ClearFolder"; this.ClrFoldersBTN.UseVisualStyleBackColor = false; - this.ClrFoldersBTN.Click += new System.EventHandler(this.ClrFoldersBTN_Click); + this.ClrFoldersBTN.Click += new System.EventHandler(this.button12_Click); // // groupBox6 // @@ -475,65 +463,6 @@ private void InitializeComponent() this.QCOM1.TabIndex = 1; this.QCOM1.Text = "QCOM"; // - // GLOADER - // - this.GLOADER.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); - this.GLOADER.Controls.Add(this.UFSChk); - this.GLOADER.Controls.Add(this.LoaderBox); - this.GLOADER.Controls.Add(this.label1); - this.GLOADER.Controls.Add(this.SelectLOADER); - this.GLOADER.Controls.Add(this.AutoLdr); - this.GLOADER.ForeColor = System.Drawing.Color.DarkGray; - this.GLOADER.Location = new System.Drawing.Point(77, 61); - this.GLOADER.Name = "GLOADER"; - this.GLOADER.Size = new System.Drawing.Size(744, 78); - this.GLOADER.TabIndex = 28; - this.GLOADER.TabStop = false; - this.GLOADER.Text = "Select Loader"; - // - // UFSChk - // - this.UFSChk.AutoSize = true; - this.UFSChk.Font = new System.Drawing.Font("Arial", 10.2F, System.Drawing.FontStyle.Bold); - this.UFSChk.ForeColor = System.Drawing.Color.AntiqueWhite; - this.UFSChk.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.UFSChk.Location = new System.Drawing.Point(459, 13); - this.UFSChk.Margin = new System.Windows.Forms.Padding(2); - this.UFSChk.Name = "UFSChk"; - this.UFSChk.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.UFSChk.Size = new System.Drawing.Size(103, 20); - this.UFSChk.TabIndex = 32; - this.UFSChk.Text = "EMMC/UFS"; - this.UFSChk.UseVisualStyleBackColor = true; - // - // LoaderBox - // - this.LoaderBox.BackColor = System.Drawing.SystemColors.InactiveCaption; - this.LoaderBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.LoaderBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.LoaderBox.Font = new System.Drawing.Font("Arial", 9.8F, System.Drawing.FontStyle.Bold); - this.LoaderBox.Location = new System.Drawing.Point(6, 37); - this.LoaderBox.Margin = new System.Windows.Forms.Padding(2); - this.LoaderBox.Name = "LoaderBox"; - this.LoaderBox.Size = new System.Drawing.Size(632, 24); - this.LoaderBox.Sorted = true; - this.LoaderBox.TabIndex = 32; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Cursor = System.Windows.Forms.Cursors.Default; - this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.label1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); - this.label1.ForeColor = System.Drawing.Color.MintCream; - this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label1.Location = new System.Drawing.Point(2, 16); - this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(159, 19); - this.label1.TabIndex = 15; - this.label1.Text = "MSM LOADER.MBN"; - // // ACTBOX // this.ACTBOX.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); @@ -545,7 +474,7 @@ private void InitializeComponent() this.ACTBOX.ForeColor = System.Drawing.Color.Cornsilk; this.ACTBOX.Location = new System.Drawing.Point(5, 6); this.ACTBOX.Name = "ACTBOX"; - this.ACTBOX.Size = new System.Drawing.Size(720, 454); + this.ACTBOX.Size = new System.Drawing.Size(720, 521); this.ACTBOX.TabIndex = 20; this.ACTBOX.TabStop = false; this.ACTBOX.Text = "Action"; @@ -560,9 +489,9 @@ private void InitializeComponent() this.GPfir.Controls.Add(this.DUMPALL); this.GPfir.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.GPfir.ForeColor = System.Drawing.Color.AliceBlue; - this.GPfir.Location = new System.Drawing.Point(357, 191); + this.GPfir.Location = new System.Drawing.Point(357, 196); this.GPfir.Name = "GPfir"; - this.GPfir.Size = new System.Drawing.Size(357, 236); + this.GPfir.Size = new System.Drawing.Size(363, 236); this.GPfir.TabIndex = 29; this.GPfir.TabStop = false; this.GPfir.Text = "Select"; @@ -574,7 +503,7 @@ private void InitializeComponent() this.groupBox10.Controls.Add(this.CrtGPTBtn2); this.groupBox10.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.groupBox10.ForeColor = System.Drawing.Color.AliceBlue; - this.groupBox10.Location = new System.Drawing.Point(9, 312); + this.groupBox10.Location = new System.Drawing.Point(9, 317); this.groupBox10.Name = "groupBox10"; this.groupBox10.Size = new System.Drawing.Size(349, 115); this.groupBox10.TabIndex = 36; @@ -588,7 +517,7 @@ private void InitializeComponent() this.groupBox7.Controls.Add(this.FlashUpdAppBTN); this.groupBox7.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.groupBox7.ForeColor = System.Drawing.Color.AliceBlue; - this.groupBox7.Location = new System.Drawing.Point(9, 191); + this.groupBox7.Location = new System.Drawing.Point(9, 196); this.groupBox7.Name = "groupBox7"; this.groupBox7.Size = new System.Drawing.Size(349, 115); this.groupBox7.TabIndex = 35; @@ -718,41 +647,41 @@ private void InitializeComponent() this.PARTLIST.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); this.PARTLIST.BorderStyle = System.Windows.Forms.BorderStyle.None; this.PARTLIST.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Sunken; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.Menu; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.PARTLIST.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter; + dataGridViewCellStyle25.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); + dataGridViewCellStyle25.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); + dataGridViewCellStyle25.ForeColor = System.Drawing.SystemColors.Menu; + dataGridViewCellStyle25.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle25.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); + dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.PARTLIST.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle25; this.PARTLIST.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.PARTLIST.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.P, this.O, this.L}); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(62)))), ((int)(((byte)(80))))); - dataGridViewCellStyle2.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Snow; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.PARTLIST.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle26.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(62)))), ((int)(((byte)(80))))); + dataGridViewCellStyle26.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); + dataGridViewCellStyle26.ForeColor = System.Drawing.Color.Snow; + dataGridViewCellStyle26.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle26.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); + dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.PARTLIST.DefaultCellStyle = dataGridViewCellStyle26; this.PARTLIST.Dock = System.Windows.Forms.DockStyle.Fill; this.PARTLIST.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); this.PARTLIST.ImeMode = System.Windows.Forms.ImeMode.Close; this.PARTLIST.Location = new System.Drawing.Point(3, 3); this.PARTLIST.Name = "PARTLIST"; this.PARTLIST.ReadOnly = true; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); - dataGridViewCellStyle3.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.Info; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.PARTLIST.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle27.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); + dataGridViewCellStyle27.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); + dataGridViewCellStyle27.ForeColor = System.Drawing.SystemColors.Info; + dataGridViewCellStyle27.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle27.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); + dataGridViewCellStyle27.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.PARTLIST.RowHeadersDefaultCellStyle = dataGridViewCellStyle27; this.PARTLIST.RowHeadersVisible = false; this.PARTLIST.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; this.PARTLIST.RowTemplate.ReadOnly = true; @@ -802,6 +731,7 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.BLkeyHI); this.groupBox1.Controls.Add(this.isVCOM); this.groupBox1.Controls.Add(this.EnDisFBLOCK); + this.groupBox1.Controls.Add(this.CpuHISIBox); this.groupBox1.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold); this.groupBox1.ForeColor = System.Drawing.Color.Cornsilk; this.groupBox1.Location = new System.Drawing.Point(3, 3); @@ -830,7 +760,7 @@ private void InitializeComponent() this.BLkeyHI.ForeColor = System.Drawing.SystemColors.Menu; this.BLkeyHI.Location = new System.Drawing.Point(6, 39); this.BLkeyHI.Name = "BLkeyHI"; - this.BLkeyHI.Size = new System.Drawing.Size(717, 25); + this.BLkeyHI.Size = new System.Drawing.Size(358, 25); this.BLkeyHI.TabIndex = 10; this.BLkeyHI.Text = "0000000000000000"; this.BLkeyHI.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -852,7 +782,7 @@ private void InitializeComponent() // this.EnDisFBLOCK.AutoSize = true; this.EnDisFBLOCK.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.EnDisFBLOCK.Location = new System.Drawing.Point(541, 19); + this.EnDisFBLOCK.Location = new System.Drawing.Point(98, 19); this.EnDisFBLOCK.Name = "EnDisFBLOCK"; this.EnDisFBLOCK.Size = new System.Drawing.Size(156, 17); this.EnDisFBLOCK.TabIndex = 20; @@ -1155,40 +1085,40 @@ private void InitializeComponent() this.KirinFiles.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); this.KirinFiles.BorderStyle = System.Windows.Forms.BorderStyle.None; this.KirinFiles.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Sunken; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); - dataGridViewCellStyle4.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.Menu; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.KirinFiles.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter; + dataGridViewCellStyle28.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); + dataGridViewCellStyle28.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); + dataGridViewCellStyle28.ForeColor = System.Drawing.SystemColors.Menu; + dataGridViewCellStyle28.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle28.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(42)))), ((int)(((byte)(80))))); + dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.KirinFiles.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle28; this.KirinFiles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.KirinFiles.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, this.dataGridViewTextBoxColumn3}); - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(62)))), ((int)(((byte)(80))))); - dataGridViewCellStyle5.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); - dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Snow; - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.KirinFiles.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle29.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(62)))), ((int)(((byte)(80))))); + dataGridViewCellStyle29.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); + dataGridViewCellStyle29.ForeColor = System.Drawing.Color.Snow; + dataGridViewCellStyle29.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle29.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); + dataGridViewCellStyle29.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.KirinFiles.DefaultCellStyle = dataGridViewCellStyle29; this.KirinFiles.Dock = System.Windows.Forms.DockStyle.Bottom; this.KirinFiles.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); this.KirinFiles.ImeMode = System.Windows.Forms.ImeMode.Close; this.KirinFiles.Location = new System.Drawing.Point(0, 145); this.KirinFiles.Name = "KirinFiles"; this.KirinFiles.ReadOnly = true; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); - dataGridViewCellStyle6.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); - dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.Info; - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.KirinFiles.RowHeadersDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle30.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); + dataGridViewCellStyle30.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); + dataGridViewCellStyle30.ForeColor = System.Drawing.SystemColors.Info; + dataGridViewCellStyle30.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle30.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(47)))), ((int)(((byte)(60))))); + dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.KirinFiles.RowHeadersDefaultCellStyle = dataGridViewCellStyle30; this.KirinFiles.RowHeadersVisible = false; this.KirinFiles.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; this.KirinFiles.RowTemplate.ReadOnly = true; @@ -1396,6 +1326,74 @@ private void InitializeComponent() this.ReadOemBTN.UseVisualStyleBackColor = false; this.ReadOemBTN.Click += new System.EventHandler(this.ReadOemBTN_Click); // + // Dbg + // + this.Dbg.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); + this.Dbg.Location = new System.Drawing.Point(4, 25); + this.Dbg.Name = "Dbg"; + this.Dbg.Size = new System.Drawing.Size(735, 537); + this.Dbg.TabIndex = 9; + this.Dbg.Text = "DEBUG"; + // + // GLOADER + // + this.GLOADER.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); + this.GLOADER.Controls.Add(this.UFSChk); + this.GLOADER.Controls.Add(this.LoaderBox); + this.GLOADER.Controls.Add(this.label1); + this.GLOADER.Controls.Add(this.SelectLOADER); + this.GLOADER.Controls.Add(this.AutoLdr); + this.GLOADER.ForeColor = System.Drawing.Color.DarkGray; + this.GLOADER.Location = new System.Drawing.Point(77, 61); + this.GLOADER.Name = "GLOADER"; + this.GLOADER.Size = new System.Drawing.Size(744, 78); + this.GLOADER.TabIndex = 28; + this.GLOADER.TabStop = false; + this.GLOADER.Text = "Select Loader"; + // + // UFSChk + // + this.UFSChk.AutoSize = true; + this.UFSChk.Font = new System.Drawing.Font("Arial", 10.2F, System.Drawing.FontStyle.Bold); + this.UFSChk.ForeColor = System.Drawing.Color.AntiqueWhite; + this.UFSChk.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.UFSChk.Location = new System.Drawing.Point(459, 13); + this.UFSChk.Margin = new System.Windows.Forms.Padding(2); + this.UFSChk.Name = "UFSChk"; + this.UFSChk.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.UFSChk.Size = new System.Drawing.Size(103, 20); + this.UFSChk.TabIndex = 32; + this.UFSChk.Text = "EMMC/UFS"; + this.UFSChk.UseVisualStyleBackColor = true; + // + // LoaderBox + // + this.LoaderBox.BackColor = System.Drawing.SystemColors.InactiveCaption; + this.LoaderBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.LoaderBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.LoaderBox.Font = new System.Drawing.Font("Arial", 9.8F, System.Drawing.FontStyle.Bold); + this.LoaderBox.Location = new System.Drawing.Point(6, 37); + this.LoaderBox.Margin = new System.Windows.Forms.Padding(2); + this.LoaderBox.Name = "LoaderBox"; + this.LoaderBox.Size = new System.Drawing.Size(632, 24); + this.LoaderBox.Sorted = true; + this.LoaderBox.TabIndex = 32; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Cursor = System.Windows.Forms.Cursors.Default; + this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.label1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); + this.label1.ForeColor = System.Drawing.Color.MintCream; + this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label1.Location = new System.Drawing.Point(2, 16); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(159, 19); + this.label1.TabIndex = 15; + this.label1.Text = "MSM LOADER.MBN"; + // // Gbox // this.Gbox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); @@ -1403,7 +1401,7 @@ private void InitializeComponent() this.Gbox.ForeColor = System.Drawing.Color.DarkGray; this.Gbox.Location = new System.Drawing.Point(77, 2); this.Gbox.Name = "Gbox"; - this.Gbox.Size = new System.Drawing.Size(253, 53); + this.Gbox.Size = new System.Drawing.Size(448, 53); this.Gbox.TabIndex = 33; this.Gbox.TabStop = false; this.Gbox.Text = "Com PORT"; @@ -1418,7 +1416,7 @@ private void InitializeComponent() this.PORTBOX.Margin = new System.Windows.Forms.Padding(2); this.PORTBOX.Name = "PORTBOX"; this.PORTBOX.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.PORTBOX.Size = new System.Drawing.Size(243, 21); + this.PORTBOX.Size = new System.Drawing.Size(438, 21); this.PORTBOX.TabIndex = 31; // // DEVICER @@ -1441,9 +1439,9 @@ private void InitializeComponent() this.CpuHISIBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); this.CpuHISIBox.Controls.Add(this.HISIbootloaders); this.CpuHISIBox.ForeColor = System.Drawing.Color.Cornsilk; - this.CpuHISIBox.Location = new System.Drawing.Point(330, 2); + this.CpuHISIBox.Location = new System.Drawing.Point(370, 16); this.CpuHISIBox.Name = "CpuHISIBox"; - this.CpuHISIBox.Size = new System.Drawing.Size(201, 53); + this.CpuHISIBox.Size = new System.Drawing.Size(353, 48); this.CpuHISIBox.TabIndex = 20; this.CpuHISIBox.TabStop = false; this.CpuHISIBox.Text = "Select Cpu"; @@ -1457,7 +1455,7 @@ private void InitializeComponent() this.HISIbootloaders.Location = new System.Drawing.Point(5, 20); this.HISIbootloaders.Margin = new System.Windows.Forms.Padding(2); this.HISIbootloaders.Name = "HISIbootloaders"; - this.HISIbootloaders.Size = new System.Drawing.Size(191, 21); + this.HISIbootloaders.Size = new System.Drawing.Size(343, 21); this.HISIbootloaders.TabIndex = 16; this.HISIbootloaders.SelectedIndexChanged += new System.EventHandler(this.HISIbootloaders_SelectedIndexChanged); // @@ -1758,6 +1756,19 @@ private void InitializeComponent() this.SLDEV.TabStop = false; this.SLDEV.Text = "Select device"; // + // label4 + // + this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(38)))), ((int)(((byte)(49))))); + this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.label4.ForeColor = System.Drawing.Color.MintCream; + this.label4.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label4.Location = new System.Drawing.Point(293, 82); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(434, 38); + this.label4.TabIndex = 36; + this.label4.Text = "Bootloader status On:\r\nhttps://github.com/werasik2aa/UnlockedHuaweiBootloader"; + this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // // SelectLOADER // this.SelectLOADER.AutoSize = true; @@ -1922,12 +1933,12 @@ private void InitializeComponent() this.BoardU.Cursor = System.Windows.Forms.Cursors.Hand; this.BoardU.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold); this.BoardU.ForeColor = System.Drawing.Color.White; - this.BoardU.Location = new System.Drawing.Point(6, 192); + this.BoardU.Location = new System.Drawing.Point(7, 192); this.BoardU.Margin = new System.Windows.Forms.Padding(2); this.BoardU.Name = "BoardU"; this.BoardU.RippleColor = System.Drawing.Color.Beige; this.BoardU.RoundingEnable = false; - this.BoardU.Size = new System.Drawing.Size(344, 38); + this.BoardU.Size = new System.Drawing.Size(350, 38); this.BoardU.TabIndex = 17; this.BoardU.Text = "Download And Unlock"; this.BoardU.TextHover = null; @@ -1950,12 +1961,12 @@ private void InitializeComponent() this.UnlockFrp.Cursor = System.Windows.Forms.Cursors.Hand; this.UnlockFrp.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold); this.UnlockFrp.ForeColor = System.Drawing.Color.White; - this.UnlockFrp.Location = new System.Drawing.Point(6, 150); + this.UnlockFrp.Location = new System.Drawing.Point(7, 150); this.UnlockFrp.Margin = new System.Windows.Forms.Padding(2); this.UnlockFrp.Name = "UnlockFrp"; this.UnlockFrp.RippleColor = System.Drawing.Color.Black; this.UnlockFrp.RoundingEnable = false; - this.UnlockFrp.Size = new System.Drawing.Size(344, 38); + this.UnlockFrp.Size = new System.Drawing.Size(350, 38); this.UnlockFrp.TabIndex = 21; this.UnlockFrp.Text = "Unlock FRP"; this.UnlockFrp.TextHover = null; @@ -1979,11 +1990,11 @@ private void InitializeComponent() this.EraseMeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.EraseMeBtn.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.EraseMeBtn.ForeColor = System.Drawing.Color.White; - this.EraseMeBtn.Location = new System.Drawing.Point(6, 107); + this.EraseMeBtn.Location = new System.Drawing.Point(7, 107); this.EraseMeBtn.Name = "EraseMeBtn"; this.EraseMeBtn.RippleColor = System.Drawing.Color.Black; this.EraseMeBtn.RoundingEnable = false; - this.EraseMeBtn.Size = new System.Drawing.Size(344, 38); + this.EraseMeBtn.Size = new System.Drawing.Size(350, 38); this.EraseMeBtn.TabIndex = 34; this.EraseMeBtn.Text = "Erase Memory"; this.EraseMeBtn.TextHover = null; @@ -2007,11 +2018,11 @@ private void InitializeComponent() this.Flash.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.Flash.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.Flash.ForeColor = System.Drawing.Color.White; - this.Flash.Location = new System.Drawing.Point(6, 19); + this.Flash.Location = new System.Drawing.Point(7, 19); this.Flash.Name = "Flash"; this.Flash.RippleColor = System.Drawing.Color.Black; this.Flash.RoundingEnable = false; - this.Flash.Size = new System.Drawing.Size(344, 38); + this.Flash.Size = new System.Drawing.Size(350, 38); this.Flash.TabIndex = 33; this.Flash.Text = "Flash Firmware"; this.Flash.TextHover = null; @@ -2035,11 +2046,11 @@ private void InitializeComponent() this.DUMPALL.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.DUMPALL.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.DUMPALL.ForeColor = System.Drawing.Color.White; - this.DUMPALL.Location = new System.Drawing.Point(6, 63); + this.DUMPALL.Location = new System.Drawing.Point(7, 63); this.DUMPALL.Name = "DUMPALL"; this.DUMPALL.RippleColor = System.Drawing.Color.Black; this.DUMPALL.RoundingEnable = false; - this.DUMPALL.Size = new System.Drawing.Size(344, 38); + this.DUMPALL.Size = new System.Drawing.Size(350, 38); this.DUMPALL.TabIndex = 32; this.DUMPALL.Text = "Dump Firmware"; this.DUMPALL.TextHover = null; @@ -2292,7 +2303,7 @@ private void InitializeComponent() this.WriteFactoryBL.UseRippleEffect = true; this.WriteFactoryBL.UseVisualStyleBackColor = false; this.WriteFactoryBL.UseZoomEffectOnHover = false; - this.WriteFactoryBL.Click += new System.EventHandler(this.WriteFactoryBL_Click); + this.WriteFactoryBL.Click += new System.EventHandler(this.ConnectKirin); // // UNLOCKHISI // @@ -2462,7 +2473,6 @@ private void InitializeComponent() this.Controls.Add(this.IdentifyBTN); this.Controls.Add(this.button12); this.Controls.Add(this.BURG); - this.Controls.Add(this.CpuHISIBox); this.Controls.Add(this.Gbox); this.Controls.Add(this.Tab); this.Controls.Add(this.PGG); @@ -2483,8 +2493,6 @@ private void InitializeComponent() this.groupBox6.ResumeLayout(false); this.groupBox6.PerformLayout(); this.QCOM1.ResumeLayout(false); - this.GLOADER.ResumeLayout(false); - this.GLOADER.PerformLayout(); this.ACTBOX.ResumeLayout(false); this.GPfir.ResumeLayout(false); this.groupBox10.ResumeLayout(false); @@ -2514,6 +2522,8 @@ private void InitializeComponent() this.OeRrd.PerformLayout(); this.groupBox13.ResumeLayout(false); this.groupBox13.PerformLayout(); + this.GLOADER.ResumeLayout(false); + this.GLOADER.PerformLayout(); this.Gbox.ResumeLayout(false); this.CpuHISIBox.ResumeLayout(false); this.BURG.ResumeLayout(false); @@ -2651,11 +2661,12 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.CheckBox RbCheck; private System.Windows.Forms.GroupBox ACTBOX; - private System.Windows.Forms.Label label4; public System.Windows.Forms.ComboBox LoaderBox; private System.Windows.Forms.GroupBox SLDEV; private UI.NButton WriteFactoryBL; private UI.NButton TryUNLHisiFBBtn; public System.Windows.Forms.CheckBox UFSChk; + private System.Windows.Forms.TabPage Dbg; + private System.Windows.Forms.Label label4; } } \ No newline at end of file diff --git a/HuaweiUnlock/Window.cs b/HuaweiUnlock/Window.cs index 9bbc32b..077deae 100644 --- a/HuaweiUnlock/Window.cs +++ b/HuaweiUnlock/Window.cs @@ -21,18 +21,15 @@ namespace HuaweiUnlocker public partial class Window : Form { private static string device; - private static string loader; public static string Path; private Dictionary source = new Dictionary(); private Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"SOFTWARE\4PDA_HUAWEI_UNLOCK", true); private static string Temp; private static bool DumbTempState = false; - private static string DateOpen; public Window() { InitializeComponent(); wndw = this; - DateOpen = DateTime.Now.ToString(); foreach (var process in Process.GetProcesses()) if (process.ProcessName.Contains("emmcdl.exe")) process.Kill(); @@ -136,7 +133,7 @@ public void Lang() GLOADER.Text = Language.Get("LoaderHeader"); PTOFIRM.Text = PTOFIRM.Text = Language.Get("PathToFirmLBL"); RAW.Text = Language.Get("RWIMGlbl"); - SLDEV.Text = Language.Get("SELDEVlbl"); + SLDEV.Text = "[QCOM] " + Language.Get("SELDEVlbl"); CrtGPTBtn.Text = Language.Get("RrRRGPTXMLBtn"); CrtGPTBtn2.Text = Language.Get("WrRRGPTXMLBtn"); ClrFoldersBTN.Text = button12.Text = Language.Get("CancelBtn"); @@ -170,7 +167,8 @@ public void Lang() if (!Directory.Exists(Path)) BoardU.Text = Language.Get("DdBtn"); else BoardU.Text = Language.Get("DdBtnE"); DBB.Text = Language.Get("DebugLbl"); LOGGBOX.Text = "Version [" + APP_VERSION + "] BETA/n(C) MOONGAMER (QUALCOMM UNLOCKER)/n(C) MASHED-POTATOES (KIRIN UNLOCKER)".Replace("/n", Environment.NewLine); - LOG(0, "Thanks 'Yogesh Joshi' for advertising on the website: https://www.softwarecrackguru.com"); + LOG(0, "Thanks 'Yogesh Joshi' for advertising on the website: www.softwarecrackguru.com"); + LOG(0, "Bootloader status on: github.com/werasik2aa/UnlockedHuaweiBootloader"); LOG(0, "SMAIN1"); LOG(0, "SMAIN2"); LOG(0, "SMAIN3"); @@ -360,13 +358,12 @@ private void ERASEevent_Click(object sender, EventArgs e) private async void WRITEevent_Click(object sender, EventArgs e) { OpenFileDialog file = new OpenFileDialog(); - loader = AutoLdr.Checked ? "" : LoaderBox.Text; if (file.ShowDialog() == DialogResult.OK) { CurTask = Task.Run(() => { LOG(0, "EwPS", Temp + newline); - Write(Temp, loader, file.FileName); + Write(Temp, AutoLdr.Checked ? GuessMbn() : LoaderBox.Text, file.FileName); Progress(100); }, token); await CurTask; @@ -376,7 +373,6 @@ private async void WRITEevent_Click(object sender, EventArgs e) private async void READevent_Click_1(object sender, EventArgs e) { SaveFileDialog folder = new SaveFileDialog(); - loader = AutoLdr.Checked ? "" : LoaderBox.Text; if (folder.ShowDialog() == DialogResult.OK) { CurTask = Task.Run(() => @@ -384,7 +380,7 @@ private async void READevent_Click_1(object sender, EventArgs e) int i = int.Parse(DeviceInfo.Partitions[Temp].BlockStart); int j = int.Parse(DeviceInfo.Partitions[Temp].BlockNumSectors); LOG(0, "EdPS", Temp + newline); - Dump(i, j, Temp, loader, folder.FileName); + Dump(i, j, Temp, AutoLdr.Checked ? GuessMbn() : LoaderBox.Text, folder.FileName); Progress(100); }, token); await CurTask; @@ -451,10 +447,9 @@ private void UNLBTN_Click(object sender, EventArgs e) return; } if (!CheckDevice(AutoLdr.Checked ? "" : LoaderBox.Text, PORTBOX.Text)) { Tab.Enabled = true; return; } - loader = AutoLdr.Checked ? GuessMbn() : LoaderBox.Text; DeviceInfo.Name = device; LOG(0, "PrcsUnl"); - Unlock(loader, Path); + Unlock(AutoLdr.Checked ? GuessMbn() : LoaderBox.Text, Path); Progress(100); } @@ -463,11 +458,9 @@ private async void UnlockFrp_Click(object sender, EventArgs e) Progress(0); if (!CheckDevice(AutoLdr.Checked ? "" : LoaderBox.Text, PORTBOX.Text)) return; device = DEVICER.Text.ToUpper(); - LOG(0, "CheckCon"); - loader = GuessMbn(); CurTask = Task.Run(() => { - if (!UnlockFrp(loader)) + if (!UnlockFrp(AutoLdr.Checked ? GuessMbn() : LoaderBox.Text)) LOG(2, "FailFrp"); else LOG(0, "SUCC_FrpUnlock"); @@ -494,20 +487,6 @@ private void RAW_CheckedChanged(object sender, EventArgs e) private void OnApplicationExit(object sender, EventArgs e) { - if (CurProcess != null) - { - CurProcess.Close(); - CurProcess.Dispose(); - } - if (token != null && ct != null && CurTask != null) - { - ct.Cancel(); - ct.Dispose(); - if (CurTask.IsCompleted) - CurTask.Dispose(); - ct = new CancellationTokenSource(); - token = ct.Token; - } se.Close(); } private void DebugE_ch(object sender, EventArgs e) @@ -536,35 +515,27 @@ private void DBB_CheckedChanged(object sender, EventArgs e) { debug = DBB.Checked; } - - private void RdHISIinfo_Click(object sender, EventArgs e) - { - Tab.Enabled = false; - ConnectKirin(); - LOG(0, "Done", DateTime.Now); - Tab.Enabled = true; - } private void UNLOCKHISI_Click(object sender, EventArgs e) { LOG(-1, "-->HISI UNL LOGS<--"); - Tab.Enabled = false; try { if (BLkeyHI.Text.Length == 16) { - ConnectKirin(); + ConnectKirin(sender, e); if (DeviceInfo.loadedhose) { + Tab.Enabled = false; LOG(-1, "=============UNLOCKER BL/FRP (KIRIN TESTPOINT)============="); BLKEYTXT.Text = HISI.WriteKEY(BLkeyHI.Text.ToUpper()); HISI.ReadAllMethods(); if (RbCheck.Checked) HISI.Reboot(); HISI.Disconnect(); } - else LOG(2, isVCOM.Checked ? "[Huawei USB COM 1.0] " : "[FASTBOOT] ", "DeviceNotCon"); + LOG(0, "Done", DateTime.Now); } else - LOG(2, "KeyLenghtERR"); + LOG(2, "KeyLenghtERR", BLkeyHI.Text.Length + " : 16"); } catch (Exception se) { @@ -572,7 +543,6 @@ private void UNLOCKHISI_Click(object sender, EventArgs e) LOG(2, se.Message); } Tab.Enabled = true; - LOG(0, "Done", DateTime.Now); } private void HISIbootloaders_SelectedIndexChanged(object sender, EventArgs e) @@ -687,7 +657,7 @@ private void Searching(object sender, EventArgs e) PORTBOX.Items.Add(i.FullName); if (DeviceInfo.loadedhose) { - if (!PORTBOX.Items.Contains(DeviceInfo.Port.FullName) & !DeviceInfo.loadedhose) + if (!PORTBOX.Items.Contains(DeviceInfo.Port.FullName)) { LOG(0, "DPort", DeviceInfo.Port.FullName); PORTBOX.Items.Remove(DeviceInfo.Port.FullName); @@ -699,18 +669,35 @@ private void Searching(object sender, EventArgs e) } PARTLIST.Rows.Clear(); PARTLIST.Update(); - KirinFiles.Rows.Clear(); - KirinFiles.Update(); + RdGPT.Visible = RdGPT.Enabled = true; + WHAT.Enabled = WHAT.Visible = false; + HISI.BSN = HISI.AVER = HISI.BNUM = HISI.MODEL = "NaN"; + Tab.Enabled = true; } - if (!HISI.fb.device.IsOpen) + } + if (DeviceInfo.loadedhose) + { + if (HISI.fb.device != null) { + LOG(0, "DPort", DeviceInfo.Port.FullName); + if (CurProcess != null) + { + CurProcess.Close(); + CurProcess.Dispose(); + } DeviceInfo.loadedhose = false; HISI.BSN = HISI.AVER = HISI.BNUM = HISI.MODEL = "NaN"; + HISI.fb.Disconnect(); + KirinFiles.Rows.Clear(); + KirinFiles.Update(); + WHAT2.Enabled = WHAT2.Visible = false; } } - PORTBOX.SelectedItem = PORTBOX.SelectedText = a; + PORTBOX.SelectedText = a; + PORTBOX.SelectedItem = a; } + private void CrtGptBTN2_Click(object sender, EventArgs e) { try @@ -825,29 +812,36 @@ private void IdentifyBTN_Click(object sender, EventArgs e) } private async void ReadOemBTN_Click(object sender, EventArgs e) { - OpenFileDialog openFileDialog = new OpenFileDialog() - { - InitialDirectory = PrevFolder, - Filter = "Update.app (*.app;*.APP)|*.app;*.APP|All files (*.*)|*.*", - FilterIndex = 2, - RestoreDirectory = true, - Title = "Update.APP" - }; - if (openFileDialog.ShowDialog() == DialogResult.OK) + try { - IndexiesOEMdata.Items.Clear(); - OemInfoTool.data.Clear(); - OemInfoTool.Offsets.Clear(); - OemInfoTool.DevStats.Clear(); - CurTask = Task.Run(() => + OpenFileDialog openFileDialog = new OpenFileDialog() { - OemInfoTool.Decompile(openFileDialog.FileName); - }, token); - await CurTask; - foreach (var item in OemInfoTool.data) - IndexiesOEMdata.Items.Add(item); - CompileOemInfBTN.Enabled = true; - LOG(0, "Done", DateTime.Now); + InitialDirectory = PrevFolder, + Filter = "Update.app (*.app;*.APP)|*.app;*.APP|All files (*.*)|*.*", + FilterIndex = 2, + RestoreDirectory = true, + Title = "Update.APP" + }; + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + IndexiesOEMdata.Items.Clear(); + OemInfoTool.data.Clear(); + OemInfoTool.Offsets.Clear(); + OemInfoTool.DevStats.Clear(); + CurTask = Task.Run(() => + { + OemInfoTool.Decompile(openFileDialog.FileName); + }, token); + await CurTask; + foreach (var item in OemInfoTool.data) + IndexiesOEMdata.Items.Add(item); + CompileOemInfBTN.Enabled = true; + LOG(0, "Done", DateTime.Now); + } + } + catch + { + LOG(2, "FileWrong"); } } private void TabPageOeminfSwitch(object sender, EventArgs e) @@ -863,8 +857,7 @@ private void TabPageOeminfSwitch(object sender, EventArgs e) private void ClrFoldersBTN_Click(object sender, EventArgs e) { - if (Directory.Exists("UnlockFiles")) Directory.Delete("UnlockFiles", true); - if (Directory.Exists("LOGS")) Directory.Delete("LOGS", true); + } private async void CompileOemInfBTN_Click(object sender, EventArgs e) @@ -896,21 +889,28 @@ private void ISAS2(object sender, EventArgs e) private void FrpHISIUnlock_Click(object sender, EventArgs e) { - Tab.Enabled = false; - ConnectKirin(); + ConnectKirin(sender, e); if (DeviceInfo.loadedhose) + { + Tab.Enabled = false; HISI.UnlockFRP(); + LOG(0, "Done", DateTime.Now); + } else LOG(2, "FailFrp"); Tab.Enabled = true; - LOG(0, "Done", DateTime.Now); } private void RebootFB_Click(object sender, EventArgs e) { - ConnectKirin(); + ConnectKirin(sender, e); if (DeviceInfo.loadedhose) + { + Tab.Enabled = false; HISI.Reboot(); + LOG(0, "Done", DateTime.Now); + } + Tab.Enabled = true; } private void HomeeBTN_Click(object sender, EventArgs e) @@ -932,11 +932,11 @@ private void KirinPartsBTN_Click(object sender, EventArgs e) { Tab.SelectTab(3); } - private async void ConnectKirin() + private async void ConnectKirin(object sender, EventArgs e) { Tab.Enabled = false; - DumbTempState = false; - if (String.IsNullOrEmpty(HISIbootloaders.Text.ToUpper())) + DeviceInfo.loadedhose = DumbTempState = false; + if (string.IsNullOrEmpty(HISIbootloaders.Text.ToUpper())) { LOG(1, "HISISelectCpu"); Tab.Enabled = true; @@ -961,24 +961,38 @@ private async void ConnectKirin() Path = "UnlockFiles\\" + device + "\\manifest.xml"; DeviceInfo = new IDentifyDev(); DeviceInfo.CPUName = device.Replace("KIRIN", ""); - LOG(0, "CheckCon"); DeviceInfo.Port = GETPORT("huawei usb com", PORTBOX.Text); - LOG(-1, "=============BOOTLOADER (KIRIN TESTPOINT<->FASTBOOT)============="); - if (isVCOM.Checked & DeviceInfo.Port.ComName != "NaN") + if (isVCOM.Checked) { - CurTask = Task.Run(() => + LOG(0, "[VCOM] ", "CheckCon"); + if (DeviceInfo.Port.ComName != "NaN") { - HISI.FlashBootloader(Bootloader.ParseBootloader(Path), DeviceInfo.Port.ComName); - }); - await CurTask; + LOG(0, "CPort", "[VCOM] " + DeviceInfo.Port.FullName); + CurTask = Task.Run(() => + { + HISI.FlashBootloader(Bootloader.ParseBootloader(Path), DeviceInfo.Port.ComName); + LOG(0, "[Fastboot] ", "CheckCon"); + DeviceInfo.loadedhose = HISI.IsDeviceConnected(100); + if (!DeviceInfo.loadedhose) + LOG(2, "[FASTBOOT] Fail: ", "DeviceNotCon"); + }); + await CurTask; + } + else + { + DeviceInfo.loadedhose = false; //what if exist fb + LOG(2, "[Huawei USB COM 1.0] ", "DeviceNotCon"); + } } - if (!isVCOM.Checked) - DeviceInfo.loadedhose = HISI.IsDeviceConnected(3); else - DeviceInfo.loadedhose = DeviceInfo.Port.ComName != "NaN" ? HISI.IsDeviceConnected(10) : false; - if (DeviceInfo.loadedhose) { LOG(0, "[Fastboot] ", "CheckCon"); + DeviceInfo.loadedhose = HISI.IsDeviceConnected(3); + if (!DeviceInfo.loadedhose) + LOG(2, "[FASTBOOT] Fail: ", "DeviceNotCon"); + } + if (DeviceInfo.loadedhose) + { HISI.ReadInfo(); HISI.UnlockFBLOCK(); BuildIdTxt.Text = HISI.AVER; @@ -986,25 +1000,32 @@ private async void ConnectKirin() VersionIdTxt.Text = HISI.BNUM; FblockStateTxt.Text = HISI.FBLOCKSTATE; BLKEYTXT.Text = HISI.BLKEY; + LOG(0, "DeviceInfoTag", " [Fastboot] " + DeviceInfo.CPUName); + LOG(0, "Done", DateTime.Now); } else - DeviceInfo.loadedhose = false; - LOG(0, "Done", DateTime.Now); + LOG(2, "DeviceNotCon", "in [FastBoot] or [Huawei USB COM 1.0]"); + Tab.Enabled = true; } private void FlashUKIRINBtn_Click(object sender, EventArgs e) { - ConnectKirin(); - if (!HISI.FBLOCK) + ConnectKirin(sender, e); + if (!DeviceInfo.loadedhose) { - LOG(2, "HISIInfoS"); - LOG(0, "Trying to continue"); + LOG(2, "[FASTBOOT] ", "DeviceNotCon"); + return; } if (DeviceInfo.Partitions.Count <= 1) { LOG(2, "ErrBin"); return; } + if (!HISI.FBLOCK) + { + LOG(2, "HISIInfoS"); + return; + } try { if (HISI.fb.Connect(10)) @@ -1094,30 +1115,19 @@ private void ErasePA2_Click(object sender, EventArgs e) private void TryUNLHisiFBBtn_Click(object sender, EventArgs e) { - Tab.Enabled = false; DialogResult dialogResult = MessageBox.Show(Language.Get("HISITryUnlock"), Language.Get("HISITryULTag"), MessageBoxButtons.YesNo); if (dialogResult != DialogResult.Yes) return; - if (!DeviceInfo.loadedhose) + ConnectKirin(sender, e); + if (DeviceInfo.loadedhose) { - LOG(2, isVCOM.Checked ? "[Huawei USB COM 1.0] " : "[FASTBOOT] ", "DeviceNotCon"); - return; + Tab.Enabled = false; + var file = "UnlockFiles\\" + device + "\\fastboot.img"; + if (File.Exists(file)) + HISI.TryUnlock(file); + LOG(0, "Done", DateTime.Now); } - var file = "UnlockFiles\\" + device + "\\fastboot.img"; - if (File.Exists(file)) - HISI.TryUnlock(file); - Tab.Enabled = true; - LOG(0, "Done", DateTime.Now); - } - - private void WriteFactoryBL_Click(object sender, EventArgs e) - { - ConnectKirin(); - if (DeviceInfo.loadedhose) - LOG(0, "CPort", "[Fastboot]" + DeviceInfo.CPUName); Tab.Enabled = true; - LOG(0, "Done", DateTime.Now); } - private async void IndexiesOEMdata_SelectedIndexChanged(object sender, EventArgs e) { string item = IndexiesOEMdata.Text; @@ -1138,36 +1148,5 @@ private async void IndexiesOEMdata_SelectedIndexChanged(object sender, EventArgs }, token); await CurTask; } - string FindPassword = "4641494C436F6D6D616E64206E6F7420616C6C6F7765640000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - private string was = ""; - private IEnumerable GetCombinations(char[] Chars, int MaximumLength) - { - if (MaximumLength < 1) - yield break; - - foreach (var a in Chars) - { - yield return a.ToString(); - foreach (var b in GetCombinations(Chars, MaximumLength - 1)) - yield return a + b; - } - } - public string charset = "abcdefghijklmnopqrstuvwxyz0123456789"; - private async void label4_Click(object sender, EventArgs e) - { - /*CurTask = Task.Run(() => - { - LOG(0, "Brootforce start"); - foreach (var Password in GetCombinations(charset.ToArray(), 16)) - { - LOG(0, "Test:", Password.ToUpper()); - if (HISI.CompareSHA(FindPassword, Password)) - { - LOG(0, "target found:", Password.ToUpper()); - return; - } - } - }, token);*/ - } } } diff --git a/HuaweiUnlock/Window.resx b/HuaweiUnlock/Window.resx index 2878ad5..57ba298 100644 --- a/HuaweiUnlock/Window.resx +++ b/HuaweiUnlock/Window.resx @@ -6437,7 +6437,7 @@ 17, 17 - 84 + 25 diff --git a/HuaweiUnlock/app.config b/HuaweiUnlock/app.config index a3181eb..2c0f559 100644 --- a/HuaweiUnlock/app.config +++ b/HuaweiUnlock/app.config @@ -1,12 +1,3 @@ - - - - - - - - - - +