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
archive_viewer not able to find CArchive #2372
Comments
This only effects the use of archive_viewer, since Beside doubling the size to be read another possibility would be to simply read another 4096 bytes each time. On the other hand, this size does not really matter. So we could simple read 8K, 10K or 16K and add another block of this size. But then again, there is no need to keep all this data in memory, so something like this should work, too:
|
Below is some minimally tested code for this issue. One thing to consider is how far back in the archive should one try to find the cookie? The further one goes, the more chance of a false positive - but likely other things like the unpack of the TOC will fail. Below is diff from the current version of readers.py that I downloaded 3 hours ago. If this code looks OK, I can upload the new file.
|
Please submit a pull-request instead of posting patches. I'm not going to copy-and-paste raw patches out of an issue. This is not how github works and makes a lot of work. Please also have a look at the Development Guide and mind adding a test-case for this. Thanks. |
This affects the use of archive_viewer.py
In the 3.2 release of pyinstaller in archive/readers.py at lines 147 and 149 there is a constant of 4096 hardcoded for the range of searching for the "MAGIC" value back from the end of the archive. In my case, I had a certificate of length 7248 bytes appended to the archive and it never found the "MAGIC" value location. Perhaps a better way is to start with 4096 and if MAGIC is not found, keep doubling the "EndBlockLength" and search again until the "EndBlockLength" is greater than the file length (or some algorithm like that).
The text was updated successfully, but these errors were encountered: