Commit af70d44c authored by Sophie Brun's avatar Sophie Brun

Remove useless patches

parent 4b36e80f
--- a/peepdf.py
+++ b/peepdf.py
@@ -264,7 +264,7 @@ argsParser.add_option('-c', '--check-vt'
argsParser.add_option('-f', '--force-mode', action='store_true', dest='isForceMode', default=False, help='Sets force parsing mode to ignore errors.')
argsParser.add_option('-l', '--loose-mode', action='store_true', dest='isLooseMode', default=False, help='Sets loose parsing mode to catch malformed objects.')
argsParser.add_option('-m', '--manual-analysis', action='store_true', dest='isManualAnalysis', default=False, help='Avoids automatic Javascript analysis. Useful with eternal loops like heap spraying.')
-argsParser.add_option('-u', '--update', action='store_true', dest='update', default=False, help='Updates peepdf with the latest files from the repository.')
+# argsParser.add_option('-u', '--update', action='store_true', dest='update', default=False, help='Updates peepdf with the latest files from the repository.')
argsParser.add_option('-g', '--grinch-mode', action='store_true', dest='avoidColors', default=False, help='Avoids colorized output in the interactive console.')
argsParser.add_option('-v', '--version', action='store_true', dest='version', default=False, help='Shows program\'s version number.')
argsParser.add_option('-x', '--xml', action='store_true', dest='xmlOutput', default=False, help='Shows the document information in XML format.')
@@ -286,58 +286,6 @@ try:
resetColor = Style.RESET_ALL
if options.version:
print peepdfHeader
- elif options.update:
- updated = False
- newVersion = ''
- localVersion = 'v'+version+' r'+revision
- reVersion = 'version = \'(\d\.\d)\'\s*?revision = \'(\d+)\''
- repURL = 'http://peepdf.googlecode.com/svn/trunk/'
- print '[-] Checking if there are new updates...'
- try:
- remotePeepContent = urllib2.urlopen(repURL+'peepdf.py').read()
- except:
- sys.exit('[x] Connection error while trying to connect with the repository')
- repVer = re.findall(reVersion, remotePeepContent)
- if repVer != []:
- newVersion = 'v'+repVer[0][0]+' r'+repVer[0][1]
- else:
- sys.exit('[x] Error getting the version number from the repository')
- if localVersion == newVersion:
- print '[+] No changes! ;)'
- else:
- print '[+] There are new updates!!'
- print '[-] Getting paths from the repository...'
- pathNames = getRepPaths(repURL,'')
- print '[+] Done'
- localFilesInfo = getLocalFilesInfo(pathNames)
- print '[-] Checking files...'
- for path in pathNames:
- try:
- fileContent = urllib2.urlopen(repURL+path).read()
- except:
- sys.exit('[x] Connection error while getting file "'+path+'"')
- if localFilesInfo.has_key(path):
- # File exists
- # Checking hash
- shaHash = hashlib.sha256(fileContent).hexdigest()
- if shaHash != localFilesInfo[path]:
- open(path,'wb').write(fileContent)
- print '[+] File "'+path+'" updated successfully'
- else:
- # File does not exist
- index = path.rfind('/')
- if index != -1:
- dirsPath = path[:index]
- if not os.path.exists(dirsPath):
- print '[+] New directory "'+dirsPath+'" created successfully'
- os.makedirs(dirsPath)
- open(path,'wb').write(fileContent)
- print '[+] New file "'+path+'" created successfully'
- message = '[+] peepdf updated successfully'
- if newVersion != '':
- message += ' to '+newVersion
- print message
-
else:
if len(args) == 1:
fileName = args[0]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment