├── .github └── ISSUE_TEMPLATE │ ├── bug.yml │ └── config.yml ├── .gitignore ├── Extra └── FeatureDictionary.pfs ├── LICENSE ├── README.md ├── ViVe.sln ├── ViVe ├── FeatureManager.cs ├── FeaturePropertyOverflowException.cs ├── NativeEnums.cs ├── NativeMethods.Ntdll.cs ├── NativeStructs.cs ├── ObfuscationHelpers.cs ├── Properties │ └── AssemblyInfo.cs └── ViVe.csproj └── ViVeTool ├── App.config ├── ArgumentBlock.cs ├── ConsoleEx.cs ├── FeatureNaming.cs ├── NativeMethods.cs ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs └── Resources.resx ├── UpdateCheck.cs ├── ViVeTool.csproj ├── app.manifest └── packages.config /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: "Report a ViVeTool bug" 2 | description: Experiencing unexpected crashes or unintended behavior? File a report here! 3 | labels: ["bug"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thank you for taking your time to file a bug report! 9 | Before filling out the form, please give the report a brief title. e.g. _Unhandled exception when using /export_ 10 | 11 | In case you've followed a tutorial for toggling features and didn't get the desired result, this is most likely **NOT a bug.** 12 | Similarly, do **NOT** file a bug if a feature can't be toggled anymore _after updating_. Once Microsoft finishes experimenting with a feature it gets put into a permanently Enabled or Disabled state which ViVe can't change anymore. 13 | Please read [this FAQ article](https://github.com/thebookisclosed/ViVe/wiki/Which-features-can-ViVeTool-toggle%3F) if you have any further questions. 14 | - type: input 15 | id: tool-version 16 | attributes: 17 | label: Tool version 18 | description: Which version of ViVeTool is this report for? 19 | placeholder: e.g. v0.3.3 20 | validations: 21 | required: true 22 | - type: input 23 | id: os-version 24 | attributes: 25 | label: OS version 26 | description: Which version of Windows were you using when this bug occurred? 27 | placeholder: e.g. Windows 11 build 22621.1413 28 | validations: 29 | required: true 30 | - type: dropdown 31 | id: architecture 32 | attributes: 33 | label: Architecture 34 | description: Which architecture did you encounter this bug on? 35 | options: 36 | - "x64" 37 | - "x86" 38 | - "arm64" 39 | validations: 40 | required: true 41 | - type: textarea 42 | id: screenshot 43 | attributes: 44 | label: Screenshot 45 | description: Please include/paste a screenshot of the bug in the field below. 46 | placeholder: Make sure that the problematic command is clearly visible in the screenshot. 47 | validations: 48 | required: true 49 | - type: textarea 50 | id: extra-steps 51 | attributes: 52 | label: Extra steps 53 | description: If the bug occurrs only under specific circumstances, please describe the steps you've made to encounter it. Otherwise say "None." 54 | placeholder: | 55 | 1) Run /fullreset 56 | 2) Reboot 57 | 3) Run /export 58 | validations: 59 | required: true 60 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ViVe 2 | ViVe is a C# library you can use to make your own programs that interact with the A/B feature experiment mechanism found in Windows 10 & newer. 3 | 4 | The *FeatureManager* class should cover most feature management needs with the added benefit of some struct heavy lifting being done for you. Boot persistence and LKG management is offered exclusively by this class as it had to be reimplemented. 5 | 6 | In case you'd like to talk to NTDLL exports directly, you can use *NativeMethods*. 7 | 8 | # ViVeTool 9 | ViVeTool is both an example of how to use ViVe, as well as a straightforward tool for power users which want to use the new APIs instantly. 10 | 11 | [![Release downloads](https://img.shields.io/github/downloads/thebookisclosed/ViVe/total.svg)](https://GitHub.com/thebookisclosed/ViVe/releases/) 12 | 13 | # Compatibility 14 | In order to use ViVe, you must be running Windows 10 build 18963 or newer. 15 | 16 | ![ViVeTool Helpfile](https://i.imgur.com/PzCHEUQ.png) 17 | -------------------------------------------------------------------------------- /ViVe.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33403.182 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViVe", "ViVe\ViVe.csproj", "{80DCDA4D-8022-4740-8CCF-459DD3FE6F72}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViVeTool", "ViVeTool\ViVeTool.csproj", "{4DAAB723-3613-4133-AE54-646133538E44}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|ARM64 = Debug|ARM64 14 | Release|Any CPU = Release|Any CPU 15 | Release|ARM64 = Release|ARM64 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Debug|ARM64.ActiveCfg = Debug|Any CPU 21 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Debug|ARM64.Build.0 = Debug|Any CPU 22 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Release|ARM64.ActiveCfg = Release|Any CPU 25 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72}.Release|ARM64.Build.0 = Release|Any CPU 26 | {4DAAB723-3613-4133-AE54-646133538E44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {4DAAB723-3613-4133-AE54-646133538E44}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {4DAAB723-3613-4133-AE54-646133538E44}.Debug|ARM64.ActiveCfg = Debug|ARM64 29 | {4DAAB723-3613-4133-AE54-646133538E44}.Debug|ARM64.Build.0 = Debug|ARM64 30 | {4DAAB723-3613-4133-AE54-646133538E44}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {4DAAB723-3613-4133-AE54-646133538E44}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {4DAAB723-3613-4133-AE54-646133538E44}.Release|ARM64.ActiveCfg = Release|ARM64 33 | {4DAAB723-3613-4133-AE54-646133538E44}.Release|ARM64.Build.0 = Release|ARM64 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {E5173A5A-E3A8-4C36-9798-11628C4E4684} 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /ViVe/FeatureManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2025 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using Albacore.ViVe.NativeEnums; 20 | using Albacore.ViVe.NativeMethods; 21 | using Albacore.ViVe.NativeStructs; 22 | using Microsoft.Win32; 23 | using System; 24 | using System.Linq; 25 | using System.Runtime.InteropServices; 26 | 27 | namespace Albacore.ViVe 28 | { 29 | public static class FeatureManager 30 | { 31 | public static readonly RTL_FEATURE_CONFIGURATION_PRIORITY[] ImmutablePriorities = new[] { 32 | RTL_FEATURE_CONFIGURATION_PRIORITY.ImageDefault, 33 | RTL_FEATURE_CONFIGURATION_PRIORITY.EKB, 34 | RTL_FEATURE_CONFIGURATION_PRIORITY.ImageDefaultEditionOverride, 35 | RTL_FEATURE_CONFIGURATION_PRIORITY.Security, 36 | RTL_FEATURE_CONFIGURATION_PRIORITY.ImageOverride 37 | }; 38 | 39 | public unsafe static RTL_FEATURE_CONFIGURATION[] QueryAllFeatureConfigurations(RTL_FEATURE_CONFIGURATION_TYPE configurationType = RTL_FEATURE_CONFIGURATION_TYPE.Runtime) 40 | { 41 | return QueryAllFeatureConfigurations(configurationType, null); 42 | } 43 | 44 | public unsafe static RTL_FEATURE_CONFIGURATION[] QueryAllFeatureConfigurations(RTL_FEATURE_CONFIGURATION_TYPE configurationType, ref ulong changeStamp) 45 | { 46 | fixed (ulong* changeStampPtr = &changeStamp) 47 | return QueryAllFeatureConfigurations(configurationType, changeStampPtr); 48 | } 49 | 50 | public unsafe static RTL_FEATURE_CONFIGURATION[] QueryAllFeatureConfigurations(RTL_FEATURE_CONFIGURATION_TYPE configurationType, ulong* changeStamp) 51 | { 52 | Ntdll.RtlQueryAllFeatureConfigurations(configurationType, changeStamp, null, out int configCount); 53 | if (configCount == 0) 54 | return null; 55 | var allFeatureConfigs = new RTL_FEATURE_CONFIGURATION[configCount]; 56 | int hRes; 57 | fixed (RTL_FEATURE_CONFIGURATION* configsPtr = allFeatureConfigs) 58 | hRes = Ntdll.RtlQueryAllFeatureConfigurations(configurationType, changeStamp, configsPtr, out configCount); 59 | if (hRes == 0) 60 | return allFeatureConfigs; 61 | else 62 | return null; 63 | } 64 | 65 | public static RTL_FEATURE_CONFIGURATION? QueryFeatureConfiguration(uint featureId, RTL_FEATURE_CONFIGURATION_TYPE configurationType = RTL_FEATURE_CONFIGURATION_TYPE.Runtime) 66 | { 67 | ulong dummy = 0; 68 | return QueryFeatureConfiguration(featureId, configurationType, ref dummy); 69 | } 70 | 71 | public static RTL_FEATURE_CONFIGURATION? QueryFeatureConfiguration(uint featureId, RTL_FEATURE_CONFIGURATION_TYPE configurationType, ref ulong changeStamp) 72 | { 73 | int hRes = Ntdll.RtlQueryFeatureConfiguration(featureId, configurationType, ref changeStamp, out RTL_FEATURE_CONFIGURATION config); 74 | if (hRes != 0) 75 | return null; 76 | return config; 77 | } 78 | 79 | public static ulong QueryFeatureConfigurationChangeStamp() 80 | { 81 | return Ntdll.RtlQueryFeatureConfigurationChangeStamp(); 82 | } 83 | 84 | public static int SetFeatureConfigurations(RTL_FEATURE_CONFIGURATION_UPDATE[] updates, RTL_FEATURE_CONFIGURATION_TYPE configurationType = RTL_FEATURE_CONFIGURATION_TYPE.Runtime) 85 | { 86 | ulong dummy = 0; 87 | return SetFeatureConfigurations(updates, configurationType, ref dummy); 88 | } 89 | 90 | public static int SetFeatureConfigurations(RTL_FEATURE_CONFIGURATION_UPDATE[] updates, RTL_FEATURE_CONFIGURATION_TYPE configurationType, ref ulong previousChangeStamp) 91 | { 92 | foreach (var update in updates) 93 | if (ImmutablePriorities.Contains(update.Priority)) 94 | throw new ArgumentException(string.Format("{0} ({1}) is an immutable priority and can't be written to.", update.Priority, (int)update.Priority)); 95 | else if (update.Priority == RTL_FEATURE_CONFIGURATION_PRIORITY.UserPolicy && !update.UserPolicyPriorityCompatible) 96 | throw new ArgumentException("UserPolicy priority overrides do not support persisting properties other than EnabledState."); 97 | 98 | if (configurationType == RTL_FEATURE_CONFIGURATION_TYPE.Runtime) 99 | return Ntdll.RtlSetFeatureConfigurations(ref previousChangeStamp, RTL_FEATURE_CONFIGURATION_TYPE.Runtime, updates, updates.Length); 100 | else 101 | return SetFeatureConfigurationsInRegistry(updates, previousChangeStamp); 102 | } 103 | 104 | public static IntPtr RegisterFeatureConfigurationChangeNotification(FeatureConfigurationChangeCallback callback) 105 | { 106 | return RegisterFeatureConfigurationChangeNotification(callback, IntPtr.Zero); 107 | } 108 | 109 | public static IntPtr RegisterFeatureConfigurationChangeNotification(FeatureConfigurationChangeCallback callback, IntPtr context) 110 | { 111 | Ntdll.RtlRegisterFeatureConfigurationChangeNotification(callback, context, IntPtr.Zero, out IntPtr sub); 112 | return sub; 113 | } 114 | 115 | public static IntPtr RegisterFeatureConfigurationChangeNotification(FeatureConfigurationChangeCallback callback, IntPtr context, ref ulong waitForChangeStamp) 116 | { 117 | Ntdll.RtlRegisterFeatureConfigurationChangeNotification(callback, context, ref waitForChangeStamp, out IntPtr sub); 118 | return sub; 119 | } 120 | 121 | public static int UnregisterFeatureConfigurationChangeNotification(IntPtr notification) 122 | { 123 | return Ntdll.RtlUnregisterFeatureConfigurationChangeNotification(notification); 124 | } 125 | 126 | public unsafe static RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[] QueryFeatureUsageSubscriptions() 127 | { 128 | Ntdll.RtlQueryFeatureUsageNotificationSubscriptions(null, out int subCount); 129 | if (subCount == 0) 130 | return null; 131 | var allSubscriptions = new RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[subCount]; 132 | int hRes; 133 | fixed (RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS* subsPtr = allSubscriptions) 134 | hRes = Ntdll.RtlQueryFeatureUsageNotificationSubscriptions(subsPtr, out subCount); 135 | if (hRes == 0) 136 | return allSubscriptions; 137 | else 138 | return null; 139 | } 140 | 141 | public static int AddFeatureUsageSubscriptions(RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[] subscriptions) 142 | { 143 | return Ntdll.RtlSubscribeForFeatureUsageNotification(subscriptions, subscriptions.Length); 144 | } 145 | 146 | public static int RemoveFeatureUsageSubscriptions(RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[] subscriptions) 147 | { 148 | return Ntdll.RtlUnsubscribeFromFeatureUsageNotifications(subscriptions, subscriptions.Length); 149 | } 150 | 151 | public static int NotifyFeatureUsage(ref RTL_FEATURE_USAGE_REPORT report) 152 | { 153 | return Ntdll.RtlNotifyFeatureUsage(ref report); 154 | } 155 | 156 | private const int RtlBsdItemFeatureConfigurationState = 17; 157 | public static int SetBootFeatureConfigurationState(BSD_FEATURE_CONFIGURATION_STATE state) 158 | { 159 | var newState = (int)state; 160 | return Ntdll.RtlSetSystemBootStatus(RtlBsdItemFeatureConfigurationState, ref newState, sizeof(int), IntPtr.Zero); 161 | } 162 | 163 | public static int GetBootFeatureConfigurationState(out BSD_FEATURE_CONFIGURATION_STATE state) 164 | { 165 | var apiResult = Ntdll.RtlGetSystemBootStatus(RtlBsdItemFeatureConfigurationState, out int intState, sizeof(int), IntPtr.Zero); 166 | state = (BSD_FEATURE_CONFIGURATION_STATE)intState; 167 | return apiResult; 168 | } 169 | 170 | // The Last Known Good feature store sometimes gets corrupted by the OS due to a use-after-free bug in fcon.dll 171 | // We fix the corrupted store header to make sure that Windows won't completely wipe feature configurations in case it shifts into LKG mode 172 | // One feature is unfortunately lost to corruption in case this does happen, but it's still much better to lose one than to lose all 173 | public static bool FixLKGStore() 174 | { 175 | try 176 | { 177 | using (var rKey = Registry.LocalMachine.OpenSubKey(@"CurrentControlSet\Control\FeatureManagement\LastKnownGood")) 178 | { 179 | var lkgBlob = (byte[])rKey.GetValue("LKGConfiguration"); 180 | // Header is a simple 32-bit zero 181 | if (BitConverter.ToInt32(lkgBlob, 0) == 0) 182 | return false; 183 | var headerSize = sizeof(int); 184 | var oneConfigSize = Marshal.SizeOf(typeof(RTL_FEATURE_CONFIGURATION)); 185 | var fixedBlob = new byte[lkgBlob.Length - oneConfigSize]; 186 | Array.Copy(lkgBlob, headerSize + oneConfigSize, fixedBlob, headerSize, fixedBlob.Length - headerSize); 187 | rKey.SetValue("LKGConfiguration", fixedBlob); 188 | return true; 189 | } 190 | } catch { return false; } 191 | } 192 | 193 | public static int InitializeBootStatusDataFile() 194 | { 195 | return Ntdll.RtlCreateBootStatusDataFile(null); 196 | } 197 | 198 | private static int SetFeatureConfigurationsInRegistry(RTL_FEATURE_CONFIGURATION_UPDATE[] updates, ulong previousStamp) 199 | { 200 | // Stamp behavior and return values are taken from equivalent kernel operations for runtime feature configuration 201 | if (previousStamp > 0) 202 | { 203 | var currentStamp = QueryFeatureConfigurationChangeStamp(); 204 | if (previousStamp != currentStamp) 205 | return unchecked((int)0xC0000001); 206 | } 207 | 208 | try 209 | { 210 | foreach (var update in updates) 211 | { 212 | var isUserPolicy = update.Priority == RTL_FEATURE_CONFIGURATION_PRIORITY.UserPolicy; 213 | var obfuscatedId = ObfuscationHelpers.ObfuscateFeatureId(update.FeatureId).ToString(); 214 | var overrideKey = isUserPolicy ? 215 | @"SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides" : 216 | $@"SYSTEM\CurrentControlSet\Control\FeatureManagement\Overrides\{(int)update.Priority}\{obfuscatedId}"; 217 | if (update.Operation == RTL_FEATURE_CONFIGURATION_OPERATION.ResetState) 218 | { 219 | if (isUserPolicy) 220 | { 221 | var rKey = Registry.LocalMachine.OpenSubKey(overrideKey); 222 | if (rKey != null) 223 | { 224 | using (rKey) 225 | rKey.DeleteValue(obfuscatedId); 226 | } 227 | } 228 | else 229 | Registry.LocalMachine.DeleteSubKeyTree(overrideKey, false); 230 | } 231 | else 232 | { 233 | using (var rKey = Registry.LocalMachine.CreateSubKey(overrideKey)) 234 | { 235 | if (update.Operation.HasFlag(RTL_FEATURE_CONFIGURATION_OPERATION.FeatureState)) 236 | { 237 | if (isUserPolicy) 238 | { 239 | rKey.SetValue(obfuscatedId, (int)update.EnabledState); 240 | } 241 | else 242 | { 243 | rKey.SetValue("EnabledState", (int)update.EnabledState); 244 | rKey.SetValue("EnabledStateOptions", (int)update.EnabledStateOptions); 245 | } 246 | } 247 | if (!isUserPolicy && update.Operation.HasFlag(RTL_FEATURE_CONFIGURATION_OPERATION.VariantState)) 248 | { 249 | // Casting these is needed otherwise they end up getting written as strings 250 | rKey.SetValue("Variant", (int)update.Variant); 251 | rKey.SetValue("VariantPayload", (int)update.VariantPayload); 252 | rKey.SetValue("VariantPayloadKind", (int)update.VariantPayloadKind); 253 | } 254 | } 255 | } 256 | } 257 | return 0; 258 | } catch (Exception ex) { return ex.HResult; } 259 | } 260 | 261 | public static int AddFeatureUsageSubscriptionsToRegistry(RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[] subscriptions) 262 | { 263 | try 264 | { 265 | foreach (var sub in subscriptions) 266 | { 267 | uint obfuscatedId = ObfuscationHelpers.ObfuscateFeatureId(sub.FeatureId); 268 | using (var rKey = Registry.LocalMachine.CreateSubKey($@"SYSTEM\CurrentControlSet\Control\FeatureManagement\UsageSubscriptions\{obfuscatedId}\{{{Guid.NewGuid()}}}")) 269 | { 270 | rKey.SetValue("ReportingKind", (int)sub.ReportingKind); 271 | rKey.SetValue("ReportingOptions", (int)sub.ReportingOptions); 272 | rKey.SetValue("ReportingTarget", BitConverter.GetBytes(sub.ReportingTarget)); 273 | } 274 | } 275 | return 0; 276 | } 277 | catch (Exception ex) { return ex.HResult; } 278 | } 279 | 280 | public static int RemoveFeatureUsageSubscriptionsFromRegistry(RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[] subscriptions) 281 | { 282 | try 283 | { 284 | foreach (var sub in subscriptions) 285 | { 286 | var obfuscatedKey = @"SYSTEM\CurrentControlSet\Control\FeatureManagement\UsageSubscriptions\" + 287 | ObfuscationHelpers.ObfuscateFeatureId(sub.FeatureId).ToString(); 288 | var sKey = Registry.LocalMachine.OpenSubKey(obfuscatedKey, true); 289 | if (sKey != null) 290 | { 291 | var isEmpty = false; 292 | using (sKey) 293 | { 294 | foreach (var subGuid in sKey.GetSubKeyNames()) 295 | { 296 | var toRemove = false; 297 | using (var gKey = sKey.OpenSubKey(subGuid)) 298 | { 299 | if ((int)gKey.GetValue("ReportingKind") == sub.ReportingKind && 300 | BitConverter.ToUInt64((byte[])gKey.GetValue("ReportingTarget"), 0) == sub.ReportingTarget) 301 | toRemove = true; 302 | } 303 | if (toRemove) 304 | sKey.DeleteSubKeyTree(subGuid, false); 305 | } 306 | isEmpty = sKey.SubKeyCount == 0; 307 | } 308 | if (isEmpty) 309 | Registry.LocalMachine.DeleteSubKeyTree(obfuscatedKey, false); 310 | } 311 | } 312 | return 0; 313 | } 314 | catch (Exception ex) { return ex.HResult; } 315 | } 316 | } 317 | } 318 | -------------------------------------------------------------------------------- /ViVe/FeaturePropertyOverflowException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using System; 20 | 21 | namespace Albacore.ViVe.Exceptions 22 | { 23 | public class FeaturePropertyOverflowException : Exception 24 | { 25 | public FeaturePropertyOverflowException(string propertyName, int maximumValue) 26 | : base($"{propertyName} must not be higher than {maximumValue}.") 27 | { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ViVe/NativeEnums.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2025 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using System; 20 | 21 | namespace Albacore.ViVe.NativeEnums 22 | { 23 | public enum RTL_FEATURE_CONFIGURATION_TYPE : uint 24 | { 25 | Boot = 0, 26 | Runtime = 1 27 | } 28 | 29 | public enum RTL_FEATURE_ENABLED_STATE : uint 30 | { 31 | Default = 0, 32 | Disabled = 1, 33 | Enabled = 2 34 | } 35 | 36 | public enum RTL_FEATURE_CONFIGURATION_PRIORITY : uint 37 | { 38 | ImageDefault = 0, 39 | EKB = 1, 40 | Safeguard = 2, 41 | ImageDefaultEditionOverride = 3, 42 | Service = 4, 43 | Dynamic = 6, 44 | User = 8, 45 | Security = 9, 46 | UserPolicy = 10, 47 | Test = 12, 48 | ImageOverride = 15 49 | } 50 | 51 | [Flags] 52 | public enum RTL_FEATURE_VARIANT_PAYLOAD_KIND : uint 53 | { 54 | None = 0, 55 | Resident = 1, 56 | External = 2 57 | } 58 | 59 | [Flags] 60 | public enum RTL_FEATURE_CONFIGURATION_OPERATION : uint 61 | { 62 | None = 0, 63 | FeatureState = 1, 64 | VariantState = 2, 65 | ResetState = 4 66 | } 67 | 68 | public enum RTL_FEATURE_ENABLED_STATE_OPTIONS 69 | { 70 | None = 0, 71 | WexpConfig = 1 72 | } 73 | 74 | public enum BSD_FEATURE_CONFIGURATION_STATE 75 | { 76 | Uninitialized = 0, 77 | BootPending = 1, 78 | LKGPending = 2, 79 | RollbackPending = 3, 80 | Committed = 4 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /ViVe/NativeMethods.Ntdll.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using Albacore.ViVe.NativeEnums; 20 | using Albacore.ViVe.NativeStructs; 21 | using System; 22 | using System.Runtime.InteropServices; 23 | 24 | namespace Albacore.ViVe.NativeMethods 25 | { 26 | public delegate void FeatureConfigurationChangeCallback(IntPtr Context); 27 | 28 | public static class Ntdll 29 | { 30 | // Kernel supports null pointer for change stamp ref, unlike single feature query 31 | [DllImport("ntdll.dll")] 32 | public unsafe static extern int RtlQueryAllFeatureConfigurations( 33 | RTL_FEATURE_CONFIGURATION_TYPE featureConfigurationType, 34 | ulong* changeStamp, 35 | RTL_FEATURE_CONFIGURATION* featureConfigurations, 36 | out int featureConfigurationCount 37 | ); 38 | 39 | [DllImport("ntdll.dll")] 40 | public static extern int RtlQueryFeatureConfiguration( 41 | uint featureId, 42 | RTL_FEATURE_CONFIGURATION_TYPE featureConfigurationType, 43 | ref ulong changeStamp, 44 | out RTL_FEATURE_CONFIGURATION featureConfiguration 45 | ); 46 | 47 | [DllImport("ntdll.dll")] 48 | public static extern ulong RtlQueryFeatureConfigurationChangeStamp(); 49 | 50 | [DllImport("ntdll.dll")] 51 | public unsafe static extern int RtlQueryFeatureUsageNotificationSubscriptions( 52 | RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS* subscriptions, 53 | out int subscriptionCount 54 | ); 55 | 56 | // Kernel treats pointer to 0 the same as a null pointer, no alternate signature required 57 | [DllImport("ntdll.dll")] 58 | public static extern int RtlSetFeatureConfigurations( 59 | ref ulong previousChangeStamp, 60 | RTL_FEATURE_CONFIGURATION_TYPE featureConfigurationType, 61 | RTL_FEATURE_CONFIGURATION_UPDATE[] featureConfigurations, 62 | int featureConfigurationCount 63 | ); 64 | 65 | [DllImport("ntdll.dll")] 66 | public static extern int RtlRegisterFeatureConfigurationChangeNotification( 67 | FeatureConfigurationChangeCallback callback, 68 | IntPtr context, 69 | IntPtr waitForChangeStamp, 70 | out IntPtr subscription 71 | ); 72 | 73 | [DllImport("ntdll.dll")] 74 | public static extern int RtlRegisterFeatureConfigurationChangeNotification( 75 | FeatureConfigurationChangeCallback callback, 76 | IntPtr context, 77 | ref ulong waitForChangeStamp, 78 | out IntPtr subscription 79 | ); 80 | 81 | [DllImport("ntdll.dll")] 82 | public static extern int RtlUnregisterFeatureConfigurationChangeNotification( 83 | IntPtr subscription 84 | ); 85 | 86 | [DllImport("ntdll.dll")] 87 | public static extern int RtlSubscribeForFeatureUsageNotification( 88 | RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[] subscriptions, 89 | int subscriptionCount 90 | ); 91 | 92 | [DllImport("ntdll.dll")] 93 | public static extern int RtlUnsubscribeFromFeatureUsageNotifications( 94 | RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[] subscriptions, 95 | int subscriptionCount 96 | ); 97 | 98 | [DllImport("ntdll.dll")] 99 | public static extern int RtlNotifyFeatureUsage( 100 | ref RTL_FEATURE_USAGE_REPORT report 101 | ); 102 | 103 | // BSD Items can have varying sizes, int signature is enough for our needs though 104 | [DllImport("ntdll.dll")] 105 | public static extern int RtlSetSystemBootStatus( 106 | int bsdItemType, 107 | ref int data, 108 | int dataLength, 109 | IntPtr returnLength 110 | ); 111 | 112 | [DllImport("ntdll.dll")] 113 | public static extern int RtlGetSystemBootStatus( 114 | int bsdItemType, 115 | out int data, 116 | int dataLength, 117 | IntPtr returnLength 118 | ); 119 | 120 | [DllImport("ntdll.dll", CharSet = CharSet.Unicode)] 121 | public static extern int RtlCreateBootStatusDataFile(string bootStatusPath); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /ViVe/NativeStructs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using Albacore.ViVe.Exceptions; 20 | using Albacore.ViVe.NativeEnums; 21 | using System.Runtime.InteropServices; 22 | 23 | namespace Albacore.ViVe.NativeStructs 24 | { 25 | [StructLayout(LayoutKind.Sequential)] 26 | public struct RTL_FEATURE_USAGE_REPORT 27 | { 28 | public uint FeatureId; 29 | public ushort ReportingKind; 30 | public ushort ReportingOptions; 31 | } 32 | 33 | [StructLayout(LayoutKind.Sequential)] 34 | public struct RTL_FEATURE_CONFIGURATION 35 | { 36 | public uint FeatureId; 37 | public uint CompactState; 38 | public uint VariantPayload; 39 | 40 | public RTL_FEATURE_CONFIGURATION_PRIORITY Priority 41 | { 42 | get 43 | { 44 | return (RTL_FEATURE_CONFIGURATION_PRIORITY)(CompactState & 0xF); 45 | } 46 | set 47 | { 48 | if ((uint)value > 15) 49 | throw new FeaturePropertyOverflowException("Priority", 15); 50 | CompactState = (CompactState & 0xFFFFFFF0) | (uint)value; 51 | } 52 | } 53 | 54 | public RTL_FEATURE_ENABLED_STATE EnabledState 55 | { 56 | get 57 | { 58 | return (RTL_FEATURE_ENABLED_STATE)((CompactState & 0x30) >> 4); 59 | } 60 | set 61 | { 62 | if ((uint)value > 2) 63 | throw new FeaturePropertyOverflowException("EnabledState", 2); 64 | CompactState = (CompactState & 0xFFFFFFCF) | ((uint)value << 4); 65 | } 66 | } 67 | 68 | public bool IsWexpConfiguration 69 | { 70 | get 71 | { 72 | return ((CompactState & 0x40) >> 6) == 1; 73 | } 74 | set 75 | { 76 | CompactState = (CompactState & 0xFFFFFFBF) | ((value ? (uint)1 : 0) << 6); 77 | } 78 | } 79 | 80 | public bool HasSubscriptions 81 | { 82 | get 83 | { 84 | return ((CompactState & 0x80) >> 7) == 1; 85 | } 86 | set 87 | { 88 | CompactState = (CompactState & 0xFFFFFF7F) | ((value ? (uint)1 : 0) << 7); 89 | } 90 | } 91 | 92 | public uint Variant 93 | { 94 | get 95 | { 96 | return (CompactState & 0x3F00) >> 8; 97 | } 98 | set 99 | { 100 | if (value > 63) 101 | throw new FeaturePropertyOverflowException("Variant", 63); 102 | CompactState = (CompactState & 0xFFFFC0FF) | (value << 8); 103 | } 104 | } 105 | 106 | public RTL_FEATURE_VARIANT_PAYLOAD_KIND VariantPayloadKind 107 | { 108 | get 109 | { 110 | return (RTL_FEATURE_VARIANT_PAYLOAD_KIND)((CompactState & 0xC000) >> 14); 111 | } 112 | set 113 | { 114 | if ((uint)value > 3) 115 | throw new FeaturePropertyOverflowException("VariantPayloadKind", 3); 116 | CompactState = (CompactState & 0xFFFF3FFF) | ((uint)value << 14); 117 | } 118 | } 119 | } 120 | 121 | [StructLayout(LayoutKind.Sequential)] 122 | public struct RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS 123 | { 124 | public uint FeatureId; 125 | public ushort ReportingKind; 126 | public ushort ReportingOptions; 127 | public ulong ReportingTarget; 128 | } 129 | 130 | [StructLayout(LayoutKind.Sequential)] 131 | public struct RTL_FEATURE_CONFIGURATION_UPDATE 132 | { 133 | public uint FeatureId; 134 | private RTL_FEATURE_CONFIGURATION_PRIORITY _priority; 135 | private RTL_FEATURE_ENABLED_STATE _enabledState; 136 | private RTL_FEATURE_ENABLED_STATE_OPTIONS _enabledStateOptions; 137 | private uint _variant; 138 | private RTL_FEATURE_VARIANT_PAYLOAD_KIND _variantPayloadKind; 139 | public uint VariantPayload; 140 | private RTL_FEATURE_CONFIGURATION_OPERATION _operation; 141 | 142 | public RTL_FEATURE_CONFIGURATION_PRIORITY Priority 143 | { 144 | get 145 | { 146 | return _priority; 147 | } 148 | set 149 | { 150 | if ((uint)value > 15) 151 | throw new FeaturePropertyOverflowException("Priority", 15); 152 | _priority = value; 153 | } 154 | } 155 | 156 | public RTL_FEATURE_ENABLED_STATE EnabledState 157 | { 158 | get 159 | { 160 | return _enabledState; 161 | } 162 | set 163 | { 164 | if ((uint)value > 2) 165 | throw new FeaturePropertyOverflowException("EnabledState", 2); 166 | _enabledState = value; 167 | } 168 | } 169 | 170 | public RTL_FEATURE_ENABLED_STATE_OPTIONS EnabledStateOptions 171 | { 172 | get 173 | { 174 | return _enabledStateOptions; 175 | } 176 | set 177 | { 178 | if ((uint)value > 1) 179 | throw new FeaturePropertyOverflowException("EnabledStateOptions", 1); 180 | _enabledStateOptions = value; 181 | } 182 | } 183 | 184 | public uint Variant 185 | { 186 | get 187 | { 188 | return _variant; 189 | } 190 | set 191 | { 192 | if (value > 63) 193 | throw new FeaturePropertyOverflowException("Variant", 63); 194 | _variant = value; 195 | } 196 | } 197 | 198 | public RTL_FEATURE_VARIANT_PAYLOAD_KIND VariantPayloadKind 199 | { 200 | get 201 | { 202 | return _variantPayloadKind; 203 | } 204 | set 205 | { 206 | if ((uint)value > 3) 207 | throw new FeaturePropertyOverflowException("VariantPayloadKind", 3); 208 | _variantPayloadKind = value; 209 | } 210 | } 211 | 212 | public RTL_FEATURE_CONFIGURATION_OPERATION Operation 213 | { 214 | get 215 | { 216 | return _operation; 217 | } 218 | set 219 | { 220 | if ((uint)value > 4) 221 | throw new FeaturePropertyOverflowException("Operation", 4); 222 | _operation = value; 223 | } 224 | } 225 | 226 | public bool UserPolicyPriorityCompatible 227 | { 228 | get 229 | { 230 | return !((uint)EnabledStateOptions != 0 || _variant != 0 || (uint)_variantPayloadKind != 0 || VariantPayload != 0); 231 | } 232 | } 233 | } 234 | } 235 | -------------------------------------------------------------------------------- /ViVe/ObfuscationHelpers.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | namespace Albacore.ViVe 20 | { 21 | public static class ObfuscationHelpers 22 | { 23 | private static uint SwapBytes(uint x) 24 | { 25 | x = (x >> 16) | (x << 16); 26 | return ((x & 0xFF00FF00) >> 8) | ((x & 0x00FF00FF) << 8); 27 | } 28 | 29 | private static uint RotateRight32(uint value, int shift) 30 | { 31 | return (value >> shift) | (value << (32 - shift)); 32 | } 33 | 34 | public static uint ObfuscateFeatureId(uint featureId) 35 | { 36 | return RotateRight32(SwapBytes(featureId ^ 0x74161A4E) ^ 0x8FB23D4F, -1) ^ 0x833EA8FF; 37 | } 38 | 39 | public static uint DeobfuscateFeatureId(uint featureId) 40 | { 41 | return SwapBytes(RotateRight32(featureId ^ 0x833EA8FF, 1) ^ 0x8FB23D4F) ^ 0x74161A4E; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ViVe/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("Albacore.ViVe")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Albacore.ViVe")] 13 | [assembly: AssemblyCopyright("Copyright © @thebookisclosed 2025")] 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 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("80dcda4d-8022-4740-8ccf-459dd3fe6f72")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2025.3.10.0")] 36 | [assembly: AssemblyFileVersion("2025.3.10.0")] 37 | -------------------------------------------------------------------------------- /ViVe/ViVe.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {80DCDA4D-8022-4740-8CCF-459DD3FE6F72} 8 | Library 9 | Properties 10 | Albacore.ViVe 11 | Albacore.ViVe 12 | v4.8.1 13 | 512 14 | true 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | true 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | true 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ViVeTool/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ViVeTool/ArgumentBlock.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using Albacore.ViVe.NativeEnums; 20 | using System; 21 | using System.Collections.Generic; 22 | 23 | namespace Albacore.ViVeTool 24 | { 25 | static class ArgumentBlock 26 | { 27 | internal static FeatureConfigurationTypeEx? Store; 28 | internal static List IdList; 29 | internal static FeatureConfigurationProperties FeatureConfigurationProperties; 30 | internal static SubscriptionProperties SubscriptionProperties; 31 | #if SET_LKG_COMMAND 32 | internal static BSD_FEATURE_CONFIGURATION_STATE? LKGStatus; 33 | #endif 34 | internal static string FileName; 35 | internal static bool ImportReplace; 36 | internal static bool HelpMode; 37 | 38 | internal static bool ShouldUseBothStores { get { return !Store.HasValue || Store.Value == FeatureConfigurationTypeEx.Both; } } 39 | 40 | internal static void Initialize(string[] args, ArgumentBlockFlags flags) 41 | { 42 | // Fast help path 43 | if (args.Length == 2 && (args[1] == "/?" || string.Compare(args[1], "/help", true) == 0)) 44 | { 45 | HelpMode = true; 46 | return; 47 | } 48 | 49 | if (flags != 0 && 50 | (flags.HasFlag(ArgumentBlockFlags.EnabledStateOptions) || 51 | flags.HasFlag(ArgumentBlockFlags.Variant) || 52 | flags.HasFlag(ArgumentBlockFlags.VariantPayloadKind) || 53 | flags.HasFlag(ArgumentBlockFlags.VariantPayload) || 54 | flags.HasFlag(ArgumentBlockFlags.Priority))) 55 | FeatureConfigurationProperties = new FeatureConfigurationProperties(); 56 | 57 | if (flags != 0 && 58 | (flags.HasFlag(ArgumentBlockFlags.ReportingKind) || 59 | flags.HasFlag(ArgumentBlockFlags.ReportingOptions) || 60 | flags.HasFlag(ArgumentBlockFlags.ReportingTarget))) 61 | SubscriptionProperties = new SubscriptionProperties(); 62 | 63 | var bothStoresArgAllowed = flags.HasFlag(ArgumentBlockFlags.AllowBothStoresArgument); 64 | 65 | for (int i = 1; i < args.Length && flags != 0; i++) 66 | { 67 | var firstSc = args[i].IndexOf(':'); 68 | var hasValue = firstSc != -1; 69 | var lower = args[i].ToLowerInvariant(); 70 | var key = hasValue ? lower.Substring(0, firstSc) : lower; 71 | var value = hasValue ? args[i].Substring(firstSc + 1) : string.Empty; 72 | if (flags.HasFlag(ArgumentBlockFlags.Store) && key == "/store") 73 | { 74 | if (Enum.TryParse(value, true, out FeatureConfigurationTypeEx parsedStore)) 75 | { 76 | if (!bothStoresArgAllowed && parsedStore == FeatureConfigurationTypeEx.Both) 77 | { 78 | ConsoleEx.WriteErrorLine(Properties.Resources.InvalidEnumSpecInScenario, value, "Store"); 79 | HelpMode = true; 80 | return; 81 | } 82 | Store = parsedStore; 83 | } 84 | else 85 | { 86 | ConsoleEx.WriteErrorLine(Properties.Resources.InvalidEnumSpec, value, "Store"); 87 | HelpMode = true; 88 | return; 89 | } 90 | flags &= ~ArgumentBlockFlags.Store; 91 | } 92 | else if (flags.HasFlag(ArgumentBlockFlags.IdList) && key == "/id") 93 | { 94 | if (IdList == null) 95 | IdList = new List(); 96 | foreach (var strId in value.Split(',')) 97 | { 98 | if (TryParseDecHexUint(strId, out uint parsedId)) 99 | IdList.Add(parsedId); 100 | else 101 | Console.WriteLine("Unable to parse feature ID: {0}", strId); 102 | } 103 | flags &= ~ArgumentBlockFlags.IdList; 104 | } 105 | else if (flags.HasFlag(ArgumentBlockFlags.NameList) && key == "/name") 106 | { 107 | if (IdList == null) 108 | IdList = new List(); 109 | var foundIds = FeatureNaming.FindIdsForNames(value.Split(',')); 110 | if (foundIds != null) 111 | IdList.AddRange(foundIds); 112 | flags &= ~ArgumentBlockFlags.NameList; 113 | } 114 | else if (flags.HasFlag(ArgumentBlockFlags.EnabledStateOptions) && key == "/experiment") 115 | { 116 | FeatureConfigurationProperties.EnabledStateOptions = RTL_FEATURE_ENABLED_STATE_OPTIONS.WexpConfig; 117 | flags &= ~ArgumentBlockFlags.EnabledStateOptions; 118 | } 119 | else if (flags.HasFlag(ArgumentBlockFlags.Variant) && key == "/variant") 120 | { 121 | if (TryParseDecHexUint(value, out uint parsedVariant)) 122 | FeatureConfigurationProperties.Variant = parsedVariant; 123 | flags &= ~ArgumentBlockFlags.Variant; 124 | } 125 | else if (flags.HasFlag(ArgumentBlockFlags.VariantPayloadKind) && key == "/variantpayloadkind") 126 | { 127 | if (!Enum.TryParse(value, true, out RTL_FEATURE_VARIANT_PAYLOAD_KIND parsedKind)) 128 | { 129 | ConsoleEx.WriteErrorLine(Properties.Resources.InvalidEnumSpec, value, "Variant Payload Kind"); 130 | HelpMode = true; 131 | return; 132 | } 133 | FeatureConfigurationProperties.VariantPayloadKind = parsedKind; 134 | flags &= ~ArgumentBlockFlags.VariantPayloadKind; 135 | } 136 | else if (flags.HasFlag(ArgumentBlockFlags.VariantPayload) && key == "/variantpayload") 137 | { 138 | if (TryParseDecHexUint(value, out uint parsedPayload)) 139 | FeatureConfigurationProperties.VariantPayload = parsedPayload; 140 | flags &= ~ArgumentBlockFlags.VariantPayload; 141 | } 142 | else if (flags.HasFlag(ArgumentBlockFlags.Priority) && key == "/priority") 143 | { 144 | if (!Enum.TryParse(value, true, out RTL_FEATURE_CONFIGURATION_PRIORITY parsedPriority) || 145 | (uint)parsedPriority > 15) 146 | { 147 | ConsoleEx.WriteErrorLine(Properties.Resources.InvalidEnumSpec, value, "Priority"); 148 | HelpMode = true; 149 | return; 150 | } 151 | FeatureConfigurationProperties.Priority = parsedPriority; 152 | flags &= ~ArgumentBlockFlags.Priority; 153 | } 154 | else if (flags.HasFlag(ArgumentBlockFlags.ReportingKind) && key == "/reportingkind") 155 | { 156 | if (TryParseDecHexUshort(value, out ushort parsedKind)) 157 | SubscriptionProperties.ReportingKind = parsedKind; 158 | flags &= ~ArgumentBlockFlags.ReportingKind; 159 | } 160 | else if (flags.HasFlag(ArgumentBlockFlags.ReportingOptions) && key == "/reportingoptions") 161 | { 162 | if (TryParseDecHexUshort(value, out ushort parsedOptions)) 163 | SubscriptionProperties.ReportingOptions = parsedOptions; 164 | flags &= ~ArgumentBlockFlags.ReportingOptions; 165 | } 166 | else if (flags.HasFlag(ArgumentBlockFlags.ReportingTarget) && key == "/reportingtarget") 167 | { 168 | if (ulong.TryParse(value, System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out ulong parsedTarget)) 169 | SubscriptionProperties.ReportingTarget = parsedTarget; 170 | flags &= ~ArgumentBlockFlags.ReportingTarget; 171 | } 172 | #if SET_LKG_COMMAND 173 | else if (flags.HasFlag(ArgumentBlockFlags.LKGStatus) && key == "/status") 174 | { 175 | if (!Enum.TryParse(value, true, out BSD_FEATURE_CONFIGURATION_STATE parsedStatus)) 176 | { 177 | ConsoleEx.WriteErrorLine(Properties.Resources.InvalidEnumSpec, value, "LKG Status"); 178 | HelpMode = true; 179 | return; 180 | } 181 | LKGStatus = parsedStatus; 182 | flags &= ~ArgumentBlockFlags.LKGStatus; 183 | } 184 | #endif 185 | else if (flags.HasFlag(ArgumentBlockFlags.FileName) && key == "/filename") 186 | { 187 | FileName = value; 188 | flags &= ~ArgumentBlockFlags.FileName; 189 | } 190 | else if (flags.HasFlag(ArgumentBlockFlags.ImportReplace) && key == "/replace") 191 | { 192 | ImportReplace = true; 193 | flags &= ~ArgumentBlockFlags.ImportReplace; 194 | } 195 | else if (key == "/?" || string.Compare(key, "/help", true) == 0) 196 | { 197 | HelpMode = true; 198 | return; 199 | } 200 | else 201 | { 202 | ConsoleEx.WriteWarnLine(Properties.Resources.UnrecognizedParameter, key); 203 | } 204 | } 205 | } 206 | 207 | private static bool TryParseDecHexUint(string input, out uint output) 208 | { 209 | bool success; 210 | if (input.StartsWith("0x")) 211 | success = uint.TryParse(input.Substring(2), System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out output); 212 | else 213 | success = uint.TryParse(input, out output); 214 | return success; 215 | } 216 | 217 | private static bool TryParseDecHexUshort(string input, out ushort output) 218 | { 219 | bool success; 220 | if (input.StartsWith("0x")) 221 | success = ushort.TryParse(input.Substring(2), System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out output); 222 | else 223 | success = ushort.TryParse(input, out output); 224 | return success; 225 | } 226 | } 227 | 228 | internal class FeatureConfigurationProperties 229 | { 230 | internal RTL_FEATURE_ENABLED_STATE_OPTIONS EnabledStateOptions; 231 | internal uint Variant; 232 | internal RTL_FEATURE_VARIANT_PAYLOAD_KIND VariantPayloadKind; 233 | internal uint VariantPayload; 234 | internal RTL_FEATURE_CONFIGURATION_PRIORITY? Priority; 235 | } 236 | 237 | internal class SubscriptionProperties 238 | { 239 | internal ushort ReportingKind; 240 | internal ushort ReportingOptions; 241 | internal ulong ReportingTarget; 242 | } 243 | 244 | [Flags] 245 | enum ArgumentBlockFlags 246 | { 247 | Store = 1, 248 | IdList = 2, 249 | NameList = 4, 250 | EnabledStateOptions = 8, 251 | Variant = 16, 252 | VariantPayloadKind = 32, 253 | VariantPayload = 64, 254 | Priority = 128, 255 | ReportingKind = 256, 256 | ReportingOptions = 512, 257 | ReportingTarget = 1024, 258 | AllowBothStoresArgument = 2048, 259 | #if SET_LKG_COMMAND 260 | LKGStatus = 4096, 261 | #endif 262 | FileName = 8192, 263 | ImportReplace = 16384, 264 | Identifiers = IdList | NameList, 265 | FeatureConfigurationProperties = EnabledStateOptions | Variant | VariantPayloadKind | VariantPayload | Priority, 266 | SubscriptionProperties = ReportingKind | ReportingOptions | ReportingTarget, 267 | Export = Store | AllowBothStoresArgument | FileName 268 | } 269 | 270 | enum FeatureConfigurationTypeEx : uint 271 | { 272 | Boot = 0, 273 | Runtime = 1, 274 | Both = 2 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /ViVeTool/ConsoleEx.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using System; 20 | 21 | namespace Albacore.ViVeTool 22 | { 23 | public static class ConsoleEx 24 | { 25 | public static void WriteErrorLine(string text, params object[] parameters) 26 | { 27 | var formatted = string.Format(text, parameters); 28 | WriteErrorLine(formatted); 29 | } 30 | 31 | public static void WriteErrorLine(string text) 32 | { 33 | var defaultFg = Console.ForegroundColor; 34 | Console.ForegroundColor = ConsoleColor.Red; 35 | Console.WriteLine(text); 36 | Console.ForegroundColor = defaultFg; 37 | } 38 | 39 | public static void WriteWarnLine(string text, params object[] parameters) 40 | { 41 | var formatted = string.Format(text, parameters); 42 | WriteWarnLine(formatted); 43 | } 44 | 45 | public static void WriteWarnLine(string text) 46 | { 47 | var defaultFg = Console.ForegroundColor; 48 | Console.ForegroundColor = ConsoleColor.Yellow; 49 | Console.WriteLine(text); 50 | Console.ForegroundColor = defaultFg; 51 | } 52 | 53 | public static bool UserQuestion(string question) 54 | { 55 | var defaultFg = Console.ForegroundColor; 56 | bool? returnValue = null; 57 | while (!returnValue.HasValue) 58 | { 59 | Console.ForegroundColor = ConsoleColor.Yellow; 60 | Console.Write(question + " [Y/N] "); 61 | Console.ForegroundColor = defaultFg; 62 | var key = Console.ReadKey(); 63 | if (key.Key == ConsoleKey.Y) 64 | returnValue = true; 65 | else if (key.Key == ConsoleKey.N) 66 | returnValue = false; 67 | Console.WriteLine(); 68 | } 69 | return returnValue.Value; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ViVeTool/FeatureNaming.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using System.Collections.Generic; 20 | using System.IO; 21 | using System.Linq; 22 | 23 | namespace Albacore.ViVeTool 24 | { 25 | internal class FeatureNaming 26 | { 27 | internal const string DictFileName = "FeatureDictionary.pfs"; 28 | internal static string DictFilePath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), DictFileName); 29 | internal static List FindIdsForNames(IEnumerable featureNames) 30 | { 31 | if (!File.Exists(DictFilePath)) 32 | return null; 33 | var result = new List(); 34 | var namesCommas = featureNames.Select(x => x.ToLowerInvariant() + ",").ToList(); 35 | using (StreamReader reader = new StreamReader(File.OpenRead(DictFilePath))) 36 | { 37 | while (!reader.EndOfStream) 38 | { 39 | var currentLine = reader.ReadLine().ToLowerInvariant(); 40 | foreach (var nc in namesCommas) 41 | { 42 | if (currentLine.StartsWith(nc)) 43 | { 44 | result.Add(uint.Parse(currentLine.Substring(nc.Length))); 45 | namesCommas.Remove(nc); 46 | break; 47 | } 48 | } 49 | if (namesCommas.Count == 0) 50 | break; 51 | } 52 | } 53 | return result; 54 | } 55 | 56 | internal static Dictionary FindNamesForFeatures(IEnumerable featureIDs) 57 | { 58 | var result = new Dictionary(); 59 | if (!File.Exists(DictFilePath)) 60 | return null; 61 | var idsCommas = featureIDs.Select(x => "," + x.ToString()).ToList(); 62 | using (StreamReader reader = new StreamReader(File.OpenRead(DictFilePath))) 63 | { 64 | while (!reader.EndOfStream) 65 | { 66 | var currentLine = reader.ReadLine(); 67 | foreach (var ic in idsCommas) 68 | { 69 | if (currentLine.EndsWith(ic)) 70 | { 71 | result[uint.Parse(ic.Substring(1))] = currentLine.Substring(0, currentLine.IndexOf(',')); 72 | idsCommas.Remove(ic); 73 | break; 74 | } 75 | } 76 | if (idsCommas.Count == 0) 77 | break; 78 | } 79 | } 80 | return result; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /ViVeTool/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using System.Runtime.InteropServices; 20 | 21 | namespace Albacore.ViVeTool 22 | { 23 | internal class NativeMethods 24 | { 25 | [DllImport("ntdll.dll")] 26 | internal static extern int RtlNtStatusToDosError(int ntStatus); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ViVeTool/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVeTool - Windows feature configuration tool 3 | Copyright (C) 2019-2025 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.ComponentModel; 22 | using System.Diagnostics; 23 | using System.IO; 24 | using System.Linq; 25 | using Albacore.ViVe; 26 | using Albacore.ViVe.Exceptions; 27 | using Albacore.ViVe.NativeEnums; 28 | using Albacore.ViVe.NativeStructs; 29 | 30 | namespace Albacore.ViVeTool 31 | { 32 | class Program 33 | { 34 | static void Main(string[] args) 35 | { 36 | Console.WriteLine(Properties.Resources.Branding); 37 | if (args.Length < 1) 38 | { 39 | PrintHelp(); 40 | return; 41 | } 42 | if (Environment.OSVersion.Version.Build < 18963) 43 | { 44 | // An attempt at stopping people from mistaking 18363 for 18963 by showing them both target & current numbers 45 | Console.WriteLine(Properties.Resources.IncompatibleBuild, Environment.OSVersion.Version.Build); 46 | return; 47 | } 48 | ProcessArgs(args); 49 | if (Debugger.IsAttached) 50 | Console.ReadKey(); 51 | } 52 | 53 | static void PrintHelp() 54 | { 55 | Console.WriteLine(Properties.Resources.Help_Commands); 56 | } 57 | 58 | static void ProcessArgs(string[] args) 59 | { 60 | var mainCmd = args[0].ToLowerInvariant(); 61 | switch (mainCmd) 62 | { 63 | #region Current commands 64 | case "/query": 65 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Store | ArgumentBlockFlags.Identifiers | ArgumentBlockFlags.Priority); 66 | HandleQuery(); 67 | break; 68 | case "/enable": 69 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Store | ArgumentBlockFlags.Identifiers | ArgumentBlockFlags.FeatureConfigurationProperties | ArgumentBlockFlags.AllowBothStoresArgument); 70 | HandleSet(RTL_FEATURE_ENABLED_STATE.Enabled); 71 | break; 72 | case "/disable": 73 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Store | ArgumentBlockFlags.Identifiers | ArgumentBlockFlags.FeatureConfigurationProperties | ArgumentBlockFlags.AllowBothStoresArgument); 74 | HandleSet(RTL_FEATURE_ENABLED_STATE.Disabled); 75 | break; 76 | case "/reset": 77 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Store | ArgumentBlockFlags.Identifiers | ArgumentBlockFlags.Priority | ArgumentBlockFlags.AllowBothStoresArgument); 78 | HandleReset(); 79 | break; 80 | case "/fullreset": 81 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Store | ArgumentBlockFlags.AllowBothStoresArgument | ArgumentBlockFlags.Priority); 82 | HandleFullReset(); 83 | break; 84 | case "/changestamp": 85 | HandleChangeStamp(); 86 | break; 87 | case "/querysubs": 88 | HandleQuerySubs(); 89 | break; 90 | case "/addsub": 91 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Identifiers | ArgumentBlockFlags.SubscriptionProperties); 92 | HandleSetSubs(false); 93 | break; 94 | case "/delsub": 95 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Identifiers | ArgumentBlockFlags.ReportingKind | ArgumentBlockFlags.ReportingTarget); 96 | HandleSetSubs(true); 97 | break; 98 | case "/notifyusage": 99 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Identifiers | ArgumentBlockFlags.ReportingKind | ArgumentBlockFlags.ReportingOptions); 100 | HandleNotifyUsage(); 101 | break; 102 | case "/lkgstatus": 103 | ArgumentBlock.Initialize(args, 0); 104 | HandleLKGStatus(); 105 | break; 106 | #if SET_LKG_COMMAND 107 | case "/setlkg": 108 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.LKGStatus); 109 | HandleSetLKG(); 110 | break; 111 | #endif 112 | case "/export": 113 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Export); 114 | HandleExport(); 115 | break; 116 | case "/import": 117 | ArgumentBlock.Initialize(args, ArgumentBlockFlags.Export | ArgumentBlockFlags.ImportReplace); 118 | HandleImport(); 119 | break; 120 | case "/fixlkg": 121 | ArgumentBlock.Initialize(args, 0); 122 | HandleFixLKG(); 123 | break; 124 | case "/fixpriority": 125 | HandleFixPriority(); 126 | break; 127 | case "/appupdate": 128 | HandleAppUpdate(); 129 | break; 130 | case "/dictupdate": 131 | HandleDictUpdate(); 132 | break; 133 | case "/?": 134 | case "/help": 135 | PrintHelp(); 136 | break; 137 | #endregion 138 | #region Migration tips 139 | case "queryconfig": 140 | CommandMigrationInfoTip(mainCmd, "/query"); 141 | break; 142 | case "addconfig": 143 | CommandMigrationInfoTip(mainCmd, "/enable' & '/disable"); 144 | break; 145 | case "delconfig": 146 | CommandMigrationInfoTip(mainCmd, "/reset"); 147 | break; 148 | case "querysubs": 149 | CommandMigrationInfoTip(mainCmd, "/querysubs"); 150 | break; 151 | case "addsub": 152 | CommandMigrationInfoTip(mainCmd, "/addsub"); 153 | break; 154 | case "delsub": 155 | CommandMigrationInfoTip(mainCmd, "/delsub"); 156 | break; 157 | case "notifyusage": 158 | CommandMigrationInfoTip(mainCmd, "/notifyusage"); 159 | break; 160 | case "changestamp": 161 | CommandMigrationInfoTip(mainCmd, "/changestamp"); 162 | break; 163 | #endregion 164 | default: 165 | ConsoleEx.WriteWarnLine(Properties.Resources.UnrecognizedCommand, mainCmd); 166 | PrintHelp(); 167 | break; 168 | } 169 | } 170 | 171 | #region Main handlers 172 | static void HandleQuery() 173 | { 174 | if (ArgumentBlock.HelpMode) 175 | { 176 | Console.WriteLine(Properties.Resources.Help_Query); 177 | return; 178 | } 179 | 180 | var priorityClamp = ArgumentBlock.FeatureConfigurationProperties.Priority; 181 | var storeToUse = ArgumentBlock.Store.HasValue ? (RTL_FEATURE_CONFIGURATION_TYPE)ArgumentBlock.Store.Value : RTL_FEATURE_CONFIGURATION_TYPE.Runtime; 182 | if (ArgumentBlock.IdList == null || ArgumentBlock.IdList.Count == 0) 183 | { 184 | var retrievedConfigs = FeatureManager.QueryAllFeatureConfigurations(storeToUse); 185 | if (retrievedConfigs != null) 186 | { 187 | var namesAll = FeatureNaming.FindNamesForFeatures(retrievedConfigs.Select(x => x.FeatureId)); 188 | foreach (var config in retrievedConfigs) 189 | { 190 | if (priorityClamp.HasValue && config.Priority != priorityClamp.Value) 191 | continue; 192 | string name = null; 193 | if (namesAll != null) 194 | try { name = namesAll[config.FeatureId]; } catch { } 195 | PrintFeatureConfig(config, name); 196 | } 197 | } 198 | else 199 | ConsoleEx.WriteErrorLine(Properties.Resources.QueryFailed); 200 | return; 201 | } 202 | 203 | var namesSpecific = FeatureNaming.FindNamesForFeatures(ArgumentBlock.IdList); 204 | foreach (var id in ArgumentBlock.IdList) 205 | { 206 | var config = FeatureManager.QueryFeatureConfiguration(id, storeToUse); 207 | if (config != null) 208 | { 209 | if (priorityClamp.HasValue && config.Value.Priority != priorityClamp.Value) 210 | continue; 211 | string name = null; 212 | if (namesSpecific != null) 213 | try { name = namesSpecific[id]; } catch { } 214 | PrintFeatureConfig(config.Value, name); 215 | } 216 | else 217 | { 218 | ConsoleEx.WriteErrorLine(Properties.Resources.SingleQueryFailed, id, storeToUse); 219 | if (storeToUse == RTL_FEATURE_CONFIGURATION_TYPE.Boot) 220 | ConsoleEx.WriteWarnLine(Properties.Resources.BootStoreRebootTip); 221 | } 222 | } 223 | } 224 | 225 | static void HandleSet(RTL_FEATURE_ENABLED_STATE state) 226 | { 227 | if (ArgumentBlock.HelpMode) 228 | { 229 | Console.WriteLine(Properties.Resources.Help_Set, state == RTL_FEATURE_ENABLED_STATE.Enabled ? "/enable" : "/disable"); 230 | return; 231 | } 232 | 233 | if (ArgumentBlock.IdList == null || ArgumentBlock.IdList.Count == 0) 234 | { 235 | ConsoleEx.WriteErrorLine(Properties.Resources.NoFeaturesSpecified); 236 | return; 237 | } 238 | 239 | var fcp = ArgumentBlock.FeatureConfigurationProperties; 240 | var updates = new RTL_FEATURE_CONFIGURATION_UPDATE[ArgumentBlock.IdList.Count]; 241 | try 242 | { 243 | for (int i = 0; i < updates.Length; i++) 244 | { 245 | updates[i] = new RTL_FEATURE_CONFIGURATION_UPDATE() 246 | { 247 | FeatureId = ArgumentBlock.IdList[i], 248 | EnabledState = state, 249 | EnabledStateOptions = fcp.EnabledStateOptions, 250 | Priority = fcp.Priority ?? RTL_FEATURE_CONFIGURATION_PRIORITY.User, 251 | Variant = fcp.Variant, 252 | VariantPayloadKind = fcp.VariantPayloadKind, 253 | VariantPayload = fcp.VariantPayload, 254 | Operation = RTL_FEATURE_CONFIGURATION_OPERATION.FeatureState | RTL_FEATURE_CONFIGURATION_OPERATION.VariantState 255 | }; 256 | } 257 | } 258 | catch (FeaturePropertyOverflowException fpoe) { ConsoleEx.WriteErrorLine(fpoe.Message); return; } 259 | 260 | FinalizeSet(updates, false); 261 | } 262 | 263 | static void HandleReset() 264 | { 265 | if (ArgumentBlock.HelpMode) 266 | { 267 | Console.WriteLine(Properties.Resources.Help_Reset, Properties.Resources.ImmutablePropertiesInfo); 268 | return; 269 | } 270 | 271 | if (ArgumentBlock.IdList == null || ArgumentBlock.IdList.Count == 0) 272 | { 273 | ConsoleEx.WriteErrorLine(Properties.Resources.NoFeaturesSpecified); 274 | return; 275 | } 276 | 277 | RTL_FEATURE_CONFIGURATION_UPDATE[] updates; 278 | var fcp = ArgumentBlock.FeatureConfigurationProperties; 279 | if (fcp.Priority.HasValue) 280 | { 281 | var priority = fcp.Priority.Value; 282 | updates = new RTL_FEATURE_CONFIGURATION_UPDATE[ArgumentBlock.IdList.Count]; 283 | for (int i = 0; i < updates.Length; i++) 284 | { 285 | updates[i] = new RTL_FEATURE_CONFIGURATION_UPDATE() 286 | { 287 | FeatureId = ArgumentBlock.IdList[i], 288 | Priority = priority, 289 | Operation = RTL_FEATURE_CONFIGURATION_OPERATION.ResetState 290 | }; 291 | } 292 | } 293 | else 294 | updates = FindResettables(false); 295 | 296 | FinalizeSet(updates, true); 297 | } 298 | 299 | static void HandleFullReset() 300 | { 301 | if (ArgumentBlock.HelpMode) 302 | { 303 | Console.WriteLine(Properties.Resources.Help_FullReset, Properties.Resources.ImmutablePropertiesInfo); 304 | return; 305 | } 306 | 307 | var userConsent = ConsoleEx.UserQuestion(Properties.Resources.FullResetPrompt); 308 | if (!userConsent) 309 | { 310 | Console.WriteLine(Properties.Resources.FullResetCanceled); 311 | return; 312 | } 313 | 314 | var updates = FindResettables(true); 315 | 316 | FinalizeSet(updates, true); 317 | } 318 | 319 | static void HandleChangeStamp() 320 | { 321 | Console.WriteLine(Properties.Resources.ChangestampDisplay, FeatureManager.QueryFeatureConfigurationChangeStamp()); 322 | } 323 | 324 | static void HandleQuerySubs() 325 | { 326 | var retrievedSubs = FeatureManager.QueryFeatureUsageSubscriptions(); 327 | if (retrievedSubs != null) 328 | { 329 | var names = FeatureNaming.FindNamesForFeatures(retrievedSubs.Select(x => x.FeatureId)); 330 | foreach (var sub in retrievedSubs) 331 | { 332 | string name = null; 333 | if (names != null) 334 | try { name = names[sub.FeatureId]; } catch { } 335 | PrintSubscription(sub, name); 336 | } 337 | } 338 | else 339 | ConsoleEx.WriteErrorLine(Properties.Resources.QuerySubsFailed); 340 | } 341 | 342 | // No individual Store management is supported due to queries effectively being Runtime only 343 | static void HandleSetSubs(bool delete) 344 | { 345 | if (ArgumentBlock.HelpMode) 346 | { 347 | Console.WriteLine(Properties.Resources.Help_SetSubs, 348 | delete ? "/delsub" : "/addsub", 349 | delete ? "" : " [/reportingoptions:<0-65535>]", 350 | delete ? Properties.Resources.Help_SetSubs_Delete : Properties.Resources.Help_SetSubs_Add); 351 | return; 352 | } 353 | 354 | var sp = ArgumentBlock.SubscriptionProperties; 355 | if (ArgumentBlock.IdList == null || ArgumentBlock.IdList.Count == 0) 356 | { 357 | ConsoleEx.WriteErrorLine(Properties.Resources.NoFeaturesSpecified); 358 | return; 359 | } 360 | else if (sp.ReportingTarget == 0) 361 | { 362 | ConsoleEx.WriteErrorLine(Properties.Resources.NoReportingTargetSpecified); 363 | return; 364 | } 365 | 366 | var subs = new RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS[ArgumentBlock.IdList.Count]; 367 | for (int i = 0; i < subs.Length; i++) 368 | { 369 | subs[i] = new RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS() 370 | { 371 | FeatureId = ArgumentBlock.IdList[i], 372 | ReportingKind = sp.ReportingKind, 373 | ReportingOptions = sp.ReportingOptions, 374 | ReportingTarget = sp.ReportingTarget 375 | }; 376 | } 377 | int result; 378 | if (delete) 379 | result = FeatureManager.RemoveFeatureUsageSubscriptions(subs); 380 | else 381 | result = FeatureManager.AddFeatureUsageSubscriptions(subs); 382 | if (result != 0) 383 | { 384 | ConsoleEx.WriteErrorLine(Properties.Resources.SetSubsRuntimeFailed, 385 | GetHumanErrorDescription(result)); 386 | return; 387 | } 388 | if (delete) 389 | result = FeatureManager.RemoveFeatureUsageSubscriptionsFromRegistry(subs); 390 | else 391 | result = FeatureManager.AddFeatureUsageSubscriptionsToRegistry(subs); 392 | if (result != 0) 393 | ConsoleEx.WriteErrorLine(Properties.Resources.SetSubsBootFailed, 394 | GetHumanErrorDescription(result, true)); 395 | else 396 | Console.WriteLine(Properties.Resources.SetSubsSuccess); 397 | } 398 | 399 | static void HandleNotifyUsage() 400 | { 401 | if (ArgumentBlock.HelpMode) 402 | { 403 | Console.WriteLine(Properties.Resources.Help_NotifyUsage); 404 | return; 405 | } 406 | 407 | if (ArgumentBlock.IdList == null || ArgumentBlock.IdList.Count == 0) 408 | { 409 | ConsoleEx.WriteErrorLine(Properties.Resources.NoFeaturesSpecified); 410 | return; 411 | } 412 | 413 | var sp = ArgumentBlock.SubscriptionProperties; 414 | foreach (var id in ArgumentBlock.IdList) 415 | { 416 | var report = new RTL_FEATURE_USAGE_REPORT() 417 | { 418 | FeatureId = id, 419 | ReportingKind = sp.ReportingKind, 420 | ReportingOptions = sp.ReportingOptions 421 | }; 422 | int result = FeatureManager.NotifyFeatureUsage(ref report); 423 | if (result != 0) 424 | ConsoleEx.WriteErrorLine(Properties.Resources.NotifyUsageFailed, 425 | id, 426 | GetHumanErrorDescription(result)); 427 | else 428 | Console.WriteLine(Properties.Resources.NotifyUsageSuccess, id); 429 | } 430 | } 431 | 432 | static void HandleLKGStatus() 433 | { 434 | if (ArgumentBlock.HelpMode) 435 | { 436 | Console.WriteLine(Properties.Resources.Help_LKGStatus); 437 | return; 438 | } 439 | 440 | var result = FeatureManager.GetBootFeatureConfigurationState(out BSD_FEATURE_CONFIGURATION_STATE state); 441 | if (result != 0) 442 | ConsoleEx.WriteErrorLine(Properties.Resources.LKGQueryFailed, 443 | GetHumanErrorDescription(result)); 444 | else 445 | Console.WriteLine(Properties.Resources.LKGStatusDisplay, state); 446 | } 447 | 448 | #if SET_LKG_COMMAND 449 | static void HandleSetLKG() 450 | { 451 | UpdateLKGStatus(ArgumentBlock.LKGStatus.Value); 452 | } 453 | #endif 454 | 455 | static void HandleExport() 456 | { 457 | if (ArgumentBlock.HelpMode) 458 | { 459 | Console.WriteLine(Properties.Resources.Help_Export); 460 | return; 461 | } 462 | 463 | if (string.IsNullOrEmpty(ArgumentBlock.FileName)) 464 | { 465 | ConsoleEx.WriteErrorLine(Properties.Resources.NoFileNameSpecified); 466 | return; 467 | } 468 | 469 | var useBothStores = ArgumentBlock.ShouldUseBothStores; 470 | RTL_FEATURE_CONFIGURATION[] runtimeFeatures = null; 471 | RTL_FEATURE_CONFIGURATION[] bootFeatures = null; 472 | if (useBothStores || ArgumentBlock.Store.Value == FeatureConfigurationTypeEx.Runtime) 473 | runtimeFeatures = FeatureManager.QueryAllFeatureConfigurations(RTL_FEATURE_CONFIGURATION_TYPE.Runtime); 474 | if (useBothStores || ArgumentBlock.Store.Value == FeatureConfigurationTypeEx.Boot) 475 | bootFeatures = FeatureManager.QueryAllFeatureConfigurations(RTL_FEATURE_CONFIGURATION_TYPE.Boot); 476 | 477 | using (var fs = new FileStream(ArgumentBlock.FileName, FileMode.Create)) 478 | using (var bw = new BinaryWriter(fs)) 479 | { 480 | SerializeConfigsToStream(bw, runtimeFeatures); 481 | SerializeConfigsToStream(bw, bootFeatures); 482 | } 483 | 484 | Console.WriteLine(Properties.Resources.ExportSuccess, runtimeFeatures?.Length ?? 0, bootFeatures?.Length ?? 0, ArgumentBlock.FileName); 485 | } 486 | 487 | static void HandleImport() 488 | { 489 | if (ArgumentBlock.HelpMode) 490 | { 491 | Console.WriteLine(Properties.Resources.Help_Import, Properties.Resources.ImmutablePropertiesInfo); 492 | return; 493 | } 494 | 495 | if (string.IsNullOrEmpty(ArgumentBlock.FileName)) 496 | { 497 | ConsoleEx.WriteErrorLine(Properties.Resources.NoFileNameSpecified); 498 | return; 499 | } 500 | 501 | List runtimeFeatures, bootFeatures; 502 | using (var fs = new FileStream(ArgumentBlock.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 503 | using (var br = new BinaryReader(fs)) 504 | { 505 | runtimeFeatures = DeserializeConfigsFromStream(br); 506 | bootFeatures = DeserializeConfigsFromStream(br); 507 | } 508 | 509 | Console.WriteLine(Properties.Resources.ImportBreakdown, runtimeFeatures.Count, bootFeatures.Count, ArgumentBlock.FileName); 510 | 511 | if (ArgumentBlock.ImportReplace) 512 | HandleFullReset(); 513 | 514 | var useBothStores = ArgumentBlock.ShouldUseBothStores; 515 | if ((useBothStores || ArgumentBlock.Store.Value == FeatureConfigurationTypeEx.Runtime) && runtimeFeatures.Count > 0) 516 | { 517 | Console.WriteLine(Properties.Resources.ImportProcessing, runtimeFeatures.Count, FeatureConfigurationTypeEx.Runtime); 518 | var updates = ConvertConfigsToUpdates(runtimeFeatures); 519 | var prevValue = ArgumentBlock.Store; 520 | ArgumentBlock.Store = FeatureConfigurationTypeEx.Runtime; 521 | FinalizeSet(updates, false); 522 | ArgumentBlock.Store = prevValue; 523 | } 524 | if ((useBothStores || ArgumentBlock.Store.Value == FeatureConfigurationTypeEx.Boot) && bootFeatures.Count > 0) 525 | { 526 | Console.WriteLine(Properties.Resources.ImportProcessing, runtimeFeatures.Count, FeatureConfigurationTypeEx.Boot); 527 | var updates = ConvertConfigsToUpdates(bootFeatures); 528 | var prevValue = ArgumentBlock.Store; 529 | ArgumentBlock.Store = FeatureConfigurationTypeEx.Boot; 530 | FinalizeSet(updates, false); 531 | ArgumentBlock.Store = prevValue; 532 | 533 | Console.WriteLine(Properties.Resources.RebootRecommended); 534 | } 535 | } 536 | 537 | static void HandleFixLKG() 538 | { 539 | if (ArgumentBlock.HelpMode) 540 | { 541 | Console.WriteLine(Properties.Resources.Help_FixLKG); 542 | return; 543 | } 544 | 545 | var fixPerformed = FeatureManager.FixLKGStore(); 546 | if (fixPerformed) 547 | Console.WriteLine(Properties.Resources.FixLKGPerformed); 548 | else 549 | Console.WriteLine(Properties.Resources.FixLKGNotNeeded); 550 | } 551 | 552 | static void HandleFixPriority() 553 | { 554 | var success = FixPriorityInternal(RTL_FEATURE_CONFIGURATION_TYPE.Runtime); 555 | if (!success) 556 | return; 557 | FixPriorityInternal(RTL_FEATURE_CONFIGURATION_TYPE.Boot); 558 | } 559 | 560 | static void HandleAppUpdate() 561 | { 562 | Console.WriteLine(Properties.Resources.CheckingAppUpdates); 563 | var lri = UpdateCheck.GetLatestReleaseInfo(); 564 | if (lri == null || !UpdateCheck.IsAppOutdated(lri.tag_name)) 565 | Console.WriteLine(Properties.Resources.NoNewerVersionFound); 566 | else 567 | Console.WriteLine(Properties.Resources.NewAppUpdateDisplay, lri.name, lri.published_at, lri.body, lri.html_url); 568 | } 569 | 570 | static void HandleDictUpdate() 571 | { 572 | Console.WriteLine(Properties.Resources.CheckingDictUpdates); 573 | var ldi = UpdateCheck.GetLatestDictionaryInfo(); 574 | if (ldi == null || !UpdateCheck.IsDictOutdated(ldi.sha)) 575 | Console.WriteLine(Properties.Resources.NoNewerVersionFound); 576 | else 577 | { 578 | Console.WriteLine(Properties.Resources.NewDictUpdateDisplay, ldi.sha); 579 | var dlNew = !File.Exists(FeatureNaming.DictFilePath) || ConsoleEx.UserQuestion(Properties.Resources.DictUpdateConsent); 580 | if (dlNew) 581 | { 582 | UpdateCheck.ReplaceDict(ldi.download_url); 583 | Console.WriteLine(Properties.Resources.DictUpdateFinished); 584 | } 585 | else 586 | Console.WriteLine(Properties.Resources.DictUpdateCanceled); 587 | } 588 | } 589 | #endregion 590 | 591 | #region Helpers 592 | static RTL_FEATURE_CONFIGURATION_UPDATE[] FindResettables(bool fullReset) 593 | { 594 | var useBothStores = ArgumentBlock.ShouldUseBothStores; 595 | 596 | var dupeCheckHs = new HashSet(); 597 | var updateList = new List(); 598 | if (useBothStores || ArgumentBlock.Store.Value == FeatureConfigurationTypeEx.Runtime) 599 | FindResettablesInternal(RTL_FEATURE_CONFIGURATION_TYPE.Runtime, fullReset, updateList, dupeCheckHs); 600 | if (useBothStores || ArgumentBlock.Store.Value == FeatureConfigurationTypeEx.Boot) 601 | FindResettablesInternal(RTL_FEATURE_CONFIGURATION_TYPE.Boot, fullReset, updateList, dupeCheckHs); 602 | 603 | return updateList.ToArray(); 604 | } 605 | 606 | static void FindResettablesInternal(RTL_FEATURE_CONFIGURATION_TYPE type, bool fullReset, List targetList, HashSet alreadyFoundSet) 607 | { 608 | var configs = FeatureManager.QueryAllFeatureConfigurations(type); 609 | var priorityClamp = ArgumentBlock.FeatureConfigurationProperties?.Priority; 610 | foreach (var cfg in configs) 611 | { 612 | if (FeatureManager.ImmutablePriorities.Contains(cfg.Priority) || 613 | (priorityClamp.HasValue && cfg.Priority != priorityClamp.Value)) 614 | continue; 615 | if (fullReset || ArgumentBlock.IdList.Contains(cfg.FeatureId)) 616 | { 617 | if (alreadyFoundSet != null) 618 | { 619 | var preCount = alreadyFoundSet.Count; 620 | alreadyFoundSet.Add($"{cfg.FeatureId}-{(uint)cfg.Priority}"); 621 | if (alreadyFoundSet.Count == preCount) 622 | continue; 623 | } 624 | targetList.Add(new RTL_FEATURE_CONFIGURATION_UPDATE() 625 | { 626 | FeatureId = cfg.FeatureId, 627 | Priority = cfg.Priority, 628 | Operation = RTL_FEATURE_CONFIGURATION_OPERATION.ResetState 629 | }); 630 | } 631 | } 632 | } 633 | 634 | static bool FinalizeSet(RTL_FEATURE_CONFIGURATION_UPDATE[] updates, bool isReset) 635 | { 636 | var useBothStores = ArgumentBlock.ShouldUseBothStores; 637 | if (useBothStores || ArgumentBlock.Store == FeatureConfigurationTypeEx.Runtime) 638 | { 639 | int result; 640 | try { result = FeatureManager.SetFeatureConfigurations(updates, RTL_FEATURE_CONFIGURATION_TYPE.Runtime); } 641 | catch (ArgumentException ae) { ConsoleEx.WriteErrorLine(ae.Message); return false; } 642 | if (result != 0) 643 | { 644 | ConsoleEx.WriteErrorLine(isReset ? Properties.Resources.ResetRuntimeFailed : Properties.Resources.SetRuntimeFailed, 645 | GetHumanErrorDescription(result)); 646 | return false; 647 | } 648 | } 649 | if (useBothStores || ArgumentBlock.Store == FeatureConfigurationTypeEx.Boot) 650 | { 651 | int result; 652 | try { result = FeatureManager.SetFeatureConfigurations(updates, RTL_FEATURE_CONFIGURATION_TYPE.Boot); } 653 | catch (ArgumentException ae) { ConsoleEx.WriteErrorLine(ae.Message); return false; } 654 | if (result != 0) 655 | { 656 | ConsoleEx.WriteErrorLine(isReset ? Properties.Resources.ResetBootFailed : Properties.Resources.SetBootFailed, 657 | GetHumanErrorDescription(result)); 658 | return false; 659 | } 660 | 661 | UpdateLKGStatus(BSD_FEATURE_CONFIGURATION_STATE.BootPending); 662 | } 663 | 664 | Console.WriteLine(isReset ? Properties.Resources.ResetSuccess : Properties.Resources.SetSuccess); 665 | return true; 666 | } 667 | 668 | static void UpdateLKGStatus(BSD_FEATURE_CONFIGURATION_STATE newStatus) 669 | { 670 | var result = FeatureManager.GetBootFeatureConfigurationState(out BSD_FEATURE_CONFIGURATION_STATE currentStatus); 671 | if (result != 0) 672 | { 673 | // STATUS_OBJECT_NAME_NOT_FOUND check 674 | if ((uint)result == 0xC0000034) 675 | { 676 | result = FeatureManager.InitializeBootStatusDataFile(); 677 | if (result != 0) 678 | { 679 | ConsoleEx.WriteWarnLine(Properties.Resources.BootStatInitFailed, 680 | GetHumanErrorDescription(result)); 681 | return; 682 | } 683 | } 684 | else 685 | { 686 | ConsoleEx.WriteWarnLine(Properties.Resources.LKGQueryFailed, 687 | GetHumanErrorDescription(result)); 688 | } 689 | } 690 | 691 | if (currentStatus != newStatus) 692 | { 693 | result = FeatureManager.SetBootFeatureConfigurationState(newStatus); 694 | if (result != 0) 695 | ConsoleEx.WriteWarnLine(Properties.Resources.LKGUpdateFailed, 696 | GetHumanErrorDescription(result), 697 | currentStatus); 698 | } 699 | } 700 | 701 | static void SerializeConfigsToStream(BinaryWriter bw, RTL_FEATURE_CONFIGURATION[] configurations) 702 | { 703 | if (configurations != null) 704 | { 705 | bw.Write(configurations.Length); 706 | foreach (var feature in configurations) 707 | { 708 | bw.Write(feature.FeatureId); 709 | bw.Write(feature.CompactState); 710 | bw.Write(feature.VariantPayload); 711 | } 712 | } 713 | else 714 | bw.Write(0); 715 | } 716 | 717 | static List DeserializeConfigsFromStream(BinaryReader br) 718 | { 719 | var count = br.ReadInt32(); 720 | var configurations = new List(); 721 | for (int i = 0; i < count; i++) 722 | { 723 | var config = new RTL_FEATURE_CONFIGURATION 724 | { 725 | FeatureId = br.ReadUInt32(), 726 | CompactState = br.ReadUInt32(), 727 | VariantPayload = br.ReadUInt32() 728 | }; 729 | // Ignore these as they can't be written to the Runtime store and should be purely CBS managed 730 | if (FeatureManager.ImmutablePriorities.Contains(config.Priority)) 731 | continue; 732 | configurations.Add(config); 733 | } 734 | return configurations; 735 | } 736 | 737 | static RTL_FEATURE_CONFIGURATION_UPDATE[] ConvertConfigsToUpdates(List configurations) 738 | { 739 | var updates = new RTL_FEATURE_CONFIGURATION_UPDATE[configurations.Count]; 740 | for (int i = 0; i < updates.Length; i++) 741 | { 742 | var config = configurations[i]; 743 | var update = new RTL_FEATURE_CONFIGURATION_UPDATE() 744 | { 745 | FeatureId = config.FeatureId, 746 | Priority = config.Priority, 747 | EnabledState = config.EnabledState, 748 | EnabledStateOptions = config.IsWexpConfiguration ? RTL_FEATURE_ENABLED_STATE_OPTIONS.WexpConfig : RTL_FEATURE_ENABLED_STATE_OPTIONS.None, 749 | Variant = config.Variant, 750 | VariantPayloadKind = config.VariantPayloadKind, 751 | VariantPayload = config.VariantPayload, 752 | Operation = RTL_FEATURE_CONFIGURATION_OPERATION.FeatureState | RTL_FEATURE_CONFIGURATION_OPERATION.VariantState 753 | }; 754 | updates[i] = update; 755 | } 756 | return updates; 757 | } 758 | 759 | static bool FixPriorityInternal(RTL_FEATURE_CONFIGURATION_TYPE configurationType) 760 | { 761 | Console.WriteLine(Properties.Resources.FixPriorityProcessing, configurationType); 762 | var features = FeatureManager.QueryAllFeatureConfigurations(configurationType); 763 | var fixUpdates = MakePriorityFixUpdates(features); 764 | if (fixUpdates == null) 765 | { 766 | Console.WriteLine(Properties.Resources.FixPriorityNotNeeded); 767 | return true; 768 | } 769 | ArgumentBlock.Store = (FeatureConfigurationTypeEx)configurationType; 770 | var success = FinalizeSet(fixUpdates, false); 771 | if (configurationType == RTL_FEATURE_CONFIGURATION_TYPE.Boot) 772 | Console.WriteLine(Properties.Resources.RebootRecommended); 773 | return success; 774 | } 775 | 776 | static RTL_FEATURE_CONFIGURATION_UPDATE[] MakePriorityFixUpdates(RTL_FEATURE_CONFIGURATION[] configurations) 777 | { 778 | var configsToFix = configurations.Where(x => x.Priority == RTL_FEATURE_CONFIGURATION_PRIORITY.Service && !x.IsWexpConfiguration); 779 | if (!configsToFix.Any()) 780 | return null; 781 | var priorityFixUpdates = new RTL_FEATURE_CONFIGURATION_UPDATE[configsToFix.Count() * 2]; 782 | var updatesCreated = 0; 783 | foreach (var cfg in configsToFix) 784 | { 785 | priorityFixUpdates[updatesCreated] = new RTL_FEATURE_CONFIGURATION_UPDATE() 786 | { 787 | FeatureId = cfg.FeatureId, 788 | Priority = cfg.Priority, 789 | Operation = RTL_FEATURE_CONFIGURATION_OPERATION.ResetState 790 | }; 791 | priorityFixUpdates[updatesCreated + 1] = new RTL_FEATURE_CONFIGURATION_UPDATE() 792 | { 793 | FeatureId = cfg.FeatureId, 794 | Priority = RTL_FEATURE_CONFIGURATION_PRIORITY.User, 795 | EnabledState = cfg.EnabledState, 796 | Variant = cfg.Variant, 797 | VariantPayloadKind = cfg.VariantPayloadKind, 798 | VariantPayload = cfg.VariantPayload, 799 | Operation = RTL_FEATURE_CONFIGURATION_OPERATION.FeatureState | RTL_FEATURE_CONFIGURATION_OPERATION.VariantState 800 | }; 801 | updatesCreated += 2; 802 | } 803 | return priorityFixUpdates; 804 | } 805 | 806 | static void CommandMigrationInfoTip(string oldCommand, string newCommand) 807 | { 808 | ConsoleEx.WriteWarnLine(Properties.Resources.CommandMigrationNote, oldCommand, newCommand); 809 | } 810 | 811 | static string GetHumanErrorDescription(int ntStatus, bool noTranslate = false) 812 | { 813 | var hResult = 0; 814 | if (!noTranslate) 815 | hResult = NativeMethods.RtlNtStatusToDosError(ntStatus); 816 | if (noTranslate || hResult == 0x13D) //ERROR_MR_MID_NOT_FOUND 817 | hResult = ntStatus; 818 | var w32ex = new Win32Exception(hResult); 819 | return w32ex.Message; 820 | } 821 | #endregion 822 | 823 | #region Console printing 824 | static void PrintFeatureConfig(RTL_FEATURE_CONFIGURATION config, string name = null) 825 | { 826 | var defaultFg = Console.ForegroundColor; 827 | Console.ForegroundColor = ConsoleColor.Yellow; 828 | Console.Write("[{0}]", config.FeatureId); 829 | if (!string.IsNullOrEmpty(name)) 830 | Console.Write(" ({0})", name); 831 | Console.WriteLine(); 832 | Console.ForegroundColor = defaultFg; 833 | if (Enum.IsDefined(typeof(RTL_FEATURE_CONFIGURATION_PRIORITY), config.Priority)) 834 | Console.WriteLine(Properties.Resources.FeatureDisplay_Priority + " ({1})", config.Priority, (uint)config.Priority); 835 | else 836 | Console.WriteLine(Properties.Resources.FeatureDisplay_Priority, config.Priority, (uint)config.Priority); 837 | Console.WriteLine(Properties.Resources.FeatureDisplay_State, config.EnabledState, (uint)config.EnabledState); 838 | Console.WriteLine(Properties.Resources.FeatureDisplay_Type, 839 | config.IsWexpConfiguration ? Properties.Resources.FeatureType_Experiment : Properties.Resources.FeatureType_Override, 840 | config.IsWexpConfiguration ? 1 : 0); 841 | if (config.HasSubscriptions) 842 | Console.WriteLine(Properties.Resources.FeatureDisplay_HasSubscriptions, config.HasSubscriptions); 843 | if (config.Variant != 0) 844 | Console.WriteLine(Properties.Resources.FeatureDisplay_Variant, config.Variant); 845 | var vpkDefined = config.VariantPayloadKind != 0; 846 | if (vpkDefined) 847 | Console.WriteLine(Properties.Resources.FeatureDisplay_PayloadKind, config.VariantPayloadKind, (uint)config.VariantPayloadKind); 848 | if (vpkDefined || config.VariantPayload != 0) 849 | Console.WriteLine(Properties.Resources.FeatureDisplay_Payload, config.VariantPayload); 850 | Console.WriteLine(); 851 | } 852 | 853 | static void PrintSubscription(RTL_FEATURE_USAGE_SUBSCRIPTION_DETAILS sub, string name = null) 854 | { 855 | var defaultFg = Console.ForegroundColor; 856 | Console.ForegroundColor = ConsoleColor.Yellow; 857 | Console.Write("[{0}]", sub.FeatureId); 858 | if (!string.IsNullOrEmpty(name)) 859 | Console.Write(" ({0})", name); 860 | Console.WriteLine(); 861 | Console.ForegroundColor = defaultFg; 862 | Console.WriteLine(Properties.Resources.SubscriptionDisplay_ReportingKind, sub.ReportingKind); 863 | Console.WriteLine(Properties.Resources.SubscriptionDisplay_ReportingOptions, sub.ReportingOptions); 864 | Console.WriteLine(Properties.Resources.SubscriptionDisplay_ReportingTarget, sub.ReportingTarget); 865 | Console.WriteLine(); 866 | } 867 | #endregion 868 | } 869 | } 870 | -------------------------------------------------------------------------------- /ViVeTool/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("ViVeTool")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("ViVeTool")] 12 | [assembly: AssemblyCopyright("Copyright © @thebookisclosed 2025")] 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("4daab723-3613-4133-ae54-646133538e44")] 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("0.3.4.0")] 35 | [assembly: AssemblyFileVersion("0.3.4.0")] 36 | -------------------------------------------------------------------------------- /ViVeTool/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Albacore.ViVeTool.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Albacore.ViVeTool.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to An error occurred while initializing the boot status data file ({0}) 65 | ///Custom boot time overrides will be stored but won't load until the data file is present. 66 | /// 67 | internal static string BootStatInitFailed { 68 | get { 69 | return ResourceManager.GetString("BootStatInitFailed", resourceCulture); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized string similar to Boot store changes require a reboot to fully take effect, please do so if a configuration appears to be missing. 75 | /// 76 | internal static string BootStoreRebootTip { 77 | get { 78 | return ResourceManager.GetString("BootStoreRebootTip", resourceCulture); 79 | } 80 | } 81 | 82 | /// 83 | /// Looks up a localized string similar to ViVeTool v0.3.4 - Windows feature configuration tool 84 | ///. 85 | /// 86 | internal static string Branding { 87 | get { 88 | return ResourceManager.GetString("Branding", resourceCulture); 89 | } 90 | } 91 | 92 | /// 93 | /// Looks up a localized string similar to Changestamp: {0}. 94 | /// 95 | internal static string ChangestampDisplay { 96 | get { 97 | return ResourceManager.GetString("ChangestampDisplay", resourceCulture); 98 | } 99 | } 100 | 101 | /// 102 | /// Looks up a localized string similar to Checking for app updates.... 103 | /// 104 | internal static string CheckingAppUpdates { 105 | get { 106 | return ResourceManager.GetString("CheckingAppUpdates", resourceCulture); 107 | } 108 | } 109 | 110 | /// 111 | /// Looks up a localized string similar to Checking for feature dictionary updates.... 112 | /// 113 | internal static string CheckingDictUpdates { 114 | get { 115 | return ResourceManager.GetString("CheckingDictUpdates", resourceCulture); 116 | } 117 | } 118 | 119 | /// 120 | /// Looks up a localized string similar to The '{0}' command has been moved to '{1}' as part of a syntax improvement effort. 121 | ///Arguments are now position independent and clearly labeled, ambiguous strings of numbers are no longer used. 122 | ////? can be used to view more information about usage.. 123 | /// 124 | internal static string CommandMigrationNote { 125 | get { 126 | return ResourceManager.GetString("CommandMigrationNote", resourceCulture); 127 | } 128 | } 129 | 130 | /// 131 | /// Looks up a localized string similar to Dictionary update canceled. 132 | /// 133 | internal static string DictUpdateCanceled { 134 | get { 135 | return ResourceManager.GetString("DictUpdateCanceled", resourceCulture); 136 | } 137 | } 138 | 139 | /// 140 | /// Looks up a localized string similar to Replace current version with new version?. 141 | /// 142 | internal static string DictUpdateConsent { 143 | get { 144 | return ResourceManager.GetString("DictUpdateConsent", resourceCulture); 145 | } 146 | } 147 | 148 | /// 149 | /// Looks up a localized string similar to Dictionary update finished. 150 | /// 151 | internal static string DictUpdateFinished { 152 | get { 153 | return ResourceManager.GetString("DictUpdateFinished", resourceCulture); 154 | } 155 | } 156 | 157 | /// 158 | /// Looks up a localized string similar to Exported {0} Runtime type and {1} Boot type feature configuration(s) to {2}. 159 | /// 160 | internal static string ExportSuccess { 161 | get { 162 | return ResourceManager.GetString("ExportSuccess", resourceCulture); 163 | } 164 | } 165 | 166 | /// 167 | /// Looks up a localized string similar to HasSubscriptions: {0}. 168 | /// 169 | internal static string FeatureDisplay_HasSubscriptions { 170 | get { 171 | return ResourceManager.GetString("FeatureDisplay_HasSubscriptions", resourceCulture); 172 | } 173 | } 174 | 175 | /// 176 | /// Looks up a localized string similar to Payload : 0x{0:x}. 177 | /// 178 | internal static string FeatureDisplay_Payload { 179 | get { 180 | return ResourceManager.GetString("FeatureDisplay_Payload", resourceCulture); 181 | } 182 | } 183 | 184 | /// 185 | /// Looks up a localized string similar to PayloadKind : {0} ({1}). 186 | /// 187 | internal static string FeatureDisplay_PayloadKind { 188 | get { 189 | return ResourceManager.GetString("FeatureDisplay_PayloadKind", resourceCulture); 190 | } 191 | } 192 | 193 | /// 194 | /// Looks up a localized string similar to Priority : {0}. 195 | /// 196 | internal static string FeatureDisplay_Priority { 197 | get { 198 | return ResourceManager.GetString("FeatureDisplay_Priority", resourceCulture); 199 | } 200 | } 201 | 202 | /// 203 | /// Looks up a localized string similar to State : {0} ({1}). 204 | /// 205 | internal static string FeatureDisplay_State { 206 | get { 207 | return ResourceManager.GetString("FeatureDisplay_State", resourceCulture); 208 | } 209 | } 210 | 211 | /// 212 | /// Looks up a localized string similar to Type : {0} ({1}). 213 | /// 214 | internal static string FeatureDisplay_Type { 215 | get { 216 | return ResourceManager.GetString("FeatureDisplay_Type", resourceCulture); 217 | } 218 | } 219 | 220 | /// 221 | /// Looks up a localized string similar to Variant : {0}. 222 | /// 223 | internal static string FeatureDisplay_Variant { 224 | get { 225 | return ResourceManager.GetString("FeatureDisplay_Variant", resourceCulture); 226 | } 227 | } 228 | 229 | /// 230 | /// Looks up a localized string similar to Experiment. 231 | /// 232 | internal static string FeatureType_Experiment { 233 | get { 234 | return ResourceManager.GetString("FeatureType_Experiment", resourceCulture); 235 | } 236 | } 237 | 238 | /// 239 | /// Looks up a localized string similar to Override. 240 | /// 241 | internal static string FeatureType_Override { 242 | get { 243 | return ResourceManager.GetString("FeatureType_Override", resourceCulture); 244 | } 245 | } 246 | 247 | /// 248 | /// Looks up a localized string similar to 'Last Known Good' rollback system data corruption was not found. 249 | /// 250 | internal static string FixLKGNotNeeded { 251 | get { 252 | return ResourceManager.GetString("FixLKGNotNeeded", resourceCulture); 253 | } 254 | } 255 | 256 | /// 257 | /// Looks up a localized string similar to 'Last Known Good' rollback system data has been fixed successfully. 258 | /// 259 | internal static string FixLKGPerformed { 260 | get { 261 | return ResourceManager.GetString("FixLKGPerformed", resourceCulture); 262 | } 263 | } 264 | 265 | /// 266 | /// Looks up a localized string similar to No configurations in this store need to be moved. 267 | /// 268 | internal static string FixPriorityNotNeeded { 269 | get { 270 | return ResourceManager.GetString("FixPriorityNotNeeded", resourceCulture); 271 | } 272 | } 273 | 274 | /// 275 | /// Looks up a localized string similar to Moving Override type {0} configurations from Service to User priority.... 276 | /// 277 | internal static string FixPriorityProcessing { 278 | get { 279 | return ResourceManager.GetString("FixPriorityProcessing", resourceCulture); 280 | } 281 | } 282 | 283 | /// 284 | /// Looks up a localized string similar to Full reset canceled. 285 | /// 286 | internal static string FullResetCanceled { 287 | get { 288 | return ResourceManager.GetString("FullResetCanceled", resourceCulture); 289 | } 290 | } 291 | 292 | /// 293 | /// Looks up a localized string similar to Are you sure you want to perform a full reset?. 294 | /// 295 | internal static string FullResetPrompt { 296 | get { 297 | return ResourceManager.GetString("FullResetPrompt", resourceCulture); 298 | } 299 | } 300 | 301 | /// 302 | /// Looks up a localized string similar to Available commands: 303 | /// /query Lists existing feature configuration(s) 304 | /// /enable Enables a feature 305 | /// /disable Disables a feature 306 | /// /reset Removes custom configurations for a specific feature 307 | /// /fullreset Removes all custom feature configurations 308 | /// /changestamp Prints the feature store change counter (changestamp)* 309 | /// /querysubs Lists existing feature usage subscriptions* 310 | /// /addsub Adds a feature usage subscription 311 | /// /delsub Removes a feature usage subscription 312 | /// /notifyusage Fires a feature [rest of string was truncated]";. 313 | /// 314 | internal static string Help_Commands { 315 | get { 316 | return ResourceManager.GetString("Help_Commands", resourceCulture); 317 | } 318 | } 319 | 320 | /// 321 | /// Looks up a localized string similar to Syntax: 322 | /// /export /filename:<path to new file> [/store:<both | runtime | boot>] 323 | /// 324 | ///Exports all currently loaded feature configurations to a file. By default both stores are exported. 325 | /// 326 | ///Examples: 327 | /// /export /filename:features.bin. 328 | /// 329 | internal static string Help_Export { 330 | get { 331 | return ResourceManager.GetString("Help_Export", resourceCulture); 332 | } 333 | } 334 | 335 | /// 336 | /// Looks up a localized string similar to Syntax: 337 | /// /fixlkg 338 | /// 339 | ///Attempts to fix corrupted 'Last Known Good' rollback system data. Windows system components can occassionally 340 | ///invalidate this data due to a programming oversight.. 341 | /// 342 | internal static string Help_FixLKG { 343 | get { 344 | return ResourceManager.GetString("Help_FixLKG", resourceCulture); 345 | } 346 | } 347 | 348 | /// 349 | /// Looks up a localized string similar to Syntax: 350 | /// /fullreset [/store:<both | runtime | boot>] 351 | /// [/priority:{{<safeguard | service | dynamic | user | userpolicy | test> | <2-14>}}] 352 | /// 353 | ///This command removes all custom feature configuration overrides, effectively reverting 354 | ///feature store contents to their clean install state. Both stores are targeted by default. 355 | ///If a priority is specified, only features in that specific priority will be reset. 356 | ///Use with caution. 357 | /// 358 | ///{0}. 359 | /// 360 | internal static string Help_FullReset { 361 | get { 362 | return ResourceManager.GetString("Help_FullReset", resourceCulture); 363 | } 364 | } 365 | 366 | /// 367 | /// Looks up a localized string similar to Syntax: 368 | /// /import /filename:<path to file> [/store:<both | runtime | boot>] [/replace] 369 | /// 370 | ///Imports all feature configurations stored in a file into your system. By default both stores will be imported to. 371 | /// 372 | ///Specifying /replace performs a full reset before importing data. 373 | /// 374 | ///{0} 375 | /// 376 | ///Examples: 377 | /// /import /filename:features.bin 378 | /// /import /filename:features.bin /store:boot /replace. 379 | /// 380 | internal static string Help_Import { 381 | get { 382 | return ResourceManager.GetString("Help_Import", resourceCulture); 383 | } 384 | } 385 | 386 | /// 387 | /// Looks up a localized string similar to Syntax: 388 | /// /lkgstatus 389 | /// 390 | ///Queries the 'Last Known Good' (LKG) rollback system status. The LKG blob is a snapshot of feature 391 | ///configurations known to cause no critical system failures. 392 | /// 393 | ///Status descriptions: 394 | /// - BootPending Feature configurations have changed since booting up, a reboot is required 395 | /// to confirm that they don't cause boot-time failures 396 | /// 397 | /// - LKGPending The system was able to boot successfully after a feature confguration change, 398 | /// the current state will shortly become the new LKG blob /// [rest of string was truncated]";. 399 | /// 400 | internal static string Help_LKGStatus { 401 | get { 402 | return ResourceManager.GetString("Help_LKGStatus", resourceCulture); 403 | } 404 | } 405 | 406 | /// 407 | /// Looks up a localized string similar to Syntax: 408 | /// /notifyusage {/id:<comma delimited feature IDs> | /name:<comma delimited feature names>} 409 | /// /reportingkind:<0-65535> /reportingoptions:<0-65535> 410 | /// 411 | ///Fires a feature usage notification. If a subscription with matching Kind & Options conditions 412 | ///is found, the Target WNF state ID associated with it receives usage info. 413 | /// 414 | ///Features can be specified using both their IDs and names, mixing and matching is allowed. 415 | /// 416 | ///Examples: 417 | /// /notifyusage /id:12345678 /reportingkind:4 /reportingoptions:1. 418 | /// 419 | internal static string Help_NotifyUsage { 420 | get { 421 | return ResourceManager.GetString("Help_NotifyUsage", resourceCulture); 422 | } 423 | } 424 | 425 | /// 426 | /// Looks up a localized string similar to Syntax: 427 | /// /query [/store:<runtime | boot>] [/id:<comma delimited feature IDs>] 428 | /// [/name:<comma delimited feature names>] 429 | /// [/priority:{<imagedefault | ekb | safeguard | imagedefaulteditionoverride | 430 | /// service | dynamic | user | security | userpolicy | test | imageoverride> | <0-15>}] 431 | /// 432 | ///If no store is specified, the Runtime store will be queried by default. 433 | ///You can specify feature IDs or names to filter the query results, in this case only 434 | ///the override with the highest priority will be displayed. 435 | ///I [rest of string was truncated]";. 436 | /// 437 | internal static string Help_Query { 438 | get { 439 | return ResourceManager.GetString("Help_Query", resourceCulture); 440 | } 441 | } 442 | 443 | /// 444 | /// Looks up a localized string similar to Syntax: 445 | /// /reset {{/id:<comma delimited feature IDs> | /name:<comma delimited feature names>}} 446 | /// [/priority:{{<safeguard | service | dynamic | user | userpolicy | test> | <2-14>}}] 447 | /// [/store:<both | runtime | boot>] 448 | /// 449 | ///Features can be specified using both their IDs and names, mixing and matching is allowed. 450 | /// 451 | ///By default the features you've chosen will have their configuration overrides erased from 452 | ///all priorities and both stores. Specifying a priority will limit the scope of the reset. 453 | /// 454 | ///{0} 455 | /// 456 | ///Example [rest of string was truncated]";. 457 | /// 458 | internal static string Help_Reset { 459 | get { 460 | return ResourceManager.GetString("Help_Reset", resourceCulture); 461 | } 462 | } 463 | 464 | /// 465 | /// Looks up a localized string similar to Syntax: 466 | /// {0} {{/id:<comma delimited feature IDs> | /name:<comma delimited feature names>}} [/variant:<0-63>] 467 | /// [/variantpayloadkind:<none | resident | external>] [/variantpayload:<0-4294967295>] [/experiment] 468 | /// [/priority:{{<safeguard | service | dynamic | user | userpolicy | test> | <2-14>}}] 469 | /// [/store:<both | runtime | boot>] 470 | /// 471 | ///The parameters in square brackets don't need to be specified and will use these defaults: 472 | /// Variant : 0 473 | /// VariantPayloadKind: None 474 | /// VariantPayload : 0 475 | /// Exp [rest of string was truncated]";. 476 | /// 477 | internal static string Help_Set { 478 | get { 479 | return ResourceManager.GetString("Help_Set", resourceCulture); 480 | } 481 | } 482 | 483 | /// 484 | /// Looks up a localized string similar to Syntax: 485 | /// {0} {{/id:<comma delimited feature IDs> | /name:<comma delimited feature names>}} 486 | /// /reportingkind:<0-65535> /reportingtarget:<wnf state id>{1} 487 | /// 488 | ///{2} 489 | /// 490 | ///Features can be specified using both their IDs and names, mixing and matching is allowed. 491 | /// 492 | ///Examples: 493 | /// {0} /id:12345678 /reportingkind:4 /reportingtarget:0d83063ea3bdf875. 494 | /// 495 | internal static string Help_SetSubs { 496 | get { 497 | return ResourceManager.GetString("Help_SetSubs", resourceCulture); 498 | } 499 | } 500 | 501 | /// 502 | /// Looks up a localized string similar to Creates a feature usage subscription. When the conditions specified by the Kind & Options 503 | ///parameters are met, the Target WNF state ID receives usage info.. 504 | /// 505 | internal static string Help_SetSubs_Add { 506 | get { 507 | return ResourceManager.GetString("Help_SetSubs_Add", resourceCulture); 508 | } 509 | } 510 | 511 | /// 512 | /// Looks up a localized string similar to Deletes a feature usage subscription.. 513 | /// 514 | internal static string Help_SetSubs_Delete { 515 | get { 516 | return ResourceManager.GetString("Help_SetSubs_Delete", resourceCulture); 517 | } 518 | } 519 | 520 | /// 521 | /// Looks up a localized string similar to ImageDefault (0), EKB (1), ImageDefaultEditionOverride(3), Security (9), and 522 | ///ImageOverride (15) priorities are immutable and can't be written to.. 523 | /// 524 | internal static string ImmutablePropertiesInfo { 525 | get { 526 | return ResourceManager.GetString("ImmutablePropertiesInfo", resourceCulture); 527 | } 528 | } 529 | 530 | /// 531 | /// Looks up a localized string similar to File contains {0} Runtime type and {1} Boot type applicable feature configuration(s). 532 | /// 533 | internal static string ImportBreakdown { 534 | get { 535 | return ResourceManager.GetString("ImportBreakdown", resourceCulture); 536 | } 537 | } 538 | 539 | /// 540 | /// Looks up a localized string similar to Importing {0} feature configuration(s) into the {1} store.... 541 | /// 542 | internal static string ImportProcessing { 543 | get { 544 | return ResourceManager.GetString("ImportProcessing", resourceCulture); 545 | } 546 | } 547 | 548 | /// 549 | /// Looks up a localized string similar to Windows 10 build 18963 or newer is required for this program to function 550 | ///Your current build: {0}. 551 | /// 552 | internal static string IncompatibleBuild { 553 | get { 554 | return ResourceManager.GetString("IncompatibleBuild", resourceCulture); 555 | } 556 | } 557 | 558 | /// 559 | /// Looks up a localized string similar to '{0}' is not a valid {1} specification. 560 | /// 561 | internal static string InvalidEnumSpec { 562 | get { 563 | return ResourceManager.GetString("InvalidEnumSpec", resourceCulture); 564 | } 565 | } 566 | 567 | /// 568 | /// Looks up a localized string similar to '{0}' is not a valid {1} specification in this scenario. 569 | /// 570 | internal static string InvalidEnumSpecInScenario { 571 | get { 572 | return ResourceManager.GetString("InvalidEnumSpecInScenario", resourceCulture); 573 | } 574 | } 575 | 576 | /// 577 | /// Looks up a localized string similar to An error occurred while querying the 'Last Known Good' rollback system status ({0}). 578 | /// 579 | internal static string LKGQueryFailed { 580 | get { 581 | return ResourceManager.GetString("LKGQueryFailed", resourceCulture); 582 | } 583 | } 584 | 585 | /// 586 | /// Looks up a localized string similar to LKG status: {0}. 587 | /// 588 | internal static string LKGStatusDisplay { 589 | get { 590 | return ResourceManager.GetString("LKGStatusDisplay", resourceCulture); 591 | } 592 | } 593 | 594 | /// 595 | /// Looks up a localized string similar to An error occurred while setting the 'Last Known Good' rollback system status ({0}) 596 | ///Changes were made but their persistence cannot be guaranteed (Current status: {1}). 597 | /// 598 | internal static string LKGUpdateFailed { 599 | get { 600 | return ResourceManager.GetString("LKGUpdateFailed", resourceCulture); 601 | } 602 | } 603 | 604 | /// 605 | /// Looks up a localized string similar to Found release: {0} (published on {1:d}) 606 | /// 607 | ///Release notes: 608 | ///{2} 609 | /// 610 | ///Download at: {3}. 611 | /// 612 | internal static string NewAppUpdateDisplay { 613 | get { 614 | return ResourceManager.GetString("NewAppUpdateDisplay", resourceCulture); 615 | } 616 | } 617 | 618 | /// 619 | /// Looks up a localized string similar to Newer dictionary found (revision {0}). 620 | /// 621 | internal static string NewDictUpdateDisplay { 622 | get { 623 | return ResourceManager.GetString("NewDictUpdateDisplay", resourceCulture); 624 | } 625 | } 626 | 627 | /// 628 | /// Looks up a localized string similar to No features were specified. 629 | /// 630 | internal static string NoFeaturesSpecified { 631 | get { 632 | return ResourceManager.GetString("NoFeaturesSpecified", resourceCulture); 633 | } 634 | } 635 | 636 | /// 637 | /// Looks up a localized string similar to No file name was specified. 638 | /// 639 | internal static string NoFileNameSpecified { 640 | get { 641 | return ResourceManager.GetString("NoFileNameSpecified", resourceCulture); 642 | } 643 | } 644 | 645 | /// 646 | /// Looks up a localized string similar to You're using the latest version. 647 | /// 648 | internal static string NoNewerVersionFound { 649 | get { 650 | return ResourceManager.GetString("NoNewerVersionFound", resourceCulture); 651 | } 652 | } 653 | 654 | /// 655 | /// Looks up a localized string similar to No Reporting Target was specified. 656 | /// 657 | internal static string NoReportingTargetSpecified { 658 | get { 659 | return ResourceManager.GetString("NoReportingTargetSpecified", resourceCulture); 660 | } 661 | } 662 | 663 | /// 664 | /// Looks up a localized string similar to An error occurred while firing a usage notification for feature ID {0} ({1}). 665 | /// 666 | internal static string NotifyUsageFailed { 667 | get { 668 | return ResourceManager.GetString("NotifyUsageFailed", resourceCulture); 669 | } 670 | } 671 | 672 | /// 673 | /// Looks up a localized string similar to Successfully fired usage notification for feature ID {0}. 674 | /// 675 | internal static string NotifyUsageSuccess { 676 | get { 677 | return ResourceManager.GetString("NotifyUsageSuccess", resourceCulture); 678 | } 679 | } 680 | 681 | /// 682 | /// Looks up a localized string similar to Failed to query feature configurations. 683 | /// 684 | internal static string QueryFailed { 685 | get { 686 | return ResourceManager.GetString("QueryFailed", resourceCulture); 687 | } 688 | } 689 | 690 | /// 691 | /// Looks up a localized string similar to Failed to query feature usage subscriptions. 692 | /// 693 | internal static string QuerySubsFailed { 694 | get { 695 | return ResourceManager.GetString("QuerySubsFailed", resourceCulture); 696 | } 697 | } 698 | 699 | /// 700 | /// Looks up a localized string similar to A reboot is recommended for all changes to take effect. 701 | /// 702 | internal static string RebootRecommended { 703 | get { 704 | return ResourceManager.GetString("RebootRecommended", resourceCulture); 705 | } 706 | } 707 | 708 | /// 709 | /// Looks up a localized string similar to An error occurred while resetting feature configurations in the Boot store ({0}), configurations will return after reboot. 710 | /// 711 | internal static string ResetBootFailed { 712 | get { 713 | return ResourceManager.GetString("ResetBootFailed", resourceCulture); 714 | } 715 | } 716 | 717 | /// 718 | /// Looks up a localized string similar to An error occurred while resetting feature configurations in the Runtime store ({0}). 719 | /// 720 | internal static string ResetRuntimeFailed { 721 | get { 722 | return ResourceManager.GetString("ResetRuntimeFailed", resourceCulture); 723 | } 724 | } 725 | 726 | /// 727 | /// Looks up a localized string similar to Successfully reset feature configuration(s). 728 | /// 729 | internal static string ResetSuccess { 730 | get { 731 | return ResourceManager.GetString("ResetSuccess", resourceCulture); 732 | } 733 | } 734 | 735 | /// 736 | /// Looks up a localized string similar to An error occurred while setting feature configurations in the Boot store ({0}), configurations will revert after reboot. 737 | /// 738 | internal static string SetBootFailed { 739 | get { 740 | return ResourceManager.GetString("SetBootFailed", resourceCulture); 741 | } 742 | } 743 | 744 | /// 745 | /// Looks up a localized string similar to An error occurred while setting feature configurations in the Runtime store ({0}). 746 | /// 747 | internal static string SetRuntimeFailed { 748 | get { 749 | return ResourceManager.GetString("SetRuntimeFailed", resourceCulture); 750 | } 751 | } 752 | 753 | /// 754 | /// Looks up a localized string similar to An error occurred while setting feature usage subscriptions in the Boot store ({1}), subscriptions will revert after reboot. 755 | /// 756 | internal static string SetSubsBootFailed { 757 | get { 758 | return ResourceManager.GetString("SetSubsBootFailed", resourceCulture); 759 | } 760 | } 761 | 762 | /// 763 | /// Looks up a localized string similar to An error occurred while setting feature usage subscriptions in the Runtime store ({0}). 764 | /// 765 | internal static string SetSubsRuntimeFailed { 766 | get { 767 | return ResourceManager.GetString("SetSubsRuntimeFailed", resourceCulture); 768 | } 769 | } 770 | 771 | /// 772 | /// Looks up a localized string similar to Successfully set feature usage subscription(s). 773 | /// 774 | internal static string SetSubsSuccess { 775 | get { 776 | return ResourceManager.GetString("SetSubsSuccess", resourceCulture); 777 | } 778 | } 779 | 780 | /// 781 | /// Looks up a localized string similar to Successfully set feature configuration(s). 782 | /// 783 | internal static string SetSuccess { 784 | get { 785 | return ResourceManager.GetString("SetSuccess", resourceCulture); 786 | } 787 | } 788 | 789 | /// 790 | /// Looks up a localized string similar to No configuration for feature ID {0} was found in the {1} store. 791 | /// 792 | internal static string SingleQueryFailed { 793 | get { 794 | return ResourceManager.GetString("SingleQueryFailed", resourceCulture); 795 | } 796 | } 797 | 798 | /// 799 | /// Looks up a localized string similar to ReportingKind : {0}. 800 | /// 801 | internal static string SubscriptionDisplay_ReportingKind { 802 | get { 803 | return ResourceManager.GetString("SubscriptionDisplay_ReportingKind", resourceCulture); 804 | } 805 | } 806 | 807 | /// 808 | /// Looks up a localized string similar to ReportingOptions: {0}. 809 | /// 810 | internal static string SubscriptionDisplay_ReportingOptions { 811 | get { 812 | return ResourceManager.GetString("SubscriptionDisplay_ReportingOptions", resourceCulture); 813 | } 814 | } 815 | 816 | /// 817 | /// Looks up a localized string similar to ReportingTarget : {0:x16}. 818 | /// 819 | internal static string SubscriptionDisplay_ReportingTarget { 820 | get { 821 | return ResourceManager.GetString("SubscriptionDisplay_ReportingTarget", resourceCulture); 822 | } 823 | } 824 | 825 | /// 826 | /// Looks up a localized string similar to Unrecognized command: {0}. 827 | /// 828 | internal static string UnrecognizedCommand { 829 | get { 830 | return ResourceManager.GetString("UnrecognizedCommand", resourceCulture); 831 | } 832 | } 833 | 834 | /// 835 | /// Looks up a localized string similar to Unrecognized parameter: {0} 836 | ///. 837 | /// 838 | internal static string UnrecognizedParameter { 839 | get { 840 | return ResourceManager.GetString("UnrecognizedParameter", resourceCulture); 841 | } 842 | } 843 | } 844 | } 845 | -------------------------------------------------------------------------------- /ViVeTool/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | An error occurred while initializing the boot status data file ({0}) 122 | Custom boot time overrides will be stored but won't load until the data file is present 123 | 124 | 125 | Boot store changes require a reboot to fully take effect, please do so if a configuration appears to be missing 126 | 127 | 128 | ViVeTool v0.3.4 - Windows feature configuration tool 129 | 130 | 131 | 132 | Changestamp: {0} 133 | 134 | 135 | Checking for app updates... 136 | 137 | 138 | Checking for feature dictionary updates... 139 | 140 | 141 | The '{0}' command has been moved to '{1}' as part of a syntax improvement effort. 142 | Arguments are now position independent and clearly labeled, ambiguous strings of numbers are no longer used. 143 | /? can be used to view more information about usage. 144 | 145 | 146 | Dictionary update canceled 147 | 148 | 149 | Replace current version with new version? 150 | 151 | 152 | Dictionary update finished 153 | 154 | 155 | Exported {0} Runtime type and {1} Boot type feature configuration(s) to {2} 156 | 157 | 158 | HasSubscriptions: {0} 159 | 160 | 161 | Payload : 0x{0:x} 162 | 163 | 164 | PayloadKind : {0} ({1}) 165 | 166 | 167 | Priority : {0} 168 | 169 | 170 | State : {0} ({1}) 171 | 172 | 173 | Type : {0} ({1}) 174 | 175 | 176 | Variant : {0} 177 | 178 | 179 | Experiment 180 | 181 | 182 | Override 183 | 184 | 185 | 'Last Known Good' rollback system data corruption was not found 186 | 187 | 188 | 'Last Known Good' rollback system data has been fixed successfully 189 | 190 | 191 | No configurations in this store need to be moved 192 | 193 | 194 | Moving Override type {0} configurations from Service to User priority... 195 | 196 | 197 | Full reset canceled 198 | 199 | 200 | Are you sure you want to perform a full reset? 201 | 202 | 203 | Available commands: 204 | /query Lists existing feature configuration(s) 205 | /enable Enables a feature 206 | /disable Disables a feature 207 | /reset Removes custom configurations for a specific feature 208 | /fullreset Removes all custom feature configurations 209 | /changestamp Prints the feature store change counter (changestamp)* 210 | /querysubs Lists existing feature usage subscriptions* 211 | /addsub Adds a feature usage subscription 212 | /delsub Removes a feature usage subscription 213 | /notifyusage Fires a feature usage notification 214 | /export Exports custom feature configurations 215 | /import Imports custom feature configurations 216 | /lkgstatus Prints the current 'Last Known Good' rollback system status 217 | /fixlkg Fixes 'Last Known Good' rollback system corruption 218 | /fixpriority Moves Override type configurations from Service to User priority* 219 | /appupdate Checks for a new version of ViVeTool* 220 | /dictupdate Checks for a new version of the feature name dictionary* 221 | 222 | Commands can be used along with /? to view more information about usage 223 | *Does not apply to commands marked with an asterisk 224 | 225 | 226 | Syntax: 227 | /export /filename:<path to new file> [/store:<both | runtime | boot>] 228 | 229 | Exports all currently loaded feature configurations to a file. By default both stores are exported. 230 | 231 | Examples: 232 | /export /filename:features.bin 233 | 234 | 235 | Syntax: 236 | /fixlkg 237 | 238 | Attempts to fix corrupted 'Last Known Good' rollback system data. Windows system components can occassionally 239 | invalidate this data due to a programming oversight. 240 | 241 | 242 | Syntax: 243 | /fullreset [/store:<both | runtime | boot>] 244 | [/priority:{{<safeguard | service | dynamic | user | userpolicy | test> | <2-14>}}] 245 | 246 | This command removes all custom feature configuration overrides, effectively reverting 247 | feature store contents to their clean install state. Both stores are targeted by default. 248 | If a priority is specified, only features in that specific priority will be reset. 249 | Use with caution. 250 | 251 | {0} 252 | 253 | 254 | Syntax: 255 | /import /filename:<path to file> [/store:<both | runtime | boot>] [/replace] 256 | 257 | Imports all feature configurations stored in a file into your system. By default both stores will be imported to. 258 | 259 | Specifying /replace performs a full reset before importing data. 260 | 261 | {0} 262 | 263 | Examples: 264 | /import /filename:features.bin 265 | /import /filename:features.bin /store:boot /replace 266 | 267 | 268 | Syntax: 269 | /lkgstatus 270 | 271 | Queries the 'Last Known Good' (LKG) rollback system status. The LKG blob is a snapshot of feature 272 | configurations known to cause no critical system failures. 273 | 274 | Status descriptions: 275 | - BootPending Feature configurations have changed since booting up, a reboot is required 276 | to confirm that they don't cause boot-time failures 277 | 278 | - LKGPending The system was able to boot successfully after a feature confguration change, 279 | the current state will shortly become the new LKG blob 280 | 281 | - RollbackPending Recent feature configuration changes were found to cause issues, the current 282 | state will soon be replaced by the LKG blob 283 | 284 | - Committed No feature configuration changes were made since booting up, the LKG blob 285 | matches the current configuration 286 | 287 | 288 | Syntax: 289 | /notifyusage {/id:<comma delimited feature IDs> | /name:<comma delimited feature names>} 290 | /reportingkind:<0-65535> /reportingoptions:<0-65535> 291 | 292 | Fires a feature usage notification. If a subscription with matching Kind & Options conditions 293 | is found, the Target WNF state ID associated with it receives usage info. 294 | 295 | Features can be specified using both their IDs and names, mixing and matching is allowed. 296 | 297 | Examples: 298 | /notifyusage /id:12345678 /reportingkind:4 /reportingoptions:1 299 | 300 | 301 | Syntax: 302 | /query [/store:<runtime | boot>] [/id:<comma delimited feature IDs>] 303 | [/name:<comma delimited feature names>] 304 | [/priority:{<imagedefault | ekb | safeguard | imagedefaulteditionoverride | 305 | service | dynamic | user | security | userpolicy | test | imageoverride> | <0-15>}] 306 | 307 | If no store is specified, the Runtime store will be queried by default. 308 | You can specify feature IDs or names to filter the query results, in this case only 309 | the override with the highest priority will be displayed. 310 | If a priority is specified, only features in that specific priority will be shown. 311 | 312 | Boot store queries reflect the state on system startup, if you've made any changes 313 | to it since, a reboot is required for them to show up in the output. This is intended 314 | as it reflects what the Windows API sees when querying particular feature stores. 315 | 316 | Examples: 317 | /query 318 | /query /store:boot /id:12345678 319 | /query /store:runtime /name:TIFE,STTest 320 | 321 | 322 | Syntax: 323 | /reset {{/id:<comma delimited feature IDs> | /name:<comma delimited feature names>}} 324 | [/priority:{{<safeguard | service | dynamic | user | userpolicy | test> | <2-14>}}] 325 | [/store:<both | runtime | boot>] 326 | 327 | Features can be specified using both their IDs and names, mixing and matching is allowed. 328 | 329 | By default the features you've chosen will have their configuration overrides erased from 330 | all priorities and both stores. Specifying a priority will limit the scope of the reset. 331 | 332 | {0} 333 | 334 | Examples: 335 | /reset /id:12345678 336 | /reset /name:TIFE,STTest 337 | /reset /name:SmartClipboardUX /id:33000420 /priority:user 338 | 339 | 340 | Syntax: 341 | {0} {{/id:<comma delimited feature IDs> | /name:<comma delimited feature names>}} [/variant:<0-63>] 342 | [/variantpayloadkind:<none | resident | external>] [/variantpayload:<0-4294967295>] [/experiment] 343 | [/priority:{{<safeguard | service | dynamic | user | userpolicy | test> | <2-14>}}] 344 | [/store:<both | runtime | boot>] 345 | 346 | The parameters in square brackets don't need to be specified and will use these defaults: 347 | Variant : 0 348 | VariantPayloadKind: None 349 | VariantPayload : 0 350 | Experiment : false 351 | Priority : User 352 | Store : Both 353 | 354 | Features can be specified using both their IDs and names, mixing and matching is allowed. 355 | 356 | Service priority overrides are managed by Windows's automated A/B feature delivery mechanism. Experiment 357 | type overrides with this priority may get deleted without notice. Creating non-Experiment overrides with this 358 | priority may negatively impact automated A/B feature delivery. Using the Service priority is not recommended. 359 | 360 | Writing to the Boot store is necessary for features to persist across reboots. Changes to this store become 361 | effective the next time you reboot. The Runtime store can be used to make instantenous changes, however not 362 | all features support this, meaning a reboot may be required to apply changes. Use both for best results. 363 | 364 | Examples: 365 | {0} /id:12345678 366 | {0} /name:TIFE,STTest /variant:1 367 | {0} /name:SmartClipboardUX /id:33000420 /experiment /priority:user /store:boot 368 | 369 | 370 | Syntax: 371 | {0} {{/id:<comma delimited feature IDs> | /name:<comma delimited feature names>}} 372 | /reportingkind:<0-65535> /reportingtarget:<wnf state id>{1} 373 | 374 | {2} 375 | 376 | Features can be specified using both their IDs and names, mixing and matching is allowed. 377 | 378 | Examples: 379 | {0} /id:12345678 /reportingkind:4 /reportingtarget:0d83063ea3bdf875 380 | 381 | 382 | Creates a feature usage subscription. When the conditions specified by the Kind & Options 383 | parameters are met, the Target WNF state ID receives usage info. 384 | 385 | 386 | Deletes a feature usage subscription. 387 | 388 | 389 | ImageDefault (0), EKB (1), ImageDefaultEditionOverride(3), Security (9), and 390 | ImageOverride (15) priorities are immutable and can't be written to. 391 | 392 | 393 | File contains {0} Runtime type and {1} Boot type applicable feature configuration(s) 394 | 395 | 396 | Importing {0} feature configuration(s) into the {1} store... 397 | 398 | 399 | Windows 10 build 18963 or newer is required for this program to function 400 | Your current build: {0} 401 | 402 | 403 | '{0}' is not a valid {1} specification 404 | 405 | 406 | '{0}' is not a valid {1} specification in this scenario 407 | 408 | 409 | An error occurred while querying the 'Last Known Good' rollback system status ({0}) 410 | 411 | 412 | LKG status: {0} 413 | 414 | 415 | An error occurred while setting the 'Last Known Good' rollback system status ({0}) 416 | Changes were made but their persistence cannot be guaranteed (Current status: {1}) 417 | 418 | 419 | Found release: {0} (published on {1:d}) 420 | 421 | Release notes: 422 | {2} 423 | 424 | Download at: {3} 425 | 426 | 427 | Newer dictionary found (revision {0}) 428 | 429 | 430 | No features were specified 431 | 432 | 433 | No file name was specified 434 | 435 | 436 | You're using the latest version 437 | 438 | 439 | No Reporting Target was specified 440 | 441 | 442 | An error occurred while firing a usage notification for feature ID {0} ({1}) 443 | 444 | 445 | Successfully fired usage notification for feature ID {0} 446 | 447 | 448 | Failed to query feature configurations 449 | 450 | 451 | Failed to query feature usage subscriptions 452 | 453 | 454 | A reboot is recommended for all changes to take effect 455 | 456 | 457 | An error occurred while resetting feature configurations in the Boot store ({0}), configurations will return after reboot 458 | 459 | 460 | An error occurred while resetting feature configurations in the Runtime store ({0}) 461 | 462 | 463 | Successfully reset feature configuration(s) 464 | 465 | 466 | An error occurred while setting feature configurations in the Boot store ({0}), configurations will revert after reboot 467 | 468 | 469 | An error occurred while setting feature configurations in the Runtime store ({0}) 470 | 471 | 472 | An error occurred while setting feature usage subscriptions in the Boot store ({1}), subscriptions will revert after reboot 473 | 474 | 475 | An error occurred while setting feature usage subscriptions in the Runtime store ({0}) 476 | 477 | 478 | Successfully set feature usage subscription(s) 479 | 480 | 481 | Successfully set feature configuration(s) 482 | 483 | 484 | No configuration for feature ID {0} was found in the {1} store 485 | 486 | 487 | ReportingKind : {0} 488 | 489 | 490 | ReportingOptions: {0} 491 | 492 | 493 | ReportingTarget : {0:x16} 494 | 495 | 496 | Unrecognized command: {0} 497 | 498 | 499 | Unrecognized parameter: {0} 500 | 501 | 502 | -------------------------------------------------------------------------------- /ViVeTool/UpdateCheck.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ViVe - Windows feature configuration library 3 | Copyright (C) 2019-2023 @thebookisclosed 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | using Newtonsoft.Json; 20 | using System; 21 | using System.IO; 22 | using System.Linq; 23 | using System.Net; 24 | using System.Security.Cryptography; 25 | using System.Text; 26 | 27 | namespace Albacore.ViVeTool 28 | { 29 | internal class UpdateCheck 30 | { 31 | private const string GitHubRepoApiRoot = "https://api.github.com/repos/thebookisclosed/ViVe/"; 32 | private static WebClient UcWebClient; 33 | 34 | internal static GitHubReleaseInfo GetLatestReleaseInfo() 35 | { 36 | return GetJsonResponse("releases/latest"); 37 | } 38 | 39 | internal static bool IsAppOutdated(string versionTag) 40 | { 41 | var foundVersion = new Version(versionTag.Substring(1)); 42 | var currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 43 | return foundVersion > currentVersion; 44 | } 45 | 46 | internal static GitHubRepoContent GetLatestDictionaryInfo() 47 | { 48 | var resp = GetJsonResponse("contents/Extra"); 49 | var dictInfo = resp?.Where(x => x.name == FeatureNaming.DictFileName).FirstOrDefault(); 50 | return dictInfo; 51 | } 52 | 53 | internal static bool IsDictOutdated(string sha) 54 | { 55 | return sha != HashUTF8TextFile(FeatureNaming.DictFilePath); 56 | } 57 | 58 | internal static void ReplaceDict(string url) 59 | { 60 | EnsureWebClient(); 61 | UcWebClient.DownloadFile(url, FeatureNaming.DictFilePath); 62 | } 63 | 64 | private static void EnsureWebClient() 65 | { 66 | if (UcWebClient == null) 67 | { 68 | UcWebClient = new WebClient(); 69 | UcWebClient.Headers.Add("User-Agent", "ViVeTool"); 70 | } 71 | } 72 | 73 | private static T GetJsonResponse(string apiPath) 74 | { 75 | EnsureWebClient(); 76 | try 77 | { 78 | var stringResponse = UcWebClient.DownloadString(GitHubRepoApiRoot + apiPath); 79 | return JsonConvert.DeserializeObject(stringResponse); 80 | } 81 | catch { return default; } 82 | } 83 | 84 | private static string HashUTF8TextFile(string filePath) 85 | { 86 | if (!File.Exists(filePath)) 87 | return null; 88 | using (var sha1Csp = new SHA1CryptoServiceProvider()) 89 | { 90 | var fileBody = Encoding.UTF8.GetBytes(File.ReadAllText(filePath).Replace("\r\n", "\n")); 91 | var fullLength = fileBody.Length; 92 | 93 | var preamble = Encoding.UTF8.GetPreamble(); 94 | var filePortion = new byte[preamble.Length]; 95 | using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 96 | fs.Read(filePortion, 0, filePortion.Length); 97 | 98 | for (int i = 0; i < preamble.Length; i++) 99 | if (preamble[i] == filePortion[i]) 100 | fullLength++; 101 | 102 | var preface = Encoding.UTF8.GetBytes($"blob {fullLength}\0"); 103 | sha1Csp.TransformBlock(preface, 0, preface.Length, null, 0); 104 | if (fullLength > fileBody.Length) 105 | sha1Csp.TransformBlock(preamble, 0, preamble.Length, null, 0); 106 | sha1Csp.TransformFinalBlock(fileBody, 0, fileBody.Length); 107 | 108 | return BitConverter.ToString(sha1Csp.Hash).Replace("-", "").ToLowerInvariant(); 109 | } 110 | } 111 | } 112 | 113 | public class GitHubReleaseInfo 114 | { 115 | public string html_url { get; set; } 116 | public string tag_name { get; set; } 117 | public string name { get; set; } 118 | public DateTime published_at { get; set; } 119 | public string body { get; set; } 120 | } 121 | 122 | 123 | public class GitHubRepoContent 124 | { 125 | public string name { get; set; } 126 | public string sha { get; set; } 127 | public string download_url { get; set; } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /ViVeTool/ViVeTool.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {4DAAB723-3613-4133-AE54-646133538E44} 8 | Exe 9 | Albacore.ViVeTool 10 | ViVeTool 11 | v4.8.1 12 | 512 13 | true 14 | true 15 | 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | TRACE;DEBUG;SET_LKG_COMMAND 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | AnyCPU 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | false 37 | 38 | 39 | app.manifest 40 | 41 | 42 | true 43 | bin\ARM64\Debug\ 44 | TRACE;DEBUG;SET_LKG_COMMAND 45 | full 46 | ARM64 47 | 7.3 48 | prompt 49 | 50 | 51 | bin\ARM64\Release\ 52 | TRACE 53 | true 54 | pdbonly 55 | ARM64 56 | 7.3 57 | prompt 58 | 59 | 60 | 61 | ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | True 82 | True 83 | Resources.resx 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | {80dcda4d-8022-4740-8ccf-459dd3fe6f72} 94 | ViVe 95 | 96 | 97 | 98 | 99 | ResXFileCodeGenerator 100 | Resources.Designer.cs 101 | Designer 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /ViVeTool/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ViVeTool/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------