ulikunitz / xz

Pure golang package for reading and writing xz-compressed files
Other
477 stars 45 forks source link

Extract files from NSIS installer? #58

Closed chmaha closed 10 months ago

chmaha commented 10 months ago

Hi,

I wondered if I can use your package to extract files from an NSIS installer .exe? It looks like it uses LZMA compression with an offset of 4 EF BE AD DE N u l l s o f t I n s t according to the command 7z i. Thanks for any help with this.

ulikunitz commented 10 months ago

The xz module contains the lzma package. The package lzma contains a Reader for the lzma steam. You can import the package using github.com/ulikunitz/xz/lzma. The documentation can be found under https://pkg.go.dev/github.com/ulikunitz/xz@v0.5.11/lzma .

But since NSIS is an installer it must have a container format to store multiple files. Supporting this container format it out of scope of the Go module. You would need to parse that container format to extract files from NSIS executables.