├── connection.jpg ├── debrick ├── main.ico ├── Properties │ ├── gk7205v2.ubt │ ├── gk7205v3.ubt │ ├── Resources.Designer.cs │ └── Resources.resx ├── Program.cs ├── debrick.csproj ├── Form.Designer.cs ├── Form.resx └── Form.cs ├── .github └── workflows │ └── build.yml ├── LICENSE.txt ├── debrick.sln ├── README.md ├── .gitattributes └── .gitignore /connection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/debrick/master/connection.jpg -------------------------------------------------------------------------------- /debrick/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/debrick/master/debrick/main.ico -------------------------------------------------------------------------------- /debrick/Properties/gk7205v2.ubt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/debrick/master/debrick/Properties/gk7205v2.ubt -------------------------------------------------------------------------------- /debrick/Properties/gk7205v3.ubt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/debrick/master/debrick/Properties/gk7205v3.ubt -------------------------------------------------------------------------------- /debrick/Program.cs: -------------------------------------------------------------------------------- 1 | namespace debrick 2 | { 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | ApplicationConfiguration.Initialize(); 14 | Application.Run(new Form()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | push: 4 | branches: 5 | - master 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | runs-on: windows-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | 15 | - name: Build 16 | run: | 17 | dotnet build --configuration Release 18 | Compress-Archive debrick\bin\Release\* debrick.zip 19 | 20 | - name: Upload 21 | uses: softprops/action-gh-release@v2 22 | with: 23 | tag_name: latest 24 | files: debrick.zip 25 | -------------------------------------------------------------------------------- /debrick/debrick.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net8.0-windows10.0.17763.0 6 | enable 7 | true 8 | enable 9 | main.ico 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | True 23 | True 24 | Resources.resx 25 | 26 | 27 | 28 | 29 | 30 | ResXFileCodeGenerator 31 | Resources.Designer.cs 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /debrick.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.9.34728.123 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "debrick", "debrick\debrick.csproj", "{54E1DBB6-89CE-4647-92D8-D9C46067E1FC}" 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 | {54E1DBB6-89CE-4647-92D8-D9C46067E1FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {54E1DBB6-89CE-4647-92D8-D9C46067E1FC}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {54E1DBB6-89CE-4647-92D8-D9C46067E1FC}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {54E1DBB6-89CE-4647-92D8-D9C46067E1FC}.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 = {D10FD10A-C1FC-4325-965C-94C47B065215} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![OpenIPC logo][logo] 2 | 3 | ## Debrick 4 | 5 | Open-source software for Windows, which allows you to flash the camera (on Goke SoC gk7205v200/210/300) in a few clicks, without using the command line and any additional programs (like PuTTY, Tftpd64, python, etc.) 6 | 7 | Originally сreated to simplify (automate) the flashing of cameras, but can also be used to read dump flash, restore bricked/passworded cameras and writing [OpenIPC](https://openipc.org/) binary files (similar [burn](https://github.com/OpenIPC/burn)). 8 | 9 | You can download debrick tool [here](https://github.com/OpenIPC/debrick/releases/tag/latest). 10 | 11 | ### How to use 12 | 13 | ![](connection.jpg) 14 | 15 | Run the program, follow the [video](https://www.youtube.com/watch?v=WQcVlOOUAro&t=111s) instructions from the [telkam](https://t.me/telkamInfo) project. 16 | 17 | ### Notes 18 | 19 | Don't forget to reboot your device after flashing. 20 | 21 | After flashing the OpenIPC binary file, you may need to reboot the device several times, and maybe use PuTTY to install the correct partitions ("run setnor16m"), follow the guide from OpenIPC. 22 | 23 | ### Technical support and donations 24 | 25 | Please **_[support our project](https://openipc.org/support-open-source)_** with donations or orders for development or maintenance. Thank you! 26 | 27 | [logo]: https://openipc.org/assets/openipc-logo-black.svg 28 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /debrick/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 debrick.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", "17.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("debrick.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 | /// Looks up a localized resource of type System.Byte[]. 65 | /// 66 | internal static byte[] gk7205v2 { 67 | get { 68 | object obj = ResourceManager.GetObject("gk7205v2", resourceCulture); 69 | return ((byte[])(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Byte[]. 75 | /// 76 | internal static byte[] gk7205v3 { 77 | get { 78 | object obj = ResourceManager.GetObject("gk7205v3", resourceCulture); 79 | return ((byte[])(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /debrick/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 | 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 | gk7205v2.ubt;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | gk7205v3.ubt;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /debrick/Form.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace debrick 2 | { 3 | partial class Form 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form)); 32 | labelVersion = new Label(); 33 | label = new Label(); 34 | button1 = new Button(); 35 | checkedListBox = new CheckedListBox(); 36 | button2 = new Button(); 37 | button0 = new Button(); 38 | progressBar = new ProgressBar(); 39 | textBoxIP = new TextBox(); 40 | linkLabel = new LinkLabel(); 41 | SuspendLayout(); 42 | // 43 | // labelVersion 44 | // 45 | labelVersion.AutoSize = true; 46 | labelVersion.Dock = DockStyle.Left; 47 | labelVersion.Font = new Font("Arial", 12F); 48 | labelVersion.ForeColor = Color.Aqua; 49 | labelVersion.Location = new Point(0, 0); 50 | labelVersion.Margin = new Padding(2, 0, 2, 0); 51 | labelVersion.Name = "labelVersion"; 52 | labelVersion.Size = new Size(40, 18); 53 | labelVersion.TabIndex = 2; 54 | labelVersion.Text = "v.2.1"; 55 | // 56 | // label 57 | // 58 | label.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; 59 | label.BackColor = Color.Transparent; 60 | label.Font = new Font("Arial", 16F); 61 | label.ForeColor = Color.White; 62 | label.Location = new Point(50, 62); 63 | label.Margin = new Padding(2, 0, 2, 0); 64 | label.Name = "label"; 65 | label.Size = new Size(502, 215); 66 | label.TabIndex = 3; 67 | label.Text = resources.GetString("label.Text"); 68 | label.TextAlign = ContentAlignment.TopCenter; 69 | // 70 | // button1 71 | // 72 | button1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; 73 | button1.BackColor = Color.Transparent; 74 | button1.Font = new Font("Arial", 16F); 75 | button1.ForeColor = SystemColors.InfoText; 76 | button1.Location = new Point(206, 289); 77 | button1.Margin = new Padding(2); 78 | button1.Name = "button1"; 79 | button1.Size = new Size(180, 40); 80 | button1.TabIndex = 4; 81 | button1.TabStop = false; 82 | button1.Text = "button1"; 83 | button1.UseVisualStyleBackColor = false; 84 | button1.Visible = false; 85 | button1.Click += Button_Click; 86 | // 87 | // checkedListBox 88 | // 89 | checkedListBox.BackColor = Color.Black; 90 | checkedListBox.BorderStyle = BorderStyle.FixedSingle; 91 | checkedListBox.CheckOnClick = true; 92 | checkedListBox.Font = new Font("Arial", 16F); 93 | checkedListBox.ForeColor = Color.White; 94 | checkedListBox.FormattingEnabled = true; 95 | checkedListBox.Location = new Point(50, 90); 96 | checkedListBox.Margin = new Padding(2); 97 | checkedListBox.Name = "checkedListBox"; 98 | checkedListBox.Size = new Size(500, 164); 99 | checkedListBox.TabIndex = 5; 100 | checkedListBox.Visible = false; 101 | checkedListBox.ItemCheck += CheckedListBox_ItemCheck; 102 | // 103 | // button2 104 | // 105 | button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; 106 | button2.BackColor = Color.Transparent; 107 | button2.Font = new Font("Arial", 16F); 108 | button2.ForeColor = SystemColors.InfoText; 109 | button2.Location = new Point(22, 289); 110 | button2.Margin = new Padding(2); 111 | button2.Name = "button2"; 112 | button2.Size = new Size(180, 40); 113 | button2.TabIndex = 6; 114 | button2.TabStop = false; 115 | button2.Text = "button2"; 116 | button2.UseVisualStyleBackColor = false; 117 | button2.Visible = false; 118 | button2.Click += Button_Click; 119 | // 120 | // button0 121 | // 122 | button0.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; 123 | button0.BackColor = Color.Transparent; 124 | button0.Font = new Font("Arial", 16F); 125 | button0.ForeColor = SystemColors.InfoText; 126 | button0.Location = new Point(390, 289); 127 | button0.Margin = new Padding(2); 128 | button0.Name = "button0"; 129 | button0.Size = new Size(180, 40); 130 | button0.TabIndex = 7; 131 | button0.TabStop = false; 132 | button0.Text = "button0"; 133 | button0.UseVisualStyleBackColor = false; 134 | button0.Visible = false; 135 | button0.Click += Button_Click; 136 | // 137 | // progressBar 138 | // 139 | progressBar.Location = new Point(100, 150); 140 | progressBar.Margin = new Padding(2); 141 | progressBar.MarqueeAnimationSpeed = 10; 142 | progressBar.Name = "progressBar"; 143 | progressBar.Size = new Size(400, 20); 144 | progressBar.Step = 1; 145 | progressBar.Style = ProgressBarStyle.Marquee; 146 | progressBar.TabIndex = 8; 147 | progressBar.Visible = false; 148 | // 149 | // textBoxIP 150 | // 151 | textBoxIP.Font = new Font("Arial", 16F); 152 | textBoxIP.Location = new Point(190, 150); 153 | textBoxIP.Margin = new Padding(2); 154 | textBoxIP.Name = "textBoxIP"; 155 | textBoxIP.Size = new Size(220, 32); 156 | textBoxIP.TabIndex = 9; 157 | textBoxIP.Text = "192.168.1.123"; 158 | textBoxIP.TextAlign = HorizontalAlignment.Center; 159 | textBoxIP.Visible = false; 160 | // 161 | // linkLabel 162 | // 163 | linkLabel.AutoSize = true; 164 | linkLabel.Dock = DockStyle.Right; 165 | linkLabel.Font = new Font("Arial", 12F); 166 | linkLabel.LinkColor = Color.Aqua; 167 | linkLabel.Location = new Point(331, 0); 168 | linkLabel.Margin = new Padding(2, 0, 2, 0); 169 | linkLabel.Name = "linkLabel"; 170 | linkLabel.Size = new Size(253, 18); 171 | linkLabel.TabIndex = 10; 172 | linkLabel.TabStop = true; 173 | linkLabel.Text = "https://github.com/OpenIPC/debrick"; 174 | linkLabel.LinkClicked += LinkLabel_LinkClicked; 175 | // 176 | // Form 177 | // 178 | AutoScaleDimensions = new SizeF(7F, 15F); 179 | AutoScaleMode = AutoScaleMode.Font; 180 | BackColor = Color.Black; 181 | ClientSize = new Size(584, 361); 182 | Controls.Add(linkLabel); 183 | Controls.Add(textBoxIP); 184 | Controls.Add(progressBar); 185 | Controls.Add(button0); 186 | Controls.Add(button2); 187 | Controls.Add(button1); 188 | Controls.Add(labelVersion); 189 | Controls.Add(checkedListBox); 190 | Controls.Add(label); 191 | FormBorderStyle = FormBorderStyle.FixedSingle; 192 | Icon = (Icon)resources.GetObject("$this.Icon"); 193 | Margin = new Padding(2); 194 | MaximizeBox = false; 195 | MaximumSize = new Size(600, 400); 196 | MinimizeBox = false; 197 | MinimumSize = new Size(600, 400); 198 | Name = "Form"; 199 | StartPosition = FormStartPosition.CenterScreen; 200 | Text = "OpenIPC debrick"; 201 | FormClosing += Form_FormClosing; 202 | ResumeLayout(false); 203 | PerformLayout(); 204 | } 205 | 206 | #endregion 207 | 208 | private Label labelVersion; 209 | private Label label; 210 | private Button button1; 211 | private CheckedListBox checkedListBox; 212 | private Button button2; 213 | private Button button0; 214 | private ProgressBar progressBar; 215 | private TextBox textBoxIP; 216 | private LinkLabel linkLabel; 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /debrick/Form.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 | Welcome! This program from 122 | the developers of OpenIPC is created 123 | to burn gk7205v200/210/300 processors 124 | with password-protected u-boot, as well 125 | as bricked cameras. More information 126 | can be found at the links above. 127 | Let's begin? 128 | 129 | 130 | 131 | 132 | AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAABMLAAATCwAAAAAAAAAA 133 | AADZYE3j2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8Nlg 134 | TfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8Nlg 135 | TfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8Nlg 136 | TfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8NlgTfDZYE3w2WBN8Nlg 137 | TfDZYE3w2WBN8NlgTfDZYE3j2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 138 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WB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N8Nlg 163 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 164 | Tf/ZYE3/2GBN/+FiUf/TTzz/xEc6/92tq/////////////n////9/v///P7///z//////v////7///7/ 165 | ///9//3//v/+//z////7/////v7+//3//v/2//3////////////dxMH/xVZI/+BGNf/iYk7/12BN/9lg 166 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 167 | Tf/ZYE3/2WBN8NlgTfDZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 168 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2mBN/9hgTP/WW0T/xV9P/+TJx///////+/////z+/f/8//7//P////r/ 169 | ///7/////////////////////////////////////v////3////+////+f////r//P/9/////////+/i 170 | 3f/Ma2D/0lZB/9pfTP/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 171 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTfDZYE3w2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 172 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lhTf/bW0r/xEk6/+7VzP//////9/3///3+ 173 | /P////3/+//+//3///////////////Dy7v/p0s7/5cG7/+HCu//lzsn/7+rm//3///////////////z+ 174 | ///8//z//f76//v8/v//////7PLm/8hUQv/fWUb/2GBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 175 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3w2WBN8NlgTf/ZYE3/2WBN/9lg 176 | Tf/ZYE3/2WBN/9lgTf/ZYE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dv/NQCj/4V9E/9hhT//cX0z/4V5O/9dgTv/YYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 214 | Tf/ZYE3w2WBN8NlgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9hgTf/dX03/3mBO/9ld 215 | SP/JPin/zn1v//n5+P///////P////j////6/v///v/////////SinX/0004/95fTf/dX03/2WBN/9lg 216 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2GBN/9hgTf/ZYE3/2WBN/9lgTf/ZYE3/2FE8/851Z//0/////v////7+ 217 | ///8//7//P/+////////////0ZGL/8M/L//jVUT/2mJP/9tgTP/ZYEz/2GBN/9lgTf/ZYE3/2mBN/9lg 218 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN8NlgTfDZYE3/2WBN/9lgTf/ZYE3/2mBN/9lgTP/XYU3/2GBN/9dg 219 | Tf/YX03/5GFP/9tXRP+6Qyz/0ZWI//3//////////f/+///8///7/v//+//////////4+vr/04Jw/9ZP 220 | O//YYE3/319N/9pgTP/XYU3/3l9M/91bSP/aWEX/21hF/95bSP/eX0v/2mFL/9hhTP/YYE3/2GBO/9dS 221 | Pv/XcF//8+zo///////9////+v79//7+/v/5//7/+//////////VrZ//x0Uy/91SQf/eY03/12FL/9lg 222 | Tf/aYE3/2GBN/9ZhTP/YYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTfDZYE3w2WBN/9lgTf/ZYE3/2GBO/9xg 223 | S//ZYUr/2l5P/9teTv/aYU3/3mJO/99SPf/CRTX/1qmi/////////////P78//z//f/8/fz//f/+//// 224 | ///u4d7/w2JW/9JFO//fYVP/1mFL/9xhTv/hW0n/1Eo3/81HNf/QVEL/yV9O/8leUf/SVEb/z0g2/9NI 225 | M//fWUL/3WJO/9NgUP/dY1D/1U44/79SQf/kzcX///////7+///9/v///v////3+/v/+/////////+DB 226 | vP/ATUD/1U03/95lTP/aYUr/22BL/9teT//UYU3/12FM/9pgTf/ZYE3/2WBN/9lgTf/ZYE3w2WBN8Nlg 227 | Tf/ZYE3/2WBN/9lgTf/XYE3/3F1R/+FbU//XXk//4GJO/9tLO/+4TkH/3cG6/////////////v////3/ 228 | ///9/v//9//////////my8b/wlJE/9dIM//jYU//0GNM/91iTP/WSTn/yk5C/9KBd//btq3/59nR/+nm 229 | 3//p5N//6N3W/+C7tv/ViIP/yVVK/89ENf/jXUr/3WJN/9dkUf/aTj7/xEk5/9+1rv///////f////3/ 230 | /v////3//v/9//n/////////6djS/79bTv/WRzb/3WRM/9NiS//YXlH/4F1Q/9tgTf/YYE3/2WBN/9lg 231 | Tf/ZYE3/2WBN8NlgTfDZYE3/2WBN/9lgTf/ZYE3/2F9O/95dT//XYU//2mRQ/85FM//CVkz/6tbT//// 232 | /////////f/8//v////8/f/////////////ct6z/x0c3/9xNOf/aYk//1GRN/99eSP/LQjP/ynNo/+TS 233 | zf/+///////////////+/////////////////////////+zg3v/NhXz/xkU0/99YRv/XY1P/32RP/91W 234 | Pf/AQC//15+X///////9////+f///////v/8/v3//P/////////x6eb/ymlk/85BLv/gYkj/12JN/9pf 235 | Tv/bYE3/2GBN/9lgTf/ZYE3/2WBN/9lgTfDZYE3w2WBN/9lgTf/YYE3/2WBN/9lgTv/aYUz/2WJL/9FB 236 | Mv/GamH/7+fk///////7///////+/////P/+////+v/////////boZf/xEIw/91UQf/dY0//12BQ/99c 237 | Tv/MQzf/0JKJ//r//f////////////3//////v///v////7//////////P/+//7//////////////9Gt 238 | pP/CRzj/21lE/9diTP/YZEz/3FxG/8lALf/Mi37//P78///////7///////////////5/v3//f////r4 239 | +P/Kf3b/y0At/+JbR//aYU7/2GBN/9lgTf/aYE3/2WBN/9lgTf/ZYE3w2WBN8NdhTP/ZYE7/3l9M/9ph 240 | S//SZEv/4F1G/8o9L//IfHb/+fn4///////7/f3//P/9/////v/9/v////////r//f/Oi3//zD4t/91Z 241 | Sf/WYVH/0WJM/+RiTP/ORDP/yZGJ//////////////3///3////8/////v/+//7//f////////////3/ 242 | /////////f3///z/////////3LCl/8pFM//gX0n/2mJN/9piT//fX0f/yEAo/8d2aP/19PD///////n9 243 | ///7/////P/8//79/f///////f///9KTj//CPjP/3VhE/91kTf/aYEz/12BM/9ZiS//YYUz/2WBN8Nlg 244 | TfDZX07/115R/91fTf/eZEz/3llC/8ZALv/RkYn/+//////////9/v3////+//3//v/+//////////by 245 | 7//Fd2v/x0Eu/91fRv/aYU//3F5Q/9ZjTP/XTDn/yG5e//n//P///////P////3//v////////////// 246 | //////////////////////////////3//v///////f/////////Qh33/0UYz/99iTf/XX07/2mBP/+Ff 247 | T//PRi7/wmZT/+nd3f////////////v//v/6/////f////3/////////2quk/8NENv/dUj7/2GRO/9Ng 248 | Tv/cX07/3F9N/9hgTfDaYE3w2F9P/9JgUP/ZZEz/2lM7/8ZDM//ZqaH///////z////8/fv///78//v/ 249 | /v/4/////////+3h4P+/Y1n/z0Qv/+dfS//dXk7/2GBP/9VgTv/fX0v/xkg7/+PPyv//////+/7///v/ 250 | /f/8//7////////////////////////////////////////////8//7//P/+///8////////7+zn/8pT 251 | SP/iWEb/02JM/9lfTf/VYFD/4GNQ/9ZGNv/AU0f/58/J///////9/////f7+//39+//5/f3/9/////// 252 | ///kv73/wEo+/9hKOf/fY1D/12BO/9xfTv/ZYE3w2GBN8NlgTf/lY0//1041/7tMOf/iwLf///////7/ 253 | /////v7////9//7////5/////////+LPyv+8U0j/0kg3/9llTP/eX0z/3V5O/9VfT//YYU3/2E48/892 254 | bP/9////+//////+//////3///////////////////////////////////////////////////7///v/ 255 | /f/9/v7////////////Uj4j/y0Y0/9thTP/aYEz/3WBL/9leUf/UYlX/11E5/89JOP/htq7//v////z/ 256 | ///9/fz////+//7+///8/////////+fVz//CWU3/0Ugx/+FjSv/fX03/2GBO8NhhTvDeYk7/2UI0/8ZX 257 | S//m1c3///////7////9/vz//f/+//3+/////////////9y6tP+9STn/2045/9xjTv/VYE//219N/9Nh 258 | Tv/UYE//3GFM/81DMv/dqKD///////n//////v7///////////////////////////////////////// 259 | ///////////////+//////3//f/+//3/////////4MK+/8ZKOP/jXkv/219N/9ZgTv/aYE3/2WBM/91i 260 | T//eVj7/xEIx/9ednP////////////z//f/7/v7//f3+//n/////////8unm/8dpWf/QQiz/3GFL/9tg 261 | T/DcYk/wzkc0/8plWv/z5+X///////7////////////+//3+/v///////////9Glm//AQjL/3FRA/95i 262 | T//XYE3/2mBN/9lgTf/XX07/2GBN/9tgSv/NSzf/58XA//////////////////////////////////// 263 | /////////////////////////////////////////////////////////////+/e3v/OWEb/3FpI/9xf 264 | Tf/XYE3/2WBN/9tgTf/ZX03/2mJN/+BZR//IPjH/zIiB///+/f//////+f79//z//v/+//7///////// 265 | ///79/b/y3xx/8VGMv/cX0zw0k478NiFef/9////+/////v7/v/+/f7/////////////////9/j2/8Z+ 266 | cv/COSj/2l5H/91hT//ZX07/2WBN/9lgTf/ZYE3/2l9O/9pfTf/YXkj/ylI8/+vSy/////////////// 267 | //////////////////////////////////////////////////////////////////////////////// 268 | ///y6ej/z2NP/91VRf/XYE3/12BN/9lgTf/ZYE3/2WBN/9tgTf/dYU7/5F9G/8o/KP++ZF7/8OXo//z/ 269 | //////7//v/+//v//v/6///////////////fopT/yk038NVRPvDZfHP/+Pb1///////8/f//+v7+//// 270 | //////////////j5+P/Rj4H/zj4s/95XQv/ZZFH/1WBO/9pgTf/ZYE3/2WBN/9lfTv/aX03/115I/8pS 271 | PP/q0Mn///////////////////////////////////////////////////////////////////////// 272 | ////////////////////////8ero/85jT//fVkX/12BN/9dgTf/ZYE3/2WBN/9lgTf/ZYE3/22FO/+Bd 273 | RP/KRCv/x3Vu//Lo7P/8//7////+//7//v/6//7/+v/////////5////0ZKF/85TPPDcY0/wzUk2/8NZ 274 | T//q1tf//////////////////////////////////////960rP/GSDf/2k88/+BiT//XYE3/2F9N/9pg 275 | Tf/ZX07/2GBN/9pfSv/MSjX/5cK9///////+//////////////////////////////////////////// 276 | /////////////////////////////////////////////+3c3P/NV0X/3VtJ/9xfTf/ZYE3/2WBN/9pg 277 | Tf/YYE3/22NP/9lVQ//AQjL/0p6T////////////+f37//3//v/+/////v/////////y7Or/xWli/8pD 278 | Mf/cYk/w2GFN8NhkTf/USjr/vktA/9/CvP///////v////v9+//9/////P7///v/////////5MzF/75R 279 | QP/XSTT/22NN/9ZhTv/hXk3/219O/9VgT//dYEv/z0My/9mknP///////f7+//r+/v/9/////v////// 280 | //////////////////////////////////////////7///n//f/+//7////////////kvLn/ykg2/95g 281 | S//cXVD/2F5R/9tgS//aX07/3mNP/9xSNv/BSTf/3rKu///////9/////P77//79/v/4/P7/+f////// 282 | ///o2dL/wVxO/9RDM//gYk7/2mBN8NpgTfDeX03/4WNO/91ROv+8RDP/2quo//7////3//////7///z/ 283 | ///9//7//v/////////r4Nf/wmJU/9JENP/kY0z/3GBM/9JhTv/ZX1D/3l9N/9RPPf/Jb2b/+v////// 284 | ///9/f7/+P/////+//////////////////////////////////////////////v////6//3///7+//7/ 285 | ////////1IiA/85HNf/dX03/2V9P/9dhTf/bXk//2GNQ/9VJNv/NUUL/58u//////////////f79//z/ 286 | ///9/v//+P/////////fxbz/uFE//9lMNf/hY07/2GBO/9hgTfDaYE3w3l5P/9ZfT//ZZUz/3llB/8k9 287 | Mf/RlI///v/////////7//7////9//7////4//////////bw7v/Hcmr/zEEv/+FeTP/XYFD/219O/9xf 288 | Tv/aYUv/yEI3/+XBvf//////+P7///n////+//////////////////////////////////////////// 289 | ///8//7////+//n7/v//////7uTg/8ZPQv/fW0f/2V9O/9lfTv/YX03/5F5P/9NGLP+9YFT/7t3e//// 290 | ///7//////3+//z+/P/5/v//+P/////////draf/xEM1/+BQPv/aZFD/1V9P/99eT//YYE3w2WBN8Nlf 291 | Tv/aXVL/12BN/9pjS//mXEf/xz4t/8mAdf/4+Pj///////z////+//////////7////7////+v38/8eJ 292 | f//FPzH/5VlI/9phT//ZXlD/3WFM/9xOPP/LZFb/9vj2//3////+//////////////////////////// 293 | ///////////////////////////+///////7/////////8d8cf/SSTL/3GRM/9ZfUP/eX1D/4l5L/8hC 294 | K//JdGX/8+7t/////////////v/+//7+/f///f7///////7////TmI7/xEAw/+FVRP/dYVD/0WBQ/9df 295 | UP/cX07/2WBN8NlgTfDUYkz/2V9O/9tgTP/YYUv/12NL/+FhSP/PPy//xW1i//Ht5P//////+P////3/ 296 | /f/+//7/+f3///3/////////1Z6T/8tBL//bV0L/1mNR/9xfTf/hY03/ykkv/8uCeP////////////79 297 | /v////7////+//7//v/8//7////////////+//////7///39/////////////9aelP/GRDP/5GBK/9dg 298 | Sv/SY0//4lpG/8lBK//Jhnr/+fz9///////+//v//f/9///+/f/9/f///v////n6+P/Of3j/yzwy/91b 299 | R//UZE3/1WFN/91fTf/bYEz/12FM/9lgTfDZYE3w2WBN/9lgTf/ZYE3/2WBO/9dhTP/aYUz/3mFO/9pE 300 | M//CYEz/6NjU///////4/////f///////v/8/////f////7////es6b/xUg3/+FPPv/aY07/0WJO/99g 301 | TP/NRjL/z4N2//T18////////v////r///////z/+//8//v//////////f///////////////P/+/9Oa 302 | kv/FRjL/4VtG/9lgTv/fY07/4FZC/8NBLv/TnJD////////////8/////v/+//7//f/2//////////Hr 303 | 6f/JbWH/zUIs/+JfS//dX0//12BN/9pgTf/ZYE3/2WBN/9lgTf/ZYE3w2WBN8NlgTf/ZYE3/2WBN/9lg 304 | Tf/XYE3/3l9M/9hgTf/gYlH/2Ew6/8RSP//lw77////////////8//3/+/////76/v/7/////////+fK 305 | w//GUkL/0ko1/9djT//WYE7/4GJK/85FMP/JaFj/47+8//b8/f////////////////////////////// 306 | ///8////4M3L/8p0Z//PQzD/4V5G/99gTv/ZY1D/01E6/8NGNv/ctar///////7////8/f7//v/+//z+ 307 | /v/+/////////+za1f/CXVL/0EYy/9dlSf/bYEz/315P/9hgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN8Nlg 308 | TfDZYE3/2WBN/9lgTf/ZYE3/1mBO/9xeT//hXk3/2GBM/91kTf/eUz7/w0Y7/9awpf////////////z/ 309 | ///7/////f7///v/////////6d/X/8xdVv/RQjT/2GNN/9tfT//aYlD/1lA6/85INP/OdGL/26WY/+XF 310 | v//q19L/69bP/+TJwf/draP/1Hhy/8tKQP/WSTn/32JK/9djTP/gYk3/1Ek3/71QRv/iycP///////3/ 311 | /////P/////+//v//v/2/////////+HHvv+/T0D/2Uk5/+BiUP/YYU3/3F1R/9VfUP/XYE3/2mBN/9lg 312 | Tf/ZYE3/2WBN/9lgTfDZYE3w2WBN/9lgTf/ZYE3/2GBM/9xeT//ZXlD/2V9O/9pgS//ZYUz/2mFR/99W 313 | RP/HQi3/z5iK////////////+v/8//3//P/5//7/+v3////////37+7/x3Jl/8dHOv/lX0//3GBM/9Zg 314 | UP/eXU3/1FA8/8pGM//PTDn/y1VE/8hSRv/PTT7/zEYy/9ZMNf/hXkj/2GFQ/9ldUv/eYVL/zk41/8Fh 315 | TP/s3Nr///////n9///7/v7///7///j+/f/+/////////9uuqP/CRzX/3FI7/+RhT//bX07/3l5O/9hf 316 | UP/XYUv/2mBM/9lgTf/ZYE3/2WBN/9lgTf/ZYE3w2WBN8NlgTf/ZYE3/2WBN/9lgTf/aYE3/2WBN/9dg 317 | Tf/XYE3/2GBN/9hfTv/bYU3/4FxI/8pALP/OgHj/+fr9///////6//n/+v79//7+///+/f///f////// 318 | ///Zi3n/1E42/9lfTv/ZX0//12BO/9lfTv/dX03/3l5L/9tcSP/bW0n/311M/9xfTP/WYUz/1mFM/9dg 319 | Tf/aX0//2VA9/9J2Zf/1/PX///////3////7/vz//v/+//3//v///////////82ZiP/MQS3/4FZE/9hj 320 | Tv/ZYE7/2GBN/9hgTf/YYE3/2mBM/9pgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN8NlgTfDZYE3/2WBN/9lg 321 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9hhTv/eYEv/zUEv/8RrZP/06uz////////+ 322 | /////v///v/8//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/9lg 359 | Tf/ZYE3/2WBN8NlgTfDZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 360 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2mBN/9VeSv/TTkD/2ZaR//////////////79//z+///6/////////+3j 361 | 3v/Yn5f/0G9n/81ZTv/FU0P/v1M+/8pZSf/Qa2H/2JaL/+vX0v/9////+/////r+/f/2/fn/+v7///// 362 | ///eqKP/ylFA/9leSf/aYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 363 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTfDZYE3w2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 364 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9hgTf/fXEn/yEo7/+TPyP//////9v/+//j/ 365 | /P////3/+//+//z///////////////T+/f/o49//5tPP/+XRzf/o393/9vn6/////////////v////z+ 366 | ///6/////f38///8////////8Off/8tWQ//bWkb/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 367 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3w2WBN8NlgTf/ZYE3/2WBN/9lg 368 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/YYE3/3l9P/9lZ 369 | Rv/CVUD/3Lmy///////+/////v7+///+/v/8/////f////7////8/////f////////////////////// 370 | ///8////+/7///7+///7//7/+v//////////////6dDL/8dcT//XVEX/22BN/9lgTf/ZYE3/2WBN/9lg 371 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN8Nlg 372 | TfDZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 373 | Tf/ZYE3/2mBN/9ZhTP/ZZk3/21M+/8VCNf/Sn5H//f/////////3////+/7+//3+///9//3////8///+ 374 | +/////3/+/////3///////7////9//v//v/9/////f/////////+////17Kp/8ZLO//dTDr/3GFS/9dg 375 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 376 | Tf/ZYE3/2WBN/9lgTfDZYE3w2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 377 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/YYEz/2WFL/9piUP/lV0v/zT80/8lxZv/lzsX/+f////// 378 | ///////////////////////////////+///+/////P////z////////////////////s2tn/y4F7/8VD 379 | Mf/iVD3/3WRM/9dgTv/ZYE7/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 380 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3w2WBN8NlgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 381 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/aYE3/1mBN/9lgTf/dX0//1WBR/9xf 382 | Uf/QTDL/xk02/9aCeP/hxb//8PTz////////////////////////////////////////////9vv6/+XM 383 | x//RkYb/x1JD/9NFNP/fXkr/1mNN/9RhTv/cXlD/2l9N/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lg 384 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgTf/ZYE3/2WBN8NlgTfDZYE3/2WBN/9lg 385 | Tf/ZYE3/2WBN/9lgTf/ZYE3/2WBN/9lgT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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 410 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 411 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 412 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 413 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 414 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= 415 | 416 | 417 | -------------------------------------------------------------------------------- /debrick/Form.cs: -------------------------------------------------------------------------------- 1 | using System.IO.Ports; 2 | using System.Net.Sockets; 3 | using System.Net; 4 | using System.Text; 5 | using System.Diagnostics; 6 | 7 | 8 | namespace debrick 9 | { 10 | public partial class Form : System.Windows.Forms.Form 11 | { 12 | readonly ushort[] crctable = [ 13 | 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 14 | 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 15 | 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 16 | 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 17 | 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 18 | 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 19 | 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 20 | 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 21 | 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 22 | 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 23 | 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 24 | 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 25 | 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 26 | 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 27 | 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 28 | 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 29 | 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 30 | 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 31 | 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 32 | 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 33 | 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 34 | 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 35 | 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 36 | 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 37 | 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 38 | 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 39 | 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 40 | 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 41 | 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 42 | 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 43 | 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 44 | 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, 45 | ]; 46 | readonly byte[] ddrstep = [ 47 | 0x04,0xe0,0x2d,0xe5,0x24,0x00,0x9f,0xe5, 48 | 0x24,0x10,0x9f,0xe5,0x00,0x10,0x80,0xe5, 49 | 0x20,0x00,0x9f,0xe5,0x20,0x10,0x9f,0xe5, 50 | 0x04,0x10,0x80,0xe4,0x00,0xe0,0x80,0xe5, 51 | 0x04,0xf0,0x9d,0xe4,0xef,0xbe,0xad,0xde, 52 | 0xef,0xbe,0xad,0xde,0xef,0xbe,0xad,0xde, 53 | 0x3c,0x01,0x02,0x12,0x78,0x56,0x34,0x12, 54 | 0x40,0x01,0x02,0x12,0x75,0x6a,0x69,0x7a 55 | ]; 56 | 57 | enum OPCODE : byte 58 | { 59 | OC_RRQ = 1, 60 | OC_WRQ, 61 | OC_DATA, 62 | OC_ACK, 63 | OC_ERROR, 64 | OC_OPTION 65 | 66 | }; 67 | 68 | struct FLASH_FILE 69 | { 70 | public string name; 71 | public int loadA; 72 | public int sizeE; 73 | public byte[] data; 74 | } 75 | 76 | readonly List files = []; 77 | byte[] tBuf = new byte[1]; 78 | int tBuf_len = 0; 79 | const int TFTP_PAYLOAD_SIZE = 1468; 80 | Socket? socket = null; 81 | EndPoint clientEP = new IPEndPoint(IPAddress.Any, 0); 82 | string cmd = ""; 83 | SerialPort serialPort = new(); 84 | bool run; 85 | string flashInfo = ""; 86 | int flashSize = 0; 87 | int fi = 0; 88 | int stage = 0; 89 | Thread? threadBootLoad = null; 90 | Thread? threadServerTFTP = null; 91 | Thread? threadSendCmd = null; 92 | const int SP_MAX_DATA_LEN = 0x400; 93 | const int SP_BOOT_SPL_LEN = SP_MAX_DATA_LEN * 0x10; 94 | const int TIMEOUT = 3; 95 | readonly string dirApp; 96 | byte[]? ubootFile = null; 97 | string serverIP = "192.168.1.2"; 98 | string cameraIP = "192.168.1.123"; 99 | 100 | public Form() 101 | { 102 | InitializeComponent(); 103 | dirApp = Path.GetDirectoryName(Application.ExecutablePath) ?? ""; 104 | button0.Text = "Yes"; 105 | button0.Left = this.Width / 2 - button0.Width / 2; 106 | button0.Visible = true; 107 | Refresh(); 108 | } 109 | 110 | private void ThreadServerTFTP() 111 | { 112 | if (socket == null) return; 113 | int n; 114 | byte[] dRx = new byte[4096]; 115 | while (run) 116 | { 117 | n = 0; 118 | try 119 | { 120 | n = socket.ReceiveFrom(dRx, ref clientEP); 121 | } 122 | catch { } 123 | if (n < 4) 124 | { 125 | continue; 126 | } 127 | if (dRx[1] == (byte)OPCODE.OC_RRQ || dRx[1] == (byte)OPCODE.OC_WRQ) 128 | { 129 | bool isSend = dRx[1] == (byte)OPCODE.OC_RRQ; 130 | int i = 2; 131 | while (i < n && dRx[i] != 0) i++; 132 | i++; 133 | while (i < n && dRx[i] != 0) i++; 134 | i++; 135 | int l = n - i; 136 | byte[] dTx = new byte[2 + l]; 137 | dTx[0] = dRx[0]; 138 | dTx[1] = (byte)OPCODE.OC_OPTION; 139 | System.Array.Copy(dRx, i, dTx, 2, l); 140 | n = 0; 141 | try 142 | { 143 | n = socket.SendTo(dTx, clientEP); 144 | } 145 | catch { } 146 | if (n != 0) 147 | { 148 | if (isSend) 149 | { 150 | SendBuf(); 151 | } 152 | else 153 | { 154 | ReceiveBuf(); 155 | } 156 | } 157 | } 158 | } 159 | } 160 | 161 | private void ReceiveBuf() 162 | { 163 | if (socket == null) return; 164 | bool end = false; 165 | ushort bE = 1; 166 | int n; 167 | byte[] dRx = new byte[4096]; 168 | while (!end) 169 | { 170 | n = 0; 171 | try 172 | { 173 | n = socket.ReceiveFrom(dRx, ref clientEP); 174 | } 175 | catch { } 176 | if (n < 4 || dRx[1] != (byte)OPCODE.OC_DATA) 177 | { 178 | return; 179 | } 180 | ushort bN = (ushort)((dRx[2] << 8) | (dRx[3] & 0xff)); 181 | if (bE == bN) 182 | { 183 | int payloadLen = n - 4; 184 | Array.Copy(dRx, 4, tBuf, tBuf_len, payloadLen); 185 | tBuf_len += payloadLen; 186 | if (payloadLen < TFTP_PAYLOAD_SIZE) end = true; 187 | } 188 | else if (bE < bN) 189 | { 190 | return; 191 | } 192 | bE = (ushort)(bN + 1); 193 | byte[] dTx = new byte[4]; 194 | Array.Copy(dRx, 0, dTx, 0, 4); 195 | dTx[1] = (byte)OPCODE.OC_ACK; 196 | n = 0; 197 | try 198 | { 199 | n = socket.SendTo(dTx, clientEP); 200 | } 201 | catch { } 202 | if (n == 0) return; 203 | } 204 | } 205 | 206 | private void SendBuf() 207 | { 208 | if (socket == null) return; 209 | bool end = false; 210 | int n; 211 | byte[] dRx = new byte[4096]; 212 | while (!end) 213 | { 214 | try 215 | { 216 | n = socket.ReceiveFrom(dRx, ref clientEP); 217 | } 218 | catch 219 | { 220 | return; 221 | } 222 | if (n < 4 || dRx[1] != (byte)OPCODE.OC_ACK) 223 | { 224 | return; 225 | } 226 | ushort bN = (ushort)((dRx[2] << 8) | (dRx[3] & 0xff)); 227 | int i = bN * TFTP_PAYLOAD_SIZE; 228 | bN += 1; 229 | int payloadLen = 0; 230 | if (i < tBuf.Length) 231 | { 232 | payloadLen = tBuf.Length - i; 233 | if (payloadLen > TFTP_PAYLOAD_SIZE) 234 | { 235 | payloadLen = TFTP_PAYLOAD_SIZE; 236 | } 237 | } 238 | byte[] dTx = new byte[4 + payloadLen]; 239 | dTx[0] = dRx[0]; 240 | dTx[1] = (byte)OPCODE.OC_DATA; 241 | dTx[2] = (byte)(bN >> 8); 242 | dTx[3] = (byte)(bN); 243 | if (payloadLen != 0) 244 | { 245 | System.Array.Copy(tBuf, i, dTx, 4, payloadLen); 246 | } 247 | else 248 | { 249 | end = true; 250 | } 251 | n = 0; 252 | try 253 | { 254 | n = socket.SendTo(dTx, clientEP); 255 | } 256 | catch { } 257 | if (n == 0) return; 258 | } 259 | } 260 | 261 | private void FileGet() 262 | { 263 | tBuf = new byte[flashSize]; 264 | tBuf_len = 0; 265 | cmd = "mw.b 0x42000000 0xff 0x" + flashSize.ToString("x") + 266 | "; sf probe 0; sf read 0x42000000 0x0 0x" + flashSize.ToString("x") + 267 | "; tftpput 0x42000000 0x" + flashSize.ToString("x") + " file\n"; 268 | } 269 | 270 | private void FilePut() 271 | { 272 | tBuf = files[fi].data; 273 | cmd = "mw.b 0x42000000 0xff 0x" + flashSize.ToString("x") + 274 | "; tftp 0x42000000 file \n"; 275 | } 276 | 277 | private void ShowSelectAction() 278 | { 279 | label.Text = "Note! Before \"burn\" make sure\nyou have \"dump\" flash.\n\nAll files (*.bin,*.img) must be located\nin the directory with the executable file.\n\nSelect action:\n\n"; 280 | textBoxIP.Visible = false; 281 | checkedListBox.Visible = false; 282 | progressBar.Visible = false; 283 | button2.Text = "Dump"; 284 | button2.Left = this.Width / 2 - (button0.Width + button1.Width + button2.Width) / 2; 285 | button1.Text = "Burn bin"; 286 | button1.Left = button2.Left + button2.Width; 287 | button0.Text = "Burn img"; 288 | button0.Left = button1.Left + button1.Width; 289 | button0.Enabled = true; 290 | button2.Visible = true; 291 | button1.Visible = true; 292 | button0.Visible = true; 293 | Refresh(); 294 | } 295 | 296 | private void ShowSelectPort() 297 | { 298 | progressBar.Visible = false; 299 | RefreshComList(); 300 | checkedListBox.Visible = true; 301 | label.Text = "Select COM Port:"; 302 | button2.Visible = false; 303 | button1.Text = "Refresh"; 304 | button1.Left = this.Width / 2 - button1.Width; 305 | button1.Visible = true; 306 | button0.Text = "Listen"; 307 | button0.Left = button1.Left + button1.Width; 308 | button0.Visible = true; 309 | Refresh(); 310 | } 311 | 312 | private void ShowSelectSoc() 313 | { 314 | progressBar.Visible = false; 315 | checkedListBox.Items.Clear(); 316 | checkedListBox.Items.Add("gk7205v200/210"); 317 | checkedListBox.Items.Add("gk7205v300"); 318 | checkedListBox.SetItemChecked(0, true); 319 | checkedListBox.Visible = true; 320 | label.Text = "Select SoC:"; 321 | button0.Text = "OK"; 322 | button0.Left = this.Width / 2 - button0.Width / 2; ; 323 | button0.Enabled = true; 324 | button0.Visible = true; 325 | Refresh(); 326 | } 327 | 328 | private void Button_Click(object sender, EventArgs e) 329 | { 330 | Button btn = (Button)sender; 331 | if (btn.Text == "Yes") 332 | { 333 | ShowSelectSoc(); 334 | } 335 | else if (btn.Text == "Refresh") 336 | { 337 | if (label.Text.Contains("Port")) 338 | { 339 | RefreshComList(); 340 | } 341 | else 342 | { 343 | RefreshFilesList(); 344 | } 345 | } 346 | else if (btn.Text == "Cancel") 347 | { 348 | if (label.Text.StartsWith("Listening")) 349 | { 350 | run = false; 351 | threadBootLoad?.Join(); 352 | serialPort?.Close(); 353 | ShowSelectPort(); 354 | } 355 | else 356 | { 357 | ShowSelectAction(); 358 | } 359 | } 360 | else if (btn.Text == "Start") 361 | { 362 | cameraIP = textBoxIP.Text; 363 | textBoxIP.Visible = false; 364 | button0.Visible = false; 365 | socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 366 | try 367 | { 368 | socket.Bind(new IPEndPoint(IPAddress.Parse(serverIP), 69)); 369 | socket.ReceiveTimeout = 3000; 370 | threadServerTFTP = new Thread(ThreadServerTFTP); 371 | threadServerTFTP.Start(); 372 | threadSendCmd?.Join(); 373 | cmd = "setenv ipaddr " + cameraIP + "; setenv serverip " + serverIP + ";\n"; 374 | threadSendCmd = new Thread(ThreadSendCmd); 375 | threadSendCmd.Start(); 376 | ShowSelectAction(); 377 | } 378 | catch 379 | { 380 | ShowFinish("Fail server start!\nThe port busy. Try again"); 381 | } 382 | } 383 | else if (btn.Text == "Dump") 384 | { 385 | button0.Visible = false; 386 | button1.Visible = false; 387 | button2.Visible = false; 388 | threadSendCmd?.Join(); 389 | FileGet(); 390 | SetStage(1); 391 | threadSendCmd = new Thread(ThreadSendCmd); 392 | threadSendCmd.Start(); 393 | } 394 | else if (btn.Text == "OK") 395 | { 396 | if (label.Text.StartsWith("Dump") || label.Text.StartsWith("Burn")) 397 | { 398 | ShowSelectAction(); 399 | } 400 | else if (label.Text.StartsWith("Fail")) 401 | { 402 | if (label.Text.Contains("server")) 403 | { 404 | ShowServerStart(); 405 | } 406 | else if (label.Text.Contains("serial port")) 407 | { 408 | ShowSelectPort(); 409 | } 410 | else 411 | { 412 | ShowSelectSoc(); 413 | } 414 | } 415 | else 416 | { 417 | if (label.Text.Contains("SoC")) 418 | { 419 | string? soc = checkedListBox.CheckedItems[0]?.ToString(); 420 | if (soc == null || soc.Contains("v2")) 421 | { 422 | ubootFile = Properties.Resources.gk7205v2; 423 | } 424 | else 425 | { 426 | ubootFile = Properties.Resources.gk7205v3; 427 | } 428 | } 429 | ShowSelectPort(); 430 | } 431 | } 432 | else if (btn.Text == "Listen") 433 | { 434 | if (ubootFile == null) return; 435 | button1.Visible = false; 436 | checkedListBox.Visible = false; 437 | label.Text = "Listening on a port " + checkedListBox.CheckedItems[0]?.ToString(); 438 | label.Text += "\nTurn off->on the camera power"; 439 | button0.Text = "Cancel"; 440 | button0.Left = this.Width / 2 - button0.Width / 2; ; 441 | progressBar.Value = 0; 442 | progressBar.Maximum = SP_BOOT_SPL_LEN / SP_MAX_DATA_LEN + (ubootFile.Length + SP_MAX_DATA_LEN + 1) / SP_MAX_DATA_LEN + 1; 443 | progressBar.Style = ProgressBarStyle.Marquee; 444 | progressBar.Visible = true; 445 | Refresh(); 446 | try 447 | { 448 | serialPort = new SerialPort(checkedListBox.CheckedItems[0]?.ToString(), 115200, Parity.None, 8, StopBits.One); 449 | serialPort.Open(); 450 | run = true; 451 | threadBootLoad = new Thread(ThreadBootLoad); 452 | threadBootLoad.Start(); 453 | } 454 | catch 455 | { 456 | ShowFinish("Fail serial port! Unable to open a port.\nReset the equipment and try again"); 457 | } 458 | } 459 | else if (btn.Text.StartsWith("Burn ")) 460 | { 461 | if (btn.Text.Contains("bin")) 462 | { 463 | label.Text = "Select file bin:"; 464 | } 465 | else 466 | { 467 | label.Text = "Select files img:"; 468 | } 469 | RefreshFilesList(); 470 | checkedListBox.Visible = true; 471 | button2.Text = "Cancel"; 472 | button2.Left = this.Width / 2 - (button0.Width + button1.Width + button2.Width) / 2; ; 473 | button2.Visible = true; 474 | button1.Text = "Refresh"; 475 | button1.Left = button2.Left + button2.Width; 476 | button1.Visible = true; 477 | button0.Text = "Burn"; 478 | button0.Left = button1.Left + button1.Width; 479 | button0.Enabled = false; 480 | button0.Visible = true; 481 | Refresh(); 482 | } 483 | else if (btn.Text == "Burn") 484 | { 485 | files.Clear(); 486 | List checkedItems = []; 487 | foreach (var item in checkedListBox.CheckedItems) 488 | { 489 | string? filename = item.ToString(); 490 | if (filename == null) return; 491 | FLASH_FILE bf; 492 | bf.name = filename; 493 | byte[] data = File.ReadAllBytes(filename); 494 | if (label.Text.Contains("bin")) 495 | { 496 | bf.data = data; 497 | bf.loadA = 0; 498 | bf.sizeE = flashSize; 499 | files.Add(bf); 500 | break; 501 | } 502 | else 503 | { 504 | bf.data = new byte[data.Length - 0x40]; 505 | Array.Copy(data, 0x40, bf.data, 0, bf.data.Length); 506 | bf.loadA = Htonl(data, 0x10); 507 | bf.sizeE = Htonl(data, 0x14) - bf.loadA; 508 | files.Add(bf); 509 | } 510 | } 511 | if (files.Count > 0) 512 | { 513 | checkedListBox.Visible = false; 514 | button0.Visible = false; 515 | button1.Visible = false; 516 | button2.Visible = false; 517 | threadSendCmd?.Join(); 518 | fi = 0; 519 | FilePut(); 520 | SetStage(3); 521 | threadSendCmd = new Thread(ThreadSendCmd); 522 | threadSendCmd.Start(); 523 | } 524 | } 525 | } 526 | 527 | private static int Htonl(byte[] d, int o) => (d[o + 0] << (8 * 3)) | (d[o + 1] << (8 * 2)) | (d[o + 2] << (8 * 1)) | (d[o + 3]); 528 | 529 | private void RefreshComList() 530 | { 531 | checkedListBox.Items.Clear(); 532 | string[] ports = SerialPort.GetPortNames(); 533 | for (int i = 0; i < ports.Length; i++) 534 | { 535 | checkedListBox.Items.Add(ports[i]); 536 | } 537 | if (checkedListBox.Items.Count > 0) 538 | { 539 | checkedListBox.SetItemChecked(checkedListBox.Items.Count - 1, true); 540 | button0.Enabled = true; 541 | } 542 | else 543 | { 544 | button0.Enabled = false; 545 | } 546 | } 547 | 548 | private void RefreshFilesList() 549 | { 550 | checkedListBox.Items.Clear(); 551 | string ex = "*.img"; 552 | if (label.Text.Contains("bin")) 553 | { 554 | ex = "*.bin"; 555 | } 556 | string[] files = Directory.GetFiles(dirApp, ex); 557 | for (int i = 0; i < files.Length; i++) 558 | { 559 | FileInfo fileInf = new(files[i]); 560 | if (fileInf.Length <= flashSize) 561 | { 562 | string name = fileInf.Name; 563 | checkedListBox.Items.Add(name); 564 | } 565 | } 566 | button0.Enabled = false; 567 | } 568 | 569 | private void CheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e) 570 | { 571 | if (!label.Text.Contains("files")) 572 | { 573 | for (int i = 0; i < checkedListBox.Items.Count; ++i) 574 | { 575 | if (i != e.Index) checkedListBox.SetItemChecked(i, false); 576 | } 577 | } 578 | List checkedItems = []; 579 | string? str; 580 | foreach (var item in checkedListBox.CheckedItems) 581 | { 582 | str = item.ToString(); 583 | checkedItems.Add(str ?? ""); 584 | } 585 | str = checkedListBox.Items[e.Index].ToString(); 586 | if (e.NewValue == CheckState.Checked) 587 | checkedItems.Add(str ?? ""); 588 | else 589 | checkedItems.Remove(str ?? ""); 590 | 591 | if (checkedItems.Count > 0) 592 | { 593 | button0.Enabled = true; 594 | } 595 | else 596 | { 597 | button0.Enabled = false; 598 | } 599 | } 600 | 601 | private void ThreadBootLoad() 602 | { 603 | int cnt = 0; 604 | byte[] b = new byte[1]; 605 | serialPort.ReadTimeout = 500; 606 | while (run && cnt < 5) 607 | { 608 | if (Read(b)) 609 | { 610 | if (b[0] == 0x20) cnt++; else cnt = 0; 611 | } 612 | } 613 | if (!run) return; 614 | try 615 | { 616 | Invoke(ShowLoading); 617 | Invoke(ProgressStage, -1); 618 | } 619 | catch { return; } 620 | b[0] = 0xaa; 621 | if (!Write(b, 1)) goto FAIL; 622 | if (!Send_ddrstep()) goto FAIL; 623 | if (!Send_SPL()) goto FAIL; 624 | Thread.Sleep(100); 625 | if (!Send_uboot()) goto FAIL; 626 | b[0] = 0x03; 627 | for (int i = 0; i < 10; i++) 628 | { 629 | Write(b, 1); 630 | } 631 | Thread.Sleep(1000); 632 | b[0] = 0x0A; 633 | Write(b, 1); 634 | flashInfo = ""; 635 | flashSize = 0; 636 | int n = serialPort.BytesToRead; 637 | if (n > 0) 638 | { 639 | b = new byte[n]; 640 | serialPort.Read(b, 0, b.Length); 641 | string info = Encoding.ASCII.GetString(b); 642 | string find = "Flash Name: "; 643 | int iS = info.IndexOf(find); 644 | if (iS != -1) 645 | { 646 | iS += find.Length; 647 | info = info[iS..]; 648 | char[] chars = info.ToCharArray(); 649 | iS = 0; 650 | int iC = 0; 651 | while (chars[iC] != '{') iC++; 652 | string name = new(chars, iS, iC - iS); 653 | while (chars[iC] != ',') iC++; 654 | while (chars[iC] != '0') iC++; 655 | iS = iC; 656 | while (chars[iC] != '.') iC++; 657 | string size = new(chars, iS, iC - iS); 658 | flashSize = Convert.ToInt32(size, 16); 659 | flashInfo = "Flash:" + name + "(" + flashSize / 0x100000 + "MB)"; 660 | } 661 | } 662 | if (flashInfo == "" || flashSize == 0) 663 | { 664 | run = false; 665 | serialPort?.Close(); 666 | try 667 | { 668 | Invoke(ShowFinish, "Fail SoC!\nMaybe the wrong choice.\nTry again"); 669 | } 670 | catch { return; } 671 | } 672 | else 673 | { 674 | serverIP = GetLocalIPAddress(); 675 | try 676 | { 677 | Invoke(ShowServerStart); 678 | } 679 | catch { return; } 680 | } 681 | return; 682 | FAIL: 683 | run = false; 684 | serialPort?.Close(); 685 | try 686 | { 687 | Invoke(ShowFinish, "Fail serial port!\nSomething went wrong.\nCheck wiring connections,\nreset the equipment and try again"); 688 | } 689 | catch { return; } 690 | return; 691 | } 692 | 693 | private void ProgressStage(int progress) 694 | { 695 | progressBar.Style = ProgressBarStyle.Blocks; 696 | if (progress < 0) progress = progressBar.Value + 1; 697 | progressBar.Value = progress <= progressBar.Maximum ? progress : progressBar.Maximum; 698 | Refresh(); 699 | } 700 | 701 | private void ShowFinish(string txt) 702 | { 703 | stage = 0; 704 | label.Text = txt; 705 | progressBar.Visible = false; 706 | button0.Text = "OK"; 707 | button0.Left = this.Width / 2 - button0.Width / 2; ; 708 | button0.Visible = true; 709 | Refresh(); 710 | 711 | } 712 | 713 | private void ShowServerStart() 714 | { 715 | label.Text = flashInfo + "\nTFTP server IP:" + serverIP + "\nTFTP client(camera) IP:"; 716 | progressBar.Visible = false; 717 | textBoxIP.Visible = true; 718 | button0.Text = "Start"; 719 | button0.Visible = true; 720 | Refresh(); 721 | } 722 | 723 | private static string GetLocalIPAddress() 724 | { 725 | using Socket socket = new(AddressFamily.InterNetwork, SocketType.Dgram, 0); 726 | socket.Connect("8.8.8.8", 0); 727 | return socket.LocalEndPoint is IPEndPoint endPoint ? endPoint.Address.ToString() : ""; 728 | } 729 | 730 | private void ThreadSendCmd() 731 | { 732 | if (serialPort.IsOpen == false) return; 733 | serialPort.ReadTimeout = 8000; 734 | while (run && cmd.Length != 0) 735 | { 736 | Write(Encoding.ASCII.GetBytes(cmd), cmd.Length); 737 | cmd = ""; 738 | byte[] b = new byte[1]; 739 | string line = ""; 740 | int cT = TIMEOUT; 741 | bool sl = false; 742 | bool tR = false; 743 | bool tS = false; 744 | line = ""; 745 | while (run) 746 | { 747 | if (Read(b)) 748 | { 749 | line += Encoding.ASCII.GetString(b); 750 | if (line.Contains("goke #")) 751 | { 752 | break; 753 | } 754 | else if (b[0] == '\r') 755 | { 756 | if (line.Contains("Erasing") || line.Contains("Writing")) 757 | { 758 | int progress = int.Parse(line.Substring(line.IndexOf('%') - 3, 3)); ; 759 | if (line.StartsWith("Writing")) progress += 100; 760 | try 761 | { 762 | Invoke(ProgressStage, progress); 763 | } 764 | catch { return; } 765 | } 766 | line = ""; 767 | } 768 | else if (sl) 769 | { 770 | if (b[0] == '#' || b[0] == 'T') 771 | { 772 | if (b[0] == '#') 773 | { 774 | cT = TIMEOUT; 775 | try 776 | { 777 | Invoke(ProgressStage, -1); 778 | } 779 | catch { return; } 780 | } 781 | else if (--cT == 0) 782 | { 783 | tS = true; 784 | break; 785 | } 786 | line = ""; 787 | } 788 | } 789 | else if (line.Contains("Saving:") || line.Contains("Loading:")) 790 | { 791 | sl = true; 792 | line = ""; 793 | } 794 | } 795 | else 796 | { 797 | tR = true; 798 | break; 799 | } 800 | } 801 | if (run && stage != 0) 802 | { 803 | if (tR) 804 | { 805 | run = false; 806 | serialPort?.Close(); 807 | try 808 | { 809 | Invoke(ShowFinish, "Fail serial port!\nSomething went wrong.\nCheck wiring connections,\nreset the equipment and try again"); 810 | } 811 | catch { return; } 812 | return; 813 | } 814 | else if (tS) 815 | { 816 | string txt = "Dump. Fail!"; 817 | if (stage > 2) 818 | { 819 | txt = "Burn. Fail!"; 820 | } 821 | txt += "\nServer response timed out.\nTry again"; 822 | try 823 | { 824 | Invoke(ShowFinish, txt); 825 | } 826 | catch { return; } 827 | files.Clear(); 828 | cmd = "\x03"; 829 | } 830 | else 831 | { 832 | Thread.Sleep(1000); 833 | FLASH_FILE ff; 834 | switch (stage) 835 | { 836 | case 1: 837 | if (tBuf_len == flashSize) 838 | { 839 | ff.name = ""; 840 | ff.loadA = 0; 841 | ff.sizeE = tBuf_len; 842 | ff.data = new byte[tBuf_len]; 843 | Array.Copy(tBuf, ff.data, tBuf_len); 844 | files.Add(ff); 845 | FileGet(); 846 | try 847 | { 848 | Invoke(SetStage, 2); 849 | } 850 | catch { return; } 851 | } 852 | else { 853 | try 854 | { 855 | Invoke(ShowFinish, "Dump. Fail!\nSomething went wrong\nTry again"); 856 | } 857 | catch { return; } 858 | } 859 | break; 860 | case 2: 861 | if (tBuf_len == flashSize) 862 | { 863 | ff.name = ""; 864 | ff.loadA = 0; 865 | ff.sizeE = tBuf_len; 866 | ff.data = new byte[tBuf_len]; 867 | Array.Copy(tBuf, ff.data, tBuf_len); 868 | files.Add(ff); 869 | if (VerifyFiles() == true) 870 | { 871 | string filename = "dump_" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".bin"; 872 | File.WriteAllBytes(filename, files[0].data); 873 | try 874 | { 875 | Invoke(ShowFinish, "Dump. Success!\nSaved file:\n" + filename); 876 | } 877 | catch { return; } 878 | } 879 | else 880 | { 881 | try 882 | { 883 | Invoke(ShowFinish, "Dump. Fail!\nVerification error\nTry again"); 884 | } 885 | catch { return; } 886 | } 887 | } 888 | else { 889 | try 890 | { 891 | Invoke(ShowFinish, "Dump. Fail!\nSomething went wrong\nTry again"); 892 | } 893 | catch { return; } 894 | } 895 | files.Clear(); 896 | break; 897 | case 3: 898 | cmd = "sf probe 0; sf lock 0; sf erase 0x" + files[fi].loadA.ToString("x") + " 0x" + files[fi].sizeE.ToString("x") + 899 | "; sf write 0x42000000 0x" + files[fi].loadA.ToString("x") + " 0x" + files[fi].sizeE.ToString("x") + ";\n"; 900 | try 901 | { 902 | Invoke(SetStage, 4); 903 | } 904 | catch { return; } 905 | break; 906 | case 4: 907 | fi++; 908 | if (fi < files.Count) 909 | { 910 | FilePut(); 911 | try 912 | { 913 | Invoke(SetStage, 3); 914 | } 915 | catch { return; } 916 | } 917 | else 918 | { 919 | FileGet(); 920 | try 921 | { 922 | Invoke(SetStage, 5); 923 | } 924 | catch { return; } 925 | } 926 | break; 927 | case 5: 928 | if (tBuf_len == flashSize) 929 | { 930 | ff.name = ""; 931 | ff.loadA = 0; 932 | ff.sizeE = tBuf_len; 933 | ff.data = new byte[tBuf_len]; 934 | Array.Copy(tBuf, ff.data, tBuf_len); 935 | files.Add(ff); 936 | if (VerifyFiles() == true) 937 | { 938 | try 939 | { 940 | Invoke(ShowFinish, "Burn. Success!"); 941 | } 942 | catch { return; } 943 | } 944 | else 945 | { 946 | try 947 | { 948 | Invoke(ShowFinish, "Burn. Fail!\nVerification error\nTry again"); 949 | } 950 | catch { return; } 951 | } 952 | } 953 | else 954 | { 955 | try 956 | { 957 | Invoke(ShowFinish, "Burn. Fail!\nSomething went wrong\nTry again"); 958 | } 959 | catch { return; } 960 | } 961 | files.Clear(); 962 | break; 963 | } 964 | } 965 | } 966 | } 967 | } 968 | 969 | private bool VerifyFiles() 970 | { 971 | if (files.Count < 2) return false; 972 | byte[] v = files.Last().data; 973 | if (v.Length == 0) return false; 974 | for (int i = 0; i < files.Count - 1; i++) 975 | { 976 | byte[] d = files[i].data; 977 | int a = files[i].loadA; 978 | for (int j = 0; j < d.Length; j++) 979 | { 980 | if (v[a + j] != d[j]) return false; 981 | } 982 | } 983 | return true; 984 | } 985 | 986 | private void SetStage(int s) 987 | { 988 | stage = s; 989 | string txt = ""; 990 | int progressMax = 0; 991 | progressBar.Style = ProgressBarStyle.Marquee; 992 | switch (stage) 993 | { 994 | case 1: 995 | txt = "Dump. Download.\nPlease wait..."; 996 | progressMax = flashSize / (TFTP_PAYLOAD_SIZE * 10); 997 | break; 998 | case 2: 999 | txt = "Dump. Verification.\nPlease wait..."; 1000 | progressMax = flashSize / (TFTP_PAYLOAD_SIZE * 10); 1001 | break; 1002 | case 3: 1003 | txt = "Burn file (" + (fi + 1) + "/" + files.Count + "):\n" + files[fi].name + "\nUpload..."; 1004 | progressMax = files[fi].data.Length / (TFTP_PAYLOAD_SIZE * 10); 1005 | break; 1006 | case 4: 1007 | txt = "Burn file (" + (fi + 1) + "/" + files.Count + "):\n" + files[fi].name + "\nWrite..."; 1008 | progressMax = 200; 1009 | progressBar.Style = ProgressBarStyle.Blocks; 1010 | break; 1011 | case 5: 1012 | txt = "Burn. Verification.\nPlease wait..."; 1013 | progressMax = flashSize / (TFTP_PAYLOAD_SIZE * 10); 1014 | break; 1015 | } 1016 | label.Text = txt; 1017 | progressBar.Value = 0; 1018 | progressBar.Maximum = progressMax; 1019 | progressBar.Visible = true; 1020 | Refresh(); 1021 | } 1022 | 1023 | private bool Send_uboot() 1024 | { 1025 | if (ubootFile == null) return false; 1026 | int length = ubootFile.Length; 1027 | int address2 = 0x41000000; 1028 | if (!Send_frame_head(length, address2)) return false; 1029 | int seq = 1; 1030 | byte[] data = new byte[SP_MAX_DATA_LEN]; 1031 | int ui = 0; 1032 | while (ui < ubootFile.Length) 1033 | { 1034 | int dataLen = ubootFile.Length - ui; 1035 | if (dataLen > SP_MAX_DATA_LEN) 1036 | { 1037 | dataLen = SP_MAX_DATA_LEN; 1038 | } 1039 | System.Array.Copy(ubootFile, ui, data, 0, dataLen); 1040 | ui += dataLen; 1041 | if (!Send_frame_data(seq, data, dataLen)) return false; 1042 | seq++; 1043 | try 1044 | { 1045 | Invoke(ProgressStage, -1); 1046 | } 1047 | catch { return false; } 1048 | } 1049 | if (!Send_frame_tail(seq)) return false; 1050 | return true; 1051 | } 1052 | 1053 | private bool Send_SPL() 1054 | { 1055 | if (ubootFile == null) return false; 1056 | int first_length = SP_BOOT_SPL_LEN; 1057 | int address1 = 0x04010500; 1058 | if (!Send_frame_head(first_length, address1)) return false; 1059 | int seq = 1; 1060 | byte[] data = new byte[SP_MAX_DATA_LEN]; 1061 | int ui = 0; 1062 | for (int i = 0; i < first_length / data.Length; i++) 1063 | { 1064 | System.Array.Copy(ubootFile, ui, data, 0, data.Length); 1065 | ui += data.Length; 1066 | if (!Send_frame_data(seq, data, data.Length)) return false; 1067 | seq++; 1068 | try 1069 | { 1070 | Invoke(ProgressStage, -1); 1071 | } 1072 | catch { return false; } 1073 | } 1074 | if (!Send_frame_tail(seq)) return false; 1075 | return true; 1076 | } 1077 | 1078 | 1079 | private bool Send_frame_data(int seq, byte[] data, int data_len) 1080 | { 1081 | int sizeFrame = 3 + data_len + 2; 1082 | byte[] frame = new byte[3 + SP_MAX_DATA_LEN + 2]; 1083 | int i = 0; 1084 | frame[i++] = 0xda; 1085 | frame[i++] = (byte)(seq & 0xff); 1086 | frame[i++] = (byte)(~seq & 0xff); 1087 | System.Array.Copy(data, 0, frame, i, data_len); 1088 | i += data_len; 1089 | ushort crc = Calc_crc(frame, i); 1090 | frame[i++] = (byte)((crc >> 8) & 0xff); 1091 | frame[i++] = (byte)(crc & 0xff); 1092 | if (!Send_frame(frame, sizeFrame, 32)) return false; 1093 | return true; 1094 | } 1095 | 1096 | private bool Read(byte[] b) 1097 | { 1098 | try 1099 | { 1100 | serialPort.Read(b, 0, b.Length); 1101 | return true; 1102 | } 1103 | catch 1104 | { 1105 | return false; 1106 | } 1107 | } 1108 | 1109 | private bool Send_ddrstep() 1110 | { 1111 | int i = 0; 1112 | int seq = 1; 1113 | int address0 = 0x04013000; 1114 | if (!Send_frame_head(64, address0)) return false; 1115 | byte[] frame = new byte[3 + ddrstep.Length + 2]; 1116 | frame[i++] = 0xda; 1117 | frame[i++] = (byte)(seq & 0xff); 1118 | frame[i++] = (byte)(~seq & 0xff); 1119 | System.Array.Copy(ddrstep, 0, frame, i, ddrstep.Length); 1120 | i += ddrstep.Length; 1121 | ushort crc = Calc_crc(frame, i); 1122 | frame[i++] = (byte)((crc >> 8) & 0xff); 1123 | frame[i++] = (byte)(crc & 0xff); 1124 | if (!Send_frame(frame, frame.Length, 16)) return false; 1125 | if (!Send_frame_tail(seq + 1)) return false; 1126 | return true; 1127 | } 1128 | 1129 | private bool Send_frame_tail(int seq) 1130 | { 1131 | int i = 0; 1132 | byte[] frame = new byte[5]; 1133 | frame[i++] = 0xed; 1134 | frame[i++] = (byte)(seq & 0xff); 1135 | frame[i++] = (byte)(~seq & 0xff); 1136 | ushort crc = Calc_crc(frame, i); 1137 | frame[i++] = (byte)((crc >> 8) & 0xff); 1138 | frame[i++] = (byte)(crc & 0xff); 1139 | if (!Send_frame(frame, frame.Length, 16)) return false; 1140 | return true; 1141 | } 1142 | 1143 | private bool Send_frame(byte[] data, int len, int loop) 1144 | { 1145 | byte[] b = new byte[1]; 1146 | for (int i = 0; i < loop; i++) 1147 | { 1148 | if (!Write(data, len)) return false; 1149 | if (Read(b)) 1150 | { 1151 | if (b[0] == 0xaa) 1152 | { 1153 | return true; 1154 | } 1155 | } 1156 | } 1157 | return false; 1158 | } 1159 | 1160 | private bool Send_frame_head(int length, int address) 1161 | { 1162 | int i = 0; 1163 | byte[] frame = new byte[14]; 1164 | frame[i++] = 254; 1165 | frame[i++] = 0; 1166 | frame[i++] = 255; 1167 | frame[i++] = 1; 1168 | frame[i++] = (byte)((length >> 24) & 0xff); 1169 | frame[i++] = (byte)((length >> 16) & 0xff); 1170 | frame[i++] = (byte)((length >> 8) & 0xff); 1171 | frame[i++] = (byte)((length) & 0xff); 1172 | frame[i++] = (byte)((address >> 24) & 0xff); 1173 | frame[i++] = (byte)((address >> 16) & 0xff); 1174 | frame[i++] = (byte)((address >> 8) & 0xff); 1175 | frame[i++] = (byte)((address) & 0xff); 1176 | ushort crc = Calc_crc(frame, i); 1177 | frame[i++] = (byte)((crc >> 8) & 0xff); 1178 | frame[i++] = (byte)(crc & 0xff); 1179 | if (!Send_frame(frame, frame.Length, 16)) return false; 1180 | return true; 1181 | } 1182 | 1183 | private ushort Calc_crc(byte[] data, int len) 1184 | { 1185 | ushort crc = 0; 1186 | for (int i = 0; i < len; i++) 1187 | { 1188 | crc = (ushort)(((crc << 8) | data[i]) ^ crctable[(crc >> 8) & 0xff]); 1189 | } 1190 | for (int i = 0; i < 2; i++) 1191 | { 1192 | crc = (ushort)(((crc << 8) | 0) ^ crctable[(crc >> 8) & 0xff]); 1193 | } 1194 | return crc; 1195 | } 1196 | 1197 | private bool Write(byte[] b, int len) 1198 | { 1199 | try 1200 | { 1201 | serialPort.Write(b, 0, len); 1202 | return true; 1203 | } 1204 | catch 1205 | { 1206 | return false; 1207 | } 1208 | } 1209 | 1210 | private void ShowLoading() 1211 | { 1212 | label.Text = "Loading u-boot into RAM\nPlease wait..."; 1213 | button0.Visible = false; 1214 | Refresh(); 1215 | } 1216 | 1217 | private void Form_FormClosing(object sender, FormClosingEventArgs e) 1218 | { 1219 | run = false; 1220 | } 1221 | 1222 | private void LinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 1223 | { 1224 | Process.Start(new ProcessStartInfo 1225 | { 1226 | FileName = linkLabel.Text, 1227 | UseShellExecute = true 1228 | }); 1229 | } 1230 | } 1231 | } 1232 | 1233 | --------------------------------------------------------------------------------