├── .gitattributes ├── .gitignore ├── App.config ├── DLL ├── AgentModule.dll ├── CommonModule.dll └── GlobalUtil.dll ├── LICENSE ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── README.md ├── SamFirm-continued.csproj ├── SamFirm-continued.sln ├── SamFirm ├── AppendDialogBox.Designer.cs ├── AppendDialogBox.cs ├── AppendDialogBox.it.resx ├── AppendDialogBox.ko.resx ├── AppendDialogBox.resx ├── Command.cs ├── Crc32.cs ├── Decrypt.cs ├── FWFetch.cs ├── Imports.cs ├── KiesRequest.cs ├── Logger.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.de.resx ├── MainForm.it.resx ├── MainForm.ko.resx ├── MainForm.resx ├── Program.cs ├── Settings.cs ├── Utility.cs ├── Web.cs └── Xml.cs ├── imgs ├── CRC32.PNG ├── Complete.PNG ├── Decrypt.PNG ├── Download.PNG └── Update Check.PNG ├── packages.config └── res ├── download.ico └── warning.ico /.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 -------------------------------------------------------------------------------- /App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DLL/AgentModule.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/DLL/AgentModule.dll -------------------------------------------------------------------------------- /DLL/CommonModule.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/DLL/CommonModule.dll -------------------------------------------------------------------------------- /DLL/GlobalUtil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/DLL/GlobalUtil.dll -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 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 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 5 | // 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 6 | // 이러한 특성 값을 변경하세요. 7 | [assembly: AssemblyTitle("SamFirm-continued")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Labbit Lulin")] 11 | [assembly: AssemblyProduct("SamFirm-continued")] 12 | [assembly: AssemblyCopyright("Copyright © Lulin")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 17 | // 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 18 | // 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. 19 | [assembly: ComVisible(false)] 20 | 21 | // 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. 22 | [assembly: Guid("60f245fd-867c-4498-81e2-a09d232b4591")] 23 | 24 | // 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. 25 | // 26 | // 주 버전 27 | // 부 버전 28 | // 빌드 번호 29 | // 수정 버전 30 | // 31 | // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 32 | // 지정되도록 할 수 있습니다. 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.4.2")] 35 | [assembly: AssemblyFileVersion("1.4.2")] -------------------------------------------------------------------------------- /Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 이 코드는 도구를 사용하여 생성되었습니다. 4 | // 런타임 버전:4.0.30319.42000 5 | // 6 | // 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 7 | // 이러한 변경 내용이 손실됩니다. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SamFirm.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. 17 | /// 18 | // 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder 19 | // 클래스에서 자동으로 생성되었습니다. 20 | // 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을 21 | // 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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 | /// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. 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("SamFirm.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을 51 | /// 재정의합니다. 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 이 코드는 도구를 사용하여 생성되었습니다. 4 | // 런타임 버전:4.0.30319.42000 5 | // 6 | // 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 7 | // 이러한 변경 내용이 손실됩니다. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SamFirm.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.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 | -------------------------------------------------------------------------------- /Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## SamFirm-continued Development End 2 | 3 | ``` 4 | SamFirm-continued officially ended its development. 5 | This is a decision that I made because I couldn't continue to develop for my own personal reasons. 6 | ``` 7 | 8 | 9 | 10 | # SamFirm-continued 11 | 12 | > This is a SamFirm extension support project. 13 | 14 | SamFirm is a program that lets you download stock firmware for your Samsung smartphone. It was first posted to the [XDA Forum](https://forum.xda-developers.com/galaxy-tab-s/general/tool-samfirm-samsung-firmware-t2988647), and it was very helpful to many people, including me. 15 | 16 | However, the update has been down since 2016, .NET Framework 4 or later is not supported and non-up-to-date firmwares can't download anymore. So I used [updato.com](https://updato.com/) instead. This is an archive of firmware for each model, which allows users to download firmware that has been released so far without a subscription or speed limit, but the latest firmware is not apply quickly. 17 | 18 | Therefore, using the source code posted on [GitHub](https://github.com/eladkarako/SamFirm-Source), I decided to change the ".NET Framework" to the latest version, delete the inoperable or unnecessary features, and make the existing difficult usage as easy as possible. 19 | 20 | I hope this project will be useful to many users. 😎 21 | 22 | ## Project Introduction 23 | 24 | - Motive 25 | - I've started to improve the SamFirm program to make it work today. 26 | - Purpose 27 | - It is easy to download the latest stock firmware. 28 | - Main functions 29 | - Latest firmware check, encrypted file download, decryption 30 | 31 | ## Build Status 32 | 33 | [![Release](https://img.shields.io/github/release/clovadev/SamFirm-continued.svg?style=popout-square)](https://github.com/clovadev/SamFirm-continued/releases/latest) 34 | ![Last commit](https://img.shields.io/github/last-commit/clovadev/SamFirm-continued.svg?style=popout-square) 35 | ![Download](https://img.shields.io/github/downloads/clovadev/SamFirm-continued/total.svg?style=popout-square) 36 | ![License](https://img.shields.io/github/license/clovadev/SamFirm-continued.svg?style=popout-square) 37 | 38 | ## How to Install 39 | 40 | 1. Click the Release badge above or the [Release link](https://github.com/clovadev/SamFirm-continued/releases/latest). 41 | 2. Download the latest version. (Latest Release) 42 | 3. Check that .NET Framework 4.7, [Visual C++ 2010 x86](http://www.microsoft.com/ko-kr/download/details.aspx?id=5555), [Visual C++ 2008 x86](https://www.microsoft.com/ko-kr/download/details.aspx?id=5582) are installed. Please download and install the missing parts by clicking each link or search on google. 43 | 44 | ## How to Use, Example 45 | 46 | 1. Enter the model name and region code, and click the Update Check button. Additional PIT files can be downloaded when checking the 'Binary Nature'. 47 | 48 | ![Update Check](./imgs/Update%20Check.PNG) 49 | 50 | 2. Click the Download button. Decrypt automatically when checking the 'Decrypt Automatically'. 51 | 52 | ![Download](./imgs/Download.PNG) 53 | 54 | 3. Perform the CRC32 inspection automatically. 55 | 56 | ![CRC32](./imgs/CRC32.PNG) 57 | 58 | 4. The downloaded file is encrypted. If you checked for automatic decryption, perform the decryption process automatically, but click the Decrypt button to manually do so. 59 | 60 | ![Decrypt](./imgs/Decrypt.PNG) 61 | 62 | 5. The download is complete, there is a archive file and an encryption file. Unzip the firmware file and use it, and encryption file can be deleted or stored. 63 | 64 | ![Complete](./imgs/Complete.PNG) 65 | 66 | ## Functions 67 | 68 | - Check the latest firmware for each variant. 69 | - One-click Download the Latest Firmware. 70 | - CRC32 Inspection. 71 | - Automatically decrypt. 72 | 73 | ## API, Framework 74 | 75 | - .NET Framework 4.7.2 76 | - NuGet Packages 77 | - [Microsoft-WindowsAPICodePack-Core](https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Core/) 1.1.3.3 78 | - [Microsoft-WindowsAPICodePack-Shell](https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Shell/) 1.1.3.3 79 | - DLL 80 | - AgentModule.dll 81 | - CommonModule.dll 82 | - GlobalUtil.dll 83 | 84 | ## develop environment 85 | 86 | - S/W develop environment 87 | - Visual Studio 2019 Community (16.0.2) 88 | - .NET Framework 4.7.2 89 | - C# Language (x86 Build) 90 | - setting up development environment 91 | 1. Download the code as a clone, fork, or archive file from the repository. 92 | 2. Make sure that the .NET Framework 4.7.2 Development Tool is installed. If not, install. 93 | 3. Open the solution file (.sln) with Visual Studio 2019. 94 | 4. Start coding! 95 | 96 | ## Developer information and credits 97 | 98 | - Developer 99 | - Clova - [GitHub Profile](https://github.com/clovadev) 100 | - Credits 101 | - Original project: [eladkarako/SamFirm-Source](https://github.com/eladkarako/SamFirm-Source) 102 | - XDA Forum: [forum.xda-developers.com/...](https://forum.xda-developers.com/galaxy-tab-s/general/tool-samfirm-samsung-firmware-t2988647) (zxz0O0) 103 | 104 | ## contribution method 105 | 106 | 1. Fork this repository. 107 | 2. Create a new branch or use the master branch in the GitHub Desktop. 108 | 3. Commit the modification. 109 | 4. Push on the selected branch. 110 | 5. Please send a pull request. 111 | 112 | ## License 113 | 114 | MIT License 115 | 116 | You can find more information in `LICENSE`. 117 | -------------------------------------------------------------------------------- /SamFirm-continued.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {60F245FD-867C-4498-81E2-A09D232B4591} 8 | WinExe 9 | SamFirm 10 | SamFirm-continued 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | false 16 | publish\ 17 | true 18 | Disk 19 | false 20 | Foreground 21 | 7 22 | Days 23 | false 24 | false 25 | true 26 | 0 27 | 1.0.0.%2a 28 | false 29 | true 30 | 31 | 32 | x86 33 | true 34 | full 35 | false 36 | bin\Debug\ 37 | DEBUG;TRACE 38 | prompt 39 | 4 40 | false 41 | 42 | 43 | x86 44 | pdbonly 45 | true 46 | bin\Release\ 47 | TRACE 48 | prompt 49 | 4 50 | false 51 | 52 | 53 | SamFirm.Program 54 | 55 | 56 | res\download.ico 57 | 58 | 59 | 60 | packages\Microsoft-WindowsAPICodePack-Core.1.1.3.3\lib\net452\Microsoft.WindowsAPICodePack.dll 61 | 62 | 63 | packages\Microsoft-WindowsAPICodePack-Shell.1.1.3.3\lib\net452\Microsoft.WindowsAPICodePack.Shell.dll 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Form 80 | 81 | 82 | AppendDialogBox.cs 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | Form 93 | 94 | 95 | MainForm.cs 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | ResXFileCodeGenerator 105 | Resources.Designer.cs 106 | Designer 107 | 108 | 109 | True 110 | Resources.resx 111 | True 112 | 113 | 114 | AppendDialogBox.cs 115 | 116 | 117 | AppendDialogBox.cs 118 | 119 | 120 | AppendDialogBox.cs 121 | 122 | 123 | MainForm.cs 124 | 125 | 126 | MainForm.cs 127 | 128 | 129 | MainForm.cs 130 | 131 | 132 | MainForm.cs 133 | 134 | 135 | 136 | SettingsSingleFileGenerator 137 | Settings.Designer.cs 138 | 139 | 140 | True 141 | Settings.settings 142 | True 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | False 151 | Microsoft .NET Framework 4.7.2%28x86 및 x64%29 152 | true 153 | 154 | 155 | False 156 | .NET Framework 3.5 SP1 157 | false 158 | 159 | 160 | 161 | 162 | PreserveNewest 163 | 164 | 165 | PreserveNewest 166 | 167 | 168 | PreserveNewest 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /SamFirm-continued.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.271 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamFirm-continued", "SamFirm-continued.csproj", "{60F245FD-867C-4498-81E2-A09D232B4591}" 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 | {60F245FD-867C-4498-81E2-A09D232B4591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {60F245FD-867C-4498-81E2-A09D232B4591}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {60F245FD-867C-4498-81E2-A09D232B4591}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {60F245FD-867C-4498-81E2-A09D232B4591}.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 = {251EA63D-4D05-43E8-AB0B-C7B6156C3D15} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SamFirm/AppendDialogBox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SamFirm 2 | { 3 | partial class AppendDialogBox 4 | { 5 | /// 6 | /// 필수 디자이너 변수입니다. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 사용 중인 모든 리소스를 정리합니다. 12 | /// 13 | /// 관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 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 디자이너에서 생성한 코드 24 | 25 | /// 26 | /// 디자이너 지원에 필요한 메서드입니다. 27 | /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AppendDialogBox)); 32 | this.button1 = new System.Windows.Forms.Button(); 33 | this.button2 = new System.Windows.Forms.Button(); 34 | this.button3 = new System.Windows.Forms.Button(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 37 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 38 | this.SuspendLayout(); 39 | // 40 | // button1 41 | // 42 | this.button1.DialogResult = System.Windows.Forms.DialogResult.Yes; 43 | resources.ApplyResources(this.button1, "button1"); 44 | this.button1.Name = "button1"; 45 | this.button1.UseVisualStyleBackColor = true; 46 | // 47 | // button2 48 | // 49 | this.button2.DialogResult = System.Windows.Forms.DialogResult.No; 50 | resources.ApplyResources(this.button2, "button2"); 51 | this.button2.Name = "button2"; 52 | this.button2.UseVisualStyleBackColor = true; 53 | // 54 | // button3 55 | // 56 | this.button3.DialogResult = System.Windows.Forms.DialogResult.Cancel; 57 | resources.ApplyResources(this.button3, "button3"); 58 | this.button3.Name = "button3"; 59 | this.button3.UseVisualStyleBackColor = true; 60 | // 61 | // label1 62 | // 63 | resources.ApplyResources(this.label1, "label1"); 64 | this.label1.Name = "label1"; 65 | // 66 | // pictureBox1 67 | // 68 | resources.ApplyResources(this.pictureBox1, "pictureBox1"); 69 | this.pictureBox1.Name = "pictureBox1"; 70 | this.pictureBox1.TabStop = false; 71 | // 72 | // AppendDialogBox 73 | // 74 | resources.ApplyResources(this, "$this"); 75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 76 | this.Controls.Add(this.pictureBox1); 77 | this.Controls.Add(this.label1); 78 | this.Controls.Add(this.button3); 79 | this.Controls.Add(this.button2); 80 | this.Controls.Add(this.button1); 81 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 82 | this.MaximizeBox = false; 83 | this.MinimizeBox = false; 84 | this.Name = "AppendDialogBox"; 85 | this.ShowIcon = false; 86 | this.ShowInTaskbar = false; 87 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 88 | this.ResumeLayout(false); 89 | this.PerformLayout(); 90 | 91 | } 92 | 93 | #endregion 94 | 95 | private System.Windows.Forms.Button button1; 96 | private System.Windows.Forms.Button button2; 97 | private System.Windows.Forms.Button button3; 98 | private System.Windows.Forms.Label label1; 99 | private System.Windows.Forms.PictureBox pictureBox1; 100 | } 101 | } -------------------------------------------------------------------------------- /SamFirm/AppendDialogBox.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace SamFirm 4 | { 5 | public partial class AppendDialogBox : Form 6 | { 7 | public AppendDialogBox() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /SamFirm/AppendDialogBox.it.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 | Aggiungi 122 | 123 | 124 | Sovrascrivi 125 | 126 | 127 | Annulla 128 | 129 | 130 | Il file destinazione esiste già. 131 | Vuoi aggiungerlo (riprendere il download)? 132 | 133 | -------------------------------------------------------------------------------- /SamFirm/AppendDialogBox.ko.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 | 123 | 124 | 덮어쓰기 125 | 126 | 127 | 취소 128 | 129 | 130 | 대상 파일이 이미 있습니다. 131 | 이어받기 하실래요? (다운로드 재개) 132 | 133 | -------------------------------------------------------------------------------- /SamFirm/AppendDialogBox.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 | 115, 65 123 | 124 | 125 | 126 | 4, 4, 4, 4 127 | 128 | 129 | 110, 32 130 | 131 | 132 | 133 | 0 134 | 135 | 136 | Append 137 | 138 | 139 | button1 140 | 141 | 142 | System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 143 | 144 | 145 | $this 146 | 147 | 148 | 4 149 | 150 | 151 | 257, 65 152 | 153 | 154 | 4, 4, 4, 4 155 | 156 | 157 | 110, 32 158 | 159 | 160 | 1 161 | 162 | 163 | Overwrite 164 | 165 | 166 | button2 167 | 168 | 169 | System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 170 | 171 | 172 | $this 173 | 174 | 175 | 3 176 | 177 | 178 | 399, 65 179 | 180 | 181 | 4, 4, 4, 4 182 | 183 | 184 | 110, 32 185 | 186 | 187 | 2 188 | 189 | 190 | Cancel 191 | 192 | 193 | button3 194 | 195 | 196 | System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 197 | 198 | 199 | $this 200 | 201 | 202 | 2 203 | 204 | 205 | True 206 | 207 | 208 | 111, 9 209 | 210 | 211 | 4, 0, 4, 0 212 | 213 | 214 | 347, 40 215 | 216 | 217 | 3 218 | 219 | 220 | The destination file already exists. 221 | Would you like to append it? (resume download) 222 | 223 | 224 | label1 225 | 226 | 227 | System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 228 | 229 | 230 | $this 231 | 232 | 233 | 1 234 | 235 | 236 | 237 | iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCA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Z7cezGGx3CJEVzGi/PYvCdkcRUsGs//14GoPtDiOigln/++1pFLY7kq4KZrUf4HkMtjuU 251 | ngpmtR/Y8yhsdzSbKpjZ/t2xpYKZ7d8jqyqQ/QmsqUD259BUgexPpKUC2Z/L0wpkfwHPKpD9NdAKZH8h 252 | rALZX8u7Cu72X5bbr+/GD1GCfdf4zu8V4Jd4fBDFvF6W62+rOS+fTOj4igAAAABJRU5ErkJggg== 253 | 254 | 255 | 256 | 13, 9 257 | 258 | 259 | 4, 4, 4, 4 260 | 261 | 262 | 80, 80 263 | 264 | 265 | Zoom 266 | 267 | 268 | 4 269 | 270 | 271 | pictureBox1 272 | 273 | 274 | System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 275 | 276 | 277 | $this 278 | 279 | 280 | 0 281 | 282 | 283 | True 284 | 285 | 286 | 120, 120 287 | 288 | 289 | 522, 110 290 | 291 | 292 | 맑은 고딕, 9pt 293 | 294 | 295 | 4, 4, 4, 4 296 | 297 | 298 | CenterParent 299 | 300 | 301 | SamFirm Continued 302 | 303 | 304 | AppendDialogBox 305 | 306 | 307 | System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 308 | 309 | -------------------------------------------------------------------------------- /SamFirm/Command.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace SamFirm 6 | { 7 | internal class Command 8 | { 9 | public static int Download(string path, string file, string version, string region, string model_type, string saveTo, string size) 10 | { 11 | int htmlstatus = Web.GenerateNonce(); 12 | if (htmlstatus != 200) 13 | { 14 | Logger.WriteLine("Error Download(): Could not generate Nonce. Status code (" + htmlstatus + ")"); 15 | return -1; 16 | } 17 | htmlstatus = Web.DownloadBinaryInit(Xml.GetXmlBinaryInit(file, version, region, model_type), out string str); 18 | if ((htmlstatus != 200) || (Utility.GetXmlStatusCode(str) != 200)) 19 | { 20 | Logger.WriteLine("Error Download(): Could not send BinaryInform. Status code (" + htmlstatus + "/" + Utility.GetXmlStatusCode(str) + ")"); 21 | Utility.CheckHtmlXmlStatus(htmlstatus, Utility.GetXmlStatusCode(str)); 22 | return -1; 23 | } 24 | return Web.DownloadBinary(path, file, saveTo, size); 25 | } 26 | 27 | public static Firmware UpdateCheck(string model, string region, string info, bool BinaryNature, bool AutoFetch = false) 28 | { 29 | if (string.IsNullOrEmpty(info)) 30 | { 31 | return new Firmware(); 32 | } 33 | string pda = Utility.InfoExtract(info, "pda"); 34 | if (string.IsNullOrEmpty(pda)) 35 | { 36 | return new Firmware(); 37 | } 38 | string csc = Utility.InfoExtract(info, "csc"); 39 | string phone = Utility.InfoExtract(info, "phone"); 40 | string data = Utility.InfoExtract(info, "data"); 41 | return UpdateCheck(model, region, pda, csc, phone, data, BinaryNature, AutoFetch); 42 | } 43 | 44 | public static Firmware UpdateCheck(string model, string region, string pda, string csc, string phone, string data, bool BinaryNature, bool AutoFetch = false) 45 | { 46 | string str; 47 | Firmware firmware = new Firmware(); 48 | Logger.WriteLine("Checking firmware for " + model + "/" + region + "/" + pda + "/" + csc + "/" + phone + "/" + data); 49 | int htmlstatus = Web.GenerateNonce(); 50 | if (htmlstatus != 200) 51 | { 52 | Logger.WriteLine("Error UpdateCheck(): Could not generate Nonce. Status code (" + htmlstatus + ")"); 53 | firmware.ConnectionError = true; 54 | return firmware; 55 | } 56 | htmlstatus = Web.DownloadBinaryInform(Xml.GetXmlBinaryInform(model, region, pda, csc, phone, data, BinaryNature), out str); 57 | if ((htmlstatus != 200) || (Utility.GetXmlStatusCode(str) != 200)) 58 | { 59 | Logger.WriteLine("Error UpdateCheck(): Could not send BinaryInform. Status code (" + htmlstatus + "/" + Utility.GetXmlStatusCode(str) + ")"); 60 | Utility.CheckHtmlXmlStatus(htmlstatus, Utility.GetXmlStatusCode(str)); 61 | return firmware; 62 | } 63 | firmware.Version = Xml.GetXMLValue(str, "FUSBody/Results/LATEST_FW_VERSION/Data", null, null); 64 | firmware.Model = Xml.GetXMLValue(str, "FUSBody/Put/DEVICE_MODEL_NAME/Data", null, null); 65 | firmware.DisplayName = Xml.GetXMLValue(str, "FUSBody/Put/DEVICE_MODEL_DISPLAYNAME/Data", null, null); 66 | firmware.OS = Xml.GetXMLValue(str, "FUSBody/Put/LATEST_OS_VERSION/Data", null, null); 67 | firmware.LastModified = Xml.GetXMLValue(str, "FUSBody/Put/LAST_MODIFIED/Data", null, null); 68 | firmware.Filename = Xml.GetXMLValue(str, "FUSBody/Put/BINARY_NAME/Data", null, null); 69 | firmware.Size = Xml.GetXMLValue(str, "FUSBody/Put/BINARY_BYTE_SIZE/Data", null, null); 70 | string str3 = Xml.GetXMLValue(str, "FUSBody/Put/BINARY_CRC/Data", null, null); 71 | if (!string.IsNullOrEmpty(str3)) 72 | { 73 | firmware.CRC = BitConverter.GetBytes(Convert.ToUInt32(str3)).Reverse().ToArray(); 74 | } 75 | firmware.Model_Type = Xml.GetXMLValue(str, "FUSBody/Put/DEVICE_MODEL_TYPE/Data", null, null); 76 | firmware.Path = Xml.GetXMLValue(str, "FUSBody/Put/MODEL_PATH/Data", null, null); 77 | firmware.Region = Xml.GetXMLValue(str, "FUSBody/Put/DEVICE_LOCAL_CODE/Data", null, null); 78 | firmware.BinaryNature = int.Parse(Xml.GetXMLValue(str, "FUSBody/Put/BINARY_NATURE/Data", null, null)); 79 | if (Xml.GetXMLValue(str, "FUSBody/Put/LOGIC_OPTION_FACTORY/Data", null, null) == "1") 80 | { 81 | firmware.LogicValueFactory = Xml.GetXMLValue(str, "FUSBody/Put/LOGIC_VALUE_FACTORY/Data", null, null); 82 | } 83 | if (Xml.GetXMLValue(str, "FUSBody/Put/LOGIC_OPTION_HOME/Data", null, null) == "1") 84 | { 85 | firmware.LogicValueHome = Xml.GetXMLValue(str, "FUSBody/Put/LOGIC_VALUE_HOME/Data", null, null); 86 | } 87 | if (!AutoFetch) 88 | { 89 | if ((pda + "/" + csc + "/" + phone + "/" + pda) == firmware.Version) 90 | { 91 | Logger.WriteLine("\nCurrent firmware is latest:"); 92 | } 93 | else 94 | { 95 | Logger.WriteLine("\nNewer firmware available:"); 96 | } 97 | } 98 | 99 | Logger.WriteLine("Model: " + firmware.Model); 100 | Logger.WriteLine("Version: " + firmware.Version); 101 | Logger.WriteLine("OS: " + firmware.OS); 102 | Logger.WriteLine("Filename: " + firmware.Filename); 103 | Logger.WriteLine("Size: " + firmware.Size + " bytes"); 104 | if ((firmware.BinaryNature == 1) && !string.IsNullOrEmpty(firmware.LogicValueFactory)) 105 | { 106 | Logger.WriteLine("LogicValue: " + firmware.LogicValueFactory); 107 | } 108 | else if (!string.IsNullOrEmpty(firmware.LogicValueHome)) 109 | { 110 | Logger.WriteLine("LogicValue: " + firmware.LogicValueHome); 111 | } 112 | return firmware; 113 | } 114 | 115 | public static Firmware UpdateCheckAuto(string model, string region, bool BinaryNature) 116 | { 117 | int num = 0; 118 | Firmware firmware = new Firmware(); 119 | foreach (Func func in FWFetch.FWFetchFuncs) 120 | { 121 | string str = func(model, region); 122 | if (!string.IsNullOrEmpty(str)) 123 | { 124 | num++; 125 | firmware = UpdateCheck(model, region, str, BinaryNature, true); 126 | if ((firmware.Version != null) || firmware.ConnectionError) 127 | { 128 | break; 129 | } 130 | } 131 | } 132 | if (firmware.Version == null) 133 | { 134 | Logger.WriteLine("Error UpdateCheckAuto(): Could not fetch info for " + model + "/" + region + ". Please check the input data."); 135 | } 136 | firmware.FetchAttempts = num; 137 | return firmware; 138 | } 139 | 140 | [StructLayout(LayoutKind.Sequential)] 141 | public struct Firmware 142 | { 143 | public string Model; 144 | public string DisplayName; 145 | public string Version; 146 | public string OS; 147 | public string LastModified; 148 | public string Filename; 149 | public string Path; 150 | public string Size; 151 | public byte[] CRC; 152 | public string Model_Type; 153 | public string Region; 154 | public int BinaryNature; 155 | public string LogicValueFactory; 156 | public string LogicValueHome; 157 | public string Announce; 158 | public bool ConnectionError; 159 | public int FetchAttempts; 160 | } 161 | } 162 | } -------------------------------------------------------------------------------- /SamFirm/Crc32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Security.Cryptography; 4 | 5 | namespace SamFirm 6 | { 7 | public sealed class Crc32 : HashAlgorithm 8 | { 9 | private uint hash; 10 | private readonly uint seed; 11 | private readonly uint[] table; 12 | private static uint[] defaultTable; 13 | 14 | public Crc32() : this(0xedb88320, uint.MaxValue) 15 | { } 16 | 17 | public Crc32(uint polynomial, uint seed) 18 | { 19 | table = InitializeTable(polynomial); 20 | hash = seed; 21 | this.seed = seed; 22 | } 23 | 24 | private static uint CalculateHash(uint[] table, uint seed, IList buffer, int start, int size) 25 | { 26 | uint num = seed; 27 | for (int i = start; i < (size - start); i++) 28 | { 29 | num = (num >> 8) ^ table[(int) ((IntPtr) (buffer[i] ^ (num & 0xff)))]; 30 | } 31 | return num; 32 | } 33 | 34 | public static uint Compute(byte[] buffer) => 35 | Compute(uint.MaxValue, buffer); 36 | 37 | public static uint Compute(uint seed, byte[] buffer) => 38 | Compute(0xedb88320, seed, buffer); 39 | 40 | public static uint Compute(uint polynomial, uint seed, byte[] buffer) => 41 | ~CalculateHash(InitializeTable(polynomial), seed, buffer, 0, buffer.Length); 42 | 43 | protected override void HashCore(byte[] buffer, int start, int length) 44 | { 45 | this.hash = CalculateHash(this.table, this.hash, buffer, start, length); 46 | } 47 | 48 | protected override byte[] HashFinal() 49 | { 50 | byte[] buffer = UInt32ToBigEndianBytes(~this.hash); 51 | base.HashValue = buffer; 52 | return buffer; 53 | } 54 | 55 | public override void Initialize() 56 | { 57 | this.hash = this.seed; 58 | } 59 | 60 | private static uint[] InitializeTable(uint polynomial) 61 | { 62 | if ((polynomial == 0xedb88320) && (defaultTable != null)) 63 | { 64 | return defaultTable; 65 | } 66 | uint[] numArray = new uint[0x100]; 67 | for (int i = 0; i < 0x100; i++) 68 | { 69 | uint num2 = (uint) i; 70 | for (int j = 0; j < 8; j++) 71 | { 72 | if ((num2 & 1) == 1) 73 | { 74 | num2 = (num2 >> 1) ^ polynomial; 75 | } 76 | else 77 | { 78 | num2 = num2 >> 1; 79 | } 80 | } 81 | numArray[i] = num2; 82 | } 83 | if (polynomial == 0xedb88320) 84 | { 85 | defaultTable = numArray; 86 | } 87 | return numArray; 88 | } 89 | 90 | private static byte[] UInt32ToBigEndianBytes(uint uint32) 91 | { 92 | byte[] bytes = BitConverter.GetBytes(uint32); 93 | if (BitConverter.IsLittleEndian) 94 | { 95 | Array.Reverse(bytes); 96 | } 97 | return bytes; 98 | } 99 | 100 | public override int HashSize => 101 | 0x20; 102 | } 103 | } -------------------------------------------------------------------------------- /SamFirm/Decrypt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Security.Cryptography; 4 | using System.Text; 5 | 6 | namespace SamFirm 7 | { 8 | internal static class Decrypt 9 | { 10 | public static MainForm Form { get; set; } 11 | private static readonly byte[] IV = new byte[1]; 12 | private static byte[] KEY; 13 | 14 | public static int DecryptFile(string encryptedFile, string outputFile) 15 | { 16 | using (FileStream stream1 = new FileStream(encryptedFile, FileMode.Open)) 17 | { 18 | using (FileStream stream2 = new FileStream(outputFile, FileMode.Create)) 19 | { 20 | using (RijndaelManaged managed = new RijndaelManaged()) 21 | { 22 | managed.Mode = CipherMode.ECB; 23 | managed.BlockSize = 0x80; 24 | managed.Padding = PaddingMode.PKCS7; 25 | 26 | using (ICryptoTransform transform = managed.CreateDecryptor(KEY, IV)) 27 | { 28 | try 29 | { 30 | Utility.PreventDeepSleep(Utility.PDSMode.Start); 31 | using (CryptoStream stream3 = new CryptoStream(stream1, transform, CryptoStreamMode.Read)) 32 | { 33 | byte[] buffer = new byte[0x1000]; 34 | long num = 0L; 35 | int count = 0; 36 | do 37 | { 38 | Utility.PreventDeepSleep(Utility.PDSMode.Continue); 39 | count = stream3.Read(buffer, 0, buffer.Length); 40 | num += count; 41 | stream2.Write(buffer, 0, count); 42 | Form.SetProgressBar(Utility.GetProgress(num, stream1.Length)); 43 | } 44 | while (count > 0); 45 | } 46 | } 47 | catch (CryptographicException) 48 | { 49 | Logger.WriteLine("Error DecryptFile(): Wrong key."); 50 | return 2; 51 | } 52 | catch (Exception e) 53 | { 54 | Logger.WriteLine("Error DecryptFile() -> " + e); 55 | return 1; 56 | } 57 | finally 58 | { 59 | Utility.PreventDeepSleep(Utility.PDSMode.Stop); 60 | } 61 | } 62 | } 63 | } 64 | } 65 | return 0; 66 | } 67 | 68 | public static void SetDecryptKey(string version, string LogicValue) 69 | { 70 | string logicCheck = Utility.GetLogicCheck(version, LogicValue); 71 | byte[] bytes = Encoding.ASCII.GetBytes(logicCheck); 72 | using (MD5 md = MD5.Create()) 73 | { 74 | KEY = md.ComputeHash(bytes); 75 | } 76 | } 77 | 78 | public static void SetDecryptKey(string region, string model, string version) 79 | { 80 | StringBuilder builder = new StringBuilder(region); 81 | builder.Append(':'); 82 | builder.Append(model); 83 | builder.Append(':'); 84 | builder.Append(version); 85 | byte[] bytes = Encoding.ASCII.GetBytes(builder.ToString()); 86 | using (MD5 md = MD5.Create()) 87 | { 88 | KEY = md.ComputeHash(bytes); 89 | } 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /SamFirm/FWFetch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Net; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | 8 | namespace SamFirm 9 | { 10 | internal static class FWFetch 11 | { 12 | internal static readonly List> FWFetchFuncs; 13 | private static string SamMobileHtml; 14 | private static string SamsungFirmwareOrgHtml; 15 | 16 | static FWFetch() 17 | { 18 | List> list = new List> { 19 | new Func(FOTAInfoFetch1), 20 | new Func(FOTAInfoFetch2), 21 | new Func(SamsungFirmwareOrgFetch1), 22 | new Func(SamsungFirmwareOrgFetch2), 23 | new Func(SamMobileFetch1), 24 | new Func(SamMobileFetch2), 25 | new Func(SamsungUpdatesFetch) 26 | }; 27 | FWFetchFuncs = list; 28 | } 29 | 30 | //http://fota-cloud-dn.ospserver.net 31 | public static string FOTAInfoFetch(string model, string region, bool latest) 32 | { 33 | try 34 | { 35 | using (WebClient client = new WebClient()) 36 | { 37 | string xml = client.DownloadString("http://fota-cloud-dn.ospserver.net/firmware/" + region + "/" + model + "/version.xml"); 38 | string str2; 39 | if (latest == true) 40 | { 41 | str2 = Xml.GetXMLValue(xml, "firmware/version/latest", null, null).ToUpper(); 42 | } 43 | else 44 | { 45 | str2 = Xml.GetXMLValue(xml, "firmware/version/upgrade/value", null, null).ToUpper(); 46 | } 47 | return str2; 48 | } 49 | } 50 | catch (Exception) 51 | { 52 | return string.Empty; 53 | } 54 | } 55 | 56 | public static string FOTAInfoFetch1(string model, string region) => 57 | FOTAInfoFetch(model, region, true); 58 | 59 | public static string FOTAInfoFetch2(string model, string region) => 60 | FOTAInfoFetch(model, region, false); 61 | 62 | private static string GetInfoSFO(string html, string search) 63 | { 64 | if (string.IsNullOrEmpty(html)) 65 | { 66 | return string.Empty; 67 | } 68 | int index = html.IndexOf(">" + search + "<"); 69 | if (index < 0) 70 | { 71 | return string.Empty; 72 | } 73 | index += (search.Length + 1) + 0x13; 74 | string str = html.Substring(index); 75 | return str.Substring(0, str.IndexOf('<')); 76 | } 77 | 78 | //http://www.sammobile.com 79 | public static string SamMobileFetch(string model, string region, int index) 80 | { 81 | string samMobileHtml = SamMobileHtml; 82 | if (string.IsNullOrEmpty(samMobileHtml)) 83 | { 84 | return string.Empty; 85 | } 86 | if (samMobileHtml.Contains("Device model not found")) 87 | { 88 | return string.Empty; 89 | } 90 | int num = 0; 91 | while ((index-- >= 0) && (num >= 0)) 92 | { 93 | num = samMobileHtml.IndexOf(" 142 | SamMobileFetch(model, region, 1); 143 | 144 | //https://samsung-firmware.org 145 | public static string SamsungFirmwareOrgFetch(string model, string region) 146 | { 147 | string samsungFirmwareOrgHtml = SamsungFirmwareOrgHtml; 148 | int index = samsungFirmwareOrgHtml.IndexOf("\"/model/" + model + "/\""); 149 | if (index < 0) 150 | { 151 | return string.Empty; 152 | } 153 | samsungFirmwareOrgHtml = samsungFirmwareOrgHtml.Substring(index); 154 | 155 | StringBuilder bld = new StringBuilder(); 156 | bld.Append("https://samsung-firmware.org"); 157 | 158 | using (StringReader reader = new StringReader(samsungFirmwareOrgHtml)) 159 | { 160 | string str3; 161 | while ((str3 = reader.ReadLine()) != null) 162 | { 163 | if (str3.Contains("Download")) 164 | { 165 | int num2 = str3.IndexOf('"'); 166 | int length = str3.Substring(num2 + 1).IndexOf('"'); 167 | bld.Append(str3.Substring(num2 + 1, length)); 168 | break; 169 | } 170 | } 171 | } 172 | 173 | string url = bld.ToString(); 174 | samsungFirmwareOrgHtml = Utility.GetHtml(url); 175 | string infoSFO = GetInfoSFO(samsungFirmwareOrgHtml, "PDA Version"); 176 | string str5 = GetInfoSFO(samsungFirmwareOrgHtml, "CSC Version"); 177 | string str6 = GetInfoSFO(samsungFirmwareOrgHtml, "PHONE Version"); 178 | if ((string.IsNullOrEmpty(infoSFO) || string.IsNullOrEmpty(str5)) || string.IsNullOrEmpty(str6)) 179 | { 180 | return string.Empty; 181 | } 182 | return (infoSFO + "/" + str5 + "/" + str6); 183 | } 184 | 185 | public static string SamsungFirmwareOrgFetch1(string model, string region) 186 | { 187 | SamsungFirmwareOrgHtml = Utility.GetHtml("https://samsung-firmware.org/model/" + model + "/region/" + region + "/"); 188 | return SamsungFirmwareOrgFetch(model, region); 189 | } 190 | 191 | public static string SamsungFirmwareOrgFetch2(string model, string region) 192 | { 193 | string str = SamsungFirmwareOrgFetch(model, region); 194 | if (!string.IsNullOrEmpty(str)) 195 | { 196 | string[] strArray = str.Split(new [] { '/' }); 197 | str = strArray[0] + "/" + strArray[2] + "/" + strArray[1]; 198 | } 199 | return str; 200 | } 201 | 202 | //http://samsung-updates.com (연결안됨) 203 | private static string SamsungUpdatesFetch(string model, string region) 204 | { 205 | try 206 | { 207 | using (WebClient client = new WebClient()) 208 | { 209 | string s = client.DownloadString("http://samsung-updates.com/device/?id=" + model); 210 | StringBuilder bld = new StringBuilder(); 211 | bld.Append("http://samsung-updates.com"); 212 | bool flag = false; 213 | using (StringReader reader = new StringReader(s)) 214 | { 215 | string str3; 216 | while ((str3 = reader.ReadLine()) != null) 217 | { 218 | if (str3.Contains("/" + model + "/" + region + "/")) 219 | { 220 | int index = str3.IndexOf("a href=\""); 221 | int length = str3.Substring(index + 8).IndexOf('"'); 222 | bld.Append(str3.Substring(index + 8, length)); 223 | flag = true; 224 | break; 225 | } 226 | } 227 | } 228 | 229 | if (!flag) 230 | { 231 | return string.Empty; 232 | } 233 | string address = bld.ToString(); 234 | s = client.DownloadString(address); 235 | Match match = Regex.Match(s, @"PDA: ([^\s]+) "); 236 | if (!match.Success) 237 | { 238 | return string.Empty; 239 | } 240 | string format = match.Groups[1].Value + "/{0}/" + match.Groups[1].Value; 241 | match = Regex.Match(s, @"CSC: ([^\s]+) "); 242 | if (!match.Success) 243 | { 244 | return string.Empty; 245 | } 246 | return string.Format(format, match.Groups[1].Value); 247 | } 248 | } 249 | catch (WebException) 250 | { 251 | return string.Empty; 252 | } 253 | } 254 | 255 | private static string tdExtract(string line) 256 | { 257 | int startIndex = line.IndexOf("") + 4; 258 | int index = line.IndexOf(""); 259 | if ((startIndex >= 0) && (index >= 0)) 260 | { 261 | return line.Substring(startIndex, index - startIndex); 262 | } 263 | return string.Empty; 264 | } 265 | } 266 | } -------------------------------------------------------------------------------- /SamFirm/Imports.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace SamFirm 7 | { 8 | internal class Imports 9 | { 10 | private static IntPtr mod = IntPtr.Zero; 11 | 12 | //콘솔을 메모리에서 반환하는 메소드 13 | [DllImport("kernel32.dll")] 14 | public static extern bool FreeConsole(); 15 | 16 | //모듈(라이브러리)을 메모리에서 반환하는 메소드 17 | [DllImport("kernel32.dll")] 18 | private static extern bool FreeLibrary(IntPtr hModule); 19 | public static void FreeModule() 20 | { 21 | if (mod != IntPtr.Zero) 22 | { 23 | if (!FreeLibrary(mod)) 24 | { 25 | Logger.WriteLine("Error FreeModule(): Unable to free library."); 26 | } 27 | mod = IntPtr.Zero; 28 | } 29 | } 30 | 31 | //권한을 얻는 메소드 32 | public static string GetAuthorization(string Nonce) 33 | { 34 | if ((mod == IntPtr.Zero) && (LoadModule("AgentModule.dll") != 0)) 35 | { 36 | return string.Empty; 37 | } 38 | Auth_t _t = load_function(mod, "?MakeAuthorizationHeaderWithGeneratedNonceValueAndAMModule@AgentNetworkModule@@CAPB_WPB_W@Z"); 39 | IntPtr nonce = Marshal.StringToHGlobalUni(Nonce); 40 | string str = Marshal.PtrToStringUni(_t(nonce)); 41 | Marshal.FreeHGlobal(nonce); 42 | return str; 43 | } 44 | 45 | [DllImport("kernel32.dll")] 46 | private static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); 47 | private static T load_function(IntPtr module, string name) where T: class => 48 | (Marshal.GetDelegateForFunctionPointer(GetProcAddress(module, name), typeof(T)) as T); 49 | 50 | //모듈(라이브러리)을 로드하는 메소드 51 | [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)] 52 | private static extern IntPtr LoadLibrary(string dllToLoad); 53 | private static int LoadModule(string module) 54 | { 55 | try 56 | { 57 | string modulePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 58 | modulePath = Path.Combine(modulePath, "DLL", module); 59 | if (!File.Exists(modulePath)) 60 | { 61 | Logger.WriteLine("Error LoadModule(): " + module + " does not exist."); 62 | return 1; 63 | } 64 | 65 | mod = LoadLibrary(modulePath); 66 | if (mod == IntPtr.Zero) 67 | { 68 | Logger.WriteLine("Error LoadLibrary(): " + Marshal.GetLastWin32Error().ToString()); 69 | Logger.WriteLine("Please make sure \"Microsoft Visual C++ 2008 Redistributable Package (x86)\" and \"Microsoft Visual C++ 2010 Redistributable Package (x86)\" are installed."); 70 | return 1; 71 | } 72 | } 73 | catch (Exception exception) 74 | { 75 | Logger.WriteLine("Error LoadModule() -> " + exception); 76 | return 1; 77 | } 78 | return 0; 79 | } 80 | 81 | //스레드 실행 상태를 설정하는 메소드 82 | [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)] 83 | public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags); 84 | 85 | [UnmanagedFunctionPointer(CallingConvention.Winapi)] 86 | private delegate IntPtr Auth_t(IntPtr nonce); 87 | 88 | public enum EXECUTION_STATE : uint 89 | { 90 | ES_AWAYMODE_REQUIRED = 0x40, 91 | ES_CONTINUOUS = 0x80000000, 92 | ES_DISPLAY_REQUIRED = 2, 93 | ES_SYSTEM_REQUIRED = 1 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /SamFirm/KiesRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace SamFirm 5 | { 6 | internal class KiesRequest : WebRequest 7 | { 8 | public static new HttpWebRequest Create(string requestUriString) 9 | { 10 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUriString); 11 | request.Headers["Cache-Control"] = "no-cache"; 12 | request.UserAgent = "Kies2.0_FUS"; 13 | request.Headers.Add("Authorization", "FUS nonce=\"\", signature=\"\", nc=\"\", type=\"\", realm=\"\""); 14 | CookieContainer container = new CookieContainer(1); 15 | Cookie cookie = new Cookie("JSESSIONID", Web.JSessionID); 16 | container.Add(new Uri(requestUriString), cookie); 17 | request.CookieContainer = container; 18 | return request; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /SamFirm/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Windows.Forms; 4 | 5 | namespace SamFirm 6 | { 7 | internal static class Logger 8 | { 9 | public static MainForm Form { get; set; } 10 | 11 | //현재 날짜와 시각을 알아내는 함수 12 | private static string GetTimeDate() 13 | { 14 | return DateTime.Now.ToString("yyyy/MM/dd") + " " + DateTime.Now.ToString("HH:mm:ss"); 15 | } 16 | 17 | //로그를 파일로 저장하는 메소드 18 | public static void SaveLog() 19 | { 20 | if (!string.IsNullOrEmpty(Form.Log_textbox.Text)) 21 | { 22 | using (TextWriter writer = new StreamWriter(new FileStream("SamFirm.log", FileMode.Create))) 23 | { 24 | writer.WriteLine(GetTimeDate()); 25 | foreach (string str in Form.Log_textbox.Lines) 26 | { 27 | writer.WriteLine(str); 28 | } 29 | } 30 | } 31 | } 32 | 33 | //로그 텍스트 박스에 문자열을 출력하는 메소드 34 | public static void WriteLine(string str) 35 | { 36 | if (Form.Log_textbox.InvokeRequired) 37 | { 38 | Form.Log_textbox.Invoke(new Action(() => 39 | { 40 | Form.Log_textbox.AppendText(str + "\n"); 41 | Form.Log_textbox.ScrollToCaret(); 42 | })); 43 | } 44 | else 45 | { 46 | Form.Log_textbox.AppendText(str + "\n"); 47 | Form.Log_textbox.ScrollToCaret(); 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /SamFirm/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace SamFirm 4 | { 5 | partial class MainForm 6 | { 7 | /// 8 | /// 필수 디자이너 변수입니다. 9 | /// 10 | private System.ComponentModel.IContainer components = null; 11 | 12 | /// 13 | /// 사용 중인 모든 리소스를 정리합니다. 14 | /// 15 | /// 관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다. 16 | protected override void Dispose(bool disposing) 17 | { 18 | if (disposing && (components != null)) 19 | { 20 | components.Dispose(); 21 | } 22 | base.Dispose(disposing); 23 | } 24 | 25 | #region Windows Form 디자이너에서 생성한 코드 26 | 27 | /// 28 | /// 디자이너 지원에 필요한 메서드입니다. 29 | /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. 30 | /// 31 | private void InitializeComponent() 32 | { 33 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 34 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 35 | this.size_label = new System.Windows.Forms.Label(); 36 | this.update_button = new System.Windows.Forms.Button(); 37 | this.binary_checkbox = new System.Windows.Forms.CheckBox(); 38 | this.label8 = new System.Windows.Forms.Label(); 39 | this.speed_label = new System.Windows.Forms.Label(); 40 | this.region_textbox = new System.Windows.Forms.TextBox(); 41 | this.model_textbox = new System.Windows.Forms.TextBox(); 42 | this.label9 = new System.Windows.Forms.Label(); 43 | this.label2 = new System.Windows.Forms.Label(); 44 | this.label1 = new System.Windows.Forms.Label(); 45 | this.groupBox2 = new System.Windows.Forms.GroupBox(); 46 | this.progressBar1 = new System.Windows.Forms.ProgressBar(); 47 | this.decrypt_button = new System.Windows.Forms.Button(); 48 | this.download_button = new System.Windows.Forms.Button(); 49 | this.autoDecrypt_checkbox = new System.Windows.Forms.CheckBox(); 50 | this.version_textbox = new System.Windows.Forms.TextBox(); 51 | this.file_textbox = new System.Windows.Forms.TextBox(); 52 | this.label7 = new System.Windows.Forms.Label(); 53 | this.label6 = new System.Windows.Forms.Label(); 54 | this.log_textbox = new System.Windows.Forms.RichTextBox(); 55 | this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); 56 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); 57 | this.groupBox1.SuspendLayout(); 58 | this.groupBox2.SuspendLayout(); 59 | this.SuspendLayout(); 60 | // 61 | // groupBox1 62 | // 63 | this.groupBox1.Controls.Add(this.size_label); 64 | this.groupBox1.Controls.Add(this.update_button); 65 | this.groupBox1.Controls.Add(this.binary_checkbox); 66 | this.groupBox1.Controls.Add(this.label8); 67 | this.groupBox1.Controls.Add(this.speed_label); 68 | this.groupBox1.Controls.Add(this.region_textbox); 69 | this.groupBox1.Controls.Add(this.model_textbox); 70 | this.groupBox1.Controls.Add(this.label9); 71 | this.groupBox1.Controls.Add(this.label2); 72 | this.groupBox1.Controls.Add(this.label1); 73 | resources.ApplyResources(this.groupBox1, "groupBox1"); 74 | this.groupBox1.Name = "groupBox1"; 75 | this.groupBox1.TabStop = false; 76 | // 77 | // size_label 78 | // 79 | resources.ApplyResources(this.size_label, "size_label"); 80 | this.size_label.Name = "size_label"; 81 | // 82 | // update_button 83 | // 84 | resources.ApplyResources(this.update_button, "update_button"); 85 | this.update_button.Name = "update_button"; 86 | this.update_button.UseVisualStyleBackColor = true; 87 | this.update_button.Click += new System.EventHandler(this.Update_button_Click); 88 | // 89 | // binary_checkbox 90 | // 91 | resources.ApplyResources(this.binary_checkbox, "binary_checkbox"); 92 | this.binary_checkbox.Name = "binary_checkbox"; 93 | this.binary_checkbox.UseVisualStyleBackColor = true; 94 | // 95 | // label8 96 | // 97 | resources.ApplyResources(this.label8, "label8"); 98 | this.label8.Name = "label8"; 99 | // 100 | // speed_label 101 | // 102 | resources.ApplyResources(this.speed_label, "speed_label"); 103 | this.speed_label.Name = "speed_label"; 104 | // 105 | // region_textbox 106 | // 107 | this.region_textbox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; 108 | resources.ApplyResources(this.region_textbox, "region_textbox"); 109 | this.region_textbox.Name = "region_textbox"; 110 | // 111 | // model_textbox 112 | // 113 | this.model_textbox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; 114 | resources.ApplyResources(this.model_textbox, "model_textbox"); 115 | this.model_textbox.Name = "model_textbox"; 116 | // 117 | // label9 118 | // 119 | resources.ApplyResources(this.label9, "label9"); 120 | this.label9.Name = "label9"; 121 | // 122 | // label2 123 | // 124 | resources.ApplyResources(this.label2, "label2"); 125 | this.label2.Name = "label2"; 126 | // 127 | // label1 128 | // 129 | resources.ApplyResources(this.label1, "label1"); 130 | this.label1.Name = "label1"; 131 | // 132 | // groupBox2 133 | // 134 | resources.ApplyResources(this.groupBox2, "groupBox2"); 135 | this.groupBox2.Controls.Add(this.progressBar1); 136 | this.groupBox2.Controls.Add(this.decrypt_button); 137 | this.groupBox2.Controls.Add(this.download_button); 138 | this.groupBox2.Controls.Add(this.autoDecrypt_checkbox); 139 | this.groupBox2.Controls.Add(this.version_textbox); 140 | this.groupBox2.Controls.Add(this.file_textbox); 141 | this.groupBox2.Controls.Add(this.label7); 142 | this.groupBox2.Controls.Add(this.label6); 143 | this.groupBox2.Name = "groupBox2"; 144 | this.groupBox2.TabStop = false; 145 | // 146 | // progressBar1 147 | // 148 | resources.ApplyResources(this.progressBar1, "progressBar1"); 149 | this.progressBar1.Name = "progressBar1"; 150 | // 151 | // decrypt_button 152 | // 153 | resources.ApplyResources(this.decrypt_button, "decrypt_button"); 154 | this.decrypt_button.Name = "decrypt_button"; 155 | this.decrypt_button.UseVisualStyleBackColor = true; 156 | this.decrypt_button.Click += new System.EventHandler(this.Decrypt_button_Click); 157 | // 158 | // download_button 159 | // 160 | resources.ApplyResources(this.download_button, "download_button"); 161 | this.download_button.Name = "download_button"; 162 | this.download_button.UseVisualStyleBackColor = true; 163 | this.download_button.Click += new System.EventHandler(this.Download_button_Click); 164 | // 165 | // autoDecrypt_checkbox 166 | // 167 | resources.ApplyResources(this.autoDecrypt_checkbox, "autoDecrypt_checkbox"); 168 | this.autoDecrypt_checkbox.Checked = true; 169 | this.autoDecrypt_checkbox.CheckState = System.Windows.Forms.CheckState.Checked; 170 | this.autoDecrypt_checkbox.Name = "autoDecrypt_checkbox"; 171 | this.autoDecrypt_checkbox.UseVisualStyleBackColor = true; 172 | // 173 | // version_textbox 174 | // 175 | resources.ApplyResources(this.version_textbox, "version_textbox"); 176 | this.version_textbox.Name = "version_textbox"; 177 | this.version_textbox.ReadOnly = true; 178 | this.version_textbox.TabStop = false; 179 | // 180 | // file_textbox 181 | // 182 | resources.ApplyResources(this.file_textbox, "file_textbox"); 183 | this.file_textbox.Name = "file_textbox"; 184 | this.file_textbox.ReadOnly = true; 185 | this.file_textbox.TabStop = false; 186 | // 187 | // label7 188 | // 189 | resources.ApplyResources(this.label7, "label7"); 190 | this.label7.Name = "label7"; 191 | // 192 | // label6 193 | // 194 | resources.ApplyResources(this.label6, "label6"); 195 | this.label6.Name = "label6"; 196 | // 197 | // log_textbox 198 | // 199 | resources.ApplyResources(this.log_textbox, "log_textbox"); 200 | this.log_textbox.Name = "log_textbox"; 201 | this.log_textbox.ReadOnly = true; 202 | this.log_textbox.TabStop = false; 203 | // 204 | // saveFileDialog1 205 | // 206 | this.saveFileDialog1.AddExtension = false; 207 | resources.ApplyResources(this.saveFileDialog1, "saveFileDialog1"); 208 | this.saveFileDialog1.OverwritePrompt = false; 209 | this.saveFileDialog1.SupportMultiDottedExtensions = true; 210 | // 211 | // openFileDialog1 212 | // 213 | resources.ApplyResources(this.openFileDialog1, "openFileDialog1"); 214 | this.openFileDialog1.SupportMultiDottedExtensions = true; 215 | // 216 | // MainForm 217 | // 218 | this.AcceptButton = this.update_button; 219 | resources.ApplyResources(this, "$this"); 220 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 221 | this.Controls.Add(this.log_textbox); 222 | this.Controls.Add(this.groupBox2); 223 | this.Controls.Add(this.groupBox1); 224 | this.MaximizeBox = false; 225 | this.Name = "MainForm"; 226 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); 227 | this.Load += new System.EventHandler(this.MainForm_Load); 228 | this.groupBox1.ResumeLayout(false); 229 | this.groupBox1.PerformLayout(); 230 | this.groupBox2.ResumeLayout(false); 231 | this.groupBox2.PerformLayout(); 232 | this.ResumeLayout(false); 233 | 234 | } 235 | 236 | #endregion 237 | 238 | //필드 (컨트롤) 239 | private System.Windows.Forms.Button update_button; 240 | private System.Windows.Forms.Button download_button; 241 | private System.Windows.Forms.Button decrypt_button; 242 | private System.Windows.Forms.CheckBox binary_checkbox; 243 | private System.Windows.Forms.CheckBox autoDecrypt_checkbox; 244 | private System.Windows.Forms.GroupBox groupBox1; 245 | private System.Windows.Forms.GroupBox groupBox2; 246 | private System.Windows.Forms.Label label1; 247 | private System.Windows.Forms.Label label2; 248 | private System.Windows.Forms.Label label6; 249 | private System.Windows.Forms.Label label7; 250 | private System.Windows.Forms.Label label8; 251 | private System.Windows.Forms.Label label9; 252 | private System.Windows.Forms.Label size_label; 253 | private System.Windows.Forms.Label speed_label; 254 | private System.Windows.Forms.OpenFileDialog openFileDialog1; 255 | private System.Windows.Forms.ProgressBar progressBar1; 256 | private System.Windows.Forms.RichTextBox log_textbox; 257 | private System.Windows.Forms.SaveFileDialog saveFileDialog1; 258 | private System.Windows.Forms.TextBox model_textbox; 259 | private System.Windows.Forms.TextBox region_textbox; 260 | private System.Windows.Forms.TextBox file_textbox; 261 | private System.Windows.Forms.TextBox version_textbox; 262 | 263 | //Getter, Setter 메소드 264 | public RichTextBox Log_textbox { get => log_textbox; set => log_textbox = value; } 265 | public Label Speed_label { get => speed_label; set => speed_label = value; } 266 | } 267 | } -------------------------------------------------------------------------------- /SamFirm/MainForm.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAPICodePack.Taskbar; 2 | using System; 3 | using System.ComponentModel; 4 | using System.Diagnostics; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Net; 8 | using System.Reflection; 9 | using System.Windows.Forms; 10 | 11 | namespace SamFirm 12 | { 13 | internal partial class MainForm : Form 14 | { 15 | private string destinationFile; //다운로드하는 파일의 경로와 이름을 저장한다. 16 | private Command.Firmware FW; //다운로드할 펌웨어의 정보를 저장하는 구조체 객체. 17 | public bool PauseDownload { get; set; } //다운로드가 일시정지 되었는지 여부를 저장한다. 18 | 19 | 20 | //생성자 21 | public MainForm() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | //폼을 로드하면 호출하는 메소드 27 | private void MainForm_Load(object sender, EventArgs e) 28 | { 29 | //각 클래스의 form필드에 이 클래스를 붙여준다. 30 | Logger.Form = this; 31 | Web.Form = this; 32 | Decrypt.Form = this; 33 | 34 | //각 컨트롤에 설정파일에서 불러온 값을 적용한다. 35 | model_textbox.Text = Settings.ReadSetting("Model"); 36 | region_textbox.Text = Settings.ReadSetting("Region"); 37 | binary_checkbox.Checked = bool.Parse(Settings.ReadSetting("BinaryNature")); 38 | autoDecrypt_checkbox.Checked = bool.Parse(Settings.ReadSetting("AutoDecrypt")); 39 | 40 | //버전정보를 출력한다. 41 | FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); 42 | Logger.WriteLine("SamFirm v" + versionInfo.FileVersion); 43 | 44 | 45 | //서버 인증서의 유효성을 검사하는 콜백을 설정한다. 46 | ServicePointManager.ServerCertificateValidationCallback = (senderX, certificate, chain, sslPolicyErrors) => true; 47 | 48 | //다운로드 버튼, 복호화 버튼 비활성화 49 | download_button.Enabled = false; 50 | decrypt_button.Enabled = false; 51 | } 52 | 53 | //폼을 닫으면 호출하는 메소드 54 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) 55 | { 56 | //설정값을 저장한다. 57 | Settings.SetSetting("Model", model_textbox.Text); 58 | Settings.SetSetting("Region", region_textbox.Text); 59 | Settings.SetSetting("BinaryNature", binary_checkbox.Checked.ToString()); 60 | Settings.SetSetting("AutoDecrypt", autoDecrypt_checkbox.Checked.ToString()); 61 | 62 | //다운로드 일시정지 필드를 true로 한다. 63 | PauseDownload = true; 64 | 65 | //모듈을 메모리에서 내리고, 로그를 파일로 저장한다. 66 | Imports.FreeModule(); 67 | Logger.SaveLog(); 68 | } 69 | 70 | //Update 버튼 클릭시 실행하는 메소드 71 | private void Update_button_Click(object sender, EventArgs e) 72 | { 73 | //예외 처리 74 | if (string.IsNullOrEmpty(model_textbox.Text) || string.IsNullOrEmpty(region_textbox.Text)) 75 | { 76 | Logger.WriteLine("Error: Please specify a model or a region."); 77 | return; 78 | } 79 | 80 | //백그라운드 작업 등록 81 | using (BackgroundWorker worker = new BackgroundWorker()) 82 | { 83 | worker.DoWork += delegate 84 | { 85 | try 86 | { 87 | SetProgressBar(0); 88 | ControlsEnabled(false); 89 | Utility.ReconnectDownload = false; 90 | 91 | //업데이트를 검사한다. 92 | FW = Command.UpdateCheckAuto(model_textbox.Text, region_textbox.Text, binary_checkbox.Checked); 93 | 94 | //FW 구조체의 Filename멤버가 비어있으면 빈 글자를 출력하고, 95 | //비어있지 않으면 FW의 멤버를 출력한다. 96 | if (string.IsNullOrEmpty(FW.Filename)) 97 | { 98 | file_textbox.Invoke(new Action(() => file_textbox.Text = string.Empty)); 99 | version_textbox.Invoke(new Action(() => version_textbox.Text = string.Empty)); 100 | size_label.Invoke(new Action(() => size_label.Text = "0 GB")); 101 | } 102 | else 103 | { 104 | file_textbox.Invoke(new Action(() => file_textbox.Text = FW.Filename)); 105 | version_textbox.Invoke(new Action(() => version_textbox.Text = FW.Version)); 106 | double size = Math.Round(long.Parse(FW.Size) / 1024.0 / 1024.0 / 1024.0, 3); 107 | size_label.Invoke(new Action(() => size_label.Text = size.ToString(CultureInfo.InvariantCulture) + " GB")); 108 | } 109 | 110 | //출력을 완료하면 컨트롤을 활성화한다. 111 | ControlsEnabled(true); 112 | } 113 | catch (Exception exception) 114 | { 115 | Logger.WriteLine("Error Update_button_Click() -> " + exception); 116 | } 117 | }; 118 | worker.RunWorkerAsync(); 119 | } 120 | } 121 | 122 | //Download 버튼 클릭시 실행하는 메소드 123 | private void Download_button_Click(object sender, EventArgs e) 124 | { 125 | //다운로드를 일시정지한다. 126 | if (download_button.Text == "Pause") 127 | { 128 | Utility.TaskBarProgressPaused(true); 129 | PauseDownload = true; 130 | Utility.ReconnectDownload = false; 131 | download_button.Text = "Download"; 132 | return; 133 | } 134 | 135 | //예외 처리 136 | if ((e.GetType() == typeof(DownloadEventArgs)) && ((DownloadEventArgs)e).isReconnect) 137 | { 138 | if (download_button.Text == "Pause" || !Utility.ReconnectDownload) 139 | { 140 | return; 141 | } 142 | } 143 | if (PauseDownload == true) 144 | { 145 | Logger.WriteLine("Download thread is still running. Please wait."); 146 | return; 147 | } 148 | else if (string.IsNullOrEmpty(FW.Filename)) 149 | { 150 | Logger.WriteLine("No file to download. Please check for update first."); 151 | return; 152 | } 153 | 154 | //다운로드 작업 155 | if ((e.GetType() != typeof(DownloadEventArgs)) || !((DownloadEventArgs)e).isReconnect) 156 | { 157 | //extension = .zip.enc4 158 | string extension = Path.GetExtension(Path.GetFileNameWithoutExtension(FW.Filename)) + Path.GetExtension(FW.Filename); 159 | 160 | //파일이름의 기본값을 Model_Region_LastModified_Version으로 한다. 161 | string filename = string.Join("_", new string[] { FW.Model, FW.LastModified.Substring(0, 8), FW.Region, FW.Version.Replace('/', '-') }); 162 | saveFileDialog1.FileName = filename + extension; 163 | 164 | //확인 버튼을 누르지 않으면 다운로드를 취소한다. 165 | if (saveFileDialog1.ShowDialog() != DialogResult.OK) 166 | { 167 | Logger.WriteLine("Download canceled."); 168 | return; 169 | } 170 | 171 | //확장자가 .zip.enc4로 끝나지 않으면 따로 붙여준다. 172 | if (saveFileDialog1.FileName.EndsWith(extension) != true) 173 | { 174 | destinationFile = saveFileDialog1.FileName + extension; 175 | } 176 | else 177 | { 178 | destinationFile = saveFileDialog1.FileName; 179 | } 180 | 181 | //파일명을 출력한다. 182 | Logger.WriteLine("\nFilename: " + FW.Filename); 183 | 184 | //목적지에 파일이 존재하면 대화상자를 보여준다. 185 | if (File.Exists(destinationFile)) 186 | { 187 | using (AppendDialogBox appendDialog = new AppendDialogBox()) 188 | { 189 | switch (appendDialog.ShowDialog()) 190 | { 191 | case DialogResult.Yes: //append 192 | break; 193 | 194 | case DialogResult.No: //overwrite 195 | File.Delete(destinationFile); 196 | break; 197 | 198 | case DialogResult.Cancel: 199 | Logger.WriteLine("Download canceled."); 200 | return; 201 | 202 | default: 203 | Logger.WriteLine("Error: Wrong DialogResult."); 204 | return; 205 | } 206 | } 207 | } 208 | } 209 | 210 | //백그라운드 작업 등록 211 | Utility.TaskBarProgressPaused(false); 212 | using (BackgroundWorker worker = new BackgroundWorker()) 213 | { 214 | worker.DoWork += delegate (object o, DoWorkEventArgs _e) 215 | { 216 | try 217 | { 218 | ControlsEnabled(false); 219 | Utility.ReconnectDownload = false; 220 | 221 | //다운로드 버튼을 일시정지 버튼으로 바꾼다. 222 | MethodInvoker invoker1 = delegate 223 | { 224 | download_button.Enabled = true; 225 | download_button.Text = "Pause"; 226 | }; 227 | download_button.Invoke(invoker1); 228 | 229 | //다운로드 경로와 파일명을 출력한다. 230 | Logger.WriteLine("Download: " + destinationFile); 231 | 232 | //펌웨어 다운로드를 시작한다. 233 | Command.Download(FW.Path, FW.Filename, FW.Version, FW.Region, FW.Model_Type, destinationFile, FW.Size); 234 | if (PauseDownload == true) 235 | { 236 | Logger.WriteLine("Download paused."); 237 | PauseDownload = false; 238 | if (Utility.ReconnectDownload) 239 | { 240 | Logger.WriteLine("Reconnecting..."); 241 | Utility.Reconnect(new Action(Download_button_Click)); 242 | } 243 | } 244 | else 245 | { 246 | Logger.WriteLine("Download finished."); 247 | if (FW.CRC == null) 248 | { 249 | Logger.WriteLine("Error: Unable to check CRC. Value not set by Samsung."); 250 | } 251 | else 252 | { 253 | Logger.WriteLine("\nChecking CRC32..."); 254 | if (!Utility.CRCCheck(destinationFile, FW.CRC)) 255 | { 256 | Logger.WriteLine("Error: CRC does not match. Please redownload the file."); 257 | File.Delete(destinationFile); 258 | goto Label_01C9; 259 | } 260 | Logger.WriteLine("CRC matched."); 261 | } 262 | 263 | //자동 복호화가 체크되어 있으면 복호화 버튼 클릭 이벤트를 호출한다. 264 | if (autoDecrypt_checkbox.Checked) 265 | { 266 | decrypt_button.Invoke(new Action(() => decrypt_button.Enabled = true)); 267 | Decrypt_button_Click(o, null); 268 | } 269 | } 270 | Label_01C9: 271 | if (!Utility.ReconnectDownload) 272 | { 273 | ControlsEnabled(true); 274 | } 275 | download_button.Invoke(new Action(() => download_button.Text = "Download")); 276 | } 277 | catch (Exception exception) 278 | { 279 | Logger.WriteLine("Error Download_button_Click() -> " + exception); 280 | } 281 | }; 282 | worker.RunWorkerAsync(); 283 | } 284 | } 285 | 286 | //Decrypt 버튼 클릭시 실행하는 메소드 287 | private void Decrypt_button_Click(object sender, EventArgs e) 288 | { 289 | int retval; 290 | 291 | //목적경로에 파일이 없으면 파일열기 대화상자를 보여준다. 292 | if (!File.Exists(destinationFile)) 293 | { 294 | if (openFileDialog1.ShowDialog() != DialogResult.OK) 295 | { 296 | Logger.WriteLine("Decrypt canceled."); 297 | return; 298 | } 299 | destinationFile = openFileDialog1.FileName; 300 | } 301 | 302 | //백그라운드 작업 등록 303 | using (BackgroundWorker worker = new BackgroundWorker()) 304 | { 305 | worker.DoWork += delegate 306 | { 307 | ControlsEnabled(false); 308 | Logger.WriteLine("\nDecrypting firmware..."); 309 | 310 | //복호화 키를 설정한다. 311 | if (destinationFile.EndsWith(".enc2")) 312 | { 313 | Decrypt.SetDecryptKey(FW.Region, FW.Model, FW.Version); 314 | } 315 | else if (destinationFile.EndsWith(".enc4")) 316 | { 317 | if (FW.BinaryNature == 1) 318 | { 319 | Decrypt.SetDecryptKey(FW.Version, FW.LogicValueFactory); 320 | } 321 | else 322 | { 323 | Decrypt.SetDecryptKey(FW.Version, FW.LogicValueHome); 324 | } 325 | } 326 | 327 | //복호화를 실행한다. 328 | retval = Decrypt.DecryptFile(destinationFile, Path.Combine(Path.GetDirectoryName(destinationFile), Path.GetFileNameWithoutExtension(destinationFile))); 329 | if (retval == 0) 330 | { 331 | Logger.WriteLine("Decryption finished."); 332 | SetProgressBar(0); 333 | } 334 | ControlsEnabled(true); 335 | }; 336 | worker.RunWorkerAsync(); 337 | } 338 | } 339 | 340 | //컨트롤 활성화/비활성화 설정 메소드 341 | private void ControlsEnabled(bool boolValue) 342 | { 343 | model_textbox.Invoke(new Action(() => model_textbox.Enabled = boolValue)); 344 | region_textbox.Invoke(new Action(() => region_textbox.Enabled = boolValue)); 345 | binary_checkbox.Invoke(new Action(() => binary_checkbox.Enabled = boolValue)); 346 | update_button.Invoke(new Action(() => update_button.Enabled = boolValue)); 347 | download_button.Invoke(new Action(() => download_button.Enabled = boolValue)); 348 | decrypt_button.Invoke(new Action(() => decrypt_button.Enabled = boolValue)); 349 | autoDecrypt_checkbox.Invoke(new Action(() => autoDecrypt_checkbox.Enabled = boolValue)); 350 | } 351 | 352 | //작업 진행바를 설정하는 메소드 353 | public void SetProgressBar(int progress) 354 | { 355 | //폼의 진행바 컨트롤의 값을 변경한다. 356 | progressBar1.Invoke(new Action(() => progressBar1.Value = progress > 100 ? 100 : progress)); 357 | 358 | //작업 표시줄의 진행바의 값을 변경한다. 359 | TaskbarManager.Instance.SetProgressValue(progress, 100); 360 | } 361 | 362 | public class DownloadEventArgs : EventArgs 363 | { 364 | internal bool isReconnect; 365 | } 366 | } 367 | } -------------------------------------------------------------------------------- /SamFirm/MainForm.de.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 | Update suchen 122 | 123 | 124 | Binary Nature 125 | 126 | 127 | Region 128 | 129 | 130 | Modell 131 | 132 | 133 | Firmware Info 134 | 135 | 136 | Entschlüsseln 137 | 138 | 139 | Automatisch entschlüsseln 140 | 141 | 142 | Version 143 | 144 | 145 | Datei 146 | 147 | 148 | Download Info 149 | 150 | 151 | Alle Dateien|*.* 152 | 153 | 154 | Alle Dateien|*.* 155 | 156 | 157 | 158 | 159 | AAABAAEAAAAAAAEAIAD5FgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAFsBJ 160 | REFUeNrtnW10HNV5x/9rSRY2+AVsCAkJuAXSuAVsQtqEvGBRXsK717wTn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4j1rmDlByE8M 250 | nOLuJ0h+JqCD3Rfgt6DGz+HFPL7ZGoBmaw2CDgGqmPuf5SnHWULl+oEo6wOSWhfgNyvQq6NwxkImmdzf 251 | IXSlc0UCjhD4rQb0y+uDrAL0akFl+gDc75X26r8sLjrKInEs1JG9n3jfMCsEG/UBRFkZGPQ4baQh1dWA 252 | Dq7JQWLxGqdvNrGn0fuE2QPAa8JPWuv/VQqPLsTliFHvHXWPAD+HjrI3QLPjtKJkPwA3wsYgzrHg8bv4 253 | WqOx+GbDd3499+LnE50x6R2AVAqPbsTpiGHv38x5g8wHaDSCEXZ3IL+JSkffQ/mOQH402A9Q/LnRdNcg 254 | ghHkM8QhJLKoEB6dicMRo9w3qPP6vYfXe3k6rc/fATM/24y/S2JfwFQrn8+OwEHONROLIJ8xqpDIokJ4 255 | dCUORwx7X6/7N3PeZu8F+ItVoHNp7Q6cqcoX4PsAok7TjSIksqgSHh2J0xGj3t9th8zfNjs3jax8R4C2 256 | lS/itwElNd+/0f3SEh6dieKIUe7X7FxTsuLQsuS+Eqb8XYBpC48uxOaIYdDVeeOAlU8RGfsS0kyQZ0dU 257 | xf8DjTFm0sJ/UasAAAAASUVORK5CYII= 258 | 259 | 260 | -------------------------------------------------------------------------------- /SamFirm/MainForm.it.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 | 102, 138 123 | 124 | 125 | 138, 96 126 | 127 | 128 | 191, 30 129 | 130 | 131 | Controllo aggiornamenti 132 | 133 | 134 | 114, 24 135 | 136 | 137 | Tipo binario 138 | 139 | 140 | 90, 20 141 | 142 | 143 | Dimensione 144 | 145 | 146 | 247, 138 147 | 148 | 149 | 150 | Top, Left, Right 151 | 152 | 153 | 223, 27 154 | 155 | 156 | Top, Left, Right 157 | 158 | 159 | 223, 27 160 | 161 | 162 | 177, 138 163 | 164 | 165 | 64, 20 166 | 167 | 168 | Velocità 169 | 170 | 171 | 65, 20 172 | 173 | 174 | Regione 175 | 176 | 177 | 66, 20 178 | 179 | 180 | Modello 181 | 182 | 183 | 335, 161 184 | 185 | 186 | Info firmware 187 | 188 | 189 | 486, 27 190 | 191 | 192 | Decripta 193 | 194 | 195 | 212, 24 196 | 197 | 198 | Decripta automaticamente 199 | 200 | 201 | 486, 27 202 | 203 | 204 | 486, 27 205 | 206 | 207 | 68, 20 208 | 209 | 210 | Versione 211 | 212 | 213 | 353, 12 214 | 215 | 216 | 596, 161 217 | 218 | 219 | Info download 220 | 221 | 222 | 938, 282 223 | 224 | 225 | 962, 473 226 | 227 | 228 | 229 | AAABAAEAAAAAAAEAIAD5FgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAFsBJ 230 | REFUeNrtnW10HNV5x/9rSRY2+AVsCAkJuAXSuAVsQtqEvGBRXsK717wTnLD60k8hCMy7DV5DlJ42JweZ 231 | ck6/1aaFNqdJD+smJ2kSEmSMwQQMMiaoJLjIiRPqYpuVFMtIK2n6YWes0dXM7tx5u3Pv/H/n3DPS7Gjn 232 | 2dF9/vd57tsChBBCCCGEkBxRUG2AKXRW9iwDUATQYZ/qCPteZAYDrtILoLKpePqgaqNMgAIQEdvxe0CH 233 | T5Mq6s+8h0IQDQpABDore+5AvSISNfQBKG0qnr5LtSG6QgEIS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QFRTRQFLnvvGl7WcAOSgzUQggSKAqmojSK4p6e78gKYRAAB0bPyvOwD0qLaD5JLNvXdc1qna 260 | iDjQNQJA7x2XbQTQq9oOkjsGAHSpNiIutBoFmIF1dFRgoWpTSG4o9XZdpn3o76BtCuCwoufHK6HxYgyi 261 | FT1buy6/U7URcaJtCuCwtevyLaAAkOTpg4HDz9oLgE0JHBUgyVLa2nW5MaG/g/YpgMOKx368woLVq9oO 262 | YiTl5++8YoNqI5LAGAEAgAse+9FjMKiHlmSCvufvvOJc1UYkhSkpgEMZ9WEaQuKipNqAJDEqAgCACx77 263 | 0QrLYipAYqFr211XblRtRJKYFgHg+Tuv2AoDe2tJ6vSa7vyAgQIAANvuunIDuGyYhKcKw0N/B71nAjam 264 | BFh9qo0gWlLedtdV2q7xl8G4PgA3X/zOD7lgiMjS+8Kaqy5UbURaGJkCOLyw5iouGCIyVFFfap4bTE4B 265 | HEp2KrBQtSEk6xRKL6y5yrjZfg0/sWoD0uAL3/kBUwHSjMr2NVdrvb1XGIxOARy2r7l6IyxUjn65AAvL 266 | 9FJFTnr9RfKQAjiUAGsATAXIDAql7WuuzlXo75CLCAAAtt999SByqvKkIT3b7756i2ojVJGLPgA3n//2 267 | f24ChYDUGSgUsHz73dfksvUH8pUCOHQBVgfqX+ZIck2hlGfnB3KUAji8eM81TAUIAPS8eM81Wn6hZ5zk 268 | LgVw+Py3t3DvgPzS9+I9K41d4y9DbgUAAM7/+y38hqF8svyle1fuUm1EFshjH4CbEhcM5Y7yS/cW6fw2 269 | LaoNUMm+n313/ycuuRkAOlTbQlKh76V7i7eoNiJL5DoFcPjc31WYCphPFQV07GDrP428pwAORS4YMp7y 270 | jntX0fkFcjcM6MWO+4p7wW3ETKZ3x32rjN/eKwwUAJsd963aaAG96telsMRcquC8D1+YAkynCIsLhgyj 271 | vOP+a3OxvVcYGAG4ePm+VZwlaBaVl++/lqF/AygAAi/ff+0WC6hkIHRliVaqoJg3hSmANyXuHaA9pZfv 272 | vy7XC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QLPjtKJkPwA3wsYgzrHg8bv4 323 | WqOx+GbDd3499+LnE50x6R2AVAqPbsTpiGHv38x5g8wHaDSCEXZ3IL+JSkffQ/mOQH402A9Q/LnRdNcg 324 | ghHkM8QhJLKoEB6dicMRo9w3qPP6vYfXe3k6rc/fATM/24y/S2JfwFQrn8+OwEHONROLIJ8xqpDIokJ4 325 | dCUORwx7X6/7N3PeZu8F+ItVoHNp7Q6cqcoX4PsAok7TjSIksqgSHh2J0xGj3t9th8zfNjs3jax8R4C2 326 | lS/itwElNd+/0f3SEh6dieKIUe7X7FxTsuLQsuS+Eqb8XYBpC48uxOaIYdDVeeOAlU8RGfsS0kyQZ0dU 327 | xf8DjTFm0sJ/UasAAAAASUVORK5CYII= 328 | 329 | 330 | 331 | 980, 520 332 | 333 | -------------------------------------------------------------------------------- /SamFirm/MainForm.ko.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 | 123 | 124 | 복호화 125 | 126 | 127 | 펌웨어 정보 128 | 129 | 130 | 다운로드 정보 131 | 132 | 133 | 모델 134 | 135 | 136 | 지역 137 | 138 | 139 | 파일 140 | 141 | 142 | 버전 143 | 144 | 145 | 크기 146 | 147 | 148 | 속도 149 | 150 | 151 | 업데이트 확인 152 | 153 | -------------------------------------------------------------------------------- /SamFirm/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Globalization; 4 | using System.Reflection; 5 | using System.Windows.Forms; 6 | 7 | namespace SamFirm 8 | { 9 | internal static class Program 10 | { 11 | [STAThread] 12 | public static void Main() 13 | { 14 | Application.EnableVisualStyles(); 15 | Application.SetCompatibleTextRenderingDefault(false); 16 | Imports.FreeConsole(); 17 | 18 | //Set localization for testing. 19 | #if DEBUG 20 | CultureInfo.CurrentUICulture = new CultureInfo("de"); 21 | #endif 22 | 23 | //제목 표시줄에 버전정보를 출력한다. 24 | MainForm mainForm = new MainForm(); 25 | FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); 26 | mainForm.Text = "SamFirm Continued (v" + versionInfo.FileVersion + ")"; 27 | 28 | //프로그램 실행 29 | Application.Run(mainForm); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SamFirm/Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Xml.Linq; 4 | 5 | namespace SamFirm 6 | { 7 | internal static class Settings 8 | { 9 | //설정파일의 이름을 가진 상수 10 | private const string settingsXml = "Settings.xml"; 11 | 12 | //설정파일을 만드는 메소드 13 | private static void GenerateSettings() 14 | { 15 | string default_contents = 16 | "\r\n" + 17 | "\r\n" + 18 | "\t\r\n" + 19 | "\t\r\n" + 20 | "\tFalse\r\n" + 21 | "\tTrue\r\n" + 22 | ""; 23 | File.WriteAllText(settingsXml, default_contents); 24 | } 25 | 26 | //설정파일을 읽는 메소드 27 | public static string ReadSetting(string element) 28 | { 29 | try 30 | { 31 | if (!File.Exists(settingsXml)) 32 | { 33 | GenerateSettings(); 34 | } 35 | return XDocument.Load(settingsXml).Element("SamFirm").Element(element).Value; 36 | } 37 | catch (Exception exception) 38 | { 39 | Logger.WriteLine("Error ReadSetting() -> " + exception); 40 | return string.Empty; 41 | } 42 | } 43 | 44 | //설정파일을 쓰는 메소드 45 | public static void SetSetting(string element, string value) 46 | { 47 | if (!File.Exists(settingsXml)) 48 | { 49 | GenerateSettings(); 50 | } 51 | XDocument document = XDocument.Load(settingsXml); 52 | XElement element2 = document.Element("SamFirm").Element(element); 53 | if (element2 == null) 54 | { 55 | document.Element("SamFirm").Add(new XElement(element, value)); 56 | } 57 | else 58 | { 59 | element2.Value = value; 60 | } 61 | document.Save(settingsXml); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /SamFirm/Utility.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAPICodePack.Taskbar; 2 | using System; 3 | using System.ComponentModel; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Net; 7 | using System.Net.NetworkInformation; 8 | using System.Text; 9 | using System.Threading; 10 | 11 | namespace SamFirm 12 | { 13 | public static class Utility 14 | { 15 | private static Stopwatch dswatch = new Stopwatch(); 16 | private static int interval; 17 | private static long lastBread; 18 | private static int lastSpeed; 19 | public static bool ReconnectDownload { get; set; } 20 | 21 | public static bool CheckConnection(string address) 22 | { 23 | bool flag = false; 24 | Ping ping = new Ping(); 25 | for (int i = 1; i <= 4; i++) 26 | { 27 | if (flag == true) 28 | { 29 | return true; 30 | } 31 | 32 | flag = ping.Send(address, 2000).Status == IPStatus.Success; 33 | } 34 | return false; 35 | } 36 | 37 | public static int CheckHtmlXmlStatus(int htmlstatus, int xmlstatus) 38 | { 39 | int code = (xmlstatus == 0) ? htmlstatus : xmlstatus; 40 | switch (code) 41 | { 42 | case 400: 43 | Logger.WriteLine("Error CheckHtmlXmlStatus(): Request was invalid. Please check the input data."); 44 | return code; 45 | 46 | case 401: 47 | Logger.WriteLine("Error CheckHtmlXmlStatus(): Authorization failed."); 48 | return code; 49 | 50 | default: 51 | return code; 52 | } 53 | } 54 | 55 | //배열 2개가 같은 원소를 가졌는지 검사하는 메소드 56 | public static bool Compare(this byte[] arr1, byte[] arr2) 57 | { 58 | if (arr1.Length != arr2.Length) 59 | { 60 | return false; 61 | } 62 | for (int i = 0; i < arr1.Length; i++) 63 | { 64 | if (arr1[i] != arr2[i]) 65 | { 66 | return false; 67 | } 68 | } 69 | return true; 70 | } 71 | 72 | //CRC32를 검사하는 메소드 73 | public static bool CRCCheck(string file, byte[] crc) 74 | { 75 | byte[] buffer; 76 | if (!File.Exists(file)) 77 | { 78 | throw new FileNotFoundException("File for crc check not found"); 79 | } 80 | Crc32 crc2 = new Crc32(); 81 | using (FileStream stream = File.Open(file, FileMode.Open, FileAccess.Read)) 82 | { 83 | buffer = crc2.ComputeHash(stream); 84 | } 85 | return crc.Compare(buffer); 86 | } 87 | 88 | //다운로드 속도를 알아내는 메소드 89 | public static int DownloadSpeed(long bread, Stopwatch sw) 90 | { 91 | if (!sw.IsRunning) 92 | { 93 | sw.Start(); 94 | } 95 | if (interval < 150) 96 | { 97 | interval++; 98 | return -1; 99 | } 100 | interval = 0; 101 | double num = sw.ElapsedMilliseconds / 1000.0; 102 | long num2 = bread - lastBread; 103 | int num3 = (int) Math.Floor(num2 / num / 1024.0); 104 | if (lastSpeed != 0) 105 | { 106 | num3 = (lastSpeed + num3) / 2; 107 | } 108 | lastSpeed = num3; 109 | lastBread = bread; 110 | sw.Reset(); 111 | return Round(num3, 2); 112 | } 113 | 114 | public static string GetHtml(string url) 115 | { 116 | int num = 0; 117 | Label_0002: 118 | try 119 | { 120 | using (WebClient client = new WebClient()) 121 | { 122 | return client.DownloadString(url); 123 | } 124 | } 125 | catch (WebException) 126 | { 127 | if (num < 2) 128 | { 129 | num++; 130 | goto Label_0002; 131 | } 132 | } 133 | return string.Empty; 134 | } 135 | 136 | public static string GetLogicCheck(string input, string nonce) 137 | { 138 | if (string.IsNullOrEmpty(input)) 139 | { 140 | return string.Empty; 141 | } 142 | StringBuilder builder = new StringBuilder(); 143 | int num = 0; 144 | if (input.EndsWith(".zip.enc2") || input.EndsWith(".zip.enc4")) 145 | { 146 | num = input.Length - 0x19; 147 | } 148 | foreach (char ch in nonce) 149 | { 150 | int num2 = ch & '\x000f'; 151 | if (input.Length <= (num2 + num)) 152 | { 153 | return string.Empty; 154 | } 155 | builder.Append(input[num2 + num]); 156 | } 157 | return builder.ToString(); 158 | } 159 | 160 | public static int GetProgress(long value, long total) 161 | { 162 | float num = ((float) value) / total * 100f; 163 | return (int) num; 164 | } 165 | 166 | public static int GetXmlStatusCode(string xml) 167 | { 168 | int num; 169 | if (string.IsNullOrEmpty(xml)) 170 | { 171 | return 0; 172 | } 173 | if (int.TryParse(Xml.GetXMLValue(xml, "FUSBody/Results/Status", null, null), out num)) 174 | { 175 | return num; 176 | } 177 | return 666; 178 | } 179 | 180 | public static string InfoExtract(string info, string type) 181 | { 182 | string[] strArray = info.Split(new [] { '/' }); 183 | 184 | if (strArray.Length < 2) 185 | { 186 | Logger.WriteLine("Error InfoExtract(): The number of info is too small."); 187 | return string.Empty; 188 | } 189 | 190 | switch (type) 191 | { 192 | case "pda": 193 | return strArray[0]; 194 | 195 | case "csc": 196 | return strArray[1]; 197 | 198 | case "phone": 199 | if ((strArray.Length >= 3) && !string.IsNullOrEmpty(strArray[2])) 200 | { 201 | return strArray[2]; 202 | } 203 | return strArray[0]; 204 | 205 | case "data": 206 | if (strArray.Length < 4) 207 | { 208 | return strArray[0]; 209 | } 210 | return strArray[3]; 211 | 212 | default: 213 | Logger.WriteLine("Error InfoExtract(): Wrong type of info."); 214 | return string.Empty; 215 | } 216 | } 217 | 218 | public static void PreventDeepSleep(PDSMode mode) 219 | { 220 | if (mode == PDSMode.Start) 221 | { 222 | dswatch.Reset(); 223 | dswatch.Start(); 224 | } 225 | else if (mode == PDSMode.Stop) 226 | { 227 | dswatch.Stop(); 228 | } 229 | if (dswatch.ElapsedMilliseconds > 30000L) 230 | { 231 | Imports.SetThreadExecutionState(Imports.EXECUTION_STATE.ES_SYSTEM_REQUIRED); 232 | PreventDeepSleep(PDSMode.Start); 233 | } 234 | } 235 | 236 | public static void Reconnect(Action action) 237 | { 238 | BackgroundWorker worker = new BackgroundWorker(); 239 | worker.DoWork += delegate 240 | { 241 | Thread.Sleep(1000); 242 | if (CheckConnection("cloud-neofussvr.sslcs.cdngc.net")) 243 | { 244 | MainForm.DownloadEventArgs args = new MainForm.DownloadEventArgs 245 | { 246 | isReconnect = true 247 | }; 248 | action(null, args); 249 | } 250 | }; 251 | worker.RunWorkerAsync(); 252 | } 253 | 254 | public static void ResetSpeed(long _lastBread) 255 | { 256 | lastSpeed = 0; 257 | interval = 0; 258 | lastBread = _lastBread; 259 | } 260 | 261 | public static int Round(int num, int pos) 262 | { 263 | double num2 = Math.Pow(10.0, pos); 264 | if (num2 > num) 265 | { 266 | return num; 267 | } 268 | return num / ((int) num2) * ((int) num2); 269 | } 270 | 271 | public static void TaskBarProgressPaused(bool paused) 272 | { 273 | if (paused) 274 | { 275 | TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Paused); 276 | } 277 | else 278 | { 279 | TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Normal); 280 | } 281 | } 282 | 283 | public enum PDSMode 284 | { 285 | Start, 286 | Stop, 287 | Continue 288 | } 289 | } 290 | } -------------------------------------------------------------------------------- /SamFirm/Web.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | 9 | namespace SamFirm 10 | { 11 | internal static class Web 12 | { 13 | public static MainForm Form { get; set; } 14 | public static string JSessionID { get; set; } = string.Empty; 15 | public static string Nonce { get; set; } = string.Empty; 16 | 17 | public static int DownloadBinary(string path, string file, string saveTo, string size) 18 | { 19 | int num5; 20 | long num = 0L; 21 | HttpWebRequest wr = KiesRequest.Create("http://cloud-neofussvr.sslcs.cdngc.net/NF_DownloadBinaryForMass.do?file=" + path + file); 22 | wr.Method = "GET"; 23 | wr.Headers["Authorization"] = Imports.GetAuthorization(Nonce).Replace("Authorization: ", "").Replace("nonce=\"", "nonce=\"" + Nonce); 24 | wr.Timeout = 0x61a8; 25 | wr.ReadWriteTimeout = 0x61a8; 26 | if (File.Exists(saveTo)) 27 | { 28 | long length = new FileInfo(saveTo).Length; 29 | if (long.Parse(size) == length) 30 | { 31 | Logger.WriteLine("File already downloaded."); 32 | return 200; 33 | } 34 | Logger.WriteLine("File exists. Resuming download..."); 35 | wr.AddRange((int) length); 36 | num = length; 37 | } 38 | using (HttpWebResponse response = (HttpWebResponse) wr.GetFUSResponse()) 39 | { 40 | if (response == null) 41 | { 42 | Logger.WriteLine("Error DownloadBinary(): response is null."); 43 | return 0x385; 44 | } 45 | if ((response.StatusCode != HttpStatusCode.OK) && (response.StatusCode != HttpStatusCode.PartialContent)) 46 | { 47 | Logger.WriteLine("Error DownloadBinary(): " + ((int)response.StatusCode)); 48 | } 49 | else 50 | { 51 | long total = long.Parse(response.GetResponseHeader("content-length")) + num; 52 | if (!File.Exists(saveTo) || (new FileInfo(saveTo).Length != total)) 53 | { 54 | byte[] buffer = new byte[0x2000]; 55 | Stopwatch sw = new Stopwatch(); 56 | Utility.ResetSpeed(num); 57 | try 58 | { 59 | Utility.PreventDeepSleep(Utility.PDSMode.Start); 60 | using (BinaryWriter writer = new BinaryWriter(new FileStream(saveTo, FileMode.Append))) 61 | { 62 | int count = 0; 63 | do 64 | { 65 | Utility.PreventDeepSleep(Utility.PDSMode.Continue); 66 | if (Form.PauseDownload) 67 | { 68 | goto Label_02BB; 69 | } 70 | count = response.GetResponseStream().Read(buffer, 0, buffer.Length); 71 | num += count; 72 | if (count > 0) 73 | { 74 | writer.Write(buffer, 0, count); 75 | int dlspeed = Utility.DownloadSpeed(num, sw); 76 | if (dlspeed != -1) 77 | { 78 | Form.Speed_label.Invoke(new Action(delegate { 79 | Form.Speed_label.Text = dlspeed + " KB/s"; 80 | })); 81 | } 82 | } 83 | Form.SetProgressBar(Utility.GetProgress(num, total)); 84 | } 85 | while (count > 0); 86 | } 87 | } 88 | catch (IOException exception) 89 | { 90 | Logger.WriteLine("Error DownloadBinary(): Can't access output file " + saveTo); 91 | Logger.WriteLine(exception.ToString()); 92 | Form.PauseDownload = true; 93 | return -1; 94 | } 95 | catch (WebException) 96 | { 97 | Logger.WriteLine("Error DownloadBinary(): Connection interrupted."); 98 | SetReconnect(); 99 | } 100 | finally 101 | { 102 | Utility.PreventDeepSleep(Utility.PDSMode.Stop); 103 | Form.Speed_label.Invoke(new Action(() => Form.Speed_label.Text = "0 KB/s")); 104 | } 105 | } 106 | } 107 | Label_02BB: 108 | num5 = (int) response.StatusCode; 109 | } 110 | return num5; 111 | } 112 | 113 | public static int DownloadBinaryInform(string xml, out string xmlresponse) => 114 | XMLFUSRequest("https://neofussvr.sslcs.cdngc.net/NF_DownloadBinaryInform.do", xml, out xmlresponse); 115 | 116 | public static int DownloadBinaryInit(string xml, out string xmlresponse) => 117 | XMLFUSRequest("https://neofussvr.sslcs.cdngc.net/NF_DownloadBinaryInitForMass.do", xml, out xmlresponse); 118 | 119 | public static int GenerateNonce() 120 | { 121 | HttpWebRequest wr = KiesRequest.Create("https://neofussvr.sslcs.cdngc.net/NF_DownloadGenerateNonce.do"); 122 | wr.Method = "POST"; 123 | wr.ContentLength = 0L; 124 | using (HttpWebResponse response = (HttpWebResponse) wr.GetFUSResponse()) 125 | { 126 | if (response == null) 127 | { 128 | return 0x385; 129 | } 130 | return (int) response.StatusCode; 131 | } 132 | } 133 | 134 | public static void SetReconnect() 135 | { 136 | if (!Form.PauseDownload) 137 | { 138 | Utility.ReconnectDownload = true; 139 | } 140 | Form.PauseDownload = true; 141 | } 142 | 143 | private static int XMLFUSRequest(string URL, string xml, out string xmlresponse) 144 | { 145 | xmlresponse = null; 146 | HttpWebRequest wr = KiesRequest.Create(URL); 147 | wr.Method = "POST"; 148 | wr.Headers["Authorization"] = "FUS nonce=\"\", signature=\"" + Imports.GetAuthorization(Nonce) + "\", nc=\"\", type=\"\", realm=\"\""; 149 | byte[] bytes = Encoding.ASCII.GetBytes(Regex.Replace(xml, @"\r\n?|\n|\t", string.Empty)); 150 | wr.ContentLength = bytes.Length; 151 | using (Stream stream = wr.GetRequestStream()) 152 | { 153 | stream.Write(bytes, 0, bytes.Length); 154 | } 155 | using (HttpWebResponse response = (HttpWebResponse) wr.GetFUSResponse()) 156 | { 157 | if (response == null) 158 | { 159 | return 0x385; 160 | } 161 | if (response.StatusCode == HttpStatusCode.OK) 162 | { 163 | try 164 | { 165 | xmlresponse = new StreamReader(response.GetResponseStream()).ReadToEnd(); 166 | } 167 | catch (Exception) 168 | { 169 | return 900; 170 | } 171 | } 172 | return (int) response.StatusCode; 173 | } 174 | } 175 | 176 | public static WebResponse GetFUSResponse(this WebRequest wr) 177 | { 178 | try 179 | { 180 | WebResponse response = wr.GetResponse(); 181 | if (response.Headers.AllKeys.Contains("Set-Cookie")) 182 | { 183 | JSessionID = response.Headers["Set-Cookie"].Replace("JSESSIONID=", "").Split(new[] { ';' })[0]; 184 | } 185 | if (response.Headers.AllKeys.Contains("NONCE")) 186 | { 187 | Nonce = response.Headers["NONCE"]; 188 | } 189 | return response; 190 | } 191 | catch (WebException exception) 192 | { 193 | Logger.WriteLine("Error GetResponseFUS() -> " + exception.ToString()); 194 | if (exception.Status == WebExceptionStatus.NameResolutionFailure) 195 | { 196 | SetReconnect(); 197 | } 198 | return exception.Response; 199 | } 200 | } 201 | } 202 | } -------------------------------------------------------------------------------- /SamFirm/Xml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | 4 | namespace SamFirm 5 | { 6 | internal static class Xml 7 | { 8 | private static string BinaryInit = "\r\n\t\r\n\t\t1\r\n\t\t0\r\n\t\t1\r\n\t\r\n\t\r\n\t\t\r\n\t\t\t1\r\n\t\t\t\r\n\t\t\t\tSM-T805_AUT_1_20140929155250_b8l0mvlbba_fac.zip.enc2\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t0\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tT805XXU1ANFB/T805AUT1ANF1/T805XXU1ANF6/T805XXU1ANFB\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tAUT\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t9\r\n\t\t\t\r\n \r\n 805XXU1ANFU1ANXX\r\n \r\n\t\t\r\n\t\t\r\n\t\t\t2\r\n\t\t\t\r\n\t\t\r\n\t\r\n"; 9 | private static string LatestVer = "\r\n\t\r\n\t\t1\r\n\t\t0\r\n\t\t1\r\n\t\r\n\t\r\n\t\t\r\n\t\t\t1\r\n\t\t\t\r\n\t\t\t\t2\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t0\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tString\r\n\t\t\t\tISO 3166-1-alpha-3\r\n\t\t\t\t1033\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tSmart Switch\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t4.1.16014_12\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tT805XXU1ANF6\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tT805AUT1ANF1\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tT805XXU1ANFB/T805AUT1ANF1/T805XXU1ANF6/T805XXU1ANFB\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tAUT\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tSM-T805\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tT805XXU1ANE6\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tT805XXU1ANF6\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\tAndroid\r\n\t\t\t\r\n \r\n 805XXU1ANFU1ANXX\r\n \r\n\t\t\r\n\t\t\r\n\t\t\t2\r\n\t\t\t\r\n\t\t\r\n\t\r\n"; 10 | 11 | public static string GetXmlBinaryInform(string model, string region, string pdaver, string cscver, string phonever, string dataver, bool BinaryNature = false) 12 | { 13 | XDocument document = XDocument.Parse(LatestVer); 14 | XElement element = document.Element("FUSMsg").Element("FUSBody").Element("Put"); 15 | element.Element("DEVICE_MODEL_NAME").Element("Data").Value = model; 16 | element.Element("DEVICE_LOCAL_CODE").Element("Data").Value = region; 17 | element.Element("DEVICE_CONTENTS_DATA_VERSION").Element("Data").Value = dataver; 18 | element.Element("DEVICE_CSC_CODE2_VERSION").Element("Data").Value = cscver; 19 | element.Element("DEVICE_PDA_CODE1_VERSION").Element("Data").Value = pdaver; 20 | element.Element("DEVICE_PHONE_FONT_VERSION").Element("Data").Value = phonever; 21 | element.Element("DEVICE_FW_VERSION").Element("Data").Value = pdaver + "/" + cscver + "/" + phonever + "/" + dataver; 22 | element.Element("BINARY_NATURE").Element("Data").Value = Convert.ToInt32(BinaryNature).ToString(); 23 | element.Element("LOGIC_CHECK").Element("Data").Value = Utility.GetLogicCheck(pdaver + "/" + cscver + "/" + phonever + "/" + dataver, Web.Nonce); 24 | return document.ToString(); 25 | } 26 | 27 | public static string GetXmlBinaryInit(string file, string version, string region, string model_type) 28 | { 29 | XDocument document = XDocument.Parse(BinaryInit); 30 | XElement element = document.Element("FUSMsg").Element("FUSBody").Element("Put"); 31 | element.Element("BINARY_FILE_NAME").Element("Data").Value = file; 32 | element.Element("BINARY_VERSION").Element("Data").Value = version; 33 | element.Element("DEVICE_LOCAL_CODE").Element("Data").Value = region; 34 | element.Element("DEVICE_MODEL_TYPE").Element("Data").Value = model_type; 35 | element.Element("LOGIC_CHECK").Element("Data").Value = Utility.GetLogicCheck(file, Web.Nonce); 36 | return document.ToString(); 37 | } 38 | 39 | public static string GetXMLValue(string xml, string element, string attributename = null, string attributevalue = null) 40 | { 41 | XDocument document = XDocument.Parse(xml); 42 | string[] strArray = element.Split(new [] { '/' }); 43 | XElement root = document.Root; 44 | for (int i = 0; i < strArray.Length; i++) 45 | { 46 | if (i < (strArray.Length - 1)) 47 | { 48 | root = root.Element(strArray[i]); 49 | } 50 | else 51 | { 52 | foreach (XElement element3 in root.Elements(strArray[i])) 53 | { 54 | if (attributename == null) 55 | { 56 | root = element3; 57 | break; 58 | } 59 | XAttribute attribute = element3.Attribute(attributename); 60 | if ((attribute != null) && ((attributevalue == null) || (attribute.Value == attributevalue))) 61 | { 62 | root = element3; 63 | break; 64 | } 65 | } 66 | } 67 | } 68 | return root.Value; 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /imgs/CRC32.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/imgs/CRC32.PNG -------------------------------------------------------------------------------- /imgs/Complete.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/imgs/Complete.PNG -------------------------------------------------------------------------------- /imgs/Decrypt.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/imgs/Decrypt.PNG -------------------------------------------------------------------------------- /imgs/Download.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/imgs/Download.PNG -------------------------------------------------------------------------------- /imgs/Update Check.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/imgs/Update Check.PNG -------------------------------------------------------------------------------- /packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/download.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/res/download.ico -------------------------------------------------------------------------------- /res/warning.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synml/SamFirm-continued/334514521d5e6faa349fd0ff4ff35599d4f2e9e9/res/warning.ico --------------------------------------------------------------------------------