예제 #1
0
def patch(backup):
    import sign_support
    unsign_support.goUnsign(backup, CMA, False, "PGAME", account, ".")
    print "Patching " + backup + " With VHBL."
    if os.path.exists(CMA + "/EXTRACTED/PGAME/" + backup +
                      "/game/ux0_pspemu_temp_game_PSP_GAME_" + backup +
                      "/PBOOT.PBP"):
        print "Removing VHBL.."
        os.remove(CMA + "/EXTRACTED/PGAME/" + backup +
                  "/game/ux0_pspemu_temp_game_PSP_GAME_" + backup +
                  "/PBOOT.PBP")
        print "Re-Patching VHBL"
    shutil.copy(
        defs.getWorkingDir() + "/easyinstallers/VHBL/patch/PBOOT.PBP",
        CMA + "/EXTRACTED/PGAME/" + backup +
        "/game/ux0_pspemu_temp_game_PSP_GAME_" + backup + "/PBOOT.PBP")
    print "Signing to: " + account
    sign_support.goSign(account, "PGAME", backup, True)
    print "Copying Savedata To " + CMA + "/PSAVEDATA/" + defs.getAid(
        account) + "/VHBL01234"
    if not os.path.exists(CMA + "/PSAVEDATA/" + defs.getAid(account) +
                          "/VHBL01234"):
        shutil.copytree(
            defs.getWorkingDir() + "/easyinstallers/VHBL/VHBL01234",
            CMA + "/PSAVEDATA/" + defs.getAid(account) + "/VHBL01234")
    import easyInstallers
    tkMessageBox.showinfo(
        title="ARK Easy Installer",
        message=
        "VHBL Backup Created!\n(Note: Icon will be the same as base game)\nBe sure to copy the VHBL Savedata file too!"
    )
    easyInstallers.vp_start_gui()
예제 #2
0
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9'  # X11 color: 'gray85'
        _ana1color = '#d9d9d9'  # X11 color: 'gray85'
        _ana2color = '#d9d9d9'  # X11 color: 'gray85'
        font10 = "-family {DejaVu Sans Mono} -size 12 -weight normal "  \
            "-slant roman -underline 0 -overstrike 0"
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.map('.',
                       background=[('selected', _compcolor),
                                   ('active', _ana2color)])

        top.geometry("750x500+218+86")
        top.title("Select Backup")
        top.configure(highlightcolor="black")

        cmadir = open('cmadir.txt', 'r')
        CMA = cmadir.read()
        a = 0
        self.Label1 = Label(top)
        self.Label1.place(relx=0.02, rely=0.02, height=18, width=96)
        self.Label1.configure(text='''Patch: ''')
        self.Label1.configure(width=96)

        self.backupList = ScrolledListBox(top)
        self.backupList.place(relx=0.01,
                              rely=0.06,
                              relheight=0.87,
                              relwidth=0.97)
        self.backupList.configure(background="white")
        self.backupList.configure(font=font10)
        self.backupList.configure(highlightcolor="#d9d9d9")
        self.backupList.configure(selectbackground="#c4c4c4")
        self.backupList.configure(width=10)
        print("Looking For Backups In: " + CMA + "/PGAME/" +
              defs.getAid(account))
        for root, dir, files in os.walk(CMA + "/PGAME/" +
                                        defs.getAid(account)):
            for items in fnmatch.filter(dir, "*"):
                a += 1
                if defs.isEncryptedApp(CMA + "/PGAME/" + defs.getAid(account) +
                                       "/" + items):
                    title = sfoParser.main(CMA + "/PGAME/" +
                                           defs.getAid(account) + "/" + items +
                                           "/sce_sys/param.sfo")
                    self.backupList.insert(a, title + " (" + items + ")")

        self.Button1 = Button(top)
        self.Button1.place(relx=0.83, rely=0.94, height=26, width=117)
        self.Button1.configure(activebackground="#d9d9d9")
        self.Button1.configure(command=lambda: patch(
            defs.getTitleID(self.backupList.get(ACTIVE))))
        self.Button1.configure(text='''Patch W VHBL''')
def patch(backup):
    import sign_support
    unsign_support.pushVars(account, "PGAME", ".")
    unsign_support.goUnsign(backup, CMA)
    print "Patching With VHBL"
    shutil.copy(
        defs.getWorkingDir() + "/easyinstallers/VHBL/patch/PBOOT.PBP",
        CMA + "/EXTRACTED/PGAME/" + backup +
        "/game/ux0_pspemu_temp_game_PSP_GAME_" + backup + "/")
    print "Signing to: " + account
    sign_support.goSign(account, "PGAME", backup, True)
    print "Copying Savedata To " + CMA + "/PSAVEDATA/" + defs.getAid(
        account) + "/VHBL01234"
    if not os.path.exists(CMA + "/PSAVEDATA/" + defs.getAid(account) +
                          "/VHBL01234"):
        shutil.copytree(
            defs.getWorkingDir() + "/easyinstallers/VHBL/VHBL01234",
            CMA + "/PSAVEDATA/" + defs.getAid(account) + "/VHBL01234")
    import easyInstallers
    tkMessageBox.showinfo(
        title="VHBL Easy Installer",
        message=
        "VHBL Backup Created! (Note: Icon will be the same as base game)")
    easyInstallers.close_window(root)
    easyInstallers.vp_start_gui()
예제 #4
0
    def __init__(self, top = None):
        """This class configures and populates the toplevel window.
        top is the toplevel containing window."""
        _bgcolor = '#d9d9d9'
        _fgcolor = '#000000'
        _compcolor = '#d9d9d9'
        _ana1color = '#d9d9d9'
        _ana2color = '#d9d9d9'
        font10 = '-family {DejaVu Sans Mono} -size 12 -weight normal -slant roman -underline 0 -overstrike 0'
        self.style = ttk.Style()
        if sys.platform == 'win32':
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)])
        top.geometry('750x500+218+86')
        top.title('Unsign Backup')
        top.configure(highlightcolor='black')
        cmadir = open('cmadir.txt', 'r')
        CMA = cmadir.read()
        a = 0
        self.Label1 = Label(top)
        self.Label1.place(relx=0.02, rely=0.02, height=18, width=96)
        self.Label1.configure(text='What Backup?')
        self.Label1.configure(width=96)
        self.backupList = ScrolledListBox(top)
        self.backupList.place(relx=0.01, rely=0.06, relheight=0.87, relwidth=0.97)
        self.backupList.configure(background='white')
        self.backupList.configure(font=font10)
        self.backupList.configure(highlightcolor='#d9d9d9')
        self.backupList.configure(selectbackground='#c4c4c4')
        self.backupList.configure(width=10)
        print 'Looking For Backups In: ' + CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount())
        for root, dir, files in defs.walklevel(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()),0):
            for items in fnmatch.filter(dir, '*'):
                a += 1
                if defs.isEncryptedApp(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()) + '/' + items):
                    title = sfoParser.main(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()) + '/' + items + '/sce_sys/param.sfo')
                    if pfs.isKeyKnown(items):
                        self.backupList.insert(a, title + ' [PFS] (' + items + ')')
                    else:
                        self.backupList.insert(a, title + ' (' + items + ')')
                elif unsign_support.getLoad() == 'SYSTEM' and defs.isBackup(CMA + '/' + unsign_support.getLoad() + '/' + defs.getAid(unsign_support.getAccount()) + '/' + items + '/' + items):
                    self.backupList.insert(a, items)

        self.Button1 = Button(top)
        self.Button1.place(relx=0.83, rely=0.94, height=26, width=117)
        self.Button1.configure(activebackground='#d9d9d9')
        if unsign_support.getLoad() != "SYSTEM":
            self.Button1.configure(command=lambda: unsign_support.goUnsign(defs.getTitleID(self.backupList.get(ACTIVE)), CMA, False,unsign_support.getLoad(), unsign_support.getAccount()))
        else:
            self.Button1.configure(command=lambda: unsign_support.goUnsign(self.backupList.get(ACTIVE), CMA, False,unsign_support.getLoad(), unsign_support.getAccount()))
        self.Button1.configure(text='Unsign & Extract')
        if unsign_support.getResign() == False:
            self.Button2 = Button(top)
            self.Button2.place(relx=0.01, rely=0.94, height=26, width=120)
            self.Button2.configure(activebackground='#d9d9d9')
            self.Button2.configure(command=lambda: unsign_support.goUnsign(defs.getTitleID(self.backupList.get(ACTIVE)), CMA, True,unsign_support.getLoad(), unsign_support.getAccount()))
            self.Button2.configure(text='Create .cmbackup')
예제 #5
0
def patch(backup):
    import sign_support
    print "Patching " + backup + " With VHBL."
    unsign_support.goUnsign(backup, CMA, False, "PGAME", account, ".")
    print "Patching With ARK-2"
    shutil.copy(
        defs.getWorkingDir() + "/easyinstallers/ARK/patch/PBOOT.PBP",
        CMA + "/EXTRACTED/PGAME/" + backup +
        "/game/ux0_pspemu_temp_game_PSP_GAME_" + backup + "/")
    print "Signing to: " + account
    sign_support.goSign(account, "PGAME", backup, True)
    if tkMessageBox.askyesno(title="OneMenu?",
                             message="Would you like to use ONEMENU?"):
        print "Copying Savedata To " + CMA + "/PSAVEDATA/" + defs.getAid(
            account) + "/ARK_01234"
        if not os.path.exists(CMA + "/PSAVEDATA/" + defs.getAid(account) +
                              "/ARK_01234"):
            shutil.copytree(
                defs.getWorkingDir() + "/easyinstallers/ARK/ONEMENU",
                CMA + "/PSAVEDATA/" + defs.getAid(account) + "/ARK_01234")
    else:
        print "Copying Savedata To " + CMA + "/PSAVEDATA/" + defs.getAid(
            account) + "/ARK_01234"
        if not os.path.exists(CMA + "/PSAVEDATA/" + defs.getAid(account) +
                              "/ARK_01234"):
            shutil.copytree(
                defs.getWorkingDir() + "/easyinstallers/ARK/ARK_01234",
                CMA + "/PSAVEDATA/" + defs.getAid(account) + "/ARK_01234")
    import easyInstallers
    tkMessageBox.showinfo(
        title="ARK Easy Installer",
        message=
        "ARK Backup Created! (Note: Icon will be the same as base game)\nBe sure to copy the PSP ARK-2 Savedata file too!"
    )
    easyInstallers.vp_start_gui()
def goSign(acc, ld, bkup, resign):
    global am
    global foldParams
    CMA = defs.getCmaDir()
    cmaKey = defs.getStoredKey(acc)
    cmaAID = defs.getAid(acc)
    import sys
    print ld
    if ld != 'SYSTEM':
        if ld == 'PGAME':
            foldParams = ['game', 'license']
            am = 1
        elif ld == 'APP':
            foldParams = [
                'app', 'patch', 'addcont', 'appmeta', 'license', 'savedata'
            ]
            am = 5
        elif ld == 'PSGAME':
            foldParams = ['game', 'license']
            am = 1
        elif ld == 'PSM':
            foldParams = ['game', 'license', 'patch', 'savedata']
            am = 3

        print 'Checking for Packed Backup..'
        if os.path.exists(CMA + '/' + ld + '/' + cmaAID + '/' + bkup):
            print "Packed backup allredy exists. removing.."
            shutil.rmtree(CMA + '/' + ld + '/' + cmaAID + '/' + bkup)
            print 'Packing backup..'
        else:
            print "Nope, Packing Backup.."

        if not os.path.exists(CMA + '/' + ld + '/' + cmaAID + '/' + bkup):
            os.makedirs(CMA + '/' + ld + '/' + cmaAID + '/' + bkup)
        while am != -1:
            if not os.path.exists(CMA + '/' + ld + '/' + cmaAID + '/' + bkup +
                                  '/' + foldParams[am]):
                if os.path.exists(CMA + '/EXTRACTED/' + ld + '/' + bkup + '/' +
                                  foldParams[am]):
                    os.makedirs(CMA + '/' + ld + '/' + cmaAID + '/' + bkup +
                                '/' + foldParams[am])
            am -= 1

        if ld == 'PGAME':
            foldParams = ['game', 'license']
            am = 1
        elif ld == 'APP':
            foldParams = [
                'app', 'patch', 'addcont', 'appmeta', 'license', 'savedata'
            ]
            am = 5
        elif ld == 'PSGAME':
            foldParams = ['game', 'license']
            am = 1
        elif ld == 'PSM':
            foldParams = ['app']
            am = 0
        while am != -1:
            if sys.platform.__contains__('linux') or sys.platform.__contains__(
                    'darwin'):
                print 'Executing: ./psvimg-create -m ' + '"' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '/' + foldParams[
                    am] + '.psvmd-dec" -K ' + cmaKey + ' "' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '/' + foldParams[
                        am] + '" "' + CMA + '/' + ld + '/' + cmaAID + '/' + bkup + '/' + foldParams[
                            am] + '"'
                os.system('./psvimg-create -m "' + CMA + '/EXTRACTED/' + ld +
                          '/' + bkup + '/' + foldParams[am] +
                          '.psvmd-dec" -K ' + cmaKey + ' "' + CMA +
                          '/EXTRACTED/' + ld + '/' + bkup + '/' +
                          foldParams[am] + '" "' + CMA + '/' + ld + '/' +
                          cmaAID + '/' + bkup + '/' + foldParams[am] + '"')
                am -= 1
            if sys.platform.__contains__(
                    'win') and not sys.platform.__contains__("darwin"):
                print 'Executing: psvimg-create.exe -m ' + '"' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '/' + foldParams[
                    am] + '.psvmd-dec" -K ' + cmaKey + ' "' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '/' + foldParams[
                        am] + '" "' + CMA + '/' + ld + '/' + cmaAID + '/' + bkup + '/' + foldParams[
                            am] + '"'
                os.system('psvimg-create.exe -m ' + '"' + CMA + '/EXTRACTED/' +
                          ld + '/' + bkup + '/' + foldParams[am] +
                          '.psvmd-dec" -K ' + cmaKey + ' "' + CMA +
                          '/EXTRACTED/' + ld + '/' + bkup + '/' +
                          foldParams[am] + '" "' + CMA + '/' + ld + '/' +
                          cmaAID + '/' + bkup + '/' + foldParams[am] + '"')
                am -= 1

        if not os.path.exists(CMA + '/' + ld + '/' + cmaAID + '/' + bkup +
                              '/sce_sys'):
            print 'Copying Folder: ' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '/sce_sys To: ' + CMA + '/' + ld + '/' + cmaAID + '/' + bkup + '/sce_sys'
            shutil.copytree(
                CMA + '/EXTRACTED/' + ld + '/' + bkup + '/sce_sys',
                CMA + '/' + ld + '/' + cmaAID + '/' + bkup + '/sce_sys')
    elif ld == 'SYSTEM':
        if sys.platform.__contains__('linux') or sys.platform.__contains__(
                'darwin'):
            print 'Executing: ./psvimg-create -m ' + '"' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '.psvmd-dec" -K ' + cmaKey + ' "' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '" "' + CMA + '/' + ld + '/' + cmaAID + '/' + bkup + '"'
            os.system('./psvimg-create -m "' + CMA + '/EXTRACTED/' + ld + '/' +
                      bkup + '.psvmd-dec" -K ' + cmaKey + ' "' + CMA +
                      '/EXTRACTED/' + ld + '/' + bkup + '" "' + CMA + '/' +
                      ld + '/' + cmaAID + '/' + bkup + '"')
        if sys.platform.__contains__(
                'win') and not sys.platform.__contains__("darwin"):
            print 'Executing: psvimg-create.exe -m ' + '"' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '.psvmd-dec" -K ' + cmaKey + ' "' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '" "' + CMA + '/' + ld + '/' + cmaAID + '/' + bkup + '"'
            os.system('psvimg-create.exe -m ' + '"' + CMA + '/EXTRACTED/' +
                      ld + '/' + bkup + '.psvmd-dec" -K ' + cmaKey + ' "' +
                      CMA + '/EXTRACTED/' + ld + '/' + bkup + '" "' + CMA +
                      '/' + ld + '/' + cmaAID + '/' + bkup + '"')
        print 'Copying File: ' + CMA + '/EXTRACTED/' + ld + '/' + bkup + '.psvinf To: ' + CMA + '/' + ld + '/' + cmaAID + '/' + bkup + '/' + bkup + '.psvinf'
        shutil.copy(
            CMA + '/EXTRACTED/' + ld + '/' + bkup + '.psvinf', CMA + '/' + ld +
            '/' + cmaAID + '/' + bkup + '/' + bkup + '.psvinf')
    if resign == False:
        tkMessageBox.showinfo(title='Pack',
                              message='Packing Complete! (Refresh QCMA!)')
        import sign
        sign.vp_start_gui()
예제 #7
0
def goUnsign(cmaBackup,
             CMA=defs.getCmaDir(),
             cmbackup=False,
             load="",
             account="",
             resign=False):
    if cmbackup == True:
        title = sfoParser.main(CMA + '/' + load + '/' + defs.getAid(account) +
                               '/' + cmaBackup + '/sce_sys/param.sfo')
        try:
            location = tkFileDialog.asksaveasfilename(
                title='Select location',
                filetypes=[('Unsigned CMA Backup File', '*.cmbackup')],
                initialfile=title)
        except:
            location = tkFileDialog.asksaveasfilename(
                title='Select location',
                filetypes=[('Unsigned CMA Backup File', '*.cmbackup')],
                initialfile=cmaBackup)
        try:
            print 'location: ' + location
        except TypeError:
            tkMessageBox.showerror(
                title="Error 302",
                message=
                "ERROR: You did not select a location to create the .cmbackup!"
            )
            import sys
            sys.exit()

    print "Checking if allready extracted backup exists..."
    if os.path.exists(CMA + '/EXTRACTED/' + load + '/' + cmaBackup):
        print 'Backup Found! Removing...'
        shutil.rmtree(CMA + '/EXTRACTED/' + load + '/' + cmaBackup)
        print 'Extracting backup..'
    else:
        print 'Nope! Extracting backup..'
    global am
    global foldParams
    import unsign
    unsign.close_window(root)
    key = open('keys/' + account, 'r')
    cmaKey = key.read()
    aid = open('accounts/' + account, 'r')
    cmaAID = aid.read()
    import sys
    if load != 'SYSTEM':
        if load == 'PGAME':
            foldParams = ['game', 'license']
            am = 1
        elif load == 'APP':
            foldParams = [
                'app', 'patch', 'addcont', 'appmeta', 'license', 'savedata'
            ]
            am = 5
        elif load == 'PSGAME':
            foldParams = ['game', 'license']
            am = 1
        elif load == 'PSM':
            foldParams = ['game', 'license', 'patch', 'savedata']
            am = 3
        if not os.path.exists(CMA + '/EXTRACTED/' + load + '/' + cmaBackup +
                              '/'):
            os.makedirs(CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/')
        while am != -1:
            if os.path.exists(CMA + '/' + load + '/' + cmaAID + '/' +
                              cmaBackup + '/' + foldParams[am] + '/'):
                if not os.path.exists(CMA + '/EXTRACTED/' + load + '/' +
                                      cmaBackup + '/' + foldParams[am]):
                    os.makedirs(CMA + '/EXTRACTED/' + load + '/' + cmaBackup +
                                '/' + foldParams[am])
            am -= 1

        if load == 'PGAME':
            foldParams = ['game', 'license']
            am = 1
        elif load == 'APP':
            foldParams = [
                'app', 'patch', 'addcont', 'appmeta', 'license', 'savedata'
            ]
            am = 5
        elif load == 'PSGAME':
            foldParams = ['game', 'license']
            am = 1
        elif load == 'PSM':
            foldParams = ['app']
            am = 0
        while am != -1:
            if sys.platform.__contains__('linux') or sys.platform.__contains__(
                    'darwin'):
                print 'Executing: ./psvimg-extract -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + foldParams[
                    am] + '/' + foldParams[
                        am] + '.psvimg" "' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/' + foldParams[
                            am] + '"'
                os.system('./psvimg-extract -K ' + cmaKey + ' "' + CMA + '/' +
                          load + '/' + cmaAID + '/' + cmaBackup + '/' +
                          foldParams[am] + '/' + foldParams[am] +
                          '.psvimg" "' + CMA + '/EXTRACTED/' + load + '/' +
                          cmaBackup + '/' + foldParams[am] + '"')
                print 'Executing: ./psvmd-decrypt -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + foldParams[
                    am] + '/' + foldParams[
                        am] + '.psvmd" "' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/' + foldParams[
                            am] + '.psvmd-dec"'
                os.system('./psvmd-decrypt -K ' + cmaKey + ' "' + CMA + '/' +
                          load + '/' + cmaAID + '/' + cmaBackup + '/' +
                          foldParams[am] + '/' + foldParams[am] + '.psvmd" "' +
                          CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/' +
                          foldParams[am] + '.psvmd-dec"')
                am -= 1
            if sys.platform.__contains__(
                    'win') and not sys.platform.__contains__("darwin"):
                print 'Executing: psvimg-extract.exe -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + foldParams[
                    am] + '/' + foldParams[
                        am] + '.psvimg ' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/' + foldParams[
                            am]
                os.system('psvimg-extract.exe -K ' + cmaKey + ' "' + CMA +
                          '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' +
                          foldParams[am] + '/' + foldParams[am] +
                          '.psvimg" "' + CMA + '/EXTRACTED/' + load + '/' +
                          cmaBackup + '/' + foldParams[am] + '"')
                print 'Executing: psvmd-decrypt.exe -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + foldParams[
                    am] + '/' + foldParams[
                        am] + '.psvmd" "' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/' + foldParams[
                            am] + '.psvmd-dec"'
                os.system('psvmd-decrypt.exe -K ' + cmaKey + ' "' + CMA + '/' +
                          load + '/' + cmaAID + '/' + cmaBackup + '/' +
                          foldParams[am] + '/' + foldParams[am] + '.psvmd" "' +
                          CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/' +
                          foldParams[am] + '.psvmd-dec"')
                am -= 1

        if not os.path.exists(CMA + '/EXTRACTED/' + load + '/' + cmaBackup +
                              '/sce_sys'):
            print 'Copying Folder: ' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/sce_sys' + ' To: ' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/sce_sys'
            shutil.copytree(
                CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/sce_sys',
                CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/sce_sys')
    elif load == 'SYSTEM':
        if sys.platform.__contains__('linux') or sys.platform.__contains__(
                'darwin'):
            print 'Executing: ./psvimg-extract -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup + '.psvimg" "' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '"'
            os.system('./psvimg-extract -K ' + cmaKey + ' "' + CMA + '/' +
                      load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup +
                      '.psvimg" "' + CMA + '/EXTRACTED/' + load + '/' +
                      cmaBackup + '"')
            print 'Executing: ./psvmd-decrypt -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup + '.psvmd" "' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '.psvmd-dec"'
            os.system('./psvmd-decrypt -K ' + cmaKey + ' "' + CMA + '/' +
                      load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup +
                      '.psvmd" "' + CMA + '/EXTRACTED/' + load + '/' +
                      cmaBackup + '.psvmd-dec"')
        if sys.platform.__contains__(
                'win') and not sys.platform.__contains__("darwin"):
            print 'Executing: psvimg-extract.exe -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup + '.psvimg" "' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '"'
            os.system('psvimg-extract.exe -K ' + cmaKey + ' "' + CMA + '/' +
                      load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup +
                      '.psvimg" "' + CMA + '/EXTRACTED/' + load + '/' +
                      cmaBackup + '"')
            print 'Executing: psvmd-decrypt.exe -K ' + cmaKey + ' "' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup + '.psvmd" "' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '.psvmd-dec"'
            os.system('psvmd-decrypt.exe -K ' + cmaKey + ' "' + CMA + '/' +
                      load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup +
                      '.psvmd" "' + CMA + '/EXTRACTED/' + load + '/' +
                      cmaBackup + '.psvmd-dec"')
        print 'Copying File: ' + CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' + cmaBackup + '.psvinf' + ' To: ' + CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '.psvinf'
        if os.path.exists(CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup +
                          '/' + cmaBackup + '.psvinf'):
            shutil.copy(
                CMA + '/' + load + '/' + cmaAID + '/' + cmaBackup + '/' +
                cmaBackup + '.psvinf',
                CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '.psvinf')
    if resign == False and cmbackup == False:
        tkMessageBox.showinfo(title='Extract', message='Extraction Complete!')
        if pfs.isKeyKnown(cmaBackup):
            if tkMessageBox.askyesno(
                    title="PFS",
                    message=
                    "The PFS Key for this application is known\nWould you like to decrypt PFS as well?"
            ):
                pfs.decrypt(cmaBackup)
                tkMessageBox.showinfo(title="PFS",
                                      message="PFS Decrypted for " + cmaBackup)
        import unsign
        unsign.vp_start_gui()
    elif resign == True:
        loaad = load
        accSelect_support.resignVars(cmaBackup, load)
        backupType_support.action('resign2')
        accSelect.vp_start_gui()
    elif cmbackup == True:
        print 'Creating .cmbackup'
        print 'Writing load.txt'
        loadtext = open(
            CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/load.txt', 'w')
        loadtext.write(load)
        loadtext.close()
        print 'Writing TitleID.txt'
        loadtext = open(
            CMA + '/EXTRACTED/' + load + '/' + cmaBackup + '/TitleID.txt', 'w')
        loadtext.write(cmaBackup)
        loadtext.close()
        print 'Checking for savedata..'
        if os.path.exists(CMA + '/EXTRACTED/' + load + '/' + cmaBackup +
                          '/savedata'):
            savedata = tkMessageBox.askyesno(
                title="Savedata",
                message=
                "This Backup Contains Savedata, Would you like to pack that into the .CMBACKUP File?\nSavedata could potentailly contain personal infomation!!"
            )
            if savedata == False:
                shutil.rmtree(CMA + '/EXTRACTED/' + load + '/' + cmaBackup +
                              '/savedata')
                os.remove(CMA + '/EXTRACTED/' + load + '/' + cmaBackup +
                          '/savedata.psvmd-dec')
        print 'Writing .cmbackup file..'
        defs.zip(src=CMA + '/EXTRACTED/' + load + '/' + cmaBackup,
                 dst=location)
        print "Removing: " + CMA + '/EXTRACTED/' + load + '/' + cmaBackup
        shutil.rmtree(CMA + '/EXTRACTED/' + load + '/' + cmaBackup)
        print "Done! CMBackup Created!"
        tkMessageBox.showinfo(title='CMBACKUP', message='.cmbackup Created.')
    sys.stdout.flush()