├── .gitattributes
├── .gitignore
├── Chromebook Firmware Update Tool.sln
└── Chromebook Firmware Update Tool
├── App.xaml
├── App.xaml.cs
├── AuronConfirm.xaml
├── AuronConfirm.xaml.cs
├── Chromebook Firmware Update Tool.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── Resources.Designer.cs
├── Resources.resx
├── app.config
├── app.manifest
├── c740.png
├── c910.png
├── checkmark.png
├── desktop.png
├── laptop.png
├── packages.config
├── unknown.png
└── unsupported.png
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.106
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chromebook Firmware Update Tool", "Chromebook Firmware Update Tool\Chromebook Firmware Update Tool.csproj", "{D125C2F5-9CDC-46E4-8C6F-F9AB0C486D16}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {D125C2F5-9CDC-46E4-8C6F-F9AB0C486D16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {D125C2F5-9CDC-46E4-8C6F-F9AB0C486D16}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {D125C2F5-9CDC-46E4-8C6F-F9AB0C486D16}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {D125C2F5-9CDC-46E4-8C6F-F9AB0C486D16}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {8DEDC852-5687-44FD-8008-BE43CDF6B35F}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Net;
7 | using System.Windows;
8 |
9 | namespace Chromebook_Firmware_Update_Tool
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | public App()
17 | {
18 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/AuronConfirm.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
22 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/AuronConfirm.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace Chromebook_Firmware_Update_Tool
5 | {
6 | ///
7 | /// Interaction logic for AuronConfirm.xaml
8 | ///
9 | public partial class AuronConfirm : Window
10 | {
11 | public MainWindow mainWindow;
12 | public AuronConfirm()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void c910_Click(object sender, RoutedEventArgs e)
18 | {
19 | this.mainWindow.model = "auron_yuna";
20 | this.Close();
21 | }
22 |
23 | private void c740_Click(object sender, RoutedEventArgs e)
24 | {
25 | this.mainWindow.model = "auron_paine";
26 | this.Close();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Chromebook Firmware Update Tool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D125C2F5-9CDC-46E4-8C6F-F9AB0C486D16}
8 | WinExe
9 | Chromebook_Firmware_Update_Tool
10 | Chromebook Firmware Update Tool
11 | v4.5.2
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 |
17 |
18 |
19 | AnyCPU
20 | true
21 | full
22 | false
23 | bin\Debug\
24 | DEBUG;TRACE
25 | prompt
26 | 4
27 | false
28 |
29 |
30 | AnyCPU
31 | pdbonly
32 | true
33 | bin\Release\
34 | TRACE
35 | prompt
36 | 4
37 | false
38 |
39 |
40 | app.manifest
41 |
42 |
43 |
44 | ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | 4.0
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | MSBuild:Compile
66 | Designer
67 |
68 |
69 | True
70 | True
71 | Resources.resx
72 |
73 |
74 | Designer
75 | MSBuild:Compile
76 |
77 |
78 | MSBuild:Compile
79 | Designer
80 |
81 |
82 | App.xaml
83 | Code
84 |
85 |
86 | AuronConfirm.xaml
87 |
88 |
89 | MainWindow.xaml
90 | Code
91 |
92 |
93 |
94 |
95 | Code
96 |
97 |
98 | True
99 | True
100 | Resources.resx
101 |
102 |
103 | True
104 | Settings.settings
105 | True
106 |
107 |
108 | ResXFileCodeGenerator
109 | Resources.Designer.cs
110 |
111 |
112 | ResXFileCodeGenerator
113 | Resources.Designer.cs
114 |
115 |
116 |
117 |
118 |
119 | SettingsSingleFileGenerator
120 | Settings.Designer.cs
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
11 |
13 |
15 |
17 |
19 |
20 |
22 |
24 |
26 |
27 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Management;
6 | using System.Net;
7 | using System.Reflection;
8 | using System.Security.Cryptography;
9 | using System.Text;
10 | using System.Windows;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using Newtonsoft.Json;
14 | using Newtonsoft.Json.Linq;
15 |
16 | namespace Chromebook_Firmware_Update_Tool
17 | {
18 | public partial class MainWindow : Window
19 | {
20 | private string manufacturer = "";
21 | public string model = "";
22 | private string trackpadType = "";
23 | private string humanReadableModel = "";
24 | private string chipset = "";
25 | private string executableDir = "";
26 | private int deviceType;
27 | private bool macAddressInjectionRequired = false;
28 | private bool forceTrackpadDifferentiation = false;
29 |
30 | private string sha1OfFile(string path)
31 | {
32 | try
33 | {
34 | using (FileStream fs = new FileStream(path, FileMode.Open))
35 | using (BufferedStream bs = new BufferedStream((Stream)fs))
36 | {
37 | using (SHA1Managed sha1 = new SHA1Managed())
38 | {
39 | byte[] hash = sha1.ComputeHash(bs);
40 | StringBuilder formatted = new StringBuilder(2 * hash.Length);
41 | foreach (byte b in hash)
42 | {
43 | formatted.AppendFormat("{0:X2}", b);
44 | }
45 | return formatted.ToString().ToLower();
46 | }
47 | }
48 | }
49 | catch (Exception ex)
50 | {
51 | return "";
52 | }
53 | }
54 |
55 | private bool checkHashes(bool validJSON)
56 | {
57 | if (this.executableDir == "")
58 | this.executableDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
59 | bool flag = true;
60 | if (this.sha1OfFile(this.executableDir + "/FPT-HSWBDW/fparts.txt") != "d0740e8f6de1734e65f475b21d31f40461eb7a33")
61 | flag = false;
62 | if (this.sha1OfFile(this.executableDir + "/FPT-HSWBDW/fptw64.exe") != "f78e5e922a0c0e8e877e7627298981275a380dd7")
63 | flag = false;
64 | if (this.sha1OfFile(this.executableDir + "/FPT-HSWBDW/idrvdll32e.DLL") != "0ac170fff553339e9b1779e70e7eb05a43eced07")
65 | flag = false;
66 | if (this.sha1OfFile(this.executableDir + "/FPT-HSWBDW/pmxdll32e.DLL") != "dc009ce0a6ba77f19790c0b667fa4db5d742eda4")
67 | flag = false;
68 | if (this.sha1OfFile(this.executableDir + "/FPT-BYTBSW/fparts.txt") != "f73ba677e5e8debc6e0db8931e974e22653ac3d4")
69 | flag = false;
70 | if (this.sha1OfFile(this.executableDir + "/FPT-BYTBSW/fptw64.exe") != "cd5a8c0cdd83f450221611db0586680ee479823e")
71 | flag = false;
72 | if (this.sha1OfFile(this.executableDir + "/FPT-BYTBSW/idrvdll32e.DLL") != "0ac170fff553339e9b1779e70e7eb05a43eced07")
73 | flag = false;
74 | if (this.sha1OfFile(this.executableDir + "/FPT-BYTBSW/pmxdll32e.DLL") != "dc009ce0a6ba77f19790c0b667fa4db5d742eda4")
75 | flag = false;
76 | if (this.sha1OfFile(this.executableDir + "/cbtools/cbfstool.exe") != "a9aaba341eaeb1061585ffa1b1b264ef95dad096")
77 | flag = false;
78 | if (this.sha1OfFile(this.executableDir + "/cbtools/ifdtool.exe") != "745f05f821e4fc60b6c9a20cbd8bb9752e8ed428")
79 | flag = false;
80 | if (this.sha1OfFile(this.executableDir + "/cbtools/cygwin1.dll") != "2ff758b6387ced3e33c6c0bb77a9584dcc6b577f")
81 | flag = false;
82 | if (validJSON && this.sha1OfFile(this.executableDir + "/Newtonsoft.Json.dll") != "26c78dad612aff904f216f19f49089f84cc77eb8")
83 | flag = false;
84 | if (!flag)
85 | {
86 | this.modelSupportedLabel.Content = (object)"Internal Error: Checksum Mismatch";
87 | this.supportedImg.Source = (ImageSource)new BitmapImage(new Uri("unsupported.png", UriKind.Relative));
88 | this.updateBtn.IsEnabled = false;
89 | }
90 | return flag;
91 | }
92 |
93 | private bool isModelSupported()
94 | {
95 | string lower = this.model.ToLower();
96 | //Haswell
97 |
98 | if (lower == "peppy")
99 | {
100 | this.humanReadableModel = "Acer C720(P)";
101 | this.chipset = "Intel Haswell";
102 | this.deviceType = 1;
103 | this.forceTrackpadDifferentiation = true;
104 | return true;
105 | }
106 | if (lower == "falco")
107 | {
108 | this.humanReadableModel = "HP Chromebook 14";
109 | this.chipset = "Intel Haswell";
110 | this.deviceType = 1;
111 | return true;
112 | }
113 | if (lower == "wolf")
114 | {
115 | this.humanReadableModel = "Dell Chromebook 11";
116 | this.chipset = "Intel Haswell";
117 | this.deviceType = 1;
118 | return true;
119 | }
120 | if (lower == "leon")
121 | {
122 | this.humanReadableModel = "Toshiba Chromebook 1";
123 | this.chipset = "Intel Haswell";
124 | this.deviceType = 1;
125 | return true;
126 | }
127 | if (lower == "mccloud")
128 | {
129 | this.humanReadableModel = "Acer Chromebox CXI";
130 | this.chipset = "Intel Haswell";
131 | this.deviceType = 2;
132 | this.macAddressInjectionRequired = true;
133 | return true;
134 | }
135 | if (lower == "monroe")
136 | {
137 | this.humanReadableModel = "LG Chromebase 22";
138 | this.chipset = "Intel Haswell";
139 | this.macAddressInjectionRequired = true;
140 | this.deviceType = 2;
141 | return true;
142 | }
143 | if (lower == "panther")
144 | {
145 | this.humanReadableModel = "Asus Chromebox CN60";
146 | this.chipset = "Intel Haswell";
147 | this.macAddressInjectionRequired = true;
148 | this.deviceType = 2;
149 | return true;
150 | }
151 | if (lower == "tricky")
152 | {
153 | this.humanReadableModel = "Dell Chromebox 3010";
154 | this.chipset = "Intel Haswell";
155 | this.macAddressInjectionRequired = true;
156 | this.deviceType = 2;
157 | return true;
158 | }
159 | if (lower == "zako")
160 | {
161 | this.humanReadableModel = "HP Chromebox CB1";
162 | this.chipset = "Intel Haswell";
163 | this.deviceType = 2;
164 | return true;
165 | }
166 |
167 | //Broadwell
168 | if (lower == "auron")
169 | {
170 | new AuronConfirm() { mainWindow = this }.ShowDialog();
171 | return this.isModelSupported();
172 | }
173 | if (lower == "auron_paine")
174 | {
175 | this.humanReadableModel = "Acer C740";
176 | this.chipset = "Intel Broadwell";
177 | this.deviceType = 1;
178 | return true;
179 | }
180 | if (lower == "auron_yuna")
181 | {
182 | this.humanReadableModel = "Acer C910/CB5-571";
183 | this.chipset = "Intel Broadwell";
184 | this.deviceType = 1;
185 | return true;
186 | }
187 | if (lower == "lulu")
188 | {
189 | this.humanReadableModel = "Dell Chromebook 13";
190 | this.chipset = "Intel Broadwell";
191 | this.deviceType = 1;
192 | return true;
193 | }
194 | if (lower == "gandof")
195 | {
196 | this.humanReadableModel = "Toshiba Chromebook 2 [2015]";
197 | this.chipset = "Intel Broadwell";
198 | this.deviceType = 1;
199 | return true;
200 | }
201 | if (lower == "samus")
202 | {
203 | this.humanReadableModel = "Google Pixel 2";
204 | this.chipset = "Intel Broadwell";
205 | this.deviceType = 1;
206 | return true;
207 | }
208 | if (lower == "buddy")
209 | {
210 | this.humanReadableModel = "Acer Chromebase 24";
211 | this.chipset = "Intel Broadwell";
212 | this.macAddressInjectionRequired = true;
213 | this.deviceType = 2;
214 | return true;
215 | }
216 | if (lower == "guado")
217 | {
218 | this.humanReadableModel = "Acer Chromebase CN62";
219 | this.chipset = "Intel Broadwell";
220 | this.macAddressInjectionRequired = true;
221 | this.deviceType = 2;
222 | return true;
223 | }
224 | if (lower == "rikku")
225 | {
226 | this.humanReadableModel = "Acer Chromebox CXI2";
227 | this.chipset = "Intel Broadwell";
228 | this.macAddressInjectionRequired = true;
229 | this.deviceType = 2;
230 | return true;
231 | }
232 | if (lower == "tidus")
233 | {
234 | this.humanReadableModel = "Lenovo ThinkCentre Chromebox";
235 | this.chipset = "Intel Broadwell";
236 | this.macAddressInjectionRequired = true;
237 | this.deviceType = 2;
238 | return true;
239 | }
240 |
241 | //Sandy/Ivy Bridge
242 | if (lower == "parrot")
243 | {
244 | this.humanReadableModel = "Acer C7/C710";
245 | this.chipset = "Intel Sandy/Ivy Bridge";
246 | this.deviceType = 1;
247 | return false;
248 | }
249 | if (lower == "butterfly")
250 | {
251 | this.humanReadableModel = "HP Pavilion 14";
252 | this.chipset = "Intel Sandy Bridge";
253 | this.deviceType = 1;
254 | return false;
255 | }
256 | if (lower == "lumpy")
257 | {
258 | this.humanReadableModel = "Samsung Series 5 550";
259 | this.chipset = "Intel Sandy Bridge";
260 | this.deviceType = 1;
261 | return false;
262 | }
263 | if (lower == "stout")
264 | {
265 | this.humanReadableModel = "Lenovo Thinkpad X131e";
266 | this.chipset = "Intel Ivy Bridge";
267 | this.deviceType = 1;
268 | return false;
269 | }
270 | if (lower == "link")
271 | {
272 | this.humanReadableModel = "Google Pixel 1";
273 | this.chipset = "Intel Ivy Bridge";
274 | this.deviceType = 1;
275 | return false;
276 | }
277 | if (lower == "stumpy")
278 | {
279 | this.humanReadableModel = "Samsung Chromebox Series 3";
280 | this.chipset = "Intel Sandy/Ivy Bridge";
281 | this.deviceType = 1;
282 | return false;
283 | }
284 |
285 |
286 | //Bay Trail
287 | if (lower == "banjo")
288 | {
289 | this.humanReadableModel = "Acer Chromebook 15";
290 | this.chipset = "Intel Bay Trail";
291 | this.deviceType = 1;
292 | return true;
293 | }
294 | if (lower == "candy")
295 | {
296 | this.humanReadableModel = "Dell Chromebook 11";
297 | this.chipset = "Intel Bay Trail";
298 | this.deviceType = 1;
299 | return true;
300 | }
301 | if (lower == "clapper")
302 | {
303 | this.humanReadableModel = "Lenovo N20(P)";
304 | this.chipset = "Intel Bay Trail";
305 | this.deviceType = 1;
306 | return true;
307 | }
308 | if (lower == "enguarde")
309 | {
310 | this.humanReadableModel = "Lenovo N21";
311 | this.chipset = "Intel Bay Trail";
312 | this.deviceType = 1;
313 | return true;
314 | }
315 | if (lower == "gnawty")
316 | {
317 | this.humanReadableModel = "Acer C730/CB3-111/CB3-131";
318 | this.chipset = "Intel Bay Trail";
319 | this.deviceType = 1;
320 | return true;
321 | }
322 | if (lower == "heli")
323 | {
324 | this.humanReadableModel = "Haier Chromebook G2";
325 | this.chipset = "Intel Bay Trail";
326 | this.deviceType = 1;
327 | return true;
328 | }
329 | if (lower == "kip")
330 | {
331 | this.humanReadableModel = "HP Chromebook 11";
332 | this.chipset = "Intel Bay Trail";
333 | this.deviceType = 1;
334 | return true;
335 | }
336 | if (lower == "orco")
337 | {
338 | this.humanReadableModel = "Lenovo 100S";
339 | this.chipset = "Intel Bay Trail";
340 | this.deviceType = 1;
341 | return true;
342 | }
343 | if (lower == "quawks")
344 | {
345 | this.humanReadableModel = "Asus C300";
346 | this.chipset = "Intel Bay Trail";
347 | this.deviceType = 1;
348 | return true;
349 | }
350 | if (lower == "squawks")
351 | {
352 | this.humanReadableModel = "Asus C200";
353 | this.chipset = "Intel Bay Trail";
354 | this.deviceType = 1;
355 | return true;
356 | }
357 | if (lower == "swanky")
358 | {
359 | this.humanReadableModel = "Toshiba Chromebook 2 [2014]";
360 | this.chipset = "Intel Bay Trail";
361 | this.deviceType = 1;
362 | return true;
363 | }
364 | if (lower == "winky")
365 | {
366 | this.humanReadableModel = "Samsung Chromebook 2";
367 | this.chipset = "Intel Bay Trail";
368 | this.deviceType = 1;
369 | return true;
370 | }
371 | if (lower == "ninja")
372 | {
373 | this.humanReadableModel = "AOpen Chromebox Commercial";
374 | this.chipset = "Intel Bay Trail";
375 | this.macAddressInjectionRequired = true;
376 | this.deviceType = 2;
377 | return true;
378 | }
379 | if (lower == "sumo")
380 | {
381 | this.humanReadableModel = "AOpen Chromebase Commercial";
382 | this.chipset = "Intel Bay Trail";
383 | this.macAddressInjectionRequired = true;
384 | this.deviceType = 2;
385 | return true;
386 | }
387 |
388 | //Braswell
389 | if (lower == "banon")
390 | {
391 | this.humanReadableModel = "Acer 15.6 Chromebook";
392 | this.chipset = "Intel Braswell";
393 | this.deviceType = 1;
394 | return true;
395 | }
396 | if (lower == "celes")
397 | {
398 | this.humanReadableModel = "Samsung Chromebook 3";
399 | this.chipset = "Intel Braswell";
400 | this.deviceType = 1;
401 | return false;
402 | }
403 | if (lower == "cyan")
404 | {
405 | this.humanReadableModel = "Acer Chromebook R11";
406 | this.chipset = "Intel Braswell";
407 | this.deviceType = 1;
408 | return true;
409 | }
410 | if (lower == "edgar")
411 | {
412 | this.humanReadableModel = "Acer Chromebook 14";
413 | this.chipset = "Intel Braswell";
414 | this.deviceType = 1;
415 | return true;
416 | }
417 | if (lower == "kefka")
418 | {
419 | this.humanReadableModel = "Dell Chromebook 11 3180";
420 | this.chipset = "Intel Braswell";
421 | this.deviceType = 1;
422 | return true;
423 | }
424 | if (lower == "reks")
425 | {
426 | this.humanReadableModel = "Lenovo Chromebook 11";
427 | this.chipset = "Intel Braswell";
428 | this.deviceType = 1;
429 | return true;
430 | }
431 | if (lower == "relm")
432 | {
433 | this.humanReadableModel = "";
434 | this.chipset = "Intel Braswell";
435 | this.deviceType = 1;
436 | return true;
437 | }
438 | if (lower == "setzer")
439 | {
440 | this.humanReadableModel = "HP Chromebook 11 G5";
441 | this.chipset = "Intel Braswell";
442 | this.deviceType = 1;
443 | return true;
444 | }
445 | if (lower == "terra")
446 | {
447 | this.humanReadableModel = "Asus Chromebook C202SA/C302SA";
448 | this.chipset = "Intel Braswell";
449 | this.deviceType = 1;
450 | return true;
451 | }
452 | if (lower == "ultima")
453 | {
454 | this.humanReadableModel = "Thinkpad 11e Chromebook (3rd gen)";
455 | this.chipset = "Intel Braswell";
456 | this.deviceType = 1;
457 | return true;
458 | }
459 | if (lower == "wizpig")
460 | {
461 | this.humanReadableModel = "";
462 | this.chipset = "Intel Braswell";
463 | this.deviceType = 1;
464 | return true;
465 | }
466 | this.humanReadableModel = "Unknown: " + this.model;
467 | return false;
468 | }
469 |
470 | public MainWindow()
471 | {
472 | this.InitializeComponent();
473 | using (ManagementObjectSearcher managementObjectSearcher = new ManagementObjectSearcher((ObjectQuery)new SelectQuery("Select * from Win32_ComputerSystem")))
474 | {
475 | foreach (ManagementObject managementObject in managementObjectSearcher.Get())
476 | {
477 | managementObject.Get();
478 | this.manufacturer = (string)managementObject["Manufacturer"];
479 | this.model = (string)managementObject["Model"];
480 | }
481 | }
482 | foreach (ManagementObject managementObject in new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity").Get())
483 | {
484 | object propertyValue1 = managementObject.GetPropertyValue("Present");
485 | if (propertyValue1 != null && (bool)propertyValue1)
486 | {
487 | object propertyValue2 = managementObject.GetPropertyValue("HardwareID");
488 | if (propertyValue2 != null)
489 | {
490 | string str = ((string[])propertyValue2)[0];
491 | if (str.Equals("ACPI\\VEN_CYAP&DEV_0000"))
492 | this.trackpadType = "Cypress";
493 | if (str.Equals("ACPI\\VEN_ELAN&DEV_0000"))
494 | this.trackpadType = "Elan";
495 | if (str.Equals("ACPI\\VEN_ATML&DEV_0000"))
496 | this.trackpadType = "Atmel";
497 | if (str.Equals("ACPI\\VEN_SYNA&DEV_0000"))
498 | this.trackpadType = "Synaptics";
499 | }
500 | }
501 | }
502 | if (this.isModelSupported())
503 | {
504 | this.modelSupportedLabel.Content = (object)"Firmware Update Supported";
505 | this.supportedImg.Source = (ImageSource)new BitmapImage(new Uri("checkmark.png", UriKind.Relative));
506 | this.updateBtn.IsEnabled = true;
507 | this.cleanInstall.IsEnabled = true;
508 | }
509 | else
510 | {
511 | this.modelSupportedLabel.Content = (object)"Firmware Update Unsupported";
512 | this.supportedImg.Source = (ImageSource)new BitmapImage(new Uri("unsupported.png", UriKind.Relative));
513 | }
514 | this.modelLabel.Content = (object)("Model: " + this.humanReadableModel);
515 | if (this.deviceType == 1)
516 | this.modelTypeImg.Source = (ImageSource)new BitmapImage(new Uri("laptop.png", UriKind.Relative));
517 | string str1 = "Chipset: " + this.chipset;
518 | if (this.trackpadType != "")
519 | str1 = str1 + "; Trackpad Type: " + this.trackpadType;
520 | this.modelDetails.Content = (object)str1;
521 | this.checkHashes(true);
522 | }
523 |
524 | private void updateBtn_Click(object sender, RoutedEventArgs e)
525 | {
526 | this.updateBtn.IsEnabled = false;
527 | this.cleanInstall.IsEnabled = false;
528 | if (!this.checkHashes(true))
529 | return;
530 | this.progressText.Content = (object)"Backing Up Current Firmware...";
531 | this.progressBar.Value = 10.0;
532 | if ((this.chipset == "Intel Haswell" || this.chipset == "Intel Broadwell") && !this.backupHSW())
533 | this.progressText.Content = (object)"Error Backing Up Existing Firmware!";
534 | else if ((this.chipset == "Intel Bay Trail" || this.chipset == "Intel Braswell") && !this.backupBYT())
535 | this.progressText.Content = (object)"Error Backing Up Existing Firmware!";
536 | else
537 | this.downloadFWManifest();
538 | }
539 |
540 | private bool backupHSW()
541 | {
542 | if (this.executableDir == "")
543 | this.executableDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
544 | Process process = new Process();
545 | process.StartInfo.FileName = this.executableDir + "/FPT-HSWBDW/fptw64.exe";
546 | process.StartInfo.WorkingDirectory = this.executableDir + "/FPT-HSWBDW";
547 | process.StartInfo.Arguments = "-BIOS -D ../fw-backup.bin";
548 | process.StartInfo.UseShellExecute = true;
549 | process.StartInfo.RedirectStandardOutput = false;
550 | process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
551 | process.StartInfo.CreateNoWindow = false;
552 | process.Start();
553 | process.WaitForExit();
554 | return process.ExitCode == 0;
555 | }
556 |
557 | private bool backupBYT()
558 | {
559 | if (this.executableDir == "")
560 | this.executableDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
561 | Process process = new Process();
562 | process.StartInfo.FileName = this.executableDir + "/FPT-BYTBSW/fptw64.exe";
563 | process.StartInfo.WorkingDirectory = this.executableDir + "/FPT-BYTBSW";
564 | process.StartInfo.Arguments = "-BIOS -D ../fw-backup.bin";
565 | process.StartInfo.UseShellExecute = true;
566 | process.StartInfo.RedirectStandardOutput = false;
567 | process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
568 | process.StartInfo.CreateNoWindow = false;
569 | process.Start();
570 | process.WaitForExit();
571 | return process.ExitCode == 0;
572 | }
573 |
574 | private void downloadFWManifest()
575 | {
576 | this.progressText.Content = (object)"Downloading Manifest...";
577 | this.progressBar.Value = 30.0;
578 | bool gotFWURL = false;
579 | string fwURL = "";
580 | string fwSHA = "";
581 | BackgroundWorker backgroundWorker = new BackgroundWorker();
582 | backgroundWorker.DoWork += (DoWorkEventHandler)((sender2, e2) =>
583 | {
584 | try
585 | {
586 | WebClient webClient = new WebClient();
587 | webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136");
588 | string str = webClient.DownloadString("https://raw.githubusercontent.com/MrChromebox/scripts/master/cbmodels.json");
589 | JObject json = (JObject)JsonConvert.DeserializeObject(str);
590 | JObject modelData = null;
591 | if (!this.forceTrackpadDifferentiation && json.ContainsKey(this.model.ToLower()))
592 | {
593 | modelData = (JObject)json[this.model.ToLower()];
594 | } else if (json.ContainsKey(this.model.ToLower() + "-" + this.trackpadType.ToLower()))
595 | {
596 | modelData = (JObject)json[this.model.ToLower() + "-" + this.trackpadType.ToLower()];
597 | }
598 | if (modelData != null)
599 | {
600 | if (modelData.ContainsKey("url") && modelData.ContainsKey("sha1"))
601 | {
602 | fwURL = (String)modelData["url"];
603 | fwSHA = (String)modelData["sha1"];
604 | gotFWURL = true;
605 | }
606 | }
607 | }
608 | catch (Exception ex)
609 | {
610 | gotFWURL = false;
611 | }
612 | });
613 | backgroundWorker.RunWorkerCompleted += (RunWorkerCompletedEventHandler)((sender2, e2) =>
614 | {
615 | if (gotFWURL)
616 | this.downloadFW(fwURL, fwSHA);
617 | else
618 | this.progressText.Content = (object)"Error Parsing Manifest...";
619 | });
620 | backgroundWorker.RunWorkerAsync();
621 | }
622 |
623 | private void downloadFW(string fwURL, string fwSHA)
624 | {
625 | if (this.executableDir == "")
626 | this.executableDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
627 | this.progressText.Content = (object)"Downloading Firmware...";
628 | this.progressBar.Value = 40.0;
629 | WebClient webClient = new WebClient();
630 | webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136");
631 | webClient.DownloadProgressChanged += (DownloadProgressChangedEventHandler)((sender, e) => this.progressBar.Value = 40.0 + (double)e.ProgressPercentage * 0.2);
632 | webClient.DownloadFileCompleted += (AsyncCompletedEventHandler)((sender, e) =>
633 | {
634 |
635 | this.progressBar.Value = 60.0;
636 | if (this.sha1OfFile(this.executableDir + "/fwupdate.bin") != fwSHA)
637 | this.progressText.Content = (object)"Error verifying Firmware...";
638 | else
639 | {
640 | if (this.rebuildOldFirmware())
641 | {
642 | if (!this.cleanInstall.IsChecked.Value)
643 | {
644 | if (extractNVRAM())
645 | {
646 | if (!injectNVRAM())
647 | {
648 | this.progressText.Content = (object)"Error preserving NVRAM...";
649 | return;
650 | }
651 | }
652 | }
653 |
654 | if (this.chipset == "Intel Braswell" && this.extractMRCCache())
655 | {
656 | if (!this.injectMRCCache())
657 | {
658 | MessageBox.Show("Warning: Unable to preserve Memory Training Cache. The next boot may take longer.", "MRC Cache Warning");
659 | }
660 | }
661 |
662 | this.progressBar.Value = 70.0;
663 |
664 | if (this.macAddressInjectionRequired)
665 | {
666 | if (this.injectMacAddress())
667 | this.flashFW();
668 | else
669 | this.progressText.Content = (object)"Error Injecting MAC Address...";
670 | }
671 | else
672 | this.flashFW();
673 | } else
674 | {
675 | this.progressText.Content = (object)"Error Processing dumped firmware...";
676 | }
677 | }
678 | });
679 | Console.WriteLine(fwURL);
680 | webClient.DownloadFileAsync(new Uri(fwURL, UriKind.Absolute), this.executableDir + "/fwupdate.bin");
681 | }
682 |
683 | private bool injectMacAddress()
684 | {
685 | if (!this.extractVPD())
686 | return false;
687 | return this.injectVPD();
688 | }
689 |
690 | private bool rebuildOldFirmware()
691 | {
692 | System.IO.File.Copy(this.executableDir + "/fwupdate.bin", this.executableDir + "/fwupdate-raw.bin");
693 | System.IO.File.Copy(this.executableDir + "/fwupdate.bin", this.executableDir + "/fw-reconstructed.bin");
694 |
695 | Process process = new Process();
696 | process.StartInfo.FileName = this.executableDir + "/cbtools/ifdtool.exe";
697 | process.StartInfo.WorkingDirectory = this.executableDir + "/cbtools";
698 | process.StartInfo.Arguments = "-i BIOS:../fw-backup.bin ../fw-reconstructed.bin";
699 | process.StartInfo.UseShellExecute = true;
700 | process.StartInfo.RedirectStandardOutput = false;
701 | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
702 | process.StartInfo.CreateNoWindow = false;
703 | process.Start();
704 | process.WaitForExit();
705 |
706 | if (process.ExitCode == 0)
707 | {
708 | System.IO.File.Delete(this.executableDir + "/fw-reconstructed.bin");
709 | System.IO.File.Move(this.executableDir + "/fw-reconstructed.bin.new", this.executableDir + "/fw-reconstructed.bin");
710 | return true;
711 | }
712 | return false;
713 | }
714 |
715 | private bool extractNVRAM()
716 | {
717 | Process process = new Process();
718 | process.StartInfo.FileName = this.executableDir + "/cbtools/cbfstool.exe";
719 | process.StartInfo.WorkingDirectory = this.executableDir + "/cbtools";
720 | process.StartInfo.Arguments = "../fw-reconstructed.bin read -r SMMSTORE -f ../smmstore";
721 | process.StartInfo.UseShellExecute = true;
722 | process.StartInfo.RedirectStandardOutput = false;
723 | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
724 | process.StartInfo.CreateNoWindow = false;
725 | process.Start();
726 | process.WaitForExit();
727 | return process.ExitCode == 0;
728 | }
729 |
730 | private bool injectNVRAM()
731 | {
732 | Process process = new Process();
733 | process.StartInfo.FileName = this.executableDir + "/cbtools/cbfstool.exe";
734 | process.StartInfo.WorkingDirectory = this.executableDir + "/cbtools";
735 | process.StartInfo.Arguments = "../fwupdate.bin write -r SMMSTORE -f ../smmstore";
736 | process.StartInfo.UseShellExecute = true;
737 | process.StartInfo.RedirectStandardOutput = false;
738 | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
739 | process.StartInfo.CreateNoWindow = false;
740 | process.Start();
741 | process.WaitForExit();
742 | return process.ExitCode == 0;
743 | }
744 |
745 | private bool extractMRCCache()
746 | {
747 | Process process = new Process();
748 | process.StartInfo.FileName = this.executableDir + "/cbtools/cbfstool.exe";
749 | process.StartInfo.WorkingDirectory = this.executableDir + "/cbtools";
750 | process.StartInfo.Arguments = "../fw-reconstructed.bin read -r RW_MRC_CACHE -f ../mrc.cache";
751 | process.StartInfo.UseShellExecute = true;
752 | process.StartInfo.RedirectStandardOutput = false;
753 | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
754 | process.StartInfo.CreateNoWindow = false;
755 | process.Start();
756 | process.WaitForExit();
757 | return process.ExitCode == 0;
758 | }
759 |
760 | private bool injectMRCCache()
761 | {
762 | Process process = new Process();
763 | process.StartInfo.FileName = this.executableDir + "/cbtools/cbfstool.exe";
764 | process.StartInfo.WorkingDirectory = this.executableDir + "/cbtools";
765 | process.StartInfo.Arguments = "../fwupdate.bin write -r RW_MRC_CACHE -f ../mrc.cache";
766 | process.StartInfo.UseShellExecute = true;
767 | process.StartInfo.RedirectStandardOutput = false;
768 | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
769 | process.StartInfo.CreateNoWindow = false;
770 | process.Start();
771 | process.WaitForExit();
772 | return process.ExitCode == 0;
773 | }
774 |
775 | private bool extractVPD()
776 | {
777 | Process process = new Process();
778 | process.StartInfo.FileName = this.executableDir + "/cbtools/cbfstool.exe";
779 | process.StartInfo.WorkingDirectory = this.executableDir + "/cbtools";
780 | process.StartInfo.Arguments = "../fw-reconstructed.bin extract -n vpd.bin -f ../vpd.bin";
781 | process.StartInfo.UseShellExecute = true;
782 | process.StartInfo.RedirectStandardOutput = false;
783 | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
784 | process.StartInfo.CreateNoWindow = false;
785 | process.Start();
786 | process.WaitForExit();
787 | return process.ExitCode == 0;
788 | }
789 |
790 | private bool injectVPD()
791 | {
792 | Process process = new Process();
793 | process.StartInfo.FileName = this.executableDir + "/cbtools/cbfstool.exe";
794 | process.StartInfo.WorkingDirectory = this.executableDir + "/cbtools";
795 | process.StartInfo.Arguments = "../fwupdate.bin add -n vpd.bin -f ../vpd.bin -t raw";
796 | process.StartInfo.UseShellExecute = true;
797 | process.StartInfo.RedirectStandardOutput = false;
798 | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
799 | process.StartInfo.CreateNoWindow = false;
800 | process.Start();
801 | process.WaitForExit();
802 | return process.ExitCode == 0;
803 | }
804 |
805 | private void flashFW()
806 | {
807 | if (!this.checkHashes(false))
808 | return;
809 | this.progressText.Content = (object)"Flashing Firmware... DO NOT TURN OFF YOUR COMPUTER";
810 | this.progressBar.Value = 80.0;
811 | if ((this.chipset == "Intel Haswell" || this.chipset == "Intel Broadwell") && !this.flashHSW())
812 | {
813 | this.progressText.Content = (object)"Error Flashing Firmware! DO NOT REBOOT!";
814 | int num = (int)MessageBox.Show("Error Flashing Firmware! DO NOT REBOOT. Please use FPT to flash fwbackup.bin manually.");
815 | }
816 | else if ((this.chipset == "Intel Bay Trail" || this.chipset == "Intel Braswell") && !this.flashBYT())
817 | {
818 | this.progressText.Content = (object)"Error Flashing Firmware! DO NOT REBOOT!";
819 | int num = (int)MessageBox.Show("Error Flashing Firmware! DO NOT REBOOT. Please use FPT to flash fwbackup.bin manually.");
820 | }
821 | else
822 | {
823 | this.progressText.Content = (object)"Flashing Succeeded! Please reboot!";
824 | this.progressBar.Value = 100.0;
825 | }
826 | }
827 |
828 | private bool flashHSW()
829 | {
830 | Process process = new Process();
831 | process.StartInfo.FileName = this.executableDir + "/FPT-HSWBDW/fptw64.exe";
832 | process.StartInfo.WorkingDirectory = this.executableDir + "/FPT-HSWBDW";
833 | process.StartInfo.Arguments = "-BIOS -F ../fwupdate.bin";
834 | process.StartInfo.UseShellExecute = true;
835 | process.StartInfo.RedirectStandardOutput = false;
836 | process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
837 | process.StartInfo.CreateNoWindow = false;
838 | process.Start();
839 | process.WaitForExit();
840 | return process.ExitCode == 0;
841 | }
842 |
843 | private bool flashBYT()
844 | {
845 | Process process = new Process();
846 | process.StartInfo.FileName = this.executableDir + "/FPT-BYTBSW/fptw64.exe";
847 | process.StartInfo.WorkingDirectory = this.executableDir + "/FPT-BYTBSW";
848 | process.StartInfo.Arguments = "-BIOS -F ../fwupdate.bin";
849 | process.StartInfo.UseShellExecute = true;
850 | process.StartInfo.RedirectStandardOutput = false;
851 | process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
852 | process.StartInfo.CreateNoWindow = false;
853 | process.Start();
854 | process.WaitForExit();
855 | return process.ExitCode == 0;
856 | }
857 |
858 | private void CleanInstall_Checked(object sender, RoutedEventArgs e)
859 | {
860 | MessageBox.Show("Warning: Enabling this option will wipe all saved settings, including boot entries and boot order.", "Clean Install");
861 | }
862 | }
863 | }
864 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("Chromebook Firmware Update Tool")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("Chromebook Firmware Update Tool")]
15 | [assembly: AssemblyCopyright("Copyright © 2019")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Chromebook_Firmware_Update_Tool.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Chromebook_Firmware_Update_Tool.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Chromebook_Firmware_Update_Tool.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Chromebook_Firmware_Update_Tool {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Chromebook_Firmware_Update_Tool.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap c740 {
67 | get {
68 | object obj = ResourceManager.GetObject("c740", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap c910 {
77 | get {
78 | object obj = ResourceManager.GetObject("c910", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized resource of type System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap checkmark {
87 | get {
88 | object obj = ResourceManager.GetObject("checkmark", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Looks up a localized resource of type System.Drawing.Bitmap.
95 | ///
96 | internal static System.Drawing.Bitmap desktop {
97 | get {
98 | object obj = ResourceManager.GetObject("desktop", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// Looks up a localized resource of type System.Drawing.Bitmap.
105 | ///
106 | internal static System.Drawing.Bitmap laptop {
107 | get {
108 | object obj = ResourceManager.GetObject("laptop", resourceCulture);
109 | return ((System.Drawing.Bitmap)(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// Looks up a localized resource of type System.Drawing.Bitmap.
115 | ///
116 | internal static System.Drawing.Bitmap unknown {
117 | get {
118 | object obj = ResourceManager.GetObject("unknown", resourceCulture);
119 | return ((System.Drawing.Bitmap)(obj));
120 | }
121 | }
122 |
123 | ///
124 | /// Looks up a localized resource of type System.Drawing.Bitmap.
125 | ///
126 | internal static System.Drawing.Bitmap unsupported {
127 | get {
128 | object obj = ResourceManager.GetObject("unsupported", resourceCulture);
129 | return ((System.Drawing.Bitmap)(obj));
130 | }
131 | }
132 | }
133 | }
134 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | c740.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | c910.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | checkmark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | desktop.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | laptop.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
137 | unknown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
138 |
139 |
140 | unsupported.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
141 |
142 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
52 |
59 |
60 |
61 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/c740.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolstar/Chromebook-Firmware-Update-Tool/df70c7867e5e7bd9b59e3974a024589739deeace/Chromebook Firmware Update Tool/c740.png
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/c910.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolstar/Chromebook-Firmware-Update-Tool/df70c7867e5e7bd9b59e3974a024589739deeace/Chromebook Firmware Update Tool/c910.png
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolstar/Chromebook-Firmware-Update-Tool/df70c7867e5e7bd9b59e3974a024589739deeace/Chromebook Firmware Update Tool/checkmark.png
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/desktop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolstar/Chromebook-Firmware-Update-Tool/df70c7867e5e7bd9b59e3974a024589739deeace/Chromebook Firmware Update Tool/desktop.png
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/laptop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolstar/Chromebook-Firmware-Update-Tool/df70c7867e5e7bd9b59e3974a024589739deeace/Chromebook Firmware Update Tool/laptop.png
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/unknown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolstar/Chromebook-Firmware-Update-Tool/df70c7867e5e7bd9b59e3974a024589739deeace/Chromebook Firmware Update Tool/unknown.png
--------------------------------------------------------------------------------
/Chromebook Firmware Update Tool/unsupported.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coolstar/Chromebook-Firmware-Update-Tool/df70c7867e5e7bd9b59e3974a024589739deeace/Chromebook Firmware Update Tool/unsupported.png
--------------------------------------------------------------------------------