{"id":150,"date":"2024-06-11T06:01:23","date_gmt":"2024-06-11T13:01:23","guid":{"rendered":"https:\/\/eisaichen.com\/?p=150"},"modified":"2024-06-11T06:05:36","modified_gmt":"2024-06-11T13:05:36","slug":"tamper-windowsapps-in-windows-10-11","status":"publish","type":"post","link":"https:\/\/eisaichen.com\/?p=150","title":{"rendered":"Tamper WindowsApps in Windows 10\/11"},"content":{"rendered":"\n<p>By default, WindowsApps are stored in <code>C:\\Program Files\\WindowsApps<\/code>, which is one of the most heavily defended folders in Windows. Modifying files inside it is not possible, even under WinRE\/PE.<\/p>\n\n\n\n<p>The only way I\u2019ve found to tamper with it is by using the following script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Add-Type -TypeDefinition @\"\n    using System;\n    using System.Diagnostics;\n    using System.Runtime.InteropServices;\n \n    public static class MyKernel32\n    {\n        &#91;DllImport(\"kernel32.dll\", CharSet=CharSet.Unicode)]\n        public static extern bool MoveFileEx(\n            String lpExistingFileName,\n            String lpNewFileName,\n            uint dwFlags);\n    }\n\"@\n\n&#91;MyKernel32]::MoveFileEx(\"C:\\Temp\\metadata.vhdx\", \"C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForAndroid_2304.40000.10.0_x64__8wekyb3d8bbwe\\metadata.vhdx\", 5)\n&#91;MyKernel32]::MoveFileEx(\"C:\\Temp\\userdata.vhdx\", \"C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForAndroid_2304.40000.10.0_x64__8wekyb3d8bbwe\\userdata.vhdx\", 5)\n&#91;MyKernel32]::MoveFileEx(\"C:\\Temp\\product.vhdx\", \"C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForAndroid_2304.40000.10.0_x64__8wekyb3d8bbwe\\product.vhdx\", 5)\n&#91;MyKernel32]::MoveFileEx(\"C:\\Temp\\system.vhdx\", \"C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForAndroid_2304.40000.10.0_x64__8wekyb3d8bbwe\\system.vhdx\", 5)\n&#91;MyKernel32]::MoveFileEx(\"C:\\Temp\\system_ext.vhdx\", \"C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForAndroid_2304.40000.10.0_x64__8wekyb3d8bbwe\\system_ext.vhdx\", 5)\n&#91;MyKernel32]::MoveFileEx(\"C:\\Temp\\vendor.vhdx\", \"C:\\Program Files\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForAndroid_2304.40000.10.0_x64__8wekyb3d8bbwe\\vendor.vhdx\", 5)<\/code><\/pre>\n\n\n\n<p>Run this script as an administrator. It will replace six files inside the WSA package with six files located under <code>C:\\Temp<\/code><br>Once you reboot, if the files under <code>C:\\Temp<\/code> are gone, it means the operation was successful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, WindowsApps are stored in C:\\Program Files\\WindowsApps, which is one of the most heavily defended folders in Windows. Modifying files inside it is not possible, even under WinRE\/PE. The only way I\u2019ve found to tamper with it is by using the following script: Run this script as an administrator. It will replace six files [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":151,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=150"}],"version-history":[{"count":3,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":154,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/150\/revisions\/154"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/media\/151"}],"wp:attachment":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}