Beispiel #1
0
def sub_menu4(office: Office):
    while True:
        screenClear()
        print()
        print()
        print('\t File name : "{}" '.format(office.getOfficeFileName()))
        print()
        office.showJPGjpegFiles()
        print()
        print()
        print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
        tmp = input('\tSeçim (Selection) : ').strip()
        if tmp.lower() == 'e':
            exit(0)
        elif tmp.lower() == 'b':
            return
        elif tmp.isdigit():
            slc = int(tmp)
            screenClear()
            office.showJPGjpegFile(index=slc)
Beispiel #2
0
def sub_menu1():
    while True:
        screenClear()
        print()
        print()
        #
        filename = input('\tOffice File : ').strip()
        if filename != '':
            try:
                office_obj = Office(officeFile=filename)
                if office_obj.getOfficeObj().checkFile:
                    return office_obj
            except:
                pass
            print('\tDosya bulunamadı. (File not found)')
        print()
        print()
        val = input(
            '\tGeri (Back) <<b>> , Devam (Continue) <<enter>> : ').strip()
        if val.lower() == 'b':
            return None
Beispiel #3
0
def sub_menu6(office: Office):
    while True:
        screenClear()
        print()
        print()
        print('\t File name : "{}" '.format(office.getOfficeFileName()))
        print()
        print()
        office.showFiles()
        print()
        print()
        print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
        tmp2 = input('\tSeçim (Selection) : ').strip()
        if tmp2.lower() == 'e':
            exit(0)
        elif tmp2.lower() == 'b':
            return
        elif tmp2.isdigit():
            slc2 = int(tmp2)
            screenClear()
            print()
            print()
            print('\t File name : "{}" '.format(office.getOfficeFileName()))
            print()
            print()
            office.saveFile(index=slc2)
            print()
            print()
            input('\tDevam (Continue) << enter >> : ')
Beispiel #4
0
def menu2():
    screenClear()
    print()
    print()
    filename = input('\tOffice file name  : ').strip()
    directory = input('\tExtract Directory : ').strip()
    print()
    #
    val = Office.Extract(officeFile=filename, extractDirectory=directory)
    if type(val) == type(True):
        if val:
            print('\tİşlem başarılı. (Successful operation)')
    print()
    print()
    input('\tDevam (Continue) <<enter>> : ')
Beispiel #5
0
def menu3():
    screenClear()
    print()
    print()
    #
    directory = input('\tPackage Directory : ').strip()
    filename = input('\tOffice File Name  : ').strip()
    print()
    #
    val = Office.Package(officeFile=filename, packageDirectory=directory)
    if type(val) == type(True):
        if val:
            print('\tİşlem başarılı. (Successful operation)')
    print()
    print()
    input('\tDevam (Continue) <<enter>> : ')
Beispiel #6
0
def sub_menu7(office: Office):
    while True:
        screenClear()
        print()
        print()
        print('\t File name : "{}" '.format(office.getOfficeFileName()))
        print()
        print()
        print('\t     **** MENU ****    ')
        print('\t-----------------------')
        print('\t1) Metadata bilgilerini göster. (Show metadata infos)')
        print('\t2) Metadata bilgilerini sil. (Delete metadata infos)')
        print()
        print()
        print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
        tmp = input('\tSeçim (Selection) : ').strip()
        if tmp.lower() == 'e':
            exit(0)
        elif tmp.lower() == 'b':
            return
        elif tmp.isdigit():
            slc = int(tmp)
            if slc == 1:
                screenClear()
                print()
                print()
                print('\t File name : "{}" '.format(
                    office.getOfficeFileName()))
                print()
                print()
                office.showMetadata()
                print()
                print()
                input('\tDevam (Continue) << enter >> : ')
            elif slc == 2:
                screenClear()
                print()
                print()
                print('\t File name : "{}" '.format(
                    office.getOfficeFileName()))
                print()
                print()
                res, name = office.deleteMetaData()
                if res:
                    print('\t"{}" dosya kaydedildi. (Save the file)'.format(
                        name))
                    print('\tİşlem başarılı. (Successful operation)')
                print()
                print()
                input('\tDevam (Continue) << enter >> : ')
Beispiel #7
0
def sub_menu5(office: Office):
    while True:
        screenClear()
        print()
        print()
        print('\t File name : "{}" '.format(office.getOfficeFileName()))
        print()
        print()
        print('\t     **** MENU ****    ')
        print('\t-----------------------')
        print(
            '\t1) Dosyanın ilk satırlarını "hex editor"de aç.(Show first line of the file with "hex editor") '
        )
        print('\t2) Dosyayı "hex editor"de aç. (Open file with "hex editor") ')
        print(
            '\t3) Tüm dosyaların ilk satırlarını "hex editor"de aç. (Show first line of the files with "hex editor")'
        )
        print(
            '\t4) Tüm dosyaları sırayla "hex editor"de aç. (Open files in order with "hex editor" )'
        )
        print()
        print()
        print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
        tmp = input('\tSeçim (Selection) : ').strip()
        if tmp.lower() == 'e':
            exit(0)
        elif tmp.lower() == 'b':
            return
        elif tmp.isdigit():
            slc = int(tmp)
            if slc == 1:
                while True:
                    screenClear()
                    print()
                    print()
                    print('\t File name : "{}" '.format(
                        office.getOfficeFileName()))
                    print()
                    office.showFiles()
                    print()
                    print()
                    print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
                    tmp2 = input('\tSeçim (Selection) : ').strip()
                    if tmp2.lower() == 'e':
                        exit(0)
                    elif tmp2.lower() == 'b':
                        break
                    elif tmp2.isdigit():
                        slc2 = int(tmp2)
                        screenClear()
                        print()
                        print()
                        print('\t File name : "{}" '.format(
                            office.getOfficeFileName()))
                        print()
                        office.showSummaryFileHexEditor(index=slc2)
                        print()
                        print()
                        input('\tDevam (Continue) << enter >> : ')
            #
            elif slc == 2:
                while True:
                    screenClear()
                    print()
                    print()
                    print('\t File name : "{}" '.format(
                        office.getOfficeFileName()))
                    print()
                    office.showFiles()
                    print()
                    print()
                    print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
                    tmp2 = input('\tSeçim (Selection) : ').strip()
                    if tmp2.lower() == 'e':
                        exit(0)
                    elif tmp2.lower() == 'b':
                        break
                    elif tmp2.isdigit():
                        slc2 = int(tmp2)
                        screenClear()
                        print()
                        print()
                        print('\t File name : "{}" '.format(
                            office.getOfficeFileName()))
                        print()
                        office.showFileHexEditor(index=slc2)
                        print()
                        print()
                        input('\tDevam (Continue) << enter >> : ')
            #
            elif slc == 3:
                screenClear()
                print()
                print()
                print('\t File name : "{}" '.format(
                    office.getOfficeFileName()))
                print()
                office.showSummaryHexAllFiles()
                print()
                print()
                input('\tDevam (Continue) << enter >> : ')
            #
            elif slc == 4:
                screenClear()
                office.showHexAllFiles()
Beispiel #8
0
def sub_menu3(office: Office):
    while True:
        screenClear()
        print()
        print()
        print('\t File name : "{}" '.format(office.getOfficeFileName()))
        print()
        print()
        print('\t     **** MENU ****    ')
        print('\t-----------------------')
        print(
            '\t1) Tek tek dosya imzalarını kontrol et. (Check one file signature)'
        )
        print(
            '\t2) Bütün dosyaların imzalarını kontrol et. (Check all files signature)'
        )
        print()
        print()
        print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
        tmp = input('\tSeçim (Selection) : ').strip()
        if tmp.lower() == 'e':
            exit(0)
        elif tmp.lower() == 'b':
            return
        elif tmp.isdigit():
            slc = int(tmp)
            if slc == 1:
                while True:
                    screenClear()
                    print()
                    print()
                    print('\t File name : "{}" '.format(
                        office.getOfficeFileName()))
                    print()
                    print()
                    office.showFiles()
                    print()
                    print()
                    print()
                    print()
                    print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
                    tmp2 = input('\tSeçim (Selection) : ').strip()
                    if tmp2.lower() == 'e':
                        exit(0)
                    elif tmp2.lower() == 'b':
                        break
                    elif tmp2.isdigit():
                        slc = int(tmp2)
                        screenClear()
                        print()
                        print()
                        print()
                        office.showCheckFile(index=slc)
                        print()
                        print()
                        print()
                        input('\tDevam (Continue) << enter >> : ')
            if slc == 2:
                screenClear()
                print()
                print()
                print('\t File name : "{}" '.format(
                    office.getOfficeFileName()))
                print()
                office.showCheckAllFiles()
                print()
                print()
                input('\tDevam (Continue) << enter >> : ')
Beispiel #9
0
def menu1():
    #
    office = sub_menu1()
    if type(office) == type(None):
        return
    #
    if type(office) == type(Office(officeFile='?')):
        while True:
            sub_menu2(fileaname=office.getOfficeFileName())
            print()
            print()
            print('\tGeri (Back) <<b>> , Çıkış (Exit) <<e>>')
            tmp = input('\tSeçim (Selection) : ').strip()
            if tmp.lower() == 'e':
                exit(0)
            elif tmp.lower() == 'b':
                return
            elif tmp.isdigit():
                slc = int(tmp)
                if slc == 1:
                    screenClear()
                    print()
                    print()
                    print('\tFile Name : "{}" '.format(
                        office.getOfficeFileName()))
                    print()
                    print()
                    print('\tBulunan Uzantılar')
                    print('\t------------------')
                    office.showExtensions()
                    print()
                    print()
                    input('\tDevam (Continue) <<enter>> : ').strip()
                elif slc == 2:
                    screenClear()
                    print()
                    print()
                    print('\tFile Name : "{}" '.format(
                        office.getOfficeFileName()))
                    print()
                    office.showExtensionsFiles()
                    print()
                    print()
                    input('\tDevam (Continue) <<enter>> : ').strip()
                elif slc == 3:
                    sub_menu7(office=office)
                elif slc == 4:
                    sub_menu3(office=office)
                elif slc == 5:
                    sub_menu4(office=office)
                elif slc == 6:
                    sub_menu5(office=office)
                elif slc == 7:
                    sub_menu6(office=office)
                elif slc == 8:
                    ext_name = (office.getOfficeObj().file.f1_name.split(
                        sep='.')[-1]).upper()
                    dir_name = office.getOfficeObj(
                    ).current_directory + '\\[' + ext_name + ']_' + office.getOfficeObj(
                    ).file.f1_name
                    screenClear()
                    print()
                    print()
                    print('\tOffice file name   : "' +
                          office.getOfficeObj().file.f3_fullpath + '"')
                    print('\tExtract Directory  : (Default) "' + dir_name +
                          '"')
                    print()
                    print()
                    directory = input(
                        '\tDefault <<enter>> , New Extract Directory : '
                    ).strip()
                    if directory == '':
                        res = office.extractAllFiles()
                    else:
                        res = office.extractAllFiles(directory)
                    if res:
                        print('\tİşlem başarılı. (Operation successful)')
                    print()
                    print()
                    input('\tDevam (Continue) <<enter>> : ').strip()