# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
cmdline = 'python lib\kindlepid.py "' + serial + '"'
else :
cmdline = 'lib\kindlepid.py "' + serial + '"'
-
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
log += 'Serial = "' + serial + '"\n'
log += '\n\n'
log += 'Please Wait ...\n\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.pidrdr(serial)
Tkinter.Label(body, text='Mobi eBook input file').grid(row=0, sticky=Tkconstants.E)
self.mobipath = Tkinter.Entry(body, width=50)
self.mobipath.grid(row=0, column=1, sticky=sticky)
- self.mobipath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.mobipath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_mobipath)
button.grid(row=0, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\kindlefix.py "' + infile + '" "' + pidnum + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
log += 'PID = "' + pidnum + '"\n'
log += '\n\n'
log += 'Please Wait ...\n\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.krdr(mobipath, pidnum)
Tkinter.Label(body, text='Mobi eBook input file').grid(row=0, sticky=Tkconstants.E)
self.mobipath = Tkinter.Entry(body, width=50)
self.mobipath.grid(row=0, column=1, sticky=sticky)
- self.mobipath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.mobipath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_mobipath)
button.grid(row=0, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
log += 'PID = "' + pidnum + '"\n'
log += '\n\n'
log += 'Please Wait ...\n\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.mobirdr(mobipath, outpath, pidnum)
# import filter it works when importing unencrypted files.
# Also now handles encrypted files that don't need a specific PID.
# 0.11 - use autoflushed stdout and proper return values
+# 0.12 - Fix for problems with metadata import as Calibre plugin, report errors
class Unbuffered:
- def __init__(self, stream):
- self.stream = stream
- def write(self, data):
- self.stream.write(data)
- self.stream.flush()
- def __getattr__(self, attr):
- return getattr(self.stream, attr)
+ def __init__(self, stream):
+ self.stream = stream
+ def write(self, data):
+ self.stream.write(data)
+ self.stream.flush()
+ def __getattr__(self, attr):
+ return getattr(self.stream, attr)
import sys
sys.stdout=Unbuffered(sys.stdout)
#implementation of Pukall Cipher 1
def PC1(key, src, decryption=True):
- sum1 = 0;
- sum2 = 0;
- keyXorVal = 0;
- if len(key)!=16:
- print "Bad key length!"
- return None
- wkey = []
- for i in xrange(8):
- wkey.append(ord(key[i*2])<<8 | ord(key[i*2+1]))
+ sum1 = 0;
+ sum2 = 0;
+ keyXorVal = 0;
+ if len(key)!=16:
+ print "Bad key length!"
+ return None
+ wkey = []
+ for i in xrange(8):
+ wkey.append(ord(key[i*2])<<8 | ord(key[i*2+1]))
- dst = ""
- for i in xrange(len(src)):
- temp1 = 0;
- byteXorVal = 0;
- for j in xrange(8):
- temp1 ^= wkey[j]
- sum2 = (sum2+j)*20021 + sum1
- sum1 = (temp1*346)&0xFFFF
- sum2 = (sum2+sum1)&0xFFFF
- temp1 = (temp1*20021+1)&0xFFFF
- byteXorVal ^= temp1 ^ sum2
- curByte = ord(src[i])
- if not decryption:
- keyXorVal = curByte * 257;
- curByte = ((curByte ^ (byteXorVal >> 8)) ^ byteXorVal) & 0xFF
- if decryption:
- keyXorVal = curByte * 257;
- for j in xrange(8):
- wkey[j] ^= keyXorVal;
- dst+=chr(curByte)
- return dst
+ dst = ""
+ for i in xrange(len(src)):
+ temp1 = 0;
+ byteXorVal = 0;
+ for j in xrange(8):
+ temp1 ^= wkey[j]
+ sum2 = (sum2+j)*20021 + sum1
+ sum1 = (temp1*346)&0xFFFF
+ sum2 = (sum2+sum1)&0xFFFF
+ temp1 = (temp1*20021+1)&0xFFFF
+ byteXorVal ^= temp1 ^ sum2
+ curByte = ord(src[i])
+ if not decryption:
+ keyXorVal = curByte * 257;
+ curByte = ((curByte ^ (byteXorVal >> 8)) ^ byteXorVal) & 0xFF
+ if decryption:
+ keyXorVal = curByte * 257;
+ for j in xrange(8):
+ wkey[j] ^= keyXorVal;
+ dst+=chr(curByte)
+ return dst
def checksumPid(s):
letters = "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789"
description = 'Removes DRM from secure Mobi files'
supported_platforms = ['linux', 'osx', 'windows'] # Platforms this plugin will run on
author = 'The Dark Reverser' # The author of this plugin
- version = (0, 1, 0) # The version number of this plugin
+ version = (0, 1, 2) # The version number of this plugin
file_types = set(['prc','mobi','azw']) # The file types that this plugin will be applied to
on_import = True # Run this plugin during the import
def run(self, path_to_ebook):
- of = self.temporary_file('.mobi')
+ from calibre.gui2 import is_ok_to_use_qt
+ from PyQt4.Qt import QMessageBox
PID = self.site_customization
data_file = file(path_to_ebook, 'rb').read()
ar = PID.split(',')
for i in ar:
try:
- file(of.name, 'wb').write(DrmStripper(data_file, i).getResult())
+ unlocked_file = DrmStripper(data_file, i).getResult()
except DrmException:
- # Hm, we should display an error dialog here.
- # Dunno how though.
- # Ignore the dirty hack behind the curtain.
-# strexcept = 'echo exception: %s > /dev/tty' % e
-# subprocess.call(strexcept,shell=True)
- print i + ": not PID for book"
+ # ignore the error
+ pass
else:
+ of = self.temporary_file('.mobi')
+ of.write(unlocked_file)
+ of.close()
return of.name
+ if is_ok_to_use_qt():
+ d = QMessageBox(QMessageBox.Warning, "MobiDeDRM Plugin", "Couldn't decode: %s\n\nImporting encrypted version." % path_to_ebook)
+ d.show()
+ d.raise_()
+ d.exec_()
+ return path_to_ebook
def customization_help(self, gui=False):
return 'Enter PID (separate multiple PIDs with comma)'
if __name__ == "__main__":
- print "MobiDeDrm v0.11. Copyright (c) 2008 The Dark Reverser"
+ print "MobiDeDrm v0.12. Copyright (c) 2008 The Dark Reverser"
if len(sys.argv)<4:
print "Removes protection from Mobipocket books"
print "Usage:"
print " mobidedrm infile.mobi outfile.mobi (PID)"
sys.exit(1)
- else:
+ else:
infile = sys.argv[1]
outfile = sys.argv[2]
pid = sys.argv[3]
Tkinter.Label(body, text='Topaz eBook input file').grid(row=0, sticky=Tkconstants.E)
self.tpzpath = Tkinter.Entry(body, width=50)
self.tpzpath.grid(row=0, column=1, sticky=sticky)
- self.tpzpath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.tpzpath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_tpzpath)
button.grid(row=0, column=2)
Tkinter.Label(body, text='Output Directory').grid(row=1, sticky=Tkconstants.E)
self.outpath = Tkinter.Entry(body, width=50)
self.outpath.grid(row=1, column=1, sticky=sticky)
- self.outpath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.outpath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_outpath)
button.grid(row=1, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\cmbtc_dump.py -v -d ' + pidoption + outoption + '"' + infile + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
return
def get_outpath(self):
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
outpath = tkFileDialog.askdirectory(
parent=None, title='Directory to Extract Files into',
- initialdir=os.getcwd(), initialfile=None)
+ initialdir=cwd, initialfile=None)
if outpath:
outpath = os.path.normpath(outpath)
self.outpath.delete(0, Tkconstants.END)
log += 'First 8 chars of PID = "' + pidnum + '"\n'
log += '\n\n'
log += 'Please Wait ...\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.topazrdr(tpzpath, outpath, pidnum)
Tkinter.Label(body, text='Topaz eBook input file').grid(row=0, sticky=Tkconstants.E)
self.tpzpath = Tkinter.Entry(body, width=50)
self.tpzpath.grid(row=0, column=1, sticky=sticky)
- self.tpzpath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.tpzpath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_tpzpath)
button.grid(row=0, column=2)
Tkinter.Label(body, text='Output Directory').grid(row=1, sticky=Tkconstants.E)
self.outpath = Tkinter.Entry(body, width=50)
self.outpath.grid(row=1, column=1, sticky=sticky)
- self.outpath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.outpath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_outpath)
button.grid(row=1, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\cmbtc_dump_nonK4PC.py -v -d ' + pidoption + outoption + '"' + infile + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
return
def get_outpath(self):
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
outpath = tkFileDialog.askdirectory(
parent=None, title='Directory to Extract Files into',
- initialdir=os.getcwd(), initialfile=None)
+ initialdir=cwd, initialfile=None)
if outpath:
outpath = os.path.normpath(outpath)
self.outpath.delete(0, Tkconstants.END)
log += 'First 8 chars of PID = "' + pidnum + '"\n'
log += '\n\n'
log += 'Please Wait ...\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.topazrdr(tpzpath, outpath, pidnum)
Tkinter.Label(body, text='Directory you Extracted Topaz Files into').grid(row=0, sticky=Tkconstants.E)
self.bookdir = Tkinter.Entry(body, width=50)
self.bookdir.grid(row=0, column=1, sticky=sticky)
- self.bookdir.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.bookdir.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_bookdir)
button.grid(row=0, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\genhtml.py "' + bookdir + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
def get_bookdir(self):
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
bookdir = tkFileDialog.askdirectory(
parent=None, title='Select the Directory you Extracted Topaz Files into',
- initialdir=os.getcwd(), initialfile=None)
+ initialdir=cwd, initialfile=None)
if bookdir:
bookdir = os.path.normpath(bookdir)
self.bookdir.delete(0, Tkconstants.END)
log += 'Book Directory = "' + bookdir + '"\n'
log += '\n\n'
log += 'Please Wait ...\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.topazrdr(bookdir)
Tkinter.Label(body, text='Directory you Extracted Topaz Files into').grid(row=0, sticky=Tkconstants.E)
self.bookdir = Tkinter.Entry(body, width=50)
self.bookdir.grid(row=0, column=1, sticky=sticky)
- self.bookdir.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.bookdir.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_bookdir)
button.grid(row=0, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\gensvg.py "' + bookdir + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
def get_bookdir(self):
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
bookdir = tkFileDialog.askdirectory(
parent=None, title='Select the Directory you Extracted Topaz Files into',
- initialdir=os.getcwd(), initialfile=None)
+ initialdir=cwd, initialfile=None)
if bookdir:
bookdir = os.path.normpath(bookdir)
self.bookdir.delete(0, Tkconstants.END)
log += 'Book Directory = "' + bookdir + '"\n'
log += '\n\n'
log += 'Please Wait ...\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.topazrdr(bookdir)
Tkinter.Label(body, text='Directory you Extracted Topaz Files into').grid(row=0, sticky=Tkconstants.E)
self.bookdir = Tkinter.Entry(body, width=50)
self.bookdir.grid(row=0, column=1, sticky=sticky)
- self.bookdir.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.bookdir.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_bookdir)
button.grid(row=0, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\genxml.py "' + bookdir + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
def get_bookdir(self):
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
bookdir = tkFileDialog.askdirectory(
parent=None, title='Select the Directory you Extracted Topaz Files into',
- initialdir=os.getcwd(), initialfile=None)
+ initialdir=cwd, initialfile=None)
if bookdir:
bookdir = os.path.normpath(bookdir)
self.bookdir.delete(0, Tkconstants.END)
log += 'Book Directory = "' + bookdir + '"\n'
log += '\n\n'
log += 'Please Wait ...\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.topazrdr(bookdir)
#! /usr/bin/python
-# For use in Topaz Scripts version 2.2
+# For use in Topaz Scripts version 2.3
"""
#!/usr/bin/python
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
class Unbuffered:
def __init__(self, stream):
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
class Unbuffered:
def __init__(self, stream):
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
import csv
import sys
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
import sys
import csv
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
class Unbuffered:
def __init__(self, stream):
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
class Unbuffered:
def __init__(self, stream):
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
class Unbuffered:
def __init__(self, stream):
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
import csv
import sys
#! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
-# For use with Topaz Scripts Version 2.2
+# For use with Topaz Scripts Version 2.3
import csv
import sys
+Canges in 2.3
+ - fix for use with non-latin1 based systems (thank you Tedd)
+ - fixes for out of order tokens in xml
+
Changes in 2.2
- fix for minor bug in encode_Number from clark nova
- more fixes to handle paths with spaces in them
Tkinter.Label(body, text='eBook Pml input file').grid(row=0, sticky=Tkconstants.E)
self.pmlpath = Tkinter.Entry(body, width=50)
self.pmlpath.grid(row=0, column=1, sticky=sticky)
- self.pmlpath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.pmlpath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_pmlpath)
button.grid(row=0, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\\xpml2xhtml.py "' + infile + '" "' + outfile + '"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
log += 'HTML Output File = "' + outpath + '"\n'
log += '\n\n'
log += 'Please Wait ...\n\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.pmlhtml(pmlpath, outpath)
Tkinter.Label(body, text='eBook PDB input file').grid(row=0, sticky=Tkconstants.E)
self.pdbpath = Tkinter.Entry(body, width=50)
self.pdbpath.grid(row=0, column=1, sticky=sticky)
- self.pdbpath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.pdbpath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_pdbpath)
button.grid(row=0, column=2)
Tkinter.Label(body, text='Output Directory').grid(row=1, sticky=Tkconstants.E)
self.outpath = Tkinter.Entry(body, width=50)
self.outpath.grid(row=1, column=1, sticky=sticky)
- self.outpath.insert(0, os.getcwd())
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
+ self.outpath.insert(0, cwd)
button = Tkinter.Button(body, text="...", command=self.get_outpath)
button.grid(row=1, column=2)
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
+ msg = msg.encode('utf-8')
self.stext.insert(Tkconstants.END,msg)
self.stext.yview_pickplace(Tkconstants.END)
return
else :
cmdline = 'lib\erdr2pml.py "' + infile + '" "' + outdir + '" "' + name + '" ' + ccnum
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
return
def get_outpath(self):
+ cwd = os.getcwdu()
+ cwd = cwd.encode('utf-8')
outpath = tkFileDialog.askdirectory(
parent=None, title='Directory to Store Output into',
- initialdir=os.getcwd(), initialfile=None)
+ initialdir=cwd, initialfile=None)
if outpath:
outpath = os.path.normpath(outpath)
self.outpath.delete(0, Tkconstants.END)
log += 'Last 8 of CC = "' + ccnum + '"\n'
log += '\n\n'
log += 'Please Wait ...\n'
+ log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.erdr(pdbpath, outpath, name, ccnum)