anselmorenato / peepdf

Automatically exported from code.google.com/p/peepdf
GNU General Public License v3.0
2 stars 0 forks source link

JSAnalysis.py always requires PyV8 #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Don't install PyV8
2. try to run peepdf.py on any pdf w/ js

What is the expected output? What do you see instead?
For the python to load. 

Instead presented with this:

Traceback (most recent call last):
  File "peepdf.py", line 32, in <module>
    from PDFCore import PDFParser, vulnsDict
  File "/Users/tross/Code/satori/peepdf_service/peepdf-svn/PDFCore.py", line 31, in <module>
    from JSAnalysis import *
  File "/Users/tross/Code/satori/peepdf_service/peepdf-svn/JSAnalysis.py", line 36, in <module>
    class Global(PyV8.JSClass):

NameError: name 'PyV8' is not defined

What version of the product are you using? On what operating system?
any

Please provide any additional information below.
placing the global class in the try block will fix it... probably a better fix.
try:
    import PyV8
    JS_MODULE = True 
    class Global(PyV8.JSClass):
        evalCode = ''

        def evalOverride(self, expression):
            self.evalCode += '\n\n// New evaluated code\n' + expression
            return
except:
    JS_MODULE = False

Original issue reported on code.google.com by KAK.BO....@gmail.com on 5 Sep 2013 at 3:18

GoogleCodeExporter commented 9 years ago
Hi! Thanks for reporting this! I will try to fix it today ;)

Original comment by josemigu...@gmail.com on 8 Sep 2013 at 6:55

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r200.

Original comment by josemigu...@gmail.com on 8 Sep 2013 at 7:22