Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zipfile signature not read #40

Open
Swaagie opened this issue Oct 22, 2013 · 12 comments
Open

Zipfile signature not read #40

Swaagie opened this issue Oct 22, 2013 · 12 comments

Comments

@Swaagie
Copy link

Swaagie commented Oct 22, 2013

Referencing this issue nodejs/node-v0.x-archive#6384 here as it started out with me trying to use unzip with a github repo release zipfile

Summary: any release zipfile from a github repositiory will not work correctly by just piping the stream to unzip, e.g. as per example. fs.createReadStream('path/to/archive.zip').pipe(unzip.Extract({ path: 'output/path' })); As tjfontaine demonstrated in the response to issue the signature has to be read from the stream first before piping stuff to unzip.

More background on the signature: https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html

@Swaagie
Copy link
Author

Swaagie commented Oct 23, 2013

Actually there is a slight difference this result in an: Error: invalid block type if read through unzip. The signature itself seems to be read correctly.

@ssafejava
Copy link

I just ran into this on a few large zip files I was parsing with node-excel. It appears the signature is being read, however - any ideas on this? I haven't been able to get it to work simply by skipping the signature.

@connor4312
Copy link

Ran into this same issue today with Unzip. Trace:

uncaughtException: invalid stored block lengths date=Fri Feb 07 2014 13:20:50 GMT-0600 (CST), pid=91702, uid=501, gid=20, cwd=<path>, execPath=/opt/local/bin/node, version=v0.10.21, argv=[node, <path>], rss=55934976, heapTotal=31139328, heapUsed=14503144, loadavg=[1.56640625, 1.62646484375, 1.3916015625], uptime=8404034, trace=[column=17, file=zlib.js, function=Zlib._binding.onerror, line=295, method=_binding.onerror, native=false], stack=[Error: invalid stored block lengths,     at Zlib._binding.onerror (zlib.js:295:17)]

@jeffpar
Copy link

jeffpar commented Apr 5, 2014

Anyone learn any more about this issue? I just tried to to use node-unzip on this zip file and it's not a signature problem (parse.js confirmed that the file's signature was 0x04034b50), but it still blows up with "invalid stored block lengths".

@bitmage
Copy link

bitmage commented May 20, 2014

It sounds like the "block lengths" and "block types" errors might be separate issues.

I'm working with a 3.5 MB zip file. When I use the Mac OSX compression tool to create the zip (right click on a folder and click Compress), then run it through node-unzip, I get "invalid stored block lengths". When I compress the same directory using the zip command line utility, then node-unzip extracts it just fine.

Maybe the storage format has some variations that we're not accounting for. I did a hex diff of the two files. I don't know if it's helpful to a keener eye than mine:

hex-diff.png

@detj
Copy link

detj commented Nov 18, 2014

I am getting the same issue with unzip@0.1.9 & unzip@0.1.11

Says

Error: invalid signature: 0x80014

while extracting an .ipa file generated from Xcode 6.1. This was working fine for iOS 7 IPAs but started breaking for iOS 8 IPAs

@jacksonrayhamilton
Copy link

+1 on this; also encountering this issue (Error: invalid signature: 0x80014) when unzipping this book.

@detj
Copy link

detj commented Sep 9, 2015

Anyone has any hints what this error means?

@jdonnerstag
Copy link

The problem is in parse.js. If you uncomment setImmediate in 161 than it works on my machine. And it seems logical. There is no need to wait for I/O events to finish. Actually that additional I/O events are executed is causing the problem.

// setImmediate(function() {
self._pullStream.unpipe();
self._pullStream.prepend(extra);
self._processDataDescriptor(entry);
// });

I'm using the latest version.

@andrewfaria
Copy link

Just had the same issue. Thanks for the fix @jdonnerstag. Unfortunately I do not see a PR for this change. :(

@jkuri
Copy link

jkuri commented Nov 20, 2015

+1

@seppevs
Copy link

seppevs commented Nov 23, 2015

I had the same issue. Switching to node-unzip-2 fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests