smx-smx/wcpex

wcp.dll can not be loaded

Biswa96 opened this issue · 3 comments

In Windows 10 sytem32 folder, there is no wcp.dll file. So, it can not be loaded. And Visual studio shows many error during building process. I find wcp.dll in WinSxS folder which also can't be loaded.

I didn't test it under Visual Studio. I used gcc from mingw (msys2).
As for wcp.dll, it can be found in the following paths:

  • C:\Windows\WinSxS\x86_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.16299.15_none_d02cf1b780117c58
  • C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.16299.15_none_2c4b8d3b386eed8e.

Use the x86 dll if you're building with gcc in 32bit, the amd64 one otherwise.
Once you identified it, copy it to the build folder

Question:

  • Can I use this tool to extract any file from WinSxS folder?
  • Does your tool extract files using Delta compression?
  • If yes, then why not you use msdelta.dll from System32?

In this XDA tread you mentioned to use msdelta API with source files as NULL. Can you explain that with details? I want to make a C# alternative using msdelta.dll.

This tool extracts files in the Manifests folder (.manifest files), that as far as I know are all XML files.
I'm actually not sure about the algorithm.
There are different types of compression that those files can have (for now i hardcoded it to accept type 4 only as I didn't have other files to test).
Moreover, there is some sort of dictionary (or at least I think its a dictionary) that is required to properly extract those files.
Delta files are by definition incremental, so they need supporting data to extract properly.
I used wcp.dll because its meant specifically for handling manifest files. With some effort and understanding, maybe a different or open source implementation can be used.

And finally, the API I'm using are undocumented. Its entirely possible that there are other uses for this dll besides manifest files since there are other compression types (besides 4)