After trying some very risky things, such as manually overwriting %windir% with the content of the %windir% from install.wim, I figured out that the problem was in the corrupt registry hives despite the BSOD error being 0x7B (0x0000007B), which usually means a hardware problem.
Windows makes a separate backup of the system registry hives and stores it right next to the live one. I was lucky it had been restored with shadow copies so I did the following:
- Booted into standard Recovery Environment (F8 -> Repair system)
- Opened the command prompt
- Navigated to %Windir%\System32\Config
- Ran the command to delete all files: del /P /F *
It will prompt to delete every one of them (SAM, SECURITY, SOFTWARE, SYSTEM) - make sure it's just 4. 5. Ran the command to delete the hidden parts: del /P /F /A:H *
There might be a dozen of these. 6. Copied the backup registry: xcopy RegBack c:\Windows\System32\config /E /I /Q /H /R /K /X /Y 7. Rebooted
However, my system is still not restored. I can't install any updates and reinstallation (aka in-place upgrade) still crashes. I'm trying to fix that now.