├── .github
├── ISSUE_TEMPLATE
│ └── bug_report.yml
└── workflows
│ └── ci.yml
├── .gitignore
├── LICENSE
├── Patcher
├── .gitignore
├── AutoPatcher
│ ├── App.config
│ ├── ArmDisassembler.cs
│ ├── AutoPatcher.csproj
│ ├── AutoPatcher.csproj.user
│ ├── BootUnllockAndRootAccessPatchScript.pds
│ ├── FolderSelectDialog.cs
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ ├── MainForm.resx
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── ScriptEngine.cs
├── Patcher.sln
├── Patcher
│ ├── App.config
│ ├── ArmCompiler.cs
│ ├── ByteOperations.cs
│ ├── HelperClasses.cs
│ ├── LICENSE
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ ├── MainForm.resx
│ ├── MainPatcher.cs
│ ├── ObjectFileParser.cs
│ ├── PatchEngine.cs
│ ├── Patcher.csproj
│ ├── Patcher.csproj.user
│ ├── PeFile.cs
│ ├── Program.cs
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
└── nuget.config
├── README.md
├── RootAccessTestUWP
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── LockScreenLogo.scale-200.png
│ ├── SplashScreen.scale-200.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── StoreLogo.png
│ └── Wide310x150Logo.scale-200.png
├── Core.cs
├── MainPage.xaml
├── MainPage.xaml.cs
├── Package.appxmanifest
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
└── RootAccessTestUWP.csproj
├── WPinternals.sln
├── WPinternals
├── 7zip
│ ├── Common
│ │ ├── CRC.cs
│ │ ├── CommandLineParser.cs
│ │ ├── InBuffer.cs
│ │ └── OutBuffer.cs
│ ├── Compress
│ │ ├── LZ
│ │ │ ├── IMatchFinder.cs
│ │ │ ├── LzBinTree.cs
│ │ │ ├── LzInWindow.cs
│ │ │ └── LzOutWindow.cs
│ │ ├── LZMA
│ │ │ ├── LzmaBase.cs
│ │ │ ├── LzmaDecoder.cs
│ │ │ └── LzmaEncoder.cs
│ │ └── RangeCoder
│ │ │ ├── RangeCoder.cs
│ │ │ ├── RangeCoderBit.cs
│ │ │ └── RangeCoderBitTree.cs
│ └── ICoder.cs
├── App.xaml
├── App.xaml.cs
├── CommandLine.cs
├── Config
│ ├── EmergencyFileEntry.cs
│ ├── FFUEntry.cs
│ ├── FlashProfile.cs
│ ├── Registration.cs
│ ├── SecWimEntry.cs
│ └── WPinternalsConfig.cs
├── DiscUtils
│ ├── DiscUtils.Core
│ │ ├── CoreCompat
│ │ │ └── EncodingHelper.cs
│ │ └── Internal
│ │ │ └── Utilities.cs
│ └── DiscUtils.Fat
│ │ ├── ClusterReader.cs
│ │ ├── ClusterStream.cs
│ │ ├── DirectoryEntry.cs
│ │ ├── FatAttributes.cs
│ │ ├── FatBuffer.cs
│ │ ├── FatFileStream.cs
│ │ ├── FatFileSystemOptions.cs
│ │ ├── FatType.cs
│ │ ├── FileAllocationTable.cs
│ │ ├── FileName.cs
│ │ ├── FileSystemFactory.cs
│ │ ├── FirstClusterChangedDelegate.cs
│ │ └── Modified
│ │ ├── Directory.cs
│ │ └── FatFileSystem.cs
├── FilePickerControl.xaml
├── FilePickerControl.xaml.cs
├── FolderSelectDialog.cs
├── HelperClasses
│ ├── ArrivalEventArgs.cs
│ ├── AsyncAutoResetEvent.cs
│ ├── AsyncHelpers.cs
│ ├── BigEndian.cs
│ ├── BooleanConverter.cs
│ ├── CollapsibleRun.cs
│ ├── CollapsibleSection.cs
│ ├── CompressedStream.cs
│ ├── Compression.cs
│ ├── Converter.cs
│ ├── DecompressedStream.cs
│ ├── DelegateCommand.cs
│ ├── DelegateCommandBase.cs
│ ├── ExtensionMethods.cs
│ ├── FlowDocumentScrollViewerNoMouseWheel.cs
│ ├── GifImage.cs
│ ├── GridViewColumnResize.cs
│ ├── HelperClasses.cs
│ ├── HexConverter.cs
│ ├── IActiveAware.cs
│ ├── InverseObjectToVisibilityConverter.cs
│ ├── LogFile.cs
│ ├── LogType.cs
│ ├── ObjectToVisibilityConverter.cs
│ ├── PE.cs
│ ├── Paragraph.cs
│ ├── ProgressUpdater.cs
│ ├── ReadSeekableStream.cs
│ ├── ResourceType.cs
│ ├── SeekableStream.cs
│ ├── Uploader.cs
│ ├── WPinternalsException.cs
│ ├── WPinternalsStatus.cs
│ └── WeakEventHandlerManager.cs
├── Logo-Small.png
├── Logo.png
├── Models
│ ├── ByteOperations.cs
│ ├── FFU.cs
│ ├── GPT.cs
│ ├── LZMA.cs
│ ├── Lumia
│ │ ├── MSR
│ │ │ └── LumiaDownloadModel.cs
│ │ ├── NCSd
│ │ │ └── NokiaCareSuiteModel.cs
│ │ ├── NokiaPhoneModel.cs
│ │ └── UEFI
│ │ │ ├── BootMgr
│ │ │ ├── LumiaBootManagerAppModel.cs
│ │ │ └── LumiaBootManagerPhoneInfo.cs
│ │ │ ├── CommonPhoneInfo.cs
│ │ │ ├── Flash
│ │ │ ├── FfuProtocol.cs
│ │ │ ├── FlashOptions.cs
│ │ │ ├── FlashVersion.cs
│ │ │ ├── Fuse.cs
│ │ │ ├── LumiaFlashAppModel.cs
│ │ │ ├── LumiaFlashAppPhoneInfo.cs
│ │ │ ├── SecureBootKeyType.cs
│ │ │ └── UefiSecurityStatusResponse.cs
│ │ │ ├── FlashAppType.cs
│ │ │ ├── NokiaUEFIModel.CommonExtendedSwitch.cs
│ │ │ ├── NokiaUEFIModel.cs
│ │ │ ├── PhoneInfo
│ │ │ ├── LumiaPhoneInfoAppModel.cs
│ │ │ └── LumiaPhoneInfoAppPhoneInfo.cs
│ │ │ └── PhoneInfoState.cs
│ ├── MassStorage.cs
│ ├── NativeMethods.cs
│ ├── PatchEngine.cs
│ ├── Privileges.cs
│ ├── QualcommDownload.cs
│ ├── QualcommFirehose.cs
│ ├── QualcommFlasher.cs
│ ├── QualcommLoader.cs
│ ├── QualcommPartition.cs
│ ├── QualcommSahara.cs
│ ├── QualcommSaharaCommand.cs
│ ├── QualcommSaharaMode.cs
│ ├── QualcommSerial.cs
│ ├── SBL1.cs
│ ├── SBL2.cs
│ ├── SBL3.cs
│ └── UEFI.cs
├── PatchDefinitions.xml
├── PhoneReboot.png
├── Properties
│ ├── AssemblyInfo.cs
│ ├── PublishProfiles
│ │ └── FolderProfile.pubxml.user
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── SB
├── SBA
├── SBMSM
├── Terminal
│ ├── Terminal.cs
│ └── TerminalResponse.cs
├── TestCode.cs
├── ViewModels
│ ├── AboutViewModel.cs
│ ├── BackupTargetSelectionViewModel.cs
│ ├── BackupViewModel.cs
│ ├── BusyViewModel.cs
│ ├── ContextViewModel.cs
│ ├── DisclaimerAndNdaViewModel.cs
│ ├── DisclaimerViewModel.cs
│ ├── DownloadsViewModel.cs
│ ├── DumpRomTargetSelectionViewModel.cs
│ ├── DumpRomViewModel.cs
│ ├── GettingStartedViewModel.cs
│ ├── HttpDownloader.cs
│ ├── LumiaFlashRomSourceSelectionViewModel.cs
│ ├── LumiaFlashRomViewModel.cs
│ ├── LumiaInfoViewModel.cs
│ ├── LumiaModeViewModel.cs
│ ├── LumiaUnlockBootViewModel.cs
│ ├── LumiaUnlockBootloaderViewModel.cs
│ ├── LumiaUnlockRootTargetSelectionViewModel.cs
│ ├── LumiaUnlockRootViewModel.cs
│ ├── LumiaV2UnlockBootViewModel.cs
│ ├── LumiaV3FlashRomViewModel.cs
│ ├── MainViewModel.cs
│ ├── MessageViewModel.cs
│ ├── NokiaBootloaderViewModel.cs
│ ├── NokiaFlashViewModel.cs
│ ├── NokiaLabelViewModel.cs
│ ├── NokiaMassStorageViewModel.cs
│ ├── NokiaModeBootloaderViewModel.cs
│ ├── NokiaModeFlashViewModel.cs
│ ├── NokiaModeLabelViewModel.cs
│ ├── NokiaModeMassStorageViewModel.cs
│ ├── NokiaModeNormalViewModel.cs
│ ├── NokiaModePhoneInfoViewModel.cs
│ ├── NokiaNormalViewModel.cs
│ ├── NokiaPhoneInfoViewModel.cs
│ ├── NotImplementedViewModel.cs
│ ├── PhoneNotifierViewModel.cs
│ ├── RegistrationViewModel.cs
│ ├── RestoreSourceSelectionViewModel.cs
│ ├── RestoreViewModel.cs
│ └── SwitchModeViewModel.cs
├── Views
│ ├── About.xaml
│ ├── About.xaml.cs
│ ├── BackupView.xaml
│ ├── BackupView.xaml.cs
│ ├── BootRestoreResourcesView.xaml
│ ├── BootRestoreResourcesView.xaml.cs
│ ├── BusyView.xaml
│ ├── BusyView.xaml.cs
│ ├── ContextView.xaml
│ ├── ContextView.xaml.cs
│ ├── DisclaimerAndNdaView.xaml
│ ├── DisclaimerAndNdaView.xaml.cs
│ ├── DisclaimerView.xaml
│ ├── DisclaimerView.xaml.cs
│ ├── DumpRomView.xaml
│ ├── DumpRomView.xaml.cs
│ ├── Empty.xaml
│ ├── Empty.xaml.cs
│ ├── FlashResourcesView.xaml
│ ├── FlashResourcesView.xaml.cs
│ ├── FlashRomView.xaml
│ ├── FlashRomView.xaml.cs
│ ├── GettingStartedView.xaml
│ ├── GettingStartedView.xaml.cs
│ ├── LumiaDownloadView.xaml
│ ├── LumiaDownloadView.xaml.cs
│ ├── LumiaUndoRootTargetSelectionView.xaml
│ ├── LumiaUndoRootTargetSelectionView.xaml.cs
│ ├── LumiaUnlockRootTargetSelectionView.xaml
│ ├── LumiaUnlockRootTargetSelectionView.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── MessageView.xaml
│ ├── MessageView.xaml.cs
│ ├── NokiaBootloaderView.xaml
│ ├── NokiaBootloaderView.xaml.cs
│ ├── NokiaFlashView.xaml
│ ├── NokiaFlashView.xaml.cs
│ ├── NokiaLabelView.xaml
│ ├── NokiaLabelView.xaml.cs
│ ├── NokiaMassStorageView.xaml
│ ├── NokiaMassStorageView.xaml.cs
│ ├── NokiaModeBootloaderView.xaml
│ ├── NokiaModeBootloaderView.xaml.cs
│ ├── NokiaModeFlashView.xaml
│ ├── NokiaModeFlashView.xaml.cs
│ ├── NokiaModeLabelView.xaml
│ ├── NokiaModeLabelView.xaml.cs
│ ├── NokiaModeMassStorageView.xaml
│ ├── NokiaModeMassStorageView.xaml.cs
│ ├── NokiaModeNormalView.xaml
│ ├── NokiaModeNormalView.xaml.cs
│ ├── NokiaModePhoneInfoView.xaml
│ ├── NokiaModePhoneInfoView.xaml.cs
│ ├── NokiaNormalView.xaml
│ ├── NokiaNormalView.xaml.cs
│ ├── NokiaPhoneInfoView.xaml
│ ├── NokiaPhoneInfoView.xaml.cs
│ ├── NotImplementedView.xaml
│ ├── NotImplementedView.xaml.cs
│ ├── RegistrationView.xaml
│ ├── RegistrationView.xaml.cs
│ ├── RestoreView.xaml
│ ├── RestoreView.xaml.cs
│ ├── StartupWindow.xaml
│ └── StartupWindow.xaml.cs
├── WPinternals.csproj
├── WPinternals.csproj.user
├── WPinternals.ico
├── WinUSBNet
│ ├── API
│ │ ├── APIException.cs
│ │ ├── DeviceDetails.cs
│ │ ├── DeviceManagement.cs
│ │ ├── DeviceManagementAPI.cs
│ │ ├── FileAPI.cs
│ │ ├── WinUSBDevice.cs
│ │ └── WinUSBDeviceAPI.cs
│ ├── DeviceNotifyHook.cs
│ ├── USB.cs
│ ├── USBAsyncResult.cs
│ ├── USBDevice.cs
│ ├── USBDeviceDescriptor.cs
│ ├── USBDeviceInfo.cs
│ ├── USBException.cs
│ ├── USBInterface.cs
│ ├── USBInterfaceCollection.cs
│ ├── USBNotifier.cs
│ ├── USBPipe.cs
│ ├── USBPipeCollection.cs
│ └── USBPipePolicy.cs
├── aerobusy.gif
├── app.config
└── app.manifest
├── WPinternalsSDK.UWP
├── Properties
│ └── WPinternalsSDK.UWP.rd.xml
└── WPinternalsSDK.UWP.csproj
├── WPinternalsSDK.WP81
└── WPinternalsSDK.WP81.csproj
├── WPinternalsSDK
├── CreationDisposition.cs
├── Environment.cs
├── FILETIME.cs
├── File.cs
├── FileAccess.cs
├── FileAttributes.cs
├── FileStream.cs
├── FileStreamMode.cs
├── FileSystem.cs
├── FileSystemEntry.cs
├── FileSystemType.cs
├── Folder.cs
├── GET_FILEEX_INFO_LEVELS.cs
├── KeyedList.cs
├── MoveFileFlags.cs
├── MoveMethod.cs
├── PROCESS_INFORMATION.cs
├── Properties
│ └── AssemblyInfo.cs
├── QUOTA_LIMITS.cs
├── RegCreateKeyOption.cs
├── RegOpenKeyOption.cs
├── RegResult.cs
├── RegSAM.cs
├── Registry.cs
├── RegistryHive.cs
├── RegistryItem.cs
├── RegistryKey.cs
├── RegistryValue.cs
├── RegistryValueType.cs
├── SECURITY_ATTRIBUTES.cs
├── STARTUPINFO.cs
├── ShareMode.cs
├── WIN32_FILE_ATTRIBUTE_DATA.cs
├── WIN32_FIND_DATA.cs
├── WPinternalsSDK.projitems
├── WPinternalsSDK.shproj
├── Win32.cs
└── Win32Exception.cs
└── nuget.config
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: Bug Report
2 | description: Create a bug report to help improve WPinternals
3 | labels: [bug]
4 | body:
5 | - type: textarea
6 | attributes:
7 | label: Description
8 | description: A clear and concise description of what the bug is.
9 | validations:
10 | required: true
11 | - type: textarea
12 | attributes:
13 | label: Steps To Reproduce
14 | description: Steps to reproduce the behavior.
15 | placeholder: |
16 | 1. Go to '....'
17 | 2. Click on '....'
18 | 3. Scroll down to '....'
19 | 4. See the error
20 | validations:
21 | required: false
22 | - type: textarea
23 | attributes:
24 | label: Expected behavior
25 | description: A clear and concise description of what you expected to happen.
26 | validations:
27 | required: true
28 | - type: input
29 | id: wpi-version
30 | attributes:
31 | label: WPinternals Version
32 | description: What version of WPinternals are you using?
33 | placeholder: v2.9.2
34 | validations:
35 | required: true
36 | - type: input
37 | attributes:
38 | label: Windows Version
39 | description: What version of Windows are you using? Press Win + Pause/Break and copy.
40 | placeholder: e.g. Windows 11 21H2 22000.132
41 | validations:
42 | required: true
43 | - type: input
44 | attributes:
45 | label: Phone model
46 | description: What phone model did you reproduce the bug on (if applicable)
47 | placeholder: e.g. Lumia 950 XL (RM-1085)
48 | validations:
49 | required: false
50 | - type: textarea
51 | attributes:
52 | label: Relevant Assets
53 | description: |
54 | A list of assets (logs, screenshots) relevant to this bug.
55 |
56 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
57 | placeholder: |
58 | To upload the log
59 | - Copy the `WPinternals.log` files from `%ALLUSERSPROFILE%\WPinternals`
60 | - Drag and drop them into this text area.
61 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches: [master]
6 | pull_request:
7 | branches: [master]
8 |
9 | jobs:
10 | build:
11 | runs-on: windows-latest
12 | strategy:
13 | matrix:
14 | architecture: [x86, x64, arm64]
15 | platform: [win]
16 | steps:
17 | - name: Checkout
18 | uses: actions/checkout@v4
19 |
20 | - name: Install .NET SDK
21 | uses: actions/setup-dotnet@v1
22 | with:
23 | dotnet-version: "8.0.x"
24 |
25 | - name: Add MSBuild to PATH
26 | uses: microsoft/setup-msbuild@v1.0.2
27 |
28 | - name: Build utilities
29 | shell: pwsh
30 | run: |
31 | msbuild /m /t:restore,wpinternals:publish /p:Platform=${{ matrix.architecture }} /p:RuntimeIdentifier=${{ matrix.platform }}-${{ matrix.architecture }} /p:PublishDir=${{ github.workspace }}/artifacts/${{ matrix.platform }}-${{ matrix.architecture }} /p:PublishSingleFile=true /p:PublishTrimmed=false WPinternals.sln
32 |
33 | - name: Upload artifact
34 | uses: actions/upload-artifact@v4
35 | with:
36 | name: ${{ matrix.platform }}-${{ matrix.architecture }}
37 | path: ${{ github.workspace }}/artifacts/${{ matrix.platform }}-${{ matrix.architecture }}
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
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 |
--------------------------------------------------------------------------------
/Patcher/AutoPatcher/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Patcher/AutoPatcher/AutoPatcher.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0-windows
4 | WinExe
5 | Patcher
6 | false
7 | true
8 | x86
9 |
10 |
11 |
12 | ArmCompiler.cs
13 |
14 |
15 | ByteOperations.cs
16 |
17 |
18 | HelperClasses.cs
19 |
20 |
21 | ObjectFileParser.cs
22 |
23 |
24 | PatchEngine.cs
25 |
26 |
27 | PeFile.cs
28 |
29 |
30 | LICENSE
31 |
32 |
33 | Always
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Patcher/AutoPatcher/AutoPatcher.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Form
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Patcher/AutoPatcher/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System;
22 | using System.Windows.Forms;
23 |
24 | namespace Patcher
25 | {
26 | internal static class Program
27 | {
28 | ///
29 | /// The main entry point for the application.
30 | ///
31 | [STAThread]
32 | private static void Main()
33 | {
34 | Application.EnableVisualStyles();
35 | Application.SetCompatibleTextRenderingDefault(false);
36 | Application.Run(new MainForm());
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Patcher/AutoPatcher/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("ARM Auto-patcher")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("WPinternals.net")]
11 | [assembly: AssemblyProduct("ARM Auto-patcher")]
12 | [assembly: AssemblyCopyright("Copyright © 2018 by Rene Lergner")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("95cf9509-c1c4-40f5-a60e-9d93ea6f438c")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Patcher/AutoPatcher/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Patcher.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.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 |
--------------------------------------------------------------------------------
/Patcher/AutoPatcher/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Patcher/Patcher.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.12.35323.107
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Patcher", "Patcher\Patcher.csproj", "{B67C62AE-86C4-4C18-99AB-4E94A3E09D36}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoPatcher", "AutoPatcher\AutoPatcher.csproj", "{95CF9509-C1C4-40F5-A60E-9D93EA6F438C}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | .NET45Debug|x86 = .NET45Debug|x86
13 | .NET45Release|x86 = .NET45Release|x86
14 | Debug|x86 = Debug|x86
15 | Release|x86 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|x86.ActiveCfg = Debug|x86
19 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Debug|x86.Build.0 = Debug|x86
20 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|x86.ActiveCfg = Release|x86
21 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}..NET45Release|x86.Build.0 = Release|x86
22 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|x86.ActiveCfg = Debug|x86
23 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Debug|x86.Build.0 = Debug|x86
24 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|x86.ActiveCfg = Release|Any CPU
25 | {B67C62AE-86C4-4C18-99AB-4E94A3E09D36}.Release|x86.Build.0 = Release|Any CPU
26 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|x86.ActiveCfg = Debug|x86
27 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Debug|x86.Build.0 = Debug|x86
28 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|x86.ActiveCfg = Release|x86
29 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}..NET45Release|x86.Build.0 = Release|x86
30 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|x86.ActiveCfg = Debug|x86
31 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Debug|x86.Build.0 = Debug|x86
32 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|x86.ActiveCfg = Release|x86
33 | {95CF9509-C1C4-40F5-A60E-9D93EA6F438C}.Release|x86.Build.0 = Release|x86
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | GlobalSection(ExtensibilityGlobals) = postSolution
39 | SolutionGuid = {6763D5C5-7BCE-437C-9FD0-67BDD8D79FD2}
40 | EndGlobalSection
41 | EndGlobal
42 |
--------------------------------------------------------------------------------
/Patcher/Patcher/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Patcher/Patcher/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
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 |
--------------------------------------------------------------------------------
/Patcher/Patcher/Patcher.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0-windows
4 | WinExe
5 | false
6 | true
7 | x86
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Patcher/Patcher/Patcher.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Form
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Patcher/Patcher/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System;
22 | using System.Windows.Forms;
23 |
24 | namespace Patcher
25 | {
26 | internal static class Program
27 | {
28 | ///
29 | /// The main entry point for the application.
30 | ///
31 | [STAThread]
32 | private static void Main()
33 | {
34 | Application.EnableVisualStyles();
35 | Application.SetCompatibleTextRenderingDefault(false);
36 | Application.Run(new MainForm());
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Patcher/Patcher/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("ARM Patcher")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("WPinternals.net")]
11 | [assembly: AssemblyProduct("ARM Patcher")]
12 | [assembly: AssemblyCopyright("Copyright © 2018 by Rene Lergner")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("b9aebca3-bcf8-4e4a-bf0e-5e764867be07")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Patcher/Patcher/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Patcher.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Patcher/Patcher/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Patcher/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Windows Phone Internals
2 |
3 | Windows Phone Internals (WPinternals or WPI for short) is a tool designed to unlock the bootloader and/or secure boot of select Lumia devices made by Nokia and Microsoft.
4 | Thanks to specifically crafted exploits/techniques the tool is able to disable Bootloader Security/SecureBoot on select Lumia models.
5 |
6 | After unlocking your bootloader you will be able to notably perform the following actions:
7 |
8 | - Boot other Operating Systems
9 | - Enable Root Access (on select OS versions)
10 | - Flash Custom ROMs
11 | - Backup your current Windows Phone ROM
12 | - Access your phone internal storage over USB
13 |
14 | ## Root Access
15 |
16 | Root Access is a set of patches/hacks disabling security inside Windows Phone at its root. Kernel Security, Permission checks, application container security, deployment capability security and much gets disabled as part of enabling root access.
17 |
18 | ## How to get started?
19 |
20 | The tool contains all the documentation you need to know more about the tool, we invite you to read the getting started section of the tool to know more.
21 |
22 | ## Where do I download the tool?
23 |
24 | Here: https://github.com/ReneLergner/WPinternals/releases/latest
25 |
--------------------------------------------------------------------------------
/RootAccessTestUWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/RootAccessTestUWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/RootAccessTestUWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/RootAccessTestUWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/RootAccessTestUWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/RootAccessTestUWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/RootAccessTestUWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/RootAccessTestUWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/RootAccessTestUWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/RootAccessTestUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/RootAccessTestUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/RootAccessTestUWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/RootAccessTestUWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/RootAccessTestUWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/RootAccessTestUWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/RootAccessTestUWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/RootAccessTestUWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
17 |
18 | namespace RootAccessTestUWP
19 | {
20 | ///
21 | /// An empty page that can be used on its own or navigated to within a Frame.
22 | ///
23 | public sealed partial class MainPage : Page
24 | {
25 | public MainPage()
26 | {
27 | this.InitializeComponent();
28 |
29 | TextBlock.Text = "Reading: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\PhoneProvisioner\\ColdBootDone" + Environment.NewLine + Environment.NewLine;
30 |
31 | bool flag = false;
32 | try
33 | {
34 | Core.RegReadDwordValue(Core.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\PhoneProvisioner", "ColdBootDone");
35 | flag = true;
36 | }
37 | catch
38 | {
39 | }
40 |
41 | if (flag)
42 | {
43 | TextBlock.Text = string.Concat(new string[]
44 | {
45 | TextBlock.Text,
46 | "Success!",
47 | Environment.NewLine,
48 | Environment.NewLine,
49 | "Root Access: Enabled"
50 | });
51 | }
52 | else
53 | {
54 | TextBlock.Text = string.Concat(new string[]
55 | {
56 | TextBlock.Text,
57 | "Failed!",
58 | Environment.NewLine,
59 | Environment.NewLine,
60 | "Root Access: Disabled"
61 | });
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/RootAccessTestUWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
16 |
17 | RootAccessTestUWP
18 | Rene
19 | Assets\StoreLogo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/RootAccessTestUWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("RootAccessTestUWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("RootAccessTestUWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/RootAccessTestUWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/WPinternals/7zip/Common/CRC.cs:
--------------------------------------------------------------------------------
1 | // Common/CRC.cs
2 |
3 | namespace SevenZip
4 | {
5 | internal class CRC
6 | {
7 | public static readonly uint[] Table;
8 |
9 | static CRC()
10 | {
11 | Table = new uint[256];
12 | const uint kPoly = 0xEDB88320;
13 | for (uint i = 0; i < 256; i++)
14 | {
15 | uint r = i;
16 | for (int j = 0; j < 8; j++)
17 | {
18 | if ((r & 1) != 0)
19 | {
20 | r = (r >> 1) ^ kPoly;
21 | }
22 | else
23 | {
24 | r >>= 1;
25 | }
26 | }
27 |
28 | Table[i] = r;
29 | }
30 | }
31 |
32 | private uint _value = 0xFFFFFFFF;
33 |
34 | public void Init() { _value = 0xFFFFFFFF; }
35 |
36 | public void UpdateByte(byte b)
37 | {
38 | _value = Table[((byte)_value) ^ b] ^ (_value >> 8);
39 | }
40 |
41 | public void Update(byte[] data, uint offset, uint size)
42 | {
43 | for (uint i = 0; i < size; i++)
44 | {
45 | _value = Table[((byte)_value) ^ data[offset + i]] ^ (_value >> 8);
46 | }
47 | }
48 |
49 | public uint GetDigest() { return _value ^ 0xFFFFFFFF; }
50 |
51 | private static uint CalculateDigest(byte[] data, uint offset, uint size)
52 | {
53 | CRC crc = new();
54 | // crc.Init();
55 | crc.Update(data, offset, size);
56 | return crc.GetDigest();
57 | }
58 |
59 | private static bool VerifyDigest(uint digest, byte[] data, uint offset, uint size)
60 | {
61 | return CalculateDigest(data, offset, size) == digest;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/WPinternals/7zip/Common/InBuffer.cs:
--------------------------------------------------------------------------------
1 | // InBuffer.cs
2 |
3 | namespace SevenZip.Buffer
4 | {
5 | public class InBuffer
6 | {
7 | private readonly byte[] m_Buffer;
8 | private uint m_Pos;
9 | private uint m_Limit;
10 | private readonly uint m_BufferSize;
11 | private System.IO.Stream m_Stream;
12 | private bool m_StreamWasExhausted;
13 | private ulong m_ProcessedSize;
14 |
15 | public InBuffer(uint bufferSize)
16 | {
17 | m_Buffer = new byte[bufferSize];
18 | m_BufferSize = bufferSize;
19 | }
20 |
21 | public void Init(System.IO.Stream stream)
22 | {
23 | m_Stream = stream;
24 | m_ProcessedSize = 0;
25 | m_Limit = 0;
26 | m_Pos = 0;
27 | m_StreamWasExhausted = false;
28 | }
29 |
30 | public bool ReadBlock()
31 | {
32 | if (m_StreamWasExhausted)
33 | {
34 | return false;
35 | }
36 |
37 | m_ProcessedSize += m_Pos;
38 | int aNumProcessedBytes = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize);
39 | m_Pos = 0;
40 | m_Limit = (uint)aNumProcessedBytes;
41 | m_StreamWasExhausted = aNumProcessedBytes == 0;
42 | return !m_StreamWasExhausted;
43 | }
44 |
45 | public void ReleaseStream()
46 | {
47 | // m_Stream.Close();
48 | m_Stream = null;
49 | }
50 |
51 | public bool ReadByte(byte b) // check it
52 | {
53 | if (m_Pos >= m_Limit && !ReadBlock())
54 | {
55 | return false;
56 | }
57 |
58 | b = m_Buffer[m_Pos++];
59 | return true;
60 | }
61 |
62 | public byte ReadByte()
63 | {
64 | // return (byte)m_Stream.ReadByte();
65 | if (m_Pos >= m_Limit && !ReadBlock())
66 | {
67 | return 0xFF;
68 | }
69 |
70 | return m_Buffer[m_Pos++];
71 | }
72 |
73 | public ulong GetProcessedSize()
74 | {
75 | return m_ProcessedSize + m_Pos;
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/WPinternals/7zip/Common/OutBuffer.cs:
--------------------------------------------------------------------------------
1 | // OutBuffer.cs
2 |
3 | namespace SevenZip.Buffer
4 | {
5 | public class OutBuffer
6 | {
7 | private readonly byte[] m_Buffer;
8 | private uint m_Pos;
9 | private readonly uint m_BufferSize;
10 | private System.IO.Stream m_Stream;
11 | private ulong m_ProcessedSize;
12 |
13 | public OutBuffer(uint bufferSize)
14 | {
15 | m_Buffer = new byte[bufferSize];
16 | m_BufferSize = bufferSize;
17 | }
18 |
19 | public void SetStream(System.IO.Stream stream) { m_Stream = stream; }
20 | public void FlushStream() { m_Stream.Flush(); }
21 | public void CloseStream() { m_Stream.Close(); }
22 | public void ReleaseStream() { m_Stream = null; }
23 |
24 | public void Init()
25 | {
26 | m_ProcessedSize = 0;
27 | m_Pos = 0;
28 | }
29 |
30 | public void WriteByte(byte b)
31 | {
32 | m_Buffer[m_Pos++] = b;
33 | if (m_Pos >= m_BufferSize)
34 | {
35 | FlushData();
36 | }
37 | }
38 |
39 | public void FlushData()
40 | {
41 | if (m_Pos == 0)
42 | {
43 | return;
44 | }
45 |
46 | m_Stream.Write(m_Buffer, 0, (int)m_Pos);
47 | m_Pos = 0;
48 | }
49 |
50 | public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos; }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/WPinternals/7zip/Compress/LZ/IMatchFinder.cs:
--------------------------------------------------------------------------------
1 | // IMatchFinder.cs
2 |
3 | using System;
4 |
5 | namespace SevenZip.Compression.LZ
6 | {
7 | internal interface IInWindowStream
8 | {
9 | void SetStream(System.IO.Stream inStream);
10 | void Init();
11 | void ReleaseStream();
12 | Byte GetIndexByte(Int32 index);
13 | UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit);
14 | UInt32 GetNumAvailableBytes();
15 | }
16 |
17 | internal interface IMatchFinder : IInWindowStream
18 | {
19 | void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
20 | UInt32 matchMaxLen, UInt32 keepAddBufferAfter);
21 | UInt32 GetMatches(UInt32[] distances);
22 | void Skip(UInt32 num);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WPinternals/Config/EmergencyFileEntry.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.IO;
22 | using System.Xml.Serialization;
23 | using WPinternals.HelperClasses;
24 |
25 | namespace WPinternals.Config
26 | {
27 | public class EmergencyFileEntry
28 | {
29 | public string Type;
30 |
31 | [XmlIgnore]
32 | public byte[] RKH;
33 | [XmlElement(ElementName = "RKH")]
34 | public string RKHAsString
35 | {
36 | get
37 | {
38 | return RKH == null ? null : Converter.ConvertHexToString(RKH, "");
39 | }
40 | set
41 | {
42 | RKH = value == null ? null : Converter.ConvertStringToHex(value);
43 | }
44 | }
45 |
46 | public string ProgrammerPath;
47 | public string PayloadPath;
48 |
49 | internal bool ProgrammerExists()
50 | {
51 | return File.Exists(ProgrammerPath);
52 | }
53 |
54 | internal bool PayloadExists()
55 | {
56 | return File.Exists(PayloadPath);
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/WPinternals/Config/FFUEntry.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.IO;
22 |
23 | namespace WPinternals.Config
24 | {
25 | public class FFUEntry
26 | {
27 | public string PlatformID;
28 | public string FirmwareVersion;
29 | public string OSVersion;
30 | public string Path;
31 |
32 | internal bool Exists()
33 | {
34 | return File.Exists(Path);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/WPinternals/Config/SecWimEntry.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.IO;
22 |
23 | namespace WPinternals.Config
24 | {
25 | public class SecWimEntry
26 | {
27 | public string FirmwareVersion;
28 | public string Path;
29 |
30 | internal bool Exists()
31 | {
32 | return File.Exists(Path);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/DiscUtils/DiscUtils.Core/CoreCompat/EncodingHelper.cs:
--------------------------------------------------------------------------------
1 | #if !NET40 && !NET45
2 | using System.Text;
3 | #endif
4 |
5 | namespace DiscUtils.CoreCompat
6 | {
7 | internal static class EncodingHelper
8 | {
9 | private static bool _registered;
10 |
11 | public static void RegisterEncodings()
12 | {
13 | if (_registered)
14 | return;
15 |
16 | _registered = true;
17 |
18 | #if !NET40 && !NET45
19 | Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
20 | #endif
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/WPinternals/DiscUtils/DiscUtils.Core/Internal/Utilities.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/DiscUtils/DiscUtils.Core/Internal/Utilities.cs
--------------------------------------------------------------------------------
/WPinternals/DiscUtils/DiscUtils.Fat/FatAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System;
24 |
25 | namespace DiscUtils.Fat
26 | {
27 | [Flags]
28 | internal enum FatAttributes : byte
29 | {
30 | ReadOnly = 0x01,
31 | Hidden = 0x02,
32 | System = 0x04,
33 | VolumeId = 0x08,
34 | Directory = 0x10,
35 | Archive = 0x20
36 | }
37 | }
--------------------------------------------------------------------------------
/WPinternals/DiscUtils/DiscUtils.Fat/FatFileSystemOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System;
24 | using System.Text;
25 |
26 | namespace DiscUtils.Fat
27 | {
28 | ///
29 | /// FAT file system options.
30 | ///
31 | public sealed class FatFileSystemOptions : DiscFileSystemOptions
32 | {
33 | private Encoding _encoding;
34 |
35 | internal FatFileSystemOptions()
36 | {
37 | FileNameEncoding = Encoding.GetEncoding(437);
38 | }
39 |
40 | internal FatFileSystemOptions(FileSystemParameters parameters)
41 | {
42 | if (parameters?.FileNameEncoding != null)
43 | {
44 | FileNameEncoding = parameters.FileNameEncoding;
45 | }
46 | else
47 | {
48 | FileNameEncoding = Encoding.GetEncoding(437);
49 | }
50 | }
51 |
52 | ///
53 | /// Gets or sets the character encoding used for file names.
54 | ///
55 | public Encoding FileNameEncoding
56 | {
57 | get { return _encoding; }
58 |
59 | set
60 | {
61 | if (!value.IsSingleByte)
62 | {
63 | throw new ArgumentException(value.EncodingName + " is not a single byte encoding");
64 | }
65 |
66 | _encoding = value;
67 | }
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/WPinternals/DiscUtils/DiscUtils.Fat/FatType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Fat
24 | {
25 | ///
26 | /// Enumeration of known FAT types.
27 | ///
28 | public enum FatType
29 | {
30 | ///
31 | /// Represents no known FAT type.
32 | ///
33 | None = 0,
34 |
35 | ///
36 | /// Represents a 12-bit FAT.
37 | ///
38 | Fat12 = 12,
39 |
40 | ///
41 | /// Represents a 16-bit FAT.
42 | ///
43 | Fat16 = 16,
44 |
45 | ///
46 | /// Represents a 32-bit FAT.
47 | ///
48 | Fat32 = 32
49 | }
50 | }
--------------------------------------------------------------------------------
/WPinternals/DiscUtils/DiscUtils.Fat/FileSystemFactory.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System.IO;
24 | using DiscUtils.Vfs;
25 | using DiscUtils.Streams;
26 |
27 | namespace DiscUtils.Fat
28 | {
29 | [VfsFileSystemFactory]
30 | internal class FileSystemFactory : VfsFileSystemFactory
31 | {
32 | public override FileSystemInfo[] Detect(Stream stream, VolumeInfo volume)
33 | {
34 | if (FatFileSystem.Detect(stream))
35 | {
36 | return [new VfsFileSystemInfo("FAT", "Microsoft FAT", Open)];
37 | }
38 |
39 | return [];
40 | }
41 |
42 | private DiscFileSystem Open(Stream stream, VolumeInfo volumeInfo, FileSystemParameters parameters)
43 | {
44 | return new FatFileSystem(stream, Ownership.None, parameters);
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/WPinternals/DiscUtils/DiscUtils.Fat/FirstClusterChangedDelegate.cs:
--------------------------------------------------------------------------------
1 | namespace DiscUtils.Fat
2 | {
3 | internal delegate void FirstClusterChangedDelegate(uint cluster);
4 | }
--------------------------------------------------------------------------------
/WPinternals/FilePickerControl.xaml:
--------------------------------------------------------------------------------
1 |
22 |
23 |
34 |
35 |
36 |
37 |
38 | Change
39 | Clear
40 |
41 |
42 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/ArrivalEventArgs.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 |
26 | namespace WPinternals.HelperClasses
27 | {
28 | internal class ArrivalEventArgs : EventArgs
29 | {
30 | public PhoneInterfaces NewInterface;
31 | public IDisposable NewModel;
32 |
33 | public ArrivalEventArgs(PhoneInterfaces NewInterface, IDisposable NewModel)
34 | : base()
35 | {
36 | this.NewInterface = NewInterface;
37 | this.NewModel = NewModel;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/CollapsibleRun.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 | using System.Windows;
26 | using System.Windows.Documents;
27 |
28 | namespace WPinternals.HelperClasses
29 | {
30 | internal class CollapsibleRun : Run
31 | {
32 | private string CollapsibleText;
33 |
34 | protected override void OnInitialized(EventArgs e)
35 | {
36 | base.OnInitialized(e);
37 |
38 | CollapsibleText = Text;
39 | }
40 |
41 | public bool IsVisible
42 | {
43 | get
44 | {
45 | return (bool)GetValue(IsVisibleProperty);
46 | }
47 | set
48 | {
49 | SetValue(IsVisibleProperty, value);
50 | }
51 | }
52 | public static readonly DependencyProperty IsVisibleProperty = DependencyProperty.Register(
53 | "IsVisible", typeof(bool), typeof(CollapsibleRun), new PropertyMetadata(true, IsVisibleChanged));
54 | public static void IsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
55 | {
56 | ((CollapsibleRun)d).Text = (bool)e.NewValue ? ((CollapsibleRun)d).CollapsibleText : string.Empty;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/Compression.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System.Collections;
25 | using System.IO;
26 | using System.IO.Compression;
27 |
28 | namespace WPinternals.HelperClasses
29 | {
30 | internal static class Compression
31 | {
32 | internal static Stream GetDecompressedStreamWithSeek(Stream InputStream)
33 | {
34 | long P = InputStream.Position;
35 | byte[] GZipHeader = new byte[3];
36 | InputStream.Read(GZipHeader, 0, 3);
37 | InputStream.Position = P;
38 | if (StructuralComparisons.StructuralEqualityComparer.Equals(GZipHeader, new byte[] { 0x1F, 0x8B, 0x08 }))
39 | {
40 | return new GZipStream(InputStream, CompressionMode.Decompress, false);
41 | }
42 | else
43 | {
44 | return InputStream;
45 | }
46 | }
47 |
48 | internal static bool IsCompressedStream(Stream InputStream)
49 | {
50 | byte[] GZipHeader = new byte[3];
51 | InputStream.Read(GZipHeader, 0, 3);
52 | return StructuralComparisons.StructuralEqualityComparer.Equals(GZipHeader, new byte[] { 0x1F, 0x8B, 0x08 });
53 | }
54 |
55 | internal static GZipStream GetDecompressedStream(Stream InputStream)
56 | {
57 | return new GZipStream(InputStream, CompressionMode.Decompress, false);
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/DelegateCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 |
26 | namespace WPinternals.HelperClasses
27 | {
28 | // This class is taken from the Prism library by Microsoft Patterns & Practices
29 | // License: http://compositewpf.codeplex.com/license
30 | public class DelegateCommand : DelegateCommandBase
31 | {
32 | public DelegateCommand(Action executeMethod)
33 | : this(executeMethod, () => true)
34 | {
35 | }
36 |
37 | public DelegateCommand(Action executeMethod, Func canExecuteMethod) : base(o => executeMethod(), f => canExecuteMethod())
38 | {
39 | }
40 |
41 | public bool CanExecute()
42 | {
43 | return CanExecute(null);
44 | }
45 |
46 | public void Execute()
47 | {
48 | Execute(null);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/ExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 | using System.Threading;
26 | using System.Threading.Tasks;
27 |
28 | namespace WPinternals.HelperClasses
29 | {
30 | internal static class ExtensionMethods
31 | {
32 | // This method was written by: Lawrence Johnston
33 | // https://stackoverflow.com/a/22078975
34 | public static async Task TimeoutAfter(this Task task, TimeSpan timeout)
35 | {
36 | using CancellationTokenSource timeoutCancellationTokenSource = new CancellationTokenSource();
37 | Task completedTask = await Task.WhenAny(task, Task.Delay(timeout, timeoutCancellationTokenSource.Token));
38 | if (completedTask == task)
39 | {
40 | timeoutCancellationTokenSource.Cancel();
41 | return await task; // Very important in order to propagate exceptions
42 | }
43 | else
44 | {
45 | throw new TimeoutException("The operation has timed out.");
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/FlowDocumentScrollViewerNoMouseWheel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System.Windows.Controls;
25 | using System.Windows.Input;
26 |
27 | namespace WPinternals.HelperClasses
28 | {
29 | internal class FlowDocumentScrollViewerNoMouseWheel : FlowDocumentScrollViewer
30 | {
31 | protected override void OnMouseWheel(MouseWheelEventArgs e)
32 | {
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/HelperClasses.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | namespace WPinternals.HelperClasses
25 | {
26 | internal delegate void SetWorkingStatus(string Message, string SubMessage = null, ulong? MaxProgressValue = null, bool ShowAnimation = true, WPinternalsStatus Status = WPinternalsStatus.Undefined);
27 | internal delegate void UpdateWorkingStatus(string Message, string SubMessage = null, ulong? CurrentProgressValue = null, WPinternalsStatus Status = WPinternalsStatus.Undefined);
28 | internal delegate void ExitSuccess(string Message, string SubMessage = null);
29 | internal delegate void ExitFailure(string Message, string SubMessage = null);
30 | }
31 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/IActiveAware.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 |
26 | namespace WPinternals.HelperClasses
27 | {
28 | // This interface is taken from the Prism library by Microsoft Patterns & Practices
29 | // License: http://compositewpf.codeplex.com/license
30 | public interface IActiveAware
31 | {
32 | ///
33 | /// Gets or sets a value indicating whether the object is active.
34 | ///
35 | /// if the object is active; otherwise .
36 | bool IsActive
37 | {
38 | get; set;
39 | }
40 |
41 | ///
42 | /// Notifies that the value for property has changed.
43 | ///
44 | event EventHandler IsActiveChanged;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/InverseObjectToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 | using System.Globalization;
26 | using System.Windows;
27 | using System.Windows.Data;
28 |
29 | namespace WPinternals.HelperClasses
30 | {
31 | public class InverseObjectToVisibilityConverter : DependencyObject, IValueConverter
32 | {
33 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
34 | {
35 | if (value == null)
36 | {
37 | return "Visible";
38 | }
39 | else
40 | {
41 | return "Collapsed";
42 | }
43 | }
44 |
45 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
46 | {
47 | throw new NotImplementedException();
48 | }
49 |
50 | public static object Default(Type type)
51 | {
52 | return type.IsValueType ? Activator.CreateInstance(type) : null;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/LogType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | namespace WPinternals.HelperClasses
25 | {
26 | internal enum LogType
27 | {
28 | FileOnly,
29 | FileAndConsole,
30 | ConsoleOnly
31 | };
32 | }
33 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/ObjectToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 | using System.Globalization;
26 | using System.Windows;
27 | using System.Windows.Data;
28 |
29 | namespace WPinternals.HelperClasses
30 | {
31 | public class ObjectToVisibilityConverter : DependencyObject, IValueConverter
32 | {
33 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
34 | {
35 | if (value == null)
36 | {
37 | return "Collapsed";
38 | }
39 | else
40 | {
41 | return "Visible";
42 | }
43 | }
44 |
45 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
46 | {
47 | throw new NotImplementedException();
48 | }
49 |
50 | public static object Default(Type type)
51 | {
52 | return type.IsValueType ? Activator.CreateInstance(type) : null;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/Paragraph.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 | using System.Linq;
26 | using System.Windows.Documents;
27 |
28 | namespace WPinternals.HelperClasses
29 | {
30 | // Overloaded Paragraph class to remove empty Run-elements, caused by auto-formatting new-lines in the XAML
31 | // Use helpers:Paragraph in a FlowDocument
32 | // This correction only works at run-time
33 | public class Paragraph : System.Windows.Documents.Paragraph
34 | {
35 | protected override void OnInitialized(EventArgs e)
36 | {
37 | base.OnInitialized(e);
38 | int inlinesCount = Inlines.Count;
39 | for (int i = 0; i < inlinesCount; i++)
40 | {
41 | Inline inline = Inlines.ElementAt(i);
42 | if (inline is Run run)
43 | {
44 | if (run.Text == Convert.ToChar(32).ToString()) //ACSII 32 is the white space
45 | {
46 | run.Text = string.Empty;
47 | }
48 | }
49 | }
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/ResourceType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | namespace WPinternals.HelperClasses
25 | {
26 | internal enum ResourceType
27 | {
28 | RT_CURSOR = 1,
29 | RT_BITMAP = 2,
30 | RT_ICON = 3,
31 | RT_MENU = 4,
32 | RT_DIALOG = 5,
33 | RT_STRING = 6,
34 | RT_FONTDIR = 7,
35 | RT_FONT = 8,
36 | RT_ACCELERATOR = 9,
37 | RT_RCDATA = 10,
38 | RT_MESSAGETABLE = 11,
39 | RT_GROUP_CURSOR = RT_CURSOR + 11,
40 | RT_GROUP_ICON = RT_ICON + 11,
41 | RT_VERSION = 16,
42 | RT_DLGINCLUDE = 17,
43 | RT_PLUGPLAY = 19,
44 | RT_VXD = 20,
45 | RT_ANICURSOR = 21,
46 | RT_ANIICON = 22,
47 | RT_HTML = 23,
48 | RT_MANIFEST = 24,
49 | RT_DLGINIT = 240,
50 | RT_TOOLBAR = 241
51 | };
52 | }
53 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/WPinternalsException.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | using System;
25 |
26 | namespace WPinternals.HelperClasses
27 | {
28 | internal class WPinternalsException : Exception
29 | {
30 | // Message and SubMessaage are always printable
31 | internal string SubMessage = null;
32 |
33 | internal WPinternalsException() : base() { }
34 |
35 | internal WPinternalsException(string Message) : base(Message) { }
36 |
37 | internal WPinternalsException(string Message, Exception InnerException) : base(Message, InnerException) { }
38 |
39 | internal WPinternalsException(string Message, string SubMessage) : base(Message) { this.SubMessage = SubMessage; }
40 |
41 | internal WPinternalsException(string Message, string SubMessage, Exception InnerException) : base(Message, InnerException) { this.SubMessage = SubMessage; }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/WPinternals/HelperClasses/WPinternalsStatus.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 | //
21 | // Some of the classes and functions in this file were found online.
22 | // Where possible the original authors are referenced.
23 |
24 | namespace WPinternals.HelperClasses
25 | {
26 | internal enum WPinternalsStatus
27 | {
28 | Undefined,
29 | Scanning,
30 | Flashing,
31 | Patching,
32 | WaitingForManualReset,
33 | SwitchingMode,
34 | Initializing
35 | };
36 | }
37 |
--------------------------------------------------------------------------------
/WPinternals/Logo-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/Logo-Small.png
--------------------------------------------------------------------------------
/WPinternals/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/Logo.png
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/Flash/FfuProtocol.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals.Models.UEFIApps.Flash
22 | {
23 | internal enum FfuProtocol
24 | {
25 | ProtocolSyncV1 = 1,
26 | ProtocolAsyncV1 = 2,
27 | ProtocolSyncV2 = 4,
28 | ProtocolAsyncV2 = 8,
29 | ProtocolAsyncV3 = 16
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/Flash/FlashOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System;
22 |
23 | namespace WPinternals.Models.UEFIApps.Flash
24 | {
25 | [Flags]
26 | internal enum FlashOptions : byte
27 | {
28 | SkipWrite = 1,
29 | SkipHashCheck = 2,
30 | SkipIdCheck = 4,
31 | SkipSignatureCheck = 8
32 | }
33 | }
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/Flash/FlashVersion.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals.Models.Lumia.UEFI.Flash
22 | {
23 | internal class FlashVersion
24 | {
25 | public int ApplicationMajor;
26 | public int ApplicationMinor;
27 | public int ProtocolMajor;
28 | public int ProtocolMinor;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/Flash/Fuse.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System;
22 |
23 | namespace WPinternals.Models.UEFIApps.Flash
24 | {
25 | [Flags]
26 | internal enum Fuse
27 | {
28 | SecureBoot = 1,
29 | FfuVerify = 2,
30 | Jtag = 4,
31 | Shk = 8,
32 | Simlock = 16,
33 | ProductionDone = 32,
34 | Rkh = 64,
35 | PublicId = 128,
36 | Dak = 256,
37 | SecGen = 512,
38 | OemId = 1024,
39 | FastBoot = 2048,
40 | SpdmSecMode = 4096,
41 | RpmWdog = 8192,
42 | Ssm = 16384
43 | }
44 | }
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/Flash/SecureBootKeyType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals.Models.UEFIApps.Flash
22 | {
23 | internal enum SecureBootKeyType : byte
24 | {
25 | Retail = 0,
26 | Engineering = 1
27 | }
28 | }
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/Flash/UefiSecurityStatusResponse.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals.Models.Lumia.UEFI.Flash
22 | {
23 | internal class UefiSecurityStatusResponse
24 | {
25 | public byte IsTestDevice;
26 | public bool PlatformSecureBootStatus;
27 | public bool SecureFfuEfuseStatus;
28 | public bool DebugStatus;
29 | public bool RdcStatus;
30 | public bool AuthenticationStatus;
31 | public bool UefiSecureBootStatus;
32 | public bool CryptoHardwareKey;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/FlashAppType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals.Models.Lumia.UEFI
22 | {
23 | internal enum FlashAppType
24 | {
25 | BootManager = 1,
26 | FlashApp = 2,
27 | PhoneInfoApp = 3
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/WPinternals/Models/Lumia/UEFI/PhoneInfoState.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals.Models.Lumia.UEFI
22 | {
23 | internal enum PhoneInfoState
24 | {
25 | Empty,
26 | Basic,
27 | Extended
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/WPinternals/Models/QualcommSaharaCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals
22 | {
23 | internal enum QualcommSaharaCommand : uint
24 | {
25 | HelloRequest = 0x01,
26 | HelloResponse = 0x02,
27 | ReadData = 0x03,
28 | EndTransfer = 0x04,
29 | DoneRequest = 0x05,
30 | DoneResponse = 0x06,
31 | ResetRequest = 0x07,
32 | ResetResponse = 0x08,
33 | MemoryDebug = 0x09,
34 | MemoryRead = 0x0A,
35 | CommandReady = 0x0B,
36 | SwitchMode = 0x0C,
37 | ExecuteRequest = 0x0D,
38 | ExecuteResponse = 0x0E,
39 | ExecuteData = 0x0F,
40 | MemoryDebug64 = 0x10,
41 | MemoryRead64 = 0x11,
42 | MemoryReadData64 = 0x12,
43 | ResetStateMachineIdentifier = 0x13
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/WPinternals/Models/QualcommSaharaMode.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals
22 | {
23 | internal enum QualcommSaharaMode : uint
24 | {
25 | ImageTransferPending = 0x00,
26 | ImagetransferComplete = 0x01,
27 | MemoryDebug = 0x02,
28 | Command = 0x03
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WPinternals/Models/SBL2.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System;
22 |
23 | namespace WPinternals
24 | {
25 | internal class SBL2
26 | {
27 | internal byte[] Binary;
28 |
29 | internal SBL2(byte[] Binary)
30 | {
31 | this.Binary = Binary;
32 | }
33 |
34 | // Magic!
35 | internal byte[] Patch()
36 | {
37 | UInt32? PatchOffset = ByteOperations.FindPattern(Binary,
38 | [
39 | 0xFF, 0xFF, 0xFF, 0xE3, 0x01, 0x0E, 0x42, 0xE3, 0x28, 0x00, 0xD0, 0xE5, 0x1E, 0xFF, 0x2F, 0xE1
40 | ],
41 | [
42 | 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
43 | ],
44 | null);
45 |
46 | if (PatchOffset == null)
47 | {
48 | throw new BadImageFormatException();
49 | }
50 |
51 | Buffer.BlockCopy(new byte[] { 0x00, 0x00, 0xA0, 0xE3 }, 0, Binary, (int)PatchOffset + 8, 4);
52 |
53 | return Binary;
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/WPinternals/PhoneReboot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/PhoneReboot.png
--------------------------------------------------------------------------------
/WPinternals/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("WPinternals")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WPinternals")]
13 | [assembly: AssemblyCopyright("Copyright © 2018-2023")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | //In order to begin building localizable applications, set
23 | //CultureYouAreCodingWith in your .csproj file
24 | //inside a . For example, if you are using US english
25 | //in your source files, set the to en-US. Then uncomment
26 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
27 | //the line below to match the UICulture setting in the project file.
28 |
29 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
30 |
31 | [assembly: ThemeInfo(
32 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
33 | //(used if a resource is not found in the page,
34 | // or application resource dictionaries)
35 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
36 | //(used if a resource is not found in the page,
37 | // app, or any theme specific resource dictionaries)
38 | )]
39 |
40 | // Version information for an assembly consists of the following four values:
41 | //
42 | // Major Version
43 | // Minor Version
44 | // Build Number
45 | // Revision
46 | //
47 | // You can specify all the values or you can default the Build and Revision Numbers
48 | // by using the '*' as shown below:
49 | // [assembly: AssemblyVersion("1.0.*")]
50 | [assembly: AssemblyVersion("3.0.*")]
51 | // [assembly: AssemblyFileVersion("1.0.0.0")]
52 |
--------------------------------------------------------------------------------
/WPinternals/Properties/PublishProfiles/FolderProfile.pubxml.user:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/WPinternals/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WPinternals.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.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 |
--------------------------------------------------------------------------------
/WPinternals/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WPinternals/SB:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/SB
--------------------------------------------------------------------------------
/WPinternals/SBA:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/SBA
--------------------------------------------------------------------------------
/WPinternals/SBMSM:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/SBMSM
--------------------------------------------------------------------------------
/WPinternals/Terminal/TerminalResponse.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Collections.Generic;
22 |
23 | namespace WPinternals.Terminal
24 | {
25 | internal class TerminalResponse
26 | {
27 | public Dictionary RawEntries = [];
28 | public byte[] PublicId = null;
29 | public byte[] RootKeyHash = null;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/WPinternals/ViewModels/AboutViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals
22 | {
23 | internal class AboutViewModel : ContextViewModel
24 | {
25 | internal AboutViewModel() : base() { }
26 |
27 | public int MajorVersion
28 | {
29 | get
30 | {
31 | return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major;
32 | }
33 | }
34 |
35 | public int MinorVersion
36 | {
37 | get
38 | {
39 | return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor;
40 | }
41 | }
42 |
43 | public int BuildVersion
44 | {
45 | get
46 | {
47 | return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build;
48 | }
49 | }
50 |
51 | public int RevisionVersion
52 | {
53 | get
54 | {
55 | return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision;
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/WPinternals/ViewModels/DisclaimerAndNdaViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using Microsoft.Win32;
22 | using System;
23 | using System.Windows;
24 | using WPinternals.HelperClasses;
25 |
26 | namespace WPinternals
27 | {
28 | internal class DisclaimerAndNdaViewModel : ContextViewModel
29 | {
30 | private readonly Action Accepted;
31 |
32 | internal DisclaimerAndNdaViewModel(Action Accepted)
33 | : base()
34 | {
35 | this.Accepted = Accepted;
36 | }
37 |
38 | private DelegateCommand _ExitCommand = null;
39 | public DelegateCommand ExitCommand
40 | {
41 | get
42 | {
43 | return _ExitCommand ??= new DelegateCommand(() => Application.Current.Shutdown());
44 | }
45 | }
46 |
47 | private DelegateCommand _ContinueCommand = null;
48 | public DelegateCommand ContinueCommand
49 | {
50 | get
51 | {
52 | return _ContinueCommand ??= new DelegateCommand(() =>
53 | {
54 | Registry.CurrentUser.OpenSubKey("Software\\WPInternals", true).SetValue("DisclaimerAccepted", 1, RegistryValueKind.DWord);
55 | Registry.CurrentUser.OpenSubKey("Software\\WPInternals", true).SetValue("NdaAccepted", 1, RegistryValueKind.DWord);
56 | Accepted();
57 | });
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/WPinternals/ViewModels/DisclaimerViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using Microsoft.Win32;
22 | using System;
23 | using System.Windows;
24 | using WPinternals.HelperClasses;
25 |
26 | namespace WPinternals
27 | {
28 | internal delegate void DisclaimerAcceptedHandler();
29 |
30 | internal class DisclaimerViewModel : ContextViewModel
31 | {
32 | private readonly Action Accepted;
33 |
34 | internal DisclaimerViewModel(Action Accepted)
35 | : base()
36 | {
37 | this.Accepted = Accepted;
38 | }
39 |
40 | private DelegateCommand _ExitCommand = null;
41 | public DelegateCommand ExitCommand
42 | {
43 | get
44 | {
45 | return _ExitCommand ??= new DelegateCommand(() => Application.Current.Shutdown());
46 | }
47 | }
48 |
49 | private DelegateCommand _ContinueCommand = null;
50 | public DelegateCommand ContinueCommand
51 | {
52 | get
53 | {
54 | return _ContinueCommand ??= new DelegateCommand(() =>
55 | {
56 | Registry.CurrentUser.OpenSubKey("Software\\WPInternals", true).SetValue("DisclaimerAccepted", 1, RegistryValueKind.DWord);
57 | Accepted();
58 | });
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/WPinternals/ViewModels/GettingStartedViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System;
22 |
23 | namespace WPinternals
24 | {
25 | internal class GettingStartedViewModel : ContextViewModel
26 | {
27 | internal Action ShowDisclaimer;
28 | internal Action SwitchToUnlockBoot;
29 | internal Action SwitchToUnlockRoot;
30 | internal Action SwitchToBackup;
31 | internal Action SwitchToDumpRom;
32 | internal Action SwitchToFlashRom;
33 | internal Action SwitchToDownload;
34 |
35 | internal GettingStartedViewModel(Action ShowDisclaimer, Action SwitchToUnlockBoot, Action SwitchToUnlockRoot, Action SwitchToBackup, Action SwitchToDumpRom, Action SwitchToFlashRom, Action SwitchToDownload)
36 | : base()
37 | {
38 | this.ShowDisclaimer = ShowDisclaimer;
39 | this.SwitchToUnlockBoot = SwitchToUnlockBoot;
40 | this.SwitchToUnlockRoot = SwitchToUnlockRoot;
41 | this.SwitchToBackup = SwitchToBackup;
42 | this.SwitchToFlashRom = SwitchToFlashRom;
43 | this.SwitchToDumpRom = SwitchToDumpRom;
44 | this.SwitchToDownload = SwitchToDownload;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/WPinternals/ViewModels/NokiaMassStorageViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals
22 | {
23 | internal class NokiaMassStorageViewModel : ContextViewModel
24 | {
25 | private readonly MassStorage CurrentModel;
26 |
27 | internal NokiaMassStorageViewModel(MassStorage CurrentModel)
28 | : base()
29 | {
30 | this.CurrentModel = CurrentModel;
31 | Drive = CurrentModel.Drive;
32 | }
33 | public string Drive { get; } = null;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/ViewModels/NotImplementedViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | namespace WPinternals
22 | {
23 | internal class NotImplementedViewModel : ContextViewModel
24 | {
25 | internal string Message { get; set; }
26 |
27 | internal NotImplementedViewModel(MainViewModel Main)
28 | : base(Main)
29 | {
30 | Message = "Not implemented yet...";
31 | }
32 |
33 | internal NotImplementedViewModel(MainViewModel Main, string Message)
34 | : base(Main)
35 | {
36 | this.Message = Message;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/WPinternals/Views/About.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Diagnostics;
22 | using System.Windows;
23 | using System.Windows.Controls;
24 | using System.Windows.Documents;
25 |
26 | namespace WPinternals
27 | {
28 | ///
29 | /// Interaction logic for About.xaml
30 | ///
31 | public partial class About : UserControl
32 | {
33 | public About()
34 | {
35 | InitializeComponent();
36 | }
37 |
38 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
39 | {
40 | if (args.Source is Hyperlink link)
41 | {
42 | Process process = new();
43 | process.StartInfo.UseShellExecute = true;
44 | process.StartInfo.FileName = link.NavigateUri.AbsoluteUri;
45 | process.Start();
46 | }
47 | }
48 |
49 | private void Document_Loaded(object sender, RoutedEventArgs e)
50 | {
51 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/WPinternals/Views/BackupView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for BackupView.xaml
29 | ///
30 | public partial class BackupView : UserControl
31 | {
32 | public BackupView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link && link.NavigateUri.ToString() == "UnlockBoot")
40 | {
41 | ((BackupTargetSelectionViewModel)DataContext).SwitchToUnlockBoot();
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 |
50 | private void FilePicker_PathChanged(object sender, PathChangedEventArgs e)
51 | {
52 | ((BackupTargetSelectionViewModel)DataContext).EvaluateViewState();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/WPinternals/Views/BusyView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows.Controls;
22 |
23 | namespace WPinternals
24 | {
25 | ///
26 | /// Interaction logic for BusyView.xaml
27 | ///
28 | public partial class BusyView : UserControl
29 | {
30 | public BusyView()
31 | {
32 | InitializeComponent();
33 |
34 | // Setting these properties in XAML results in an error. Why?
35 | GifImage.GifSource = "/aerobusy.gif";
36 | GifImage.AutoStart = true;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/WPinternals/Views/ContextView.xaml:
--------------------------------------------------------------------------------
1 |
22 |
23 |
31 |
32 |
33 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/WPinternals/Views/ContextView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows.Controls;
22 |
23 | namespace WPinternals
24 | {
25 | ///
26 | /// Interaction logic for ContextView.xaml
27 | ///
28 | public partial class ContextView : UserControl
29 | {
30 | public ContextView()
31 | {
32 | InitializeComponent();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/Views/DisclaimerAndNdaView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows.Controls;
22 |
23 | namespace WPinternals
24 | {
25 | ///
26 | /// Interaction logic for DisclaimerView.xaml
27 | ///
28 | public partial class DisclaimerAndNdaView : UserControl
29 | {
30 | public DisclaimerAndNdaView()
31 | {
32 | InitializeComponent();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/Views/DisclaimerView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows.Controls;
22 |
23 | namespace WPinternals
24 | {
25 | ///
26 | /// Interaction logic for DisclaimerView.xaml
27 | ///
28 | public partial class DisclaimerView : UserControl
29 | {
30 | public DisclaimerView()
31 | {
32 | InitializeComponent();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/Views/LumiaUndoRootTargetSelectionView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for LumiaUnlockRootTargetSelectionView.xaml
29 | ///
30 | public partial class LumiaUndoRootTargetSelectionView : UserControl
31 | {
32 | public LumiaUndoRootTargetSelectionView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link && link.NavigateUri.ToString() == "UnlockBoot")
40 | {
41 | ((LumiaUndoRootTargetSelectionViewModel)DataContext).SwitchToUnlockBoot();
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/MessageView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows.Controls;
22 |
23 | namespace WPinternals
24 | {
25 | ///
26 | /// Interaction logic for MessageView.xaml
27 | ///
28 | public partial class MessageView : UserControl
29 | {
30 | public MessageView()
31 | {
32 | InitializeComponent();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaFlashView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaFlashView.xaml
29 | ///
30 | public partial class NokiaFlashView : UserControl
31 | {
32 | public NokiaFlashView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | Hyperlink link = args.Source as Hyperlink;
40 | if (link?.NavigateUri != null)
41 | {
42 | if (link.NavigateUri.ToString() == "GettingStarted")
43 | {
44 | (this.DataContext as NokiaFlashViewModel)?.SwitchToGettingStarted();
45 | } (this.DataContext as NokiaFlashViewModel)?.RebootTo(link.NavigateUri.ToString());
46 | }
47 | }
48 |
49 | private void Document_Loaded(object sender, RoutedEventArgs e)
50 | {
51 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaLabelView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaLabelView.xaml
29 | ///
30 | public partial class NokiaLabelView : UserControl
31 | {
32 | public NokiaLabelView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | Hyperlink link = args.Source as Hyperlink;
40 | }
41 |
42 | private void Document_Loaded(object sender, RoutedEventArgs e)
43 | {
44 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaMassStorageView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaMassStorageView.xaml
29 | ///
30 | public partial class NokiaMassStorageView : UserControl
31 | {
32 | public NokiaMassStorageView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | Hyperlink link = args.Source as Hyperlink;
40 | }
41 |
42 | private void Document_Loaded(object sender, RoutedEventArgs e)
43 | {
44 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaModeBootloaderView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaModeBootloaderView.xaml
29 | ///
30 | public partial class NokiaModeBootloaderView : UserControl
31 | {
32 | public NokiaModeBootloaderView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | (this.DataContext as NokiaModeBootloaderViewModel)?.RebootTo(link.NavigateUri.ToString());
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaModeFlashView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaModeFlashView.xaml
29 | ///
30 | public partial class NokiaModeFlashView : UserControl
31 | {
32 | public NokiaModeFlashView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | (this.DataContext as NokiaModeFlashViewModel)?.RebootTo(link.NavigateUri.ToString());
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaModeLabelView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaModeLabelView.xaml
29 | ///
30 | public partial class NokiaModeLabelView : UserControl
31 | {
32 | public NokiaModeLabelView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | (this.DataContext as NokiaModeLabelViewModel)?.RebootTo(link.NavigateUri.ToString());
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaModeMassStorageView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaModeMassStorageView.xaml
29 | ///
30 | public partial class NokiaModeMassStorageView : UserControl
31 | {
32 | public NokiaModeMassStorageView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | (this.DataContext as NokiaModeMassStorageViewModel)?.RebootTo(link.NavigateUri.ToString());
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaModeNormalView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaModeNormalView.xaml
29 | ///
30 | public partial class NokiaModeNormalView : UserControl
31 | {
32 | public NokiaModeNormalView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | (this.DataContext as NokiaModeNormalViewModel)?.RebootTo(link.NavigateUri.ToString());
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaModePhoneInfoView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaModePhoneInfoView.xaml
29 | ///
30 | public partial class NokiaModePhoneInfoView : UserControl
31 | {
32 | public NokiaModePhoneInfoView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | (this.DataContext as NokiaModePhoneInfoViewModel)?.RebootTo(link.NavigateUri.ToString());
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaNormalView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaNormalView.xaml
29 | ///
30 | public partial class NokiaNormalView : UserControl
31 | {
32 | public NokiaNormalView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | (this.DataContext as NokiaNormalViewModel)?.RebootTo(link.NavigateUri.ToString());
42 | }
43 | }
44 |
45 | private void Document_Loaded(object sender, RoutedEventArgs e)
46 | {
47 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPinternals/Views/NokiaPhoneInfoView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for NokiaPhoneInfoView.xaml
29 | ///
30 | public partial class NokiaPhoneInfoView : UserControl
31 | {
32 | public NokiaPhoneInfoView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | Hyperlink link = args.Source as Hyperlink;
40 | if (link?.NavigateUri != null)
41 | {
42 | if (link.NavigateUri.ToString() == "GettingStarted")
43 | {
44 | (this.DataContext as NokiaPhoneInfoViewModel)?.SwitchToGettingStarted();
45 | } (this.DataContext as NokiaPhoneInfoViewModel)?.RebootTo(link.NavigateUri.ToString());
46 | }
47 | }
48 |
49 | private void Document_Loaded(object sender, RoutedEventArgs e)
50 | {
51 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/WPinternals/Views/NotImplementedView.xaml:
--------------------------------------------------------------------------------
1 |
22 |
23 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/WPinternals/Views/NotImplementedView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows.Controls;
22 |
23 | namespace WPinternals
24 | {
25 | ///
26 | /// Interaction logic for NotImplementedView.xaml
27 | ///
28 | public partial class NotImplementedView : UserControl
29 | {
30 | public NotImplementedView()
31 | {
32 | InitializeComponent();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/Views/RegistrationView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows.Controls;
22 |
23 | namespace WPinternals
24 | {
25 | ///
26 | /// Interaction logic for DisclaimerView.xaml
27 | ///
28 | public partial class RegistrationView : UserControl
29 | {
30 | public RegistrationView()
31 | {
32 | InitializeComponent();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternals/Views/RestoreView.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018, Rene Lergner - @Heathcliff74xda
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining a
4 | // copy of this software and associated documentation files (the "Software"),
5 | // to deal in the Software without restriction, including without limitation
6 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | // and/or sell copies of the Software, and to permit persons to whom the
8 | // Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in
11 | // all copies or substantial portions of the Software.
12 | //
13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | // DEALINGS IN THE SOFTWARE.
20 |
21 | using System.Windows;
22 | using System.Windows.Controls;
23 | using System.Windows.Documents;
24 |
25 | namespace WPinternals
26 | {
27 | ///
28 | /// Interaction logic for RestoreView.xaml
29 | ///
30 | public partial class RestoreView : UserControl
31 | {
32 | public RestoreView()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
38 | {
39 | if (args.Source is Hyperlink link)
40 | {
41 | if (link.NavigateUri.ToString() == "UnlockBoot")
42 | {
43 | (this.DataContext as RestoreSourceSelectionViewModel)?.SwitchToUnlockBoot();
44 | }
45 | else if (link.NavigateUri.ToString() == "Flash")
46 | {
47 | (this.DataContext as RestoreSourceSelectionViewModel)?.SwitchToFlashRom();
48 | }
49 | }
50 | }
51 |
52 | private void Document_Loaded(object sender, RoutedEventArgs e)
53 | {
54 | (sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
55 | }
56 |
57 | private void FilePicker_PathChanged(object sender, PathChangedEventArgs e)
58 | {
59 | ((RestoreSourceSelectionViewModel)DataContext).EvaluateViewState();
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/WPinternals/Views/StartupWindow.xaml:
--------------------------------------------------------------------------------
1 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/WPinternals/WPinternals.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/WPinternals.ico
--------------------------------------------------------------------------------
/WPinternals/WinUSBNet/API/APIException.cs:
--------------------------------------------------------------------------------
1 | /* WinUSBNet library
2 | * (C) 2010 Thomas Bleeker (www.madwizard.org)
3 | *
4 | * Licensed under the MIT license, see license.txt or:
5 | * http://www.opensource.org/licenses/mit-license.php
6 | */
7 |
8 | using System;
9 | using System.ComponentModel;
10 | using System.Runtime.InteropServices;
11 |
12 | namespace MadWizard.WinUSBNet.API
13 | {
14 | ///
15 | /// Exception used internally to catch Win32 API errors. This exception should
16 | /// not be thrown to the library's caller.
17 | ///
18 | internal class APIException : Exception
19 | {
20 | public APIException(string message) :
21 | base(message)
22 | {
23 | }
24 | public APIException(string message, Exception innerException) : base(message, innerException)
25 | {
26 | }
27 |
28 | public APIException() : base()
29 | {
30 | }
31 |
32 | public static APIException Win32(string message)
33 | {
34 | return Win32(message, Marshal.GetLastWin32Error());
35 |
36 | // TEST!!
37 | // int ErrorCode = Marshal.GetLastWin32Error();
38 | // if ((ErrorCode & 0xffff) == 0x1f)
39 | // ErrorCode = ErrorCode; // Break here
40 | // return APIException.Win32(message, ErrorCode);
41 | }
42 |
43 | public static APIException Win32(string message, int errorCode)
44 | {
45 | return new APIException(message, new Win32Exception(errorCode));
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/WPinternals/WinUSBNet/API/DeviceDetails.cs:
--------------------------------------------------------------------------------
1 | /* WinUSBNet library
2 | * (C) 2010 Thomas Bleeker (www.madwizard.org)
3 | *
4 | * Licensed under the MIT license, see license.txt or:
5 | * http://www.opensource.org/licenses/mit-license.php
6 | */
7 |
8 | namespace MadWizard.WinUSBNet.API
9 | {
10 | internal struct DeviceDetails
11 | {
12 | public string DevicePath;
13 | public string Manufacturer;
14 | public string DeviceDescription;
15 | public ushort VID;
16 | public ushort PID;
17 |
18 | // Heathcliff74
19 | public string BusName;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WPinternals/WinUSBNet/API/FileAPI.cs:
--------------------------------------------------------------------------------
1 | /* WinUSBNet library
2 | * (C) 2010 Thomas Bleeker (www.madwizard.org)
3 | *
4 | * Licensed under the MIT license, see license.txt or:
5 | * http://www.opensource.org/licenses/mit-license.php
6 | */
7 |
8 | /* NOTE: Parts of the code in this file are based on the work of Jan Axelson
9 | * See http://www.lvr.com/winusb.htm for more information
10 | */
11 |
12 | using Microsoft.Win32.SafeHandles;
13 | using System;
14 | using System.Runtime.InteropServices;
15 |
16 | namespace MadWizard.WinUSBNet.API
17 | {
18 | ///
19 | /// API declarations relating to file I/O (and used by WinUsb).
20 | ///
21 | sealed internal class FileIO
22 | {
23 | public const Int32 FILE_ATTRIBUTE_NORMAL = 0X80;
24 | public const Int32 FILE_FLAG_OVERLAPPED = 0X40000000;
25 | public const Int32 FILE_SHARE_READ = 1;
26 | public const Int32 FILE_SHARE_WRITE = 2;
27 | public const UInt32 GENERIC_READ = 0X80000000;
28 | public const UInt32 GENERIC_WRITE = 0X40000000;
29 | public static readonly IntPtr INVALID_HANDLE_VALUE = new(-1);
30 | public const Int32 OPEN_EXISTING = 3;
31 |
32 | public const Int32 ERROR_IO_PENDING = 997;
33 |
34 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
35 | public static extern SafeFileHandle CreateFile(String lpFileName, UInt32 dwDesiredAccess, Int32 dwShareMode, IntPtr lpSecurityAttributes, Int32 dwCreationDisposition, Int32 dwFlagsAndAttributes, Int32 hTemplateFile);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/WPinternals/WinUSBNet/USB.cs:
--------------------------------------------------------------------------------
1 | /* WinUSBNet library
2 | * (C) 2010 Thomas Bleeker (www.madwizard.org)
3 | *
4 | * Licensed under the MIT license, see license.txt or:
5 | * http://www.opensource.org/licenses/mit-license.php
6 | */
7 |
8 | namespace MadWizard.WinUSBNet
9 | {
10 | ///
11 | /// USB base class code enumeration, as defined in the USB specification
12 | ///
13 | public enum USBBaseClass
14 | {
15 | /// Unknown non-zero class code. Used when the actual class code
16 | /// does not match any of the ones defined in this enumeration.
17 | Unknown = -1,
18 |
19 | /// Base class defined elsewhere (0x00)
20 | None = 0x00,
21 |
22 | /// Audio base class (0x01)
23 | Audio = 0x01,
24 |
25 | /// Communications and CDC control base class (0x02)
26 | CommCDC = 0x02,
27 |
28 | /// HID base class (0x03)
29 | HID = 0x03,
30 |
31 | /// Physical base class (0x05)
32 | Physical = 0x05,
33 |
34 | /// Image base class (0x06)
35 | Image = 0x06,
36 |
37 | /// Printer base class (0x07)
38 | Printer = 0x07,
39 |
40 | /// Mass storage base class (0x08)
41 | MassStorage = 0x08,
42 |
43 | /// Hub base class (0x09)
44 | Hub = 0x09,
45 |
46 | /// CDC data base class (0x0A)
47 | CDCData = 0x0A,
48 |
49 | /// Smart card base class (0x0B)
50 | SmartCard = 0x0B,
51 |
52 | /// Content security base class (0x0D)
53 | ContentSecurity = 0x0D,
54 |
55 | /// Video base class (0x0E)
56 | Video = 0x0E,
57 |
58 | /// Personal health care base class (0x0F)
59 | PersonalHealthcare = 0x0F,
60 |
61 | /// Diagnostic device base class (0xDC)
62 | DiagnosticDevice = 0xDC,
63 |
64 | /// Wireless controller base class (0xE0)
65 | WirelessController = 0xE0,
66 |
67 | /// Miscellaneous base class (0xEF)
68 | Miscellaneous = 0xEF,
69 |
70 | /// Application specific base class (0xFE)
71 | ApplicationSpecific = 0xFE,
72 |
73 | /// Vendor specific base class (0xFF)
74 | VendorSpecific = 0xFF,
75 | };
76 | }
--------------------------------------------------------------------------------
/WPinternals/WinUSBNet/USBDeviceInfo.cs:
--------------------------------------------------------------------------------
1 | /* WinUSBNet library
2 | * (C) 2010 Thomas Bleeker (www.madwizard.org)
3 | *
4 | * Licensed under the MIT license, see license.txt or:
5 | * http://www.opensource.org/licenses/mit-license.php
6 | */
7 |
8 | namespace MadWizard.WinUSBNet
9 | {
10 | ///
11 | /// Gives information about a device. This information is retrieved using the setup API, not the
12 | /// actual device descriptor. Device description and manufacturer will be the strings specified
13 | /// in the .inf file. After a device is opened the actual device descriptor can be read as well.
14 | ///
15 | public class USBDeviceInfo
16 | {
17 | private API.DeviceDetails _details;
18 |
19 | ///
20 | /// Vendor ID (VID) of the USB device
21 | ///
22 | public int VID
23 | {
24 | get
25 | {
26 | return _details.VID;
27 | }
28 | }
29 |
30 | ///
31 | /// Product ID (VID) of the USB device
32 | ///
33 | public int PID
34 | {
35 | get
36 | {
37 | return _details.PID;
38 | }
39 | }
40 |
41 | ///
42 | /// Manufacturer of the device, as specified in the INF file (not the device descriptor)
43 | ///
44 | public string Manufacturer
45 | {
46 | get
47 | {
48 | return _details.Manufacturer;
49 | }
50 | }
51 |
52 | ///
53 | /// Description of the device, as specified in the INF file (not the device descriptor)
54 | ///
55 | public string DeviceDescription
56 | {
57 | get
58 | {
59 | return _details.DeviceDescription;
60 | }
61 | }
62 |
63 | ///
64 | /// Device pathname
65 | ///
66 | public string DevicePath
67 | {
68 | get
69 | {
70 | return _details.DevicePath;
71 | }
72 | }
73 |
74 | ///
75 | /// BusName
76 | /// Heathcliff74
77 | ///
78 | public string BusName
79 | {
80 | get
81 | {
82 | return _details.BusName;
83 | }
84 | }
85 |
86 | internal USBDeviceInfo(API.DeviceDetails details)
87 | {
88 | _details = details;
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/WPinternals/WinUSBNet/USBException.cs:
--------------------------------------------------------------------------------
1 | /* WinUSBNet library
2 | * (C) 2010 Thomas Bleeker (www.madwizard.org)
3 | *
4 | * Licensed under the MIT license, see license.txt or:
5 | * http://www.opensource.org/licenses/mit-license.php
6 | */
7 |
8 | using System;
9 |
10 | namespace MadWizard.WinUSBNet
11 | {
12 | ///
13 | /// Exception used by WinUSBNet to indicate errors. This is the
14 | /// main exception to catch when using the library.
15 | ///
16 | public class USBException : Exception
17 | {
18 | ///
19 | /// Constructs a new USBException with the given message
20 | ///
21 | /// The message describing the exception
22 | public USBException(string message)
23 | : base(message)
24 | {
25 | }
26 |
27 | ///
28 | /// Constructs a new USBException with the given message and underlying exception
29 | /// that caused the USBException.
30 | ///
31 | /// The message describing the exception
32 | /// The underlying exception causing the USBException
33 | public USBException(string message, Exception innerException)
34 | : base(message, innerException)
35 | {
36 | }
37 |
38 | public USBException() : base()
39 | {
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/WPinternals/aerobusy.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReneLergner/WPinternals/1cc7a5cee4eeaac95c4f16931961a62eb61f4cb7/WPinternals/aerobusy.gif
--------------------------------------------------------------------------------
/WPinternals/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPinternals/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/WPinternalsSDK.UWP/Properties/WPinternalsSDK.UWP.rd.xml:
--------------------------------------------------------------------------------
1 |
2 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/WPinternalsSDK.WP81/WPinternalsSDK.WP81.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {25D167AB-D58A-4195-8EF7-E736F330822C}
8 | Library
9 | WPinternalsSDK
10 | WPinternalsSDK
11 | v8.1
12 | WindowsPhoneApp
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/WPinternalsSDK/CreationDisposition.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public enum CreationDisposition
4 | {
5 | CreateNew = 1,
6 | CreateAlways,
7 | OpenExisting,
8 | OpenAlways,
9 | TruncateExisting,
10 | OpenForLoader
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WPinternalsSDK/Environment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace WPinternalsSDK
5 | {
6 | public static class Environment
7 | {
8 | public static bool HasRootAccess()
9 | {
10 | bool result = true;
11 | try
12 | {
13 | new Folder("C:\\Windows\\System32\\config").GetSubItems();
14 | }
15 | catch
16 | {
17 | result = false;
18 | }
19 | try
20 | {
21 | new RegistryKey((RegistryHive)2147483650U, "Security").GetSubItems();
22 | }
23 | catch
24 | {
25 | result = false;
26 | }
27 | try
28 | {
29 | Environment.ShellExecute("C:\\WINDOWS\\SYSTEM32\\INSTALLAGENT.EXE");
30 | }
31 | catch
32 | {
33 | result = false;
34 | }
35 | return result;
36 | }
37 |
38 | public static void Elevate()
39 | {
40 | IntPtr intPtr;
41 | UIntPtr uintPtr;
42 | UIntPtr uintPtr2;
43 | uint num;
44 | if (!Win32.LogonUserExEx("DefApps", "", "", 2U, 0U, UIntPtr.Zero, out intPtr, out uintPtr, out uintPtr2, out num, UIntPtr.Zero))
45 | {
46 | throw new Win32Exception(Marshal.GetLastWin32Error(), "Elevate failed");
47 | }
48 | }
49 |
50 | public static void ShellExecute(string Application)
51 | {
52 | Environment.ShellExecute(Application, null);
53 | }
54 |
55 | public static void ShellExecute(string Application, string Arguments)
56 | {
57 | PROCESS_INFORMATION process_INFORMATION = default(PROCESS_INFORMATION);
58 | STARTUPINFO startupinfo = default(STARTUPINFO);
59 | if (!Win32.CreateProcess(Application, Arguments, UIntPtr.Zero, UIntPtr.Zero, false, 32U, IntPtr.Zero, null, ref startupinfo, out process_INFORMATION))
60 | {
61 | throw new Win32Exception(Marshal.GetLastWin32Error(), "CreateProcess failed");
62 | }
63 | if (process_INFORMATION.hProcess != IntPtr.Zero && process_INFORMATION.hProcess != (IntPtr)(-1))
64 | {
65 | Win32.CloseHandle(process_INFORMATION.hProcess);
66 | }
67 | if (process_INFORMATION.hThread != IntPtr.Zero && process_INFORMATION.hThread != (IntPtr)(-1))
68 | {
69 | Win32.CloseHandle(process_INFORMATION.hThread);
70 | return;
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/WPinternalsSDK/FILETIME.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | internal struct FILETIME
4 | {
5 | public uint DateTimeLow;
6 |
7 | public uint DateTimeHigh;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WPinternalsSDK/File.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public class File : FileSystemEntry
4 | {
5 | public File(string Path, FileAttributes Attributes) : base(Path, Attributes)
6 | {
7 | }
8 |
9 | public ulong Size
10 | {
11 | get
12 | {
13 | if (!this.sizeQueried)
14 | {
15 | this.size = FileSystem.GetFileSize(base.Path);
16 | }
17 | return this.size;
18 | }
19 | internal set
20 | {
21 | this.size = value;
22 | this.sizeQueried = true;
23 | }
24 | }
25 |
26 | public override string ToString()
27 | {
28 | return base.Path;
29 | }
30 |
31 | private bool sizeQueried;
32 |
33 | private ulong size;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPinternalsSDK/FileAccess.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [Flags]
6 | internal enum FileAccess : uint
7 | {
8 | AccessSystemSecurity = 16777216U,
9 | MaximumAllowed = 33554432U,
10 | Delete = 65536U,
11 | ReadControl = 131072U,
12 | WriteDAC = 262144U,
13 | WriteOwner = 524288U,
14 | Synchronize = 1048576U,
15 | StandardRightsRequired = 983040U,
16 | StandardRightsRead = 131072U,
17 | StandardRightsWrite = 131072U,
18 | StandardRightsExecute = 131072U,
19 | StandardRightsAll = 2031616U,
20 | SpecificRightsAll = 65535U,
21 | ReadData = 1U,
22 | ListDirectory = 1U,
23 | WriteData = 2U,
24 | AddFile = 2U,
25 | AppendData = 4U,
26 | AddSubdirectory = 4U,
27 | CreatePipeInstance = 4U,
28 | ReadEa = 8U,
29 | WriteEa = 16U,
30 | Execute = 32U,
31 | Traverse = 32U,
32 | DeleteChild = 64U,
33 | ReadAttributes = 128U,
34 | WriteAttributes = 256U,
35 | GenericRead = 2147483648U,
36 | GenericWrite = 1073741824U,
37 | GenericExecute = 536870912U,
38 | GenericAll = 268435456U
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/WPinternalsSDK/FileAttributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [Flags]
6 | public enum FileAttributes : uint
7 | {
8 | Invalid = 4294967295U,
9 | Readonly = 1U,
10 | Hidden = 2U,
11 | System = 4U,
12 | Directory = 16U,
13 | Archive = 32U,
14 | Device = 64U,
15 | Normal = 128U,
16 | Temporary = 256U,
17 | SparseFile = 512U,
18 | ReparsePoint = 1024U,
19 | Compressed = 2048U,
20 | Offline = 4096U,
21 | NotContentIndexed = 8192U,
22 | Encrypted = 16384U,
23 | Virtual = 65536U,
24 | BackupSemantics = 33554432U,
25 | DeleteOnClose = 67108864U,
26 | NoBuffering = 536870912U,
27 | OpenNoRecall = 1048576U,
28 | OpenReparsePoint = 2097152U,
29 | Overlapped = 1073741824U,
30 | PosixSemantics = 1048576U,
31 | RandomAccess = 268435456U,
32 | SessionAware = 8388608U,
33 | SequentialScan = 134217728U,
34 | WriteThrough = 2147483648U
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/WPinternalsSDK/FileStreamMode.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public enum FileStreamMode
4 | {
5 | Read,
6 | Write,
7 | ReadWrite
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WPinternalsSDK/FileSystemEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | public class FileSystemEntry : IComparable
6 | {
7 | public string Path { get; private set; }
8 |
9 | public string Name { get; private set; }
10 |
11 | internal FileSystemEntry(string Path, FileAttributes Attributes)
12 | {
13 | string text = Path.TrimEnd(new char[]
14 | {
15 | '\\'
16 | });
17 | this.Path = text;
18 | this.Name = text;
19 | int num = this.Name.LastIndexOf('\\');
20 | if (num >= 0)
21 | {
22 | this.Name = this.Name.Substring(num + 1);
23 | }
24 | this.Attributes = Attributes;
25 | }
26 |
27 | int IComparable.CompareTo(FileSystemEntry Other)
28 | {
29 | if (Other == null)
30 | {
31 | throw new ArgumentException();
32 | }
33 | if (this.IsFolder && Other.IsFile)
34 | {
35 | return -1;
36 | }
37 | if (this.IsFile && Other.IsFolder)
38 | {
39 | return 1;
40 | }
41 | return string.Compare(this.Name, Other.Name, StringComparison.OrdinalIgnoreCase);
42 | }
43 |
44 | public bool IsFolder
45 | {
46 | get
47 | {
48 | return (this.Attributes & FileAttributes.Directory) > ~FileAttributes.Invalid;
49 | }
50 | }
51 |
52 | public bool IsFile
53 | {
54 | get
55 | {
56 | return (this.Attributes & FileAttributes.Directory) == ~FileAttributes.Invalid;
57 | }
58 | }
59 |
60 | public bool IsReadOnly
61 | {
62 | get
63 | {
64 | return (this.Attributes & FileAttributes.Readonly) > ~FileAttributes.Invalid;
65 | }
66 | }
67 |
68 | public bool IsHidden
69 | {
70 | get
71 | {
72 | return (this.Attributes & FileAttributes.Hidden) > ~FileAttributes.Invalid;
73 | }
74 | }
75 |
76 | public bool IsSystem
77 | {
78 | get
79 | {
80 | return (this.Attributes & FileAttributes.System) > ~FileAttributes.Invalid;
81 | }
82 | }
83 |
84 | public readonly FileAttributes Attributes;
85 |
86 | public readonly FileSystemType Type = FileSystemType.Unknown;
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/WPinternalsSDK/FileSystemType.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public enum FileSystemType
4 | {
5 | Directory,
6 | File,
7 | Unknown
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WPinternalsSDK/GET_FILEEX_INFO_LEVELS.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | internal enum GET_FILEEX_INFO_LEVELS
4 | {
5 | GetFileExInfoStandard,
6 | GetFileExMaxInfoLevel
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/WPinternalsSDK/KeyedList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 |
4 | namespace WPinternalsSDK
5 | {
6 | internal class KeyedList : KeyedCollection
7 | {
8 | public KeyedList(Func getKeyFunc)
9 | {
10 | this._getKeyFunc = getKeyFunc;
11 | }
12 |
13 | protected override TKey GetKeyForItem(TItem item)
14 | {
15 | return this._getKeyFunc(item);
16 | }
17 |
18 | public bool TryGetValue(TKey key, out TItem item)
19 | {
20 | if (base.Dictionary == null)
21 | {
22 | item = default(TItem);
23 | return false;
24 | }
25 | return base.Dictionary.TryGetValue(key, out item);
26 | }
27 |
28 | public void AddOrUpdate(TItem item)
29 | {
30 | if (!this.Contains(item))
31 | {
32 | base.Add(item);
33 | }
34 | }
35 |
36 | public new bool Contains(TItem item)
37 | {
38 | return base.Contains(this._getKeyFunc(item));
39 | }
40 |
41 | public new bool Contains(TKey key)
42 | {
43 | return base.Contains(key);
44 | }
45 |
46 | public int IndexOf(TKey key)
47 | {
48 | return base.IndexOf(base[key]);
49 | }
50 |
51 | private readonly Func _getKeyFunc;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/WPinternalsSDK/MoveFileFlags.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [Flags]
6 | public enum MoveFileFlags
7 | {
8 | ReplaceExisting = 1,
9 | CopyAllowed = 2,
10 | DelayUntilReboot = 4,
11 | WriteThrough = 8,
12 | CreateHardLink = 16,
13 | FailIfNotTrackable = 32
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WPinternalsSDK/MoveMethod.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public enum MoveMethod : uint
4 | {
5 | Begin,
6 | Current,
7 | End
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WPinternalsSDK/PROCESS_INFORMATION.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | internal struct PROCESS_INFORMATION
6 | {
7 | public IntPtr hProcess;
8 |
9 | public IntPtr hThread;
10 |
11 | public int dwProcessId;
12 |
13 | public int dwThreadId;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WPinternalsSDK/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyVersion("1.0.5795.42493")]
5 | [assembly: AssemblyTitle("WPinternals SDK")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("WPinternals")]
9 | [assembly: AssemblyProduct("WPinternals SDK")]
10 | [assembly: AssemblyCopyright("Copyright by Heathcliff74 / WPinternals")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: ComVisible(false)]
13 |
--------------------------------------------------------------------------------
/WPinternalsSDK/QUOTA_LIMITS.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | internal struct QUOTA_LIMITS
4 | {
5 | private readonly uint PagedPoolLimit;
6 |
7 | private readonly uint NonPagedPoolLimit;
8 |
9 | private readonly uint MinimumWorkingSetSize;
10 |
11 | private readonly uint MaximumWorkingSetSize;
12 |
13 | private readonly uint PagefileLimit;
14 |
15 | private readonly long TimeLimit;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPinternalsSDK/RegCreateKeyOption.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [Flags]
6 | public enum RegCreateKeyOption
7 | {
8 | NonVolatile = 0,
9 | Volatile = 1,
10 | CreateLink = 2,
11 | BackupRestore = 4,
12 | OpenLink = 8
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WPinternalsSDK/RegOpenKeyOption.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [Flags]
6 | public enum RegOpenKeyOption
7 | {
8 | OpenLink = 8
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WPinternalsSDK/RegResult.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public enum RegResult
4 | {
5 | CreatedNewKey = 1,
6 | OpenedExistingKey
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/WPinternalsSDK/RegSAM.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [Flags]
6 | public enum RegSAM
7 | {
8 | QueryValue = 1,
9 | SetValue = 2,
10 | CreateSubKey = 4,
11 | EnumerateSubKeys = 8,
12 | Notify = 16,
13 | CreateLink = 32,
14 | WOW64_32Key = 512,
15 | WOW64_64Key = 256,
16 | WOW64_Res = 768,
17 | Read = 131097,
18 | Write = 131078,
19 | Execute = 131097,
20 | AllAccess = 983103
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WPinternalsSDK/RegistryHive.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public enum RegistryHive : uint
4 | {
5 | ClassesRoot = 2147483648U,
6 | CurrentUser,
7 | LocalMachine,
8 | Users
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WPinternalsSDK/RegistryItem.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public class RegistryItem
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/WPinternalsSDK/RegistryValueType.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | public enum RegistryValueType
4 | {
5 | String = 1,
6 | ExpandString,
7 | Binary,
8 | DWord,
9 | MultiString = 7,
10 | QWord = 11,
11 | Unknown = -1,
12 | None
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WPinternalsSDK/SECURITY_ATTRIBUTES.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | internal struct SECURITY_ATTRIBUTES
6 | {
7 | public int nLength;
8 |
9 | public IntPtr lpSecurityDescriptor;
10 |
11 | public int bInheritHandle;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WPinternalsSDK/STARTUPINFO.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace WPinternalsSDK
5 | {
6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
7 | internal struct STARTUPINFO
8 | {
9 | public int cb;
10 |
11 | public string lpReserved;
12 |
13 | public string lpDesktop;
14 |
15 | public string lpTitle;
16 |
17 | public int dwX;
18 |
19 | public int dwY;
20 |
21 | public int dwXSize;
22 |
23 | public int dwYSize;
24 |
25 | public int dwXCountChars;
26 |
27 | public int dwYCountChars;
28 |
29 | public int dwFillAttribute;
30 |
31 | public int dwFlags;
32 |
33 | public short wShowWindow;
34 |
35 | public short cbReserved2;
36 |
37 | public IntPtr lpReserved2;
38 |
39 | public IntPtr hStdInput;
40 |
41 | public IntPtr hStdOutput;
42 |
43 | public IntPtr hStdError;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/WPinternalsSDK/ShareMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [Flags]
6 | internal enum ShareMode : uint
7 | {
8 | None = 0U,
9 | Read = 1U,
10 | Write = 2U,
11 | Delete = 4U
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WPinternalsSDK/WIN32_FILE_ATTRIBUTE_DATA.cs:
--------------------------------------------------------------------------------
1 | namespace WPinternalsSDK
2 | {
3 | internal struct WIN32_FILE_ATTRIBUTE_DATA
4 | {
5 | public FileAttributes dwFileAttributes;
6 |
7 | public FILETIME ftCreationTime;
8 |
9 | public FILETIME ftLastAccessTime;
10 |
11 | public FILETIME ftLastWriteTime;
12 |
13 | public uint nFileSizeHigh;
14 |
15 | public uint nFileSizeLow;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPinternalsSDK/WIN32_FIND_DATA.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
6 | internal struct WIN32_FIND_DATA
7 | {
8 | public uint dwFileAttributes;
9 |
10 | public FILETIME ftCreationTime;
11 |
12 | public FILETIME ftLastAccessTime;
13 |
14 | public FILETIME ftLastWriteTime;
15 |
16 | public uint nFileSizeHigh;
17 |
18 | public uint nFileSizeLow;
19 |
20 | public uint dwReserved0;
21 |
22 | public uint dwReserved1;
23 |
24 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
25 | public string cFileName;
26 |
27 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
28 | public string cAlternateFileName;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WPinternalsSDK/WPinternalsSDK.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | d29275f2-bb58-44a2-81e1-96d68c4c48db
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPinternalsSDK/Win32Exception.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WPinternalsSDK
4 | {
5 | public class Win32Exception : Exception
6 | {
7 | public Win32Exception(int HResult)
8 | {
9 | this.HResult = HResult;
10 | }
11 |
12 | public Win32Exception(int HResult, string Message) : base(Message)
13 | {
14 | this.HResult = HResult;
15 | }
16 |
17 | public new int HResult
18 | {
19 | get
20 | {
21 | return this._HResult;
22 | }
23 | set
24 | {
25 | this._HResult = value;
26 | }
27 | }
28 |
29 | private int _HResult;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------