Secant1006 / PSFExtractor

Extract CAB+PSF update for Windows
MIT License
76 stars 13 forks source link

Some files may be failed to extract #4

Open Secant1006 opened 1 year ago

Secant1006 commented 1 year ago

There are some updates contain an unknown type of PA30 compression which msdelta.dll doesn't recognize, thus failing to extract. Some examples may be:

I've looked into the exact file, and found out that there was no obvious indicator that the files in question are incompatible with msdelta.dll.

Currently, the workaround is to comment out problematic files with the help of debugger. I'm planning to solve the problem (obviously), as well as to improve error reporting.

dpx.dll might be useful for this situation, however Microsoft doesn't have its documentation public. One of the pratical ways is to reverse engineer dpx.dll with symbol. I'll appreciate it if anyone could provide help.

Edit: in newer version of Windows, there is a substitute for msdelta.dll named UpdateCompression.dll and it works with aformentioned files. Although its compatibility remains to be tested. I'll release an updated version soon. Before the release, you can simply rename UpdateCompression.dll to msdelta.dll and put it together with PSFExtractor and it'll work.

ShinjoKurumi commented 1 year ago

These information might help...

https://github.com/smilingthax/msdelta-pa30-format https://github.com/smx-smx/wcpex https://forum.xda-developers.com/t/decompress-manifests-files-found-in-the-winsxs-folder.3367399/ ~~https://learn.microsoft.com/en-us/previous-versions/bb417345(v=msdn.10)?redirectedfrom=MSDN https://msfn.org/board/topic/171184-microsoft-ipd-intra-package-delta-compression-tool/~~

abbodi1406 commented 1 year ago

We thought it was a glitch https://github.com/hfiref0x/SXSEXP/issues/6

nice find about UpdateCompression.dll

ShinjoKurumi commented 1 year ago

I tested to run the application on Windows 7 Build 7601.26662 with UpdateCompression.dll from Build 25931.

At the "writing files" progress, an error message popped-up and told me api-ms-win-security-cryptoapi-l1-1-0.dll is missing.

Windows 7 x64 Test-2023-08-25-23-32-06

Update: Same error message appears on Windows Server 2012 Build 9200.24412, but you can copy api-ms-win-security-cryptoapi-l1-1-0.dll from Windows 8.1, put them together, and it will works.

srv2012-2023-08-25-23-44-53

stdin82 commented 1 year ago

@ShinjoKurumi You must install UCRT (KB2999226 or KB3118401)

ShinjoKurumi commented 1 year ago

@ShinjoKurumi You must install UCRT (KB2999226 or KB3118401)

I checked this page on Microsoft Support Website, and I don't think these patches contain the file we need.

Secant1006 commented 1 year ago

I tested to run the application on Windows 7 Build 7601.26662 with UpdateCompression.dll from Build 25931.

At the "writing files" progress, an error message popped-up and told me api-ms-win-security-cryptoapi-l1-1-0.dll is missing.

Update: Same error message appears on Windows Server 2012 Build 9200.24412, but you can copy api-ms-win-security-cryptoapi-l1-1-0.dll from Windows 8.1, put them together, and it will works.

I'm planning to still load msdelta.dll for older versions of Windows (before Windows 10). I want to avoid checking system version as those APIs are really a mess, however it seems not possible since UpdateCompression.dll could be loaded regardless of the OSVersion=10.0 in its PE header.

stdin82 commented 1 year ago

however it seems not possible since UpdateCompression.dll could be loaded regardless of the OSVersion=10.0 in its PE header.

PE Subsystem Version is 6.1

Wuyouzi067 commented 1 year ago

How to Extract Windows11.0-KB5032106-arm64.psf ? I do that

code: %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename!

Extract Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. Extract Windows11.0-KB5032106-x64.psf ---> Finished.

Thanks. [

Extract Windows11 0-KB5032106-arm64 psf Error

](url)

Secant1006 commented 1 year ago

How to Extract Windows11.0-KB5032106-arm64.psf ? I do that

code: %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename!

Extract Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. Extract Windows11.0-KB5032106-x64.psf ---> Finished.

As I've already said

simply rename UpdateCompression.dll to msdelta.dll and put it together with PSFExtractor and it'll work.

I'd suggest to get a copy of UpdateCompression.dll from build 25398.

Wuyouzi067 commented 1 year ago

How to Extract Windows11.0-KB5032106-arm64.psf ? I do that code: %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename! Extract Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. Extract Windows11.0-KB5032106-x64.psf ---> Finished.

As I've already said

simply rename UpdateCompression.dll to msdelta.dll and put it together with PSFExtractor and it'll work.

I'd suggest to get a copy of UpdateCompression.dll from build 25398.

code:

%a7z% x %%i -y -o%TU% >nul

%a7z% e %TU%!filename!.wim "express.psf.cix.xml" -y -o%TU% >nul %a7z% e %TU%\DesktopDeployment.cab "updatecompression.dll" -o%TU% -y -aos -r >nul ren %TU%\updatecompression.dll msdelta.dll copy /y files\PSFExtractor-x64.exe %TU% >nul 2>nul

echo. echo Extract !filename!.psf echo. %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename! %a7z% e %TU%!filename!.wim -y -o"%TU%!filename!" >nul

Extract Windows11.0-KB5032106-x64.psf ---> is OK But Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. PSFExtractor-v3.07\x64\PSFExtractor.exe rename PSFExtractor-x64.exe

Wuyouzi067 commented 1 year ago

How to Extract Windows11.0-KB5032106-arm64.psf ? I do that code: %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename! Extract Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. Extract Windows11.0-KB5032106-x64.psf ---> Finished.

As I've already said

simply rename UpdateCompression.dll to msdelta.dll and put it together with PSFExtractor and it'll work.

I'd suggest to get a copy of UpdateCompression.dll from build 25398.

code:

%a7z% x %%i -y -o%TU% >nul %a7z% e %TU%!filename!.wim "express.psf.cix.xml" -y -o%TU% >nul %a7z% e %TU%\DesktopDeployment.cab "updatecompression.dll" -o%TU% -y -aos -r >nul ren %TU%\updatecompression.dll msdelta.dll copy /y files\PSFExtractor-x64.exe %TU% >nul 2>nul echo. echo Extract !filename!.psf echo. %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename! %a7z% e %TU%!filename!.wim -y -o"%TU%!filename!" >nul

Extract Windows11.0-KB5032106-x64.psf ---> is OK But Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. PSFExtractor-v3.07\x64\PSFExtractor.exe rename PSFExtractor-x64.exe

Sorry! From 25398.469 copy of UpdateCompression.dll , Extract 25967.1010 Windows11.0-KB5032106-arm64.psf ---> is OK Thank you! But why 25967.1010 original UpdateCompression.dll is not OK?

Wuyouzi067 commented 1 year ago

How to Extract Windows11.0-KB5032106-arm64.psf ? I do that code: %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename! Extract Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. Extract Windows11.0-KB5032106-x64.psf ---> Finished.

As I've already said

simply rename UpdateCompression.dll to msdelta.dll and put it together with PSFExtractor and it'll work.

I'd suggest to get a copy of UpdateCompression.dll from build 25398.

code:

%a7z% x %%i -y -o%TU% >nul %a7z% e %TU%!filename!.wim "express.psf.cix.xml" -y -o%TU% >nul %a7z% e %TU%\DesktopDeployment.cab "updatecompression.dll" -o%TU% -y -aos -r >nul ren %TU%\updatecompression.dll msdelta.dll copy /y files\PSFExtractor-x64.exe %TU% >nul 2>nul echo. echo Extract !filename!.psf echo. %TU%\PSFExtractor-x64.exe -v2 %TU%!filename!.psf %TU%\express.psf.cix.xml %TU%!filename! %a7z% e %TU%!filename!.wim -y -o"%TU%!filename!" >nul

Extract Windows11.0-KB5032106-x64.psf ---> is OK But Windows11.0-KB5032106-arm64.psf ---> Error: Error writing output files. PSFExtractor-v3.07\x64\PSFExtractor.exe rename PSFExtractor-x64.exe

Sorry! From 25398.469 copy of UpdateCompression.dll , Extract 25967.1010 Windows11.0-KB5032106-arm64.psf ---> is OK Thank you! But why 25967.1010 original UpdateCompression.dll is not OK?

I test from 25967.1010 amd64 copy of UpdateCompression.dll , Extract 25967.1010 Windows11.0-KB5032106-arm64.psf ---> is OK 25398.469 also amd64 So PSFExtractor-v3.07\x64\PSFExtractor.exe should amd64 UpdateCompression.dll , arm64 UpdateCompression.dll is not OK for extract Windows11.0-KB50*-arm64.psf ?

Secant1006 commented 1 year ago

So PSFExtractor-v3.07\x64\PSFExtractor.exe should amd64 UpdateCompression.dll , arm64 UpdateCompression.dll is not OK for extract Windows11.0-KB50*-arm64.psf ?

DLLs are loaded by the main application, and they usually share matching architecture. In this case, an AMD64 application cannot load ARM64 library, even in XTAJIT emulation mode.

MagicAndre1981 commented 5 months ago

How do I extract the files of Update windows11.0-kb5039239-arm64_5b4c3f8c93a28b4f1c16b303585a0f4ce03d1b84.msu? The MSU includes a PSF and WIM (Windows11.0-KB5039239-arm64.psf, Windows11.0-KB5039239-arm64.wim).

easyentry commented 1 month ago

Also there is a new Issue: New WIM/PSF format used for example in: UUP Windows 11 Insider Preview 10.0.22635.4371 (ni_release) amd64/arm64 ...your tool isn't able to extract it so far (it needs CAB/PSF),