-
Notifications
You must be signed in to change notification settings - Fork 250
Finalized Python Package #57
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create subrepo peepdf which contains all src code. This in order to create a full module peepdf with setuptools in setup.py
…the new stats after resolving objects
…s not detected as JS BUT is referenced from a /JS element. Modified the PDFFile.decrypt function to update the global stats before decrypting the objects.
…which JS code/URI
…put per version, so we don't lose that information
…s_analyse, js_eval, js_unescape, etc
…nging the stream object when we call setReferencedJSObject (it was giving bad results with encryption)
…hanks to KurtPfeifle for the feedback ;)
…e from the command line (really basic implementation)
Allow some badchars in the JS code
Due to two characteristics of PDF streams the new isJavascript() variant became extremely slow. First of all, we want to allow Javascript with *some* bad characters. E.g., a trademark or unicode apostrophe would already mark a Javascript stream as not being Javascript - this was identified and fixed by Fernando Dominguez for the 0.3.5 release. Secondly, due to the nature of the above, some streams were incorrectly let through. This was caused by "\x00" not being counted as an incorrect character and therefore the 10-20% quota not being met. Combined these two issues let to a major performance issue, as whole streams were being processed and included in the output. This commit fixes those performance issues and replaces the Python character counting by a regex query that's slightly faster.
Fixes a serious performance bottleneck. More information may be found at the following commits by Brad Spengler [1][2][3]. [1]: spender-sandbox/cuckoo-modified@1d3bdee [2]: spender-sandbox/cuckoo-modified@d1a44d8 [3]: spender-sandbox/cuckoo-modified@7e2f521
|
Amazing, thanks for maintaining the library on Pypi ! 🎩 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @jesparza, @Titotix,
This PR includes both PRs from @Titotix and some more love in order to make
peepdfa true Python package, with its core library accessible throughimport peepdfand thepeepdf.pycommand exposed as the global (or local in case ofvirtualenv)peepdfcommand.In addition to that this PR modifies a few minor things:
0.3.1). This will have to be increased for every release you do.pip install -U peepdf.$GIT/errors.txtto~/.peepdf-error.txt.I think that's most of it. Now I'd be very happy if you could merge this PR and upload it to PyPI (
python setup.py register&&python setup.py sdist upload). I'm also happy to do that for you, but as you're the developer of this library I think it would make most sense if you handle this yourself.Let me know if there are any questions.
Regards,
Jurriaan