Jump to content











Photo
- - - - -

Adding WoW64 to WinPE 10 for 32-bit app support - V2


  • Please log in to reply
41 replies to this topic

#1 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 25 July 2016 - 08:25 PM

Made this thread to simplify things as the original has gotten a bit confusing. This essentially enables you to transfer WoW64 from a Win10PESE image to a scratch WinRE/WinPE image.

 

Again, full credit to everyone at The Oven, I just went back through their 5-WOW64.script file.

 

Tested working as of 10.0.586.0, should work for later versions unless Win10PESE changes. Let me know if you have any problems and I will try to help!

 

 

 

Prerequisites

 

1) Untouched WinRE.wim/WinPE.wim (add your own desired modifications after)

 

2) 64-bit Win10PE SE image (by The Oven, google it)

 

Quickest way is to download a fresh Windows 10 ISO from Techbench, extract WinRE.wim from it, and use the ISO to build your Win10PE SE image. The image from which WoW64 originates must be the same version as the target image!

 

 

 

 

The steps

 

1) Delete \Windows\WinSxS from your own image. You will probably need to use an app such as Unlocker. Note that this will take a while.

 

2) Copy in file dependencies from the Win10PE SE image to your own image.

  • The entirety of \Windows\WinSxS
  • The entirety of \Windows\System32\Catroot (merge with existing image)
  • The entirety of \Windows\SysWOW64
    • ​Alternatively, copy the files listed under 'CopySysWoW' and 'DirCopy' sections in the 5-WoW64.script. This may be a 'cleaner' way of doing it but I haven't done this myself.
  • \Windows\System32\wow64.dll
  • \Windows\System32\wow64cpu.dll
  • \Windows\System32\wow64win.dll
  • \Windows\System32\loadWOW64.exe

 

3) Export registry dependencies from the Win10PE SE image and merge with your own image

  • HKLM\system\currentcontrolset001\control\session manager\BootExecute\
  • HKLM\software\microsoft\windows\currentversion\sidebyside\
  • HKLM\software\wow6432node\
  • HKLM\software\classes\wow6432node\
  • HKLM\software\Microsoft\Windows\CurrentVersion\SMI\WinSxS Settings\

 

4) Perform your other modifications. Add all the things that you want to be in your image, etc.

 

Done! If you want to trim the size down, there are elements in the Win10 PE SE project that you can remove (eg AutoIT scripting app if you don't use it, control panel elements, etc etc)

 

 

 

FAQ

 

Error 0xc0000034 when trying to start 32-bit apps

  • Check that the key at BootExecute has been added properly (this is necessary to launch loadWOW64.exe at startup)

 

"Side-by-side configuration incorrect" errors when trying to start 32-bit apps

  • Check that you have added everything at HKLM\software\microsoft\windows\currentversion\sidebyside\

 

"PROCESS1_INITIALISATION_FAILED" upon startup

  • Check that the SysWOW64 files and System32 files in your image are the same version (right click > properties on shell32.dll for example). Eg if you tried to add SysWOW64 from 10.0.240.0 to a 10.0.586.0 target, you would get a BSOD like this.

 

Issues with file > save, file > open, various other GUI elements in 32-bit apps that do not affect 64-bit versions of said apps

  • Check that you have added everything at HKLM\software\classes\wow6432node\CLSID

 

Issues adding packages with DISM relating to corrupted component store

  • Can occur if you deleted the side-by-side regkeys before adding those from the 10 PE SE image. Don't do this!
  • Can probably also occur in other scenarios. As you can imagine, deleting and rebuilding WinSxS is a rough way of doing it, but I haven't had any problems with transferring their WoW64 implementation to my own image this way yet.

 

Issues with already added packages after adding WoW64

  • Probably due to deleting WinSxS during this guide, hence my recommendation to perform this on a scratch image, then add other modifications after.

Edited by spleenharvester, 25 July 2016 - 09:22 PM.

  • netlord likes this

#2 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 25 July 2016 - 10:24 PM

 

  • HKLM\system\currentcontrolset001\control\session manager\BootExecute\

 

Should read 'controlset001', sorry. Don't add currentcontrolset or you'll have a bad time. PS does anyone know how I can edit posts on these forums? Seems there's a time limit, which makes corrections like these difficult?



#3 netlord

netlord

    Member

  • Members
  • 31 posts
  •  
    Germany

Posted 26 July 2016 - 01:29 PM

Hi spleenharvester

 

thank you for your work, but  I´m still confused.

Maybe you can give me an hint.

 

 

 

Prerequisites

 

1) Untouched WinRE.wim/WinPE.wim (add your own desired modifications after)

 

