2

TLDR
I have a corrupt WIM archive that I'm trying to extract. I have tried using DISM, but it won't let me mount it because it doesn't recognize it as a WIM file. I have also tried editing it with a hex editor, but I don't know what I can change.

Problem
I used 7-zip on Windows 10 to create a WIM file containing a bunch of folders in my home directory, and then moved it to an external hard drive over a network. When I tried to extract it later with 7-zip, It would only open it as a zip file with the following contents:

  • _rels
    • .rels.xml
  • docProps
    • app.xml
    • core.xml
  • word
    • _rels
      • document.xml.rels
    • theme
      • theme1.xml
    • document.xml
    • fontTable.xml
    • settings.xml
    • styles.xml
    • webSettings.xml
  • [Content_types].xml

What I have tried so far
This is the result of using 7-zip's test archive function:

D:\WIMFile.wim
Warnings:
There are some data after the end of the payload data
Warning
Can not open the file as [wim] archive
The file is open as [zip] archive

I did some googling and came across this which says you can use DISM to repair a WIM file. Unfortunately, unless I'm missing something, it requires you to mount the file in order to fix it. I tried to mount it with "dism /Apply-Image /ImageFile:D:\WIMFile.wim /Index:1 /ApplyDir:D:\mountPoint" in the windows command line and got this error:

Error: 11

An attempt was made to load a program with an incorrect format.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log

looking at the log file shows this:

Warning DISM DISM WIM Provider: PID=6912 [ReadWimHeader:(1723) -> version/header mismatch] D:\WIMFile.wim (HRESULT=0x8007000B) - CWimManager::WimProviderMsgLogCallback [6912] [0xc144012e]

Error DISM DISM WIM Provider: PID=6912 [WIMCreateFile:(425) > -> Fail to read WIM header] D:\WIMFile.wim (HRESULT=0x8007000B) - CWimManager::WimProviderMsgLogCallback

I did some more googling and found here that with 7z archives you can manually edit the archive with a hex editor and replace the corrupt parts. I made some other WIM files just for comparison and was able to open them in FAR Manger. The corrupt file is 43 GB though which is apparently to big because it tells me this:

Cannot open the file
D:\WIMFile.wim
Not enough storage is available to process this command

So, I went back to google and couldn't find anything related to FAR Manager, but I found support.microsoft.com/en-us/kb/106167(sorry, I used up my link quota) and figured I would give it a shot. I had to create the registry entry and put the value to the max of 12, but it didn't make a difference.

Next, In an effort to get more space, I thought I could switch to my almost empty 500 GB hard drive with Kubuntu 14.04 on it. I had to switch to a hex editor called Bless because FAR Manager is windows only, but I was able to open the corrupt file. The only obviously similar aspect between the test WIM files I made was the text "MSWIM" at the very beginning of each file. The corrupt file was missing this, so I added it, but it didn't make a difference. I'm not sure what else I can change without messing up the file further.

Question
So, what what else can I change with the hex editor so that I can extract this file? Did I miss something with DISM that allows you to fix a file without mounting it? I am open to any other solutions as well.

Edit
I forgot to mention I also tried 7-zip's parse mode. It gave me a bunch of archives, some of which I could open and they had some of my files in them. There was still one large file that was about 90% of the original WIM file and that still refused to open.

  • Possibly a helpful starting point: WIM file format whitepaper – Ben N Aug 12 '16 at 1:53
  • @BenN I took a look and it appears to be in Assembly. The problem is, I can't view it as Assembly. When I used FAR Manager to open my test WIM files, it showed them in Assembly, but I can't view the corrupt file in FAR Manager as stated above. – Ryan Steinmetz Aug 12 '16 at 16:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.