Skip to content

Commit

Permalink
Charset.txt directory check added
Browse files Browse the repository at this point in the history
Charset.txt wasn't being found whilst executing paranoidf.py in a directory other than it's own.
  • Loading branch information
patrickdw123 committed Sep 2, 2014
1 parent 7e515e6 commit 5270ad9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PDFConsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ def help_encrypt(self):
print newLine + 'Encrypt a PDF document.' + newLine

def do_crackpw(self, argv): #Use pdfcrack in-house to crack a password.
dirCheck = os.path.dirname(os.path.abspath(sys.argv[0]))
try:
null = open('/dev/null', 'w')
subprocess.Popen('pdfcrack', stdout=null, stderr=null)
Expand All @@ -369,7 +370,7 @@ def do_crackpw(self, argv): #Use pdfcrack in-house to crack a password.
file = open(arg)
file.close()
try:
file = open('pdfcrack/charset.txt', 'r')
file = open(dirCheck + '/pdfcrack/charset.txt', 'r')
charset = file.read()
file.close()
print 'Brute forcing using chars from "pdfcrack/charset.txt".'
Expand Down

0 comments on commit 5270ad9

Please sign in to comment.