コード例 #1
0
 def __init__(self, **kwargs):
     self.u = utils.Utils("CPU-Name")
     self.plist_path = None
     self.plist_data = {}
     self.clear_empty = True
     self.detected = self.detect_cores()
     self.cpu_model = self.detect_cpu_model()
コード例 #2
0
ファイル: OCSnapshot.py プロジェクト: corpnewt/OCSnapshot
 def __init__(self):
     self.u = utils.Utils("OC Snapshot")
     self.snapshot_data = {}
     self.safe_path_length = 128  # OC_STORAGE_SAFE_PATH_MAX from Include/Acidanthera/Library/OcStorageLib.h in OpenCorePkg
     if os.path.exists("Scripts/snapshot.plist"):
         try:
             with open("Scripts/snapshot.plist", "rb") as f:
                 self.snapshot_data = plist.load(f)
         except:
             pass
コード例 #3
0
    def __init__(self):
        self.utils = utils.Utils(f"USBToolBox {CURRENT_VERSION}".strip())
        self.controllers = None
        self.json_path = shared.current_dir / Path("usb.json")
        self.settings_path = shared.current_dir / Path("settings.json")

        self.settings = (
            json.load(self.settings_path.open()) if self.settings_path.exists() else {"show_friendly_types": False, "use_native": False, "add_comments_to_map": True, "auto_bind_companions": True}
        )
        self.controllers_historical = json.load(self.json_path.open("r")) if self.json_path.exists() else None

        self.monu()
コード例 #4
0
 def __init__(self):
     self.u = utils.Utils("MakeInstall")
     if not self.u.check_admin():
         # Try to self-elevate
         self.u.elevate(os.path.realpath(__file__))
         exit()
     self.min_plat = 9600
     # Make sure we're on windows
     self.verify_os()
     # Setup initial vars
     self.d = diskwin.Disk()
     self.dl = downloader.Downloader()
     self.r = run.Run()
     self.scripts = "Scripts"
     self.s_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                self.scripts)
     # self.dd_url  = "http://www.chrysocome.net/downloads/ddrelease64.exe"
     self.dd_url = "https://github.com/corpnewt/gibMacOS/files/4573241/ddrelease64.exe.zip"  # Rehost due to download issues
     self.dd_name = ".".join(os.path.basename(self.dd_url).split(
         ".")[:-1])  # Get the name without the last extension
     self.z_json = "https://sourceforge.net/projects/sevenzip/best_release.json"
     self.z_url2 = "https://www.7-zip.org/a/7z1806-x64.msi"
     self.z_url = "https://www.7-zip.org/a/7z[[vers]]-x64.msi"
     self.z_name = "7z.exe"
     self.bi_url = "https://raw.githubusercontent.com/corpnewt/gibMacOS/master/Scripts/BOOTICEx64.exe"
     self.bi_name = "BOOTICEx64.exe"
     self.clover_url = "https://api.github.com/repos/CloverHackyColor/CloverBootloader/releases"
     self.dids_url = "https://api.github.com/repos/dids/clover-builder/releases"
     self.oc_url = "https://api.github.com/repos/acidanthera/OpenCorePkg/releases"
     self.oc_boot = "boot"
     self.oc_boot0 = "boot0"
     self.oc_boot1 = "boot1f32"
     # self.oc_boot_url = "https://github.com/acidanthera/OpenCorePkg/raw/master/Utilities/LegacyBoot/"
     self.oc_boot_url = "https://github.com/acidanthera/OpenCorePkg/raw/870017d0e5d53abeaf0347997da912c3e382a04a/Utilities/LegacyBoot/"
     self.diskpart = os.path.join(os.environ['SYSTEMDRIVE'] + "\\",
                                  "Windows", "System32", "diskpart.exe")
     # From Tim Sutton's brigadier:  https://github.com/timsutton/brigadier/blob/master/brigadier
     self.z_path = None
     self.z_path64 = os.path.join(os.environ['SYSTEMDRIVE'] + "\\",
                                  "Program Files", "7-Zip", "7z.exe")
     self.z_path32 = os.path.join(os.environ['SYSTEMDRIVE'] + "\\",
                                  "Program Files (x86)", "7-Zip", "7z.exe")
     self.recovery_suffixes = ("recoveryhdupdate.pkg",
                               "recoveryhdmetadmg.pkg")
     self.dd_bootsector = True
     self.boot0 = "boot0af"
     self.boot1 = "boot1f32alt"
     self.boot = "boot6"
     self.efi_id = "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"  # EFI
     self.bas_id = "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7"  # Microsoft Basic Data
     self.hfs_id = "48465300-0000-11AA-AA11-00306543ECAC"  # HFS+
     self.rec_id = "426F6F74-0000-11AA-AA11-00306543ECAC"  # Apple Boot partition (Recovery HD)
     self.show_all_disks = False
コード例 #5
0
    def __init__(self):
        self.d = downloader.Downloader()
        self.u = utils.Utils("gibMacOS")
        self.r = run.Run()
        self.min_w = 80
        self.min_h = 24
        if os.name == "nt":
            self.min_w = 120
            self.min_h = 30
        self.resize()

        self.catalog_suffix = {
            "public": "beta",
            "publicrelease": "",
            "customer": "customerseed",
            "developer": "seed"
        }
        self.current_macos = 17  # if > 16, assume X-5, else 10.X
        self.min_macos = 5
        self.print_urls = False
        self.mac_os_names_url = {
            "8": "mountainlion",
            "7": "lion",
            "6": "snowleopard",
            "5": "leopard"
        }
        self.version_names = {
            "tiger": "10.4",
            "leopard": "10.5",
            "snow leopard": "10.6",
            "lion": "10.7",
            "mountain lion": "10.8",
            "mavericks": "10.9",
            "yosemite": "10.10",
            "el capitan": "10.11",
            "sierra": "10.12",
            "high sierra": "10.13",
            "mojave": "10.14",
            "catalina": "10.15",
            "big sur": "11",
            "monterey": "12"
        }
        self.current_catalog = "publicrelease"
        self.catalog_data = None
        self.scripts = "Scripts"
        self.plist = "sucatalog.plist"
        self.saves = "macOS Downloads"
        self.save_local = False
        self.force_local = False
        self.find_recovery = False
        self.recovery_suffixes = ("RecoveryHDUpdate.pkg",
                                  "RecoveryHDMetaDmg.pkg")
コード例 #6
0
 def __init__(self, **kwargs):
     self.dl   = downloader.Downloader()
     self.u    = utils.Utils("SSDT Time")
     self.r    = run.Run()
     self.re   = reveal.Reveal()
     try:
         self.d = dsdt.DSDT()
     except Exception as e:
         print("Something went wrong :( - Aborting!\n - {}".format(e))
         exit(1)
     self.iasl = None
     self.dsdt = None
     self.scripts = "Scripts"
     self.output = "Results"
     self.legacy_irq = ["TMR","TIMR","IPIC","RTC"] # Could add HPET for extra patch-ness, but shouldn't be needed
     self.target_irqs = [0,8,11]
     self.illegal_names = ("XHC1","EHC1","EHC2","PXSX")
コード例 #7
0
ファイル: USBMapInjectorEdit.py プロジェクト: corpnewt/USBMap
 def __init__(self):
     os.chdir(os.path.dirname(os.path.realpath(__file__)))
     self.output = "./Results"
     self.w = 80
     self.h = 24
     if os.name == "nt":
         self.w = 120
         self.h = 30
         os.system("color") # Run this once on Windows to enable ansi colors
     self.u = utils.Utils("USBMap Injector Edit")
     self.plist_path = None
     self.plist_data = None
     self.smbios = self.current_smbios()
     self.cs = u"\u001b[32;1m"
     self.ce = u"\u001b[0m"
     self.bs = u"\u001b[36;1m"
     self.rs = u"\u001b[31;1m"
     self.nm = u"\u001b[35;1m"
コード例 #8
0
 def __init__(self):
     self.u = utils.Utils("MakeInstall")
     self.min_plat = 9600
     # Make sure we're on windows
     self.verify_os()
     # Setup initial vars
     self.d = diskwin.Disk()
     self.dl = downloader.Downloader()
     self.r = run.Run()
     self.scripts = "Scripts"
     self.s_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                self.scripts)
     self.dd_url = "http://www.chrysocome.net/downloads/ddrelease64.exe"
     self.dd_name = os.path.basename(self.dd_url)
     self.z_json = "https://sourceforge.net/projects/sevenzip/best_release.json"
     self.z_url2 = "https://www.7-zip.org/a/7z1806-x64.msi"
     self.z_url = "https://www.7-zip.org/a/7z[[vers]]-x64.msi"
     self.z_name = "7z.exe"
     self.bi_url = "https://raw.githubusercontent.com/corpnewt/gibMacOS/master/Scripts/BOOTICEx64.exe"
     self.bi_name = "BOOTICEx64.exe"
     # self.clover_url = "https://api.github.com/repos/dids/clover-builder/releases/latest"
     # self.clover_url = "https://api.github.com/repos/CloverHackyColor/CloverBootloader/releases/latest"
     self.clover_url = "https://api.github.com/repos/CloverHackyColor/CloverBootloader/releases"
     self.oc_url = "https://api.github.com/repos/Acidanthera/OpenCorePkg/releases"
     # From Tim Sutton's brigadier:  https://github.com/timsutton/brigadier/blob/master/brigadier
     self.z_path = None
     self.z_path64 = os.path.join(os.environ['SYSTEMDRIVE'] + "\\",
                                  "Program Files", "7-Zip", "7z.exe")
     self.z_path32 = os.path.join(os.environ['SYSTEMDRIVE'] + "\\",
                                  "Program Files (x86)", "7-Zip", "7z.exe")
     self.recovery_suffixes = ("recoveryhdupdate.pkg",
                               "recoveryhdmetadmg.pkg")
     self.dd_bootsector = True
     self.boot0 = "boot0af"
     self.boot1 = "boot1f32"
     self.boot = "boot"
     self.oc_boot_loc = "Utilities/BootInstall/boot"
     self.efi_id = "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"  # EFI
     self.bas_id = "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7"  # Microsoft Basic Data
     self.hfs_id = "48465300-0000-11AA-AA11-00306543ECAC"  # HFS+
     self.rec_id = "426F6F74-0000-11AA-AA11-00306543ECAC"  # Apple Boot partition (Recovery HD)
     self.show_all_disks = False
     self.bootloader = ""
コード例 #9
0
ファイル: Mastermind.py プロジェクト: corpnewt/Mastermind
 def __init__(self):
     # Setup colors if on windows
     if os.name == "nt": os.system("color")
     self.u = utils.Utils("Mastermind")
     self.colors = [
         "\u001b[41;1m {} \u001b[0m", # red
         "\u001b[44;1m {} \u001b[0m", # blue
         "\u001b[43;1m {} \u001b[0m", # yellow
         "\u001b[42;1m {} \u001b[0m", # green
         "\u001b[47;1m {} \u001b[0m", # white
         "\u001b[40;1m {} \u001b[0m", # black
     ]
     self.check_colors = [
         "\u001b[47;1m {} \u001b[0m", # white - right color, wrong position
         "\u001b[40;1m {} \u001b[0m", # black - right color, right position
     ]
     self.num_pegs = 4
     self.sequence = []
     self.max_guesses = 0 # 0 = unlimited, anything above sets a max
     self.show_answer = False
コード例 #10
0
 def __init__(self, **kwargs):
     self.r  = run.Run()
     self.d  = disk.Disk()
     self.u  = utils.Utils("HackUpdate")
     # Get the tools we need
     self.script_folder = "Scripts"
     self.settings_file = kwargs.get("settings", None)
     self.skip_building_kexts = False
     self.skip_extracting_kexts = False
     self.skip_opencore = False
     self.skip_plist_compare = False
     cwd = os.getcwd()
     os.chdir(os.path.dirname(os.path.realpath(__file__)))
     if self.settings_file and os.path.exists(self.settings_file):
         self.settings = json.load(open(self.settings_file))
     else:
         self.settings = {
             # Default settings here
             "efi"  : "bootloader", # ask, boot, bootloader, or the mount point/disk#s#
             "disk" : None, # Overrides efi, and is an explicit mount point/identifier (not resolved to EFI)
             "lnf"  : "../Lilu-and-Friends",
             "lnfrun" : "Run.command",
             # "lnf_args" : ["-p", "Default"], # List of customized Lilu and Friends args
             "ke" : "../KextExtractor",
             "kerun" : "KextExtractor.command",
             # "ke_args" : [], # List of customized KextExtractor args
             "oc" : "../OC-Update",
             "ocrun" : "OC-Update.command",
             # "oc_args" : [], # List of customized OC-Update args
             "occ" : "../OCConfigCompare",
             "occrun" : "OCConfigCompare.command",
             # "occ_args" : [], # List of customized OCConfigCompare args
             "occ_unmount": False # Whether we unmount if differences are found or not
         }
     self.c = {
         "r":u"\u001b[31;1m",
         "g":u"\u001b[32;1m",
         "b":u"\u001b[36;1m",
         "c":u"\u001b[0m"
     }
     os.chdir(cwd)
コード例 #11
0
 def __init__(self):
     self.plist = None
     self.dir = None
     self.destination = None
     self.destination_data = None
     self.u = utils.Utils("PatchPorter")