Comments (8)
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.
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.
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.
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.
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.
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.
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.
Thanks for clarifying!
from sevenzip.
Related Issues (20)
- runtime error: index out of range [0] with length 0 HOT 9
- "invalid memory address or nil pointer dereference" when opening 7z file HOT 1
- Errors are not accessible since they are private with a lower case
- Low performance of .7z files with password HOT 2
- panic: runtime error: index out of range HOT 2
- low performance for aes7z HOT 2
- warning: a function definition without a prototype is deprecated in all versions HOT 2
- 解带密码的提示 Failed to open file in archive: lzma: unsupported chunk header byte HOT 1
- How to extract HOT 1
- Return list of volume archive files. HOT 14
- seek over file in archive HOT 2
- Support BCJ method HOT 8
- Support PPC method
- Unable to decrypt 7-ZIP file with password (err: breader.ReadByte: no data!) HOT 1
- Unable to decrypt 7-ZIP file with password (err: breader.ReadByte: no data!) HOT 1
- sevenzip as a guide HOT 3
- Add support for reading self-extracting archives
- Empty File processing issue HOT 4
- Fail to read .exe in .7z HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sevenzip.