GithubHelp home page GithubHelp logo

Comments (8)

bodgit avatar bodgit commented on September 27, 2024

It should work, in theory. The code currently expects the 7z archive signature either immediately at the beginning of the file, or within the first 1 MiB. I limited it to that to prevent it unnecessarily trawling through the whole file especially if it's was a large archive and this worked fine with the test archives I had available.

I'll check this Nullsoft installer you've linked and see where the signature is hiding.

from sevenzip.

chmaha avatar chmaha commented on September 27, 2024

Many thanks! Here's the initial output from the 7z extraction command if it's useful:

Click to expand Extracting archive: reaper683_x64-install.exe -- Path = reaper683_x64-install.exe Type = PE Physical Size = 15573512 CPU = x86 Characteristics = Executable 32-bit NoRelocs NoLineNums NoLocalSyms Created = 2016-04-02 03:20:09 Headers Size = 1024 Checksum = 15631276 Image Size = 495616 Section Alignment = 4096 File Alignment = 512 Code Size = 24064 Initialized Data Size = 120320 Uninitialized Data Size = 1024 Linker Version = 6.0 OS Version = 4.0 Image Version = 6.0 Subsystem Version = 4.0 Subsystem = Windows GUI DLL Characteristics = TerminalServerAware Stack Reserve = 1048576 Stack Commit = 4096 Heap Reserve = 1048576 Heap Commit = 4096 Image Base = 4194304 ---- Path = [0] Size = 15238320 Packed Size = 15238320 Virtual Size = 15238320 Offset = 325120 -- Path = [0] Type = Nsis Physical Size = 15238313 Tail Size = 7 Method = LZMA:26 Solid = + Headers Size = 141969 Embedded Stub Size = 0 SubType = NSIS-2 BadCmd=11

from sevenzip.

bodgit avatar bodgit commented on September 27, 2024

So this isn't the same format as the self-extracting format created by 7zip itself, the archive signature isn't anywhere in the file so my package won't open this currently.

This Nullsoft installer appears to have its own file format that I would need to parse to get to the right offset in the file where I presume there's some regular 7zip archive data.

from sevenzip.

chmaha avatar chmaha commented on September 27, 2024

Ah, I think I found the answer via the command 7z i. For NSIS it says:
offset=4 EF BE AD DE N u l l s o f t I n s t

Is that useful?

from sevenzip.

bodgit avatar bodgit commented on September 27, 2024

I've found the source here https://salsa.debian.org/debian/p7zip/-/tree/master/CPP/7zip/Archive/Nsis

7z i lists all the formats that are supported by the official tool, this package just supports the first one listed:

Formats:
 0 C   F         7z       7z            7 z BC AF ' 1C

The same as I don't support RAR, or RPM, or VMDK, etc. I think this NSIS format is beyond the scope of this package. The original self-extracting format that I've added support for is just a regular .7z archive with a stripped-down executable prepended to the front of it, whereas this Nullsoft installer is something else entirely.

from sevenzip.

chmaha avatar chmaha commented on September 27, 2024

Thanks. Can I maybe persuade you to support it or at least show me how I could add this unofficially assuming it is a relatively simple case of locating via the offset? At present as part of my ReaClassical installer I'm having to also pull 7zip exe and dll which is something I'm trying to eliminate for obvious reasons...

AFAIK, there's no NSIS extractor library for golang...

from sevenzip.

bodgit avatar bodgit commented on September 27, 2024

Can I maybe persuade you to support it or at least show me how I could add this unofficially assuming it is a relatively simple case of locating via the offset?

It isn't, that's my point. It doesn't appear to be a .7z archive, it's an entirely different format that just happens to be supported by the 7zip tool, (same as it supports a bunch of other archive formats). However it does seem to use some of the same compression algorithms; deflate, bzip2, lzma, etc.

You could use the source I referenced in my last comment to parse the format coupled with the same packages I use for the compression algorithms to write an NSIS extractor.

from sevenzip.

chmaha avatar chmaha commented on September 27, 2024

Thanks for clarifying!

from sevenzip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.