2) 64-bit Win10PE SE image (by The Oven, google it)

 

Quickest way is to download a fresh Windows 10 ISO from Techbench, extract WinRE.wim from it, and use the ISO to build your Win10PE SE image. The image from which WoW64 originates must be the same version as the target image!

 

 

First of all - i´m still working with the 10240 (until the Linux-Subsystem will be available under PE (i´m still hoping ;)))

 

What do you mean by "untouched WinRE.wim/winpe.wim"?

 

  1. My starting point is the boot.wim created via "copype amd63 c:\123" from the installed ADK. Do I have this right????
     
  2. Inside the Windows_10240.ISO is the install.wim - and inside the install.wim an winre.wim. Is this the correct source?

But in this image I cant find the 

  • \Windows\System32\wow64.dll
  • \Windows\System32\wow64cpu.dll
  • \Windows\System32\wow64win.dll
  • \Windows\System32\loadWOW64.exe

 

Thanks

netlord


Edited by netlord, 26 July 2016 - 01:30 PM.


#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13752 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2016 - 05:24 PM

 

  1. My starting point is the boot.wim created via "copype amd63 c:\123" from the installed ADK. Do I have this right????

Yes and no, you have got right only 50% :w00t:.

There are two PE images involved, one is the "target" (for which your ADK based PE is ok) and one is the "source" a Win 10 PE image built with the Winbuilder Win10PESE project, hence:

 

 

 

2) Copy in file dependencies from the Win10PE SE image to your own image.

  • The entirety of \Windows\WinSxS
  • The entirety of \Windows\System32\Catroot (merge with existing image)
  • The entirety of \Windows\SysWOW64
    • ​Alternatively, copy the files listed under 'CopySysWoW' and 'DirCopy' sections in the 5-WoW64.script. This may be a 'cleaner' way of doing it but I haven't done this myself.
  • \Windows\System32\wow64.dll
  • \Windows\System32\wow64cpu.dll
  • \Windows\System32\wow64win.dll
  • \Windows\System32\loadWOW64.exe

 

3) Export registry dependencies from the Win10PE SE image and merge with your own image

  • HKLM\system\currentcontrolset001\control\session manager\BootExecute\
  • HKLM\software\microsoft\windows\currentversion\sidebyside\
  • HKLM\software\wow6432node\
  • HKLM\software\classes\wow6432node\
  • HKLM\software\Microsoft\Windows\CurrentVersion\SMI\WinSxS Settings\

 

:duff:

Wonko



#5 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 26 July 2016 - 07:05 PM

As Wonko said - you need to be looking in the 10 PE SE image, not the Windows ISO. The ISO is just for making the 10 PE SE image with.  :thumbsup:

 

I notice that winpe.wim is now boot.wim in the ADK as of WinPE 10, which is probably where some of the confusion has come from. Also, it doesn't matter if you use WinPE or WinRE (I just use the latter since it already has some packages I need installed)

 

Cheers


Edited by spleenharvester, 26 July 2016 - 07:05 PM.


#6 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 27 July 2016 - 09:37 AM

Thanks spleenharvester, this is looking good!

You've made a very clear and basic HowTo, very easy to follow, all files are easy to "trace", and there are hardly any files of "unknown" or untrusted origin (except, maybe, for the actual LoadWow64.exe).

 

Unfortunately, I'm not having much luck with importing the PESE reg files into the basic PE reg hives, I'm getting some kind of access error, I've tried everything I can think of (around 10 tests), but I'm going to let it rest for now, maybe I need some fresh air (or sleep) to get some more good ideas. Has anybody else successfully done the export/ import combo? (Not talking about Art Vandelay).

 

From item (3) from your list (registry import) I made 5 separate reg files, when I try to import them to the PE hive, 2 of them don't work, the error I get is: "Not all data was successfully written to the Registry. Some keys are open by the system or other processes, or you have insufficient privileges to perform this operation". Any ideas?


  • spleenharvester likes this

#7 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 27 July 2016 - 11:38 AM

Well, I'm still trying: I've decided to test the boot.wim anyway, maybe the failed key was non-critical. The wim does boot, and all files seem to be in place, but unfortunately no WOW64...

 

So close.. (?) Any help, or things to try, welcomed!



#8 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 27 July 2016 - 12:42 PM

More testing: Like I said, the 3rd reg file from the HowTo, would not import into the standard PE.

So I decided to split it into chunks, and see which part would load and which parts wouldn't. Through trial and error, here are a few that don't load (if I leave them out, the files loads):

microsoft\windows\currentversion\authentication\credential providers\

m\w\c\Cloudexperiencehost

m\w\c\Bootmgr

m\WindowsRuntime\ActivatableClassID\Windows.Internal.ui.login.controller.firstsigninanimation (and more)

m\WindowsRuntime\CLSID\{03f628bf...\ UiLoginController

 

Is there any pattern in this? Is there a reason why these would cause errors? Are they critical for Wow64?



#9 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 27 July 2016 - 01:54 PM

Well, I'm still trying: I've decided to test the boot.wim anyway, maybe the failed key was non-critical. The wim does boot, and all files seem to be in place, but unfortunately no WOW64...

 

So close.. (?) Any help, or things to try, welcomed!

 

 

More testing: Like I said, the 3rd reg file from the HowTo, would not import into the standard PE.

So I decided to split it into chunks, and see which part would load and which parts wouldn't. Through trial and error, here are a few that don't load (if I leave them out, the files loads):

microsoft\windows\currentversion\authentication\credential providers\

m\w\c\Cloudexperiencehost

m\w\c\Bootmgr

m\WindowsRuntime\ActivatableClassID\Windows.Internal.ui.login.controller.firstsigninanimation (and more)

m\WindowsRuntime\CLSID\{03f628bf...\ UiLoginController

 

Is there any pattern in this? Is there a reason why these would cause errors? Are they critical for Wow64?

 

Those keys should not be critical (I was wondering if it would be something like that) - what error are you getting? Is there just a 'no subsystem present' error? If so, check that the three DLLs are in system32 (that's the only thing I can think of which would cause that!)

 

Cheers



#10 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 27 July 2016 - 02:03 PM

I will continue testing tomorrow, until then if anyone knows *why* this is happerning, I'd be interested to know. There's still reg file "4" to check as well, I really don't want to spend more hours finding out which ones work and which ones don't...

If I have to check the reg entries one by one, there's really not much fun (or use) in all this.



#11 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 27 July 2016 - 02:11 PM

I will continue testing tomorrow, until then if anyone knows *why* this is happerning, I'd be interested to know. There's still reg file "4" to check as well, I really don't want to spend more hours finding out which ones work and which ones don't...

If I have to check the reg entries one by one, there's really not much fun (or use) in all this.

 

Surely you can flag up which ones won't merge easily via a FOR loop in batch? I wouldn't have thought the keys you specified would stop WoW64 working at all if not added, to my knowledge they are just important for GUI elements and such. As per my previous post it does depend on the error you are getting when trying to run a 32-bit app.



#12 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 27 July 2016 - 02:43 PM

I will continue testing tomorrow, until then if anyone knows *why* this is happerning, I'd be interested to know. There's still reg file "4" to check as well, I really don't want to spend more hours finding out which ones work and which ones don't...

If I have to check the reg entries one by one, there's really not much fun (or use) in all this.

 

 

Further testing - I followed this guide again from a scratch image from start to finish. I get the same errors as you do on those keys (my script uses regedit /s which is probably why I hadn't seen them before!), BUT the WoW64 implementation outlined in this guide works fine for me on that image. Let me know what error you get and I will try to help.

 

One thing I did note from accidentally adding regkeys from an older 10PESE image is that subbuilds *do* matter here. If your WoW64 DLLs are a different version from the regkeys you will get a Side-By-Side configuration error (eg 10.0.586.0 vs 10.0.586.71 on a DLL, even though both sources appear to be '10.0.586.0' at quick glance).

 

Might be worth checking your sources/retracing your steps - possibly use WinRE.wim from the same Windows ISO used to create Win10PESE as a codebase?

 

~~Also found a much quicker means of removing the WinSxS folder already in place - Unlocker move to another drive, then format said drive, lol. Only took about 4 minutes to add WoW64 from there.


Edited by spleenharvester, 27 July 2016 - 03:06 PM.


#13 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 27 July 2016 - 06:39 PM

Oh btw, if XYPlorer gives you an OLE error on startup, do a regsvr32 in syswow64\oleaut32.dll. I'm fairly sure this was just an issue with my image though.



#14 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 27 July 2016 - 08:03 PM

Thanks SH, I will continue tomorrow.

About removing the sxs folder: Have you tried Wimlib? I use it in my own PE stuff as well, very convenient and fast for adding and removing stuff to and from wim files. For example:

wimlib-imagex update boot.wim 1 --command="delete \Windows\WinSxS --recursive"

See you tomorrow, thanks again for this project and your answers.



#15 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 28 July 2016 - 05:42 AM

Got it working with winre.wim!

I'll try standard (smaller) winpe.wim next and edit this message with more test results.

 

Tried some of my standard (ancient) PE tools: ACDSee, Filesync, Faststone viewer, OfficeLite (Word and Excel, 18mb for both!), PaintShopPro, TrueCrypt, Semware Editor, UltraISO. Can't get XYPlorer working yet...

Semware Editor and XYPlorer are the main reasons for 32bit support for me, so 50% achieved already! Thanks again... (also to ChrisR and JFX of course).

 

Edit1: No luck with winpe.wim as base...

Have you tried wimlib yet? Here's another example: add new files to wim:

wimlib-imagex update bootwork.wim 1 <"wim-update.txt"

wim-update.txt:

delete 'windows\system32\config' --force --recursive
add 'folderwithnewfiles-including-reg' ''

(notice the 4 single quotes in wim-update.txt)

 


Edited by Atari800XL, 28 July 2016 - 06:02 AM.


#16 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 28 July 2016 - 07:34 AM

Tried the code below to automate things (used a normal quote, didn't like the code box). For testing purposes only (I only tested it one line at a time), just to show Spleen how I used 7zip and Wimlib. I might add it to my Autohotkey-gui-driven pe builder thingy later.

Works for winre.wim, but I didn't have any luck with winpe.wim yet. Maybe you'd like to give pe.wim a go? Direct link:

http://download.micr...f1416062098.cab

(extract with 7zip, rename large file inside to winpe.wim

 

XYPlorer update: it didn't run at first, but after running some other stuff, it suddenly worked! So there's hope...

 

7z x pese.wim -oreg-pese windows\system32\config

reg load hklm\sys reg-pese\windows\system32\config\system
reg load hklm\soft reg-pese\windows\system32\config\software

reg export "hklm\sys\ControlSet001\Control\Session Manager" reg-pese-los\01sys-bootexecute.reg

reg export "hklm\soft\Microsoft\Windows\CurrentVersion\SideBySide" reg-pese-los\02sidebyside.reg
reg export "hklm\soft\WOW6432Node" reg-pese-los\03wow6432node.reg
reg export "hklm\soft\Classes\WOW6432Node" reg-pese-los\04classeswow6432node.reg
reg export "hklm\soft\Microsoft\Windows\CurrentVersion\SMI\WinSxS Settings" reg-pese-los\05smi.reg

reg unload hklm\sys
reg unload hklm\soft

wimlib-imagex.exe update bootwork.wim 1 --command="delete \Windows\WinSxS --recursive"

7z.exe x bootwork.wim -oreg-winre windows\system32\config

reg load hklm\sys reg-winre\windows\system32\config\system
reg load hklm\soft reg-winre\windows\system32\config\software

reg import reg-pese-los\01sys-bootexecute.reg
reg import reg-pese-los\02sidebyside.reg
reg import reg-pese-los\03wow6432node.reg
reg import reg-pese-los\04classeswow6432node.reg
reg import reg-pese-los\05smi.reg

reg unload hklm\soft
reg unload hklm\sys

7z.exe x pese.wim -ofiles-pese Windows\WinSxS
7z.exe x pese.wim -ofiles-pese Windows\System32\Catroot
7z.exe x pese.wim -ofiles-pese Windows\SysWOW64
7z.exe x pese.wim -ofiles-pese Windows\System32\wow64.dll
7z.exe x pese.wim -ofiles-pese Windows\System32\wow64cpu.dll
7z.exe x pese.wim -ofiles-pese Windows\System32\wow64win.dll
7z.exe x pese.wim -ofiles-pese Windows\System32\loadWOW64.exe

echo delete 'windows\system32\config' --force --recursive > wim-update.txt
echo add 'reg-winre' '' >> wim-update.txt
echo add 'files-pese' '' >> wim-update.txt

wimlib-imagex.exe update bootwork.wim 1 <"wim-update.txt"
wimlib-imagex.exe export --boot bootwork.wim 1 boot.wim

 

 



#17 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 28 July 2016 - 02:56 PM

Glad you've had some luck! Odd that WinPE.wim doesn't work - AFAIK the only differences between them are the presence of OCs WinPE-Rejuv, WinPE-WMI and a few others. Once I'm back from gym I'll see if I can get it working on WinPE.wim on my end.

 

(Oh and ty for the wimlib tips and introducing me to XYplorer - had no idea they existed!)



#18 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 28 July 2016 - 06:46 PM

WinPE.wim from the download + WoW64 is working fine for me - didn't have to inject packages or anything, just used the same procedure that I did with WinRE.wim.


Edited by spleenharvester, 28 July 2016 - 06:50 PM.


#19 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 28 July 2016 - 07:05 PM

Thanks for testing. So it should work... I must be missing something (again...), I just tested with the batch but I got a blue screen after booting ("critical process died").

Winpe instead of Winre would be nice, because it's a bit more compact (and loads faster).



#20 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 28 July 2016 - 07:09 PM

Thanks for testing. So it should work... I must be missing something (again...), I just tested with the batch but I got a blue screen after booting ("critical process died").

Winpe instead of Winre would be nice, because it's a bit more compact (and loads faster).

 

You are probably facing a version mismatch between Windows\syswow64 and Windows\system32 on your compiled image. Right click > Properties on Windows\syswow64\shell32.dll and Windows\system32\shell32.dll and go to details on each, which versions are they? (On mine, system32 is 10.0.586.0 and syswow64 is 10.0.586.122, but that doesn't seem to hurt anything)

 

On a side note - I use WinRE.wim because a lot of stuff works on it that doesn't work in WinPE.wim. I've no doubt the dependencies could be tracked down quickly, but retesting the ~60 apps or so we regularly use would be a pain to do.  ;)

 

~EDIT: I also note that WinPE.wim in the ADK has not been updated since the TH2 release, whereas WinRE.wim updates are pretty constant.


Edited by spleenharvester, 28 July 2016 - 07:22 PM.


#21 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 28 July 2016 - 07:23 PM

Thanks. No, both were the same version (had to be, because I use all 10586 sources: winpese was built with nov-16 source, winre is from nov-16, winpe is nov-16. Hmmm...

 

I will stick with winre as source for now, but knowing winpe is working for you will probably keep me testing...



#22 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 28 July 2016 - 07:29 PM

Thanks. No, both were the same version (had to be, because I use all 10586 sources: winpese was built with nov-16 source, winre is from nov-16, winpe is nov-16. Hmmm...

 

I will stick with winre as source for now, but knowing winpe is working for you will probably keep me testing...

 

Very odd - I will download the nov-16 source and try to replicate the issue.



#23 Atari800XL

Atari800XL

    Member

  • Members
  • 77 posts
  •  
    Netherlands

Posted 28 July 2016 - 07:31 PM

Sorry, that's 1511, november 15 of course...



#24 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 28 July 2016 - 07:51 PM

It has just occurred to me - when you add \windows\syswow64, are you removing the folder already there if present, before adding the syswow64 from win10pese? (on the latest winre.wim it isn't present at stock, but earlier versions of winre.wim/winpe.wim have the folder present with a small number of dlls, it just occurred to me). Probably not the cause but it's the only thing I can think of atm.


Edited by spleenharvester, 28 July 2016 - 07:51 PM.


#25 spleenharvester

spleenharvester

    Member

  • Members
  • 92 posts
  •  
    United Kingdom

Posted 28 July 2016 - 08:01 PM

WinPE you provided + TH2 release dependencies gives a working WoW64 for me still. I'd try and rebuild your image again if you hadn't already. Cheers


Edited by spleenharvester, 28 July 2016 - 08:01 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users