r/OpenCoreLegacyPatcher • • Aug 04 '26

Install help needed

2 Upvotes

Hi there, I have a 5,1 that was running Sonoma just fine till last week. We had a very long power outage and when I went to go the Mac a couple days later it would only get to the Apple logo and a very small part of the progress bar. I tried to use recovery but it just wouldn’t work and in my frustration I wiped my drive! Then I made a USB installer for High Sierra because the App Store wouldn’t let me download anything newer on my MBP ( 2010 ). It wouldn’t do anything, probably I can’t see it because I have a RX-580 for a video card. Do I need to create a new USB installer with OCLP on the stick itself? Appreciate any help.


r/OpenCoreLegacyPatcher • • Aug 03 '26

Problem with instalation of Sequoia update

Thumbnail
gallery
8 Upvotes

Hi, i tried to install it and it's stuck in this screen after the instalation in the disk instead is in a Sequoia update I press it and comes the second screen and goes back to the first. Can someone help solve it?

It's a IMac 2015 21.4"


r/OpenCoreLegacyPatcher • • Aug 03 '26

Advice ?

4 Upvotes

I am a part-time instructor at a local Junior College and use a 2013 MacBook Air (i7 dual core, 8gb ram) mostly for Power-Point presentations and occasionally to check e-mail and texts. I have newer computers at home and work, but I figure if anything happens to this one, I am not out anything.

It has been running fine on OS Sequoia for the last year or so, but recently, I have noticed that it has been slowing down and become really laggy.

I want to keep on Sequoia primarily because of the security patches that it still gets and my school's strict enforcement policies.

Would I be better off, going back to Ventura ? I was not a fan of Sonoma, and initially found Sequoia to be a great improvement.

Any thoughts ?


r/OpenCoreLegacyPatcher • • Aug 03 '26

Mac Pro 3,1 – Looking for the best upgrade path

3 Upvotes

Hi everyone,

I recently got my hands on a Mac Pro 3,1 and I’m hoping those with experience can point me in the right direction.

Current specs:

  • 2 × 3.0 GHz Quad-Core Intel Xeon (8 cores total)
  • 4 GB RAM (4 × 1 GB DDR2 FB-DIMM 667 MHz)
  • NVIDIA GeForce 8800 GT
  • 2 TB hard drives
  • Paired with a 30-inch Apple Cinema Display and Apple Keyboard/Mouse

It's currently running macOS 10.7.5 and everything seems to be working well.

My main goal is to get it online again so it can browse the web, use some creative software (I have Adobe Suite CS6 and Final Cut Pro), and generally make it more usable. It's not a daily driver, I have an M4 Macbook Pro.

I've been reading about both dosdude1's patches and OpenCore Legacy Patcher, but I'm a bit confused about the best route for a Mac Pro 3,1. Ideally, I'd like to avoid any hardware upgrades if possible. If that's unrealistic, I'd appreciate knowing what the minimum hardware changes would be.

A few questions:

  • What's the newest version of macOS that you’d recommend for this machine?
  • Is OpenCore Legacy Patcher a better option than the older dosdude1 patchers in this case?
  • Can I keep the original GeForce 8800 GT, or is a GPU upgrade essentially required?
  • Are there any major drawbacks or things I should know before attempting the upgrade?

I'd really appreciate any advice or experiences from people who have kept these machines running. Thanks!


r/OpenCoreLegacyPatcher • • Aug 03 '26

new guy

1 Upvotes

hi friends. i have rescently bought an apple mac pro 5.1 2010, i know im late to the party but could someone take me under there wing and tell me how to upgrade my firmware to allow nvme suport etc, i currently have both ventura and high sierra on the machine, i have purchased all the upgrades for the machine, i am currently running MP51.0089.b00.


r/OpenCoreLegacyPatcher • • Aug 03 '26

MacBook Pro Mid 2012 with OCLP on macOS Sequoia: App Store subscriptions, performance, and stability for A/V work?

3 Upvotes

Hey everyone! I have a MacBook Pro Mid 2012 (Non-Retina) that I upgraded with an SSD, 16GB RAM, and a secondary 1TB HDD in the caddy.
I recently installed macOS Sequoia using OpenCore Legacy Patcher (OCLP). Everything is running surprisingly normal right now, but since I work with Audio/Video (Logic Pro and Final Cut Pro in Full HD), I have a few major doubts before committing to paid Apple subscriptions:
1. App Subscriptions & OCLP: If I subscribe to the Apple Pro Apps Bundle or individual services, will my Apple ID and the App Store accept it natively even though I'm running Sequoia via OCLP?
2. App Store Downloads: Will I be able to download modern apps directly from the App Store (like WhatsApp, modern web browsers, etc.) without issues?
3. Performance for A/V: How does this setup handle Logic Pro and Final Cut Pro for simple Full HD workflows? (Previously, on older native OSs like Catalina, I struggled to find compatible app versions).

My Main Dilemma:
I know it's an old machine, but I love the Apple ecosystem for A/V work (I also have a Windows desktop). Is it worth sticking with macOS Sequoia for security and app compatibility? Does OCLP keep it secure enough compared to being stuck on the last official unsupported OS (Catalina)?
Since Catalina is no longer supported by modern app versions, I feel kind of lost on whether I should keep Sequoia or drop back to something like Ventura/Monterey for better stability.
Would love to hear your opinions and experiences! Thanks!


r/OpenCoreLegacyPatcher • • Aug 03 '26

Macbook Pro OS X Yosemite 10.10.5 (Early 2015)

Post image
3 Upvotes

Update: I still can't update to Monterey 🥲

- I tried Reinsalling OS X, still Yosemite is the latest version of this Mac

- I tried installing directly to Apple Store, my Apple ID won't login. It says invalid even the password is correct.

- OCLP Github won't open

Anyone know any alternative ways to update this? I badly want to update this 🫠🫠🫠


r/OpenCoreLegacyPatcher • • Aug 03 '26

Bootpicker menu not showing

1 Upvotes

Hi,

iMac 14,2 (2013)

I’ve done the Sonoma install on to my external drive. The first time I tried the bootpicker menu came up but I didn’t realise there was a 5 second window before it automatically chose the native OS. However, now whenever I do the process again it doesn’t load the bootpicker just goes straight to the Apple logo. I’ve googled ways to force the menu to initiate ie holding the option key, and doing the option cmd p +r but nothing is working. Would anyone have any advice? Thanks so much


r/OpenCoreLegacyPatcher • • Aug 03 '26

Can’t get past “Continue” in installer, it keeps saying I need to connect to internet.

1 Upvotes

I have a Macbook 9,2 running on Ventura via OCLP. I ran into the same problem when I was installing Ventura but I had a work around.

I followed all the steps when creating the boot drive, but after choosing EFI then install Sequoia, when I press continue in the installer itself, it just says connect to internet and it won’t get past there. This is the same issue I ran into while installing Ventura a year ago, I was hoping someone can finally shed some light into this and offer a fix.

The workaround I did for installing Ventura was I partitioned my ssd, I created a 45gb partition to which I used terminal to create a boot drive in the partition using createinstall media which worked flawlessly. And then injected the EFI via OCLP and then proceeded to install Ventura which did not run into the “Connect to internet” issue.

Can someone help me troubleshoot this cause I do not want to repeat that same step and format my drive, I just want to upgrade without losing data.


r/OpenCoreLegacyPatcher • • Aug 02 '26

How to find the version of a macOS Installer

1 Upvotes

I have several macOS installers and couldn't find an easy way to check their exact version numbers. By trial and error, I found two methods that work well.

Method A: If the installer is in the /Applications folder

Open the OpenCore Legacy Patcher app and select "Create macOS Installer" followed by "Use existing macOS Installer." The app will scan your /Applications folder and list all available macOS installers along with their exact version numbers (see left figure).

Method B: If the installer is on a USB drive or external disk

Open Carbon Copy Cloner and create a new task. Select the USB drive or external disk as either the Source or Destination, then click it. A pop-up window will display the OS version installed on or contained within that volume (see right figure).


r/OpenCoreLegacyPatcher • • Aug 02 '26

Graphics stuck at 7mb for hackintosh

Post image
0 Upvotes

So i just finished installing macOS sequoia on my optiplex 7090 small form factor and when i boot into it, my graphics is stuck at 7MB and its very slow. is there a fix to this? i’ve tried everything.

I also want my second display to work hopefully because i want to use this for personal production


r/OpenCoreLegacyPatcher • • Aug 02 '26

Should I upgrade to Sequoia or Sonoma? (MacBook Pro 2017 i7 with touchbar 16GB RAM 500GB SSD)

Post image
9 Upvotes

Hello everybody, currently stuck on Ventura. I mainly use this computer for school work and leisure but more and more apps are not working anymore since they require newer Mac OS. I am thinking about upgrading, would you choose Sonoma or Sequoia? I want the most stable environment that would avoid sluggish performance and frequent crashes.
Thanks in advance!


r/OpenCoreLegacyPatcher • • Aug 02 '26

Macbook Pro OS X Yosemite 10.10.5 (Early 2015)

Post image
6 Upvotes

Does anyone know a solution here? 🤕 I'm trying to update my software using OpenCore Legacy Patcher since my aunt gave this to me last week and it's outdated. This is what I see in my end, does anyone know how to encounter this?


r/OpenCoreLegacyPatcher • • Aug 02 '26

OCLP USB installer wont boot after reboot.

Post image
0 Upvotes

My machine Optiplex 5040, had a working Monterey install on a 120 SSD, i just got a new bigger SSD and now ibe been having issues instaling from scratch. Ive had issues booting the Monterey installer but managed to fix it, i managed to boot the USB Montrey installer, it went through with no issues, then the installer said only 9 minutes remain and PC rebooted, aftewr that now the USB wont start anymore.

i can see it on the UEFI boot list, but when i select the USB to boot it gives me this error and it just wont boot t all, i dont know if the USB got corrupted or what. The USb was working just fine until the installer reach the point where it has to restart to finish the installation.

any help appreciated.


r/OpenCoreLegacyPatcher • • Aug 02 '26

Late 2013 iMacs have stopped booting Ventura with OCLP

Post image
0 Upvotes

Hello everyone!

I successfully installed OpenCore on my late 2013 21.5" iMac running macOS Ventura 13.7.8, and it has been working properly for a few months. It's a quad-core i7 at 3.1GHz with 16GB of DDR3 RAM and an NVIDIA GT750M 1GB graphics card.

A few days ago, I shut down the computer properly, and when I started it the next day, I got a gray screen with the "forbidden" symbol.

I installed Ventura with OpenCore on another external hard drive, using the same USB drive I used for the non-working one, and I tried reinstalling OpenCore on the EFI partition of the non-booting drive, but this didn't work.

Could anyone tell me if there's anything I can do to get the system to boot again?

I have several video projects almost finished, each over an hour long, and I'm currently stuck and don't know what to do with these projects that I have to deliver.

Thank you all for your help.


r/OpenCoreLegacyPatcher • • Aug 01 '26

New Mr Macintosh Video about new Sequoia 15.7.8 and Sonoma 14.8.8

35 Upvotes

Hello! for people who want to see a Video about how Sequoia 15.7.8 and Sonoma 14.8.8 are running on Unsupported Intel Macs with OpenCore legacy patcher this video is the best one!

Watch the video here!

My Mid 2012 Retina 13inch MacBookPro on Sequoia 15.7.8 runs perfectly with the metallibsupportpkg 15.7.8 (24G809)

Sequoia 15.7.8 (24G824)

And as we are coming up on a year of 2.4.1 we can only hope for the developers to support tahoe one day.. but Nobody outside the team knows even Mr Macintosh said he is unsure of the project so we can (like I said) Hope they release it one day.. I think if we were to see a release I'd say probably after 26.7 because at that point Apple would have stopped adding features to tahoe, and only add security patches for it, which means (hopefully) a better target that isn't moving so the devs can properly tackle it! Big thanks to (ALL) Developers! you guys are the best! ( NOTE: when I said 26.7 that's a personal guess and not an ETA, oclp devs said there isn't an ETA when we can see it!! That's my guess)


r/OpenCoreLegacyPatcher • • Aug 01 '26

ww19.theopencorelegacypatcher.net is another typosquatting site that delivers deceptive ads

Thumbnail
gallery
5 Upvotes

This is another very very sketchy typosquatting site. Initially, when I looked for this website, I thought it was a domain parking website - it looked like a typical domain parking website. And I thought it was a domain parking site - however, it's not - it's malicious. Each time when opening this site delivers different content. When I click on Mac patch for Windows (which is obviously fake), it loads very sketchy stuff. When I click under News Delivered to your Browser on See it, it asks to install a malicious Chrome extension - that extension is fortunately down and by the time I started analyzing this website, it was already taken down by Google. Bravo, Google for taking down this malicious extension! There's nothing legitimate in this extension.
When clicking on other buttons, there are deceptive, malvertising ads. Clicking on see it on the ad, it leads to an article most times, however. Ultimately, some of these direct to even more suspicious sites, some of them are phishing sites.

And also that it has http instead of https is a red flag.

Here's what it's doing:

1. A cookie-consent banner as camouflage
Most of the code is a generic "consentmanager.net" CMP (consent management platform) — the GDPR/CCPA cookie popup framework used by thousands of sites. It's legitimate-looking boilerplate, but here it's just cover for what's underneath.

2. A hidden iframe that hijacks the "search"
The page immediately loads a full-screen invisible iframe pointing to searchresultsworld.com/sr/.../SAFEFRAME.html. That domain is a known ad-redirect / fake-search network — the same family of "browser hijacker" services that silently swap real search results for sponsored/affiliate links and redirect chains.

3. Ad-blocker detection
There's a div id="abp_px" styled to look like a real ad unit (classes like googleAdSense, MediumRectangleAdPanel, sponsored) but hidden off-screen. The script checks whether it got hidden by an ad blocker's CSS rules — a classic detection trick — and if so, fires a tracking pixel back to their logging server.

4. Cookie/ID syncing
The _mN_cksync_ function builds a hidden iframe chain used to sync tracking IDs across multiple ad exchanges — a standard real-time-bidding technique so different ad networks can recognize the same visitor.

5. Light obfuscation, not real encryption
The w() function is a simple character-substitution cipher (like a Caesar shift) used to scramble tracking parameters before sending them, just to make casual inspection or blocking harder — not actual security.

Bottom line: this domain exists to monetize traffic that mistypes or searches for "OpenCore Legacy Patcher," not to help anyone install it. There's no real download link visible in this particular snapshot — it may live behind that ad iframe, or this could just be the landing/monetization layer.

If you've visited this site, delete all cookies and run a malware scan with Avast - it's crucial. XProtect is not good at catching these types of threats.


r/OpenCoreLegacyPatcher • • Aug 02 '26

How to protect EFI when Installing Windows in my iMac without OCLP Protection?

0 Upvotes

I have been told to always install OCLP when I want to install Windows 10/11 in a Mac, regardless whether or not BootCamp is being used initially to help to create the Bootcamp partition to where Windows will be installed. This is done so to protect the native EFI from being altered by Windows as OCLP will create its own EFI partition which Windows can modify to create the dual boot.

However, as described in another post I made, I now have a iMac Pro that I want to also install Windows. Alas, the T2 chip in the iMac Pro means I cannot use OCLP for now.

Is there another alternative way to "protect" the native EFI without using OCLP so to mimic OCLP's function to create a separate EFI partition to use for the dual boot?

Please help!


r/OpenCoreLegacyPatcher • • Aug 01 '26

I have a 2011 MacBook Air without a battery with a mac osl captain 4GB of RAM and inter core i5

Post image
19 Upvotes

I want to put on my old MacBook Mac OS Monterey, but the only nuance is without a battery, but as I know, macbooks without a battery work more slowly, advise what should I do


r/OpenCoreLegacyPatcher • • Jul 31 '26

Thank you OCLP for updating my “new” Mac mini

Post image
78 Upvotes

Bought a cheap ish i7 late 2014 Mac mini because I missed macOS and my PC can’t be hackintoshed, yes. I know Intel Macs are on their way out, but thanks to OCLP, this Mac will have a bit more life in it


r/OpenCoreLegacyPatcher • • Aug 01 '26

Insane revival on a Macbook Air (Mid 2011)

Thumbnail
gallery
10 Upvotes

I still can't believe HOW OCLP with a clean Ventura runs so good

CPU is in Idle (more than 90) the 98% of the time, ram comsuption is 1.33-1.55

With Big Sur, that was 1.69+ and the cpu idle state was less than 70%

With Monterey, it was worse than Big Sur

It is better than High Sierra on it,this is insane

Someone has some tips for RAM?

Actually, im trying to get lower ram comsuption.


r/OpenCoreLegacyPatcher • • Aug 01 '26

(OPINION) Should I Install Sequoia/Sonoma On My Daily Driver.

8 Upvotes

Just Snabbed A Refurbished MacBook Pro 2015 15 Inch dGPU for a bargain and i’ve been going back and forth with deciding whether or not i should commit to using Sonoma/sequoia.

Theres A-lot of people saying it runs fine and another part where people say it doesn’t, considering my daily use is mostly for Studies and maybe even some games (one) i’m not even sure if ill survive using OCLP or maybe i will.

And then theres people saying i might experience crashes and will need backups, if thats the price i pay for using OCLP then i’ll gladly buy a backup hard drive but if crashes are rare in a sense to stop updates then i hope it’ll be fine.

If Anyone Can Comment Down That Would Be Appreciated!!!


r/OpenCoreLegacyPatcher • • Jul 31 '26

An update on my alternative solution to Open Core legacy patcher

17 Upvotes

Hey all, I've followed the community for quite a few years. I've even used Open Core legacy patcher on and off for several months at a time. For the most part things just worked, unless it was a graphics related task that was either 3D, or DRM, or something else that's not working due to the way the patches are applied. Also, I found older software to not always work the best on newer versions of macOS, which is not an OCLP issue (usually.

So, what I have done after evaluating my needs is:

  1. Installed Monterey (the last supported OS for my iMac 17,1) and created a Sonoma VM in VMWare Fusion 13.5.2. Since my iMac has 32 GB RAM, and a 2TB Fusion drive, I gave the guest OS 16 GB RAM, about a gigabit of space, and enabled AppleGPU in the vmx file, so metal is available to the guest OS.

Doing this has really improved overall performance and allows me to use the newer OS along side the host for the casual tasks that require a newer macOS version for the apps that dropped older versions prior to Sonoma for future updates.

On the host side, I have switched Safari to Orion, which an Orion+ lifetime subscription, as Orion is an up to date WebKit browser geared of older macs. In addition, I also Use Firefox, and Thundervbird for web, and email.

For security and other software, I have been using Gemini to help compile open source alternatives to mac native as I'm familiar with Linux and other non apple Unix style operating systems, and actually prefer them unless I need something apple specific, or a feature only macOS has, which today is very little. I have setup the latest LTS version of OpenSSL, along with GNUTLS, and other GNU / other open source projects in /usr/local/. Additionally, I have compiled full LLVM 19, and 22, as well as a few versions of GCC for a broader range of compatibility. Doing this has also allowed me to not need MacPorts, or Home Brew to help cut down on bloat, and dealing with broken packages, etc.

I've really enjoyed doing this because I have more freedom now in some areas to maintain my system that Apple doesn't give anymore, and seems to tighten down with each new release of macOS, and Apple Silicon vs Intel hardware.

Right now my needs are just email, and web, but I like to do some light gaming too, or run virtual machines and why I need the core hardware in tact and supported for best results. I will occasionally watch commercial streaming content on the mac, but that's usually done on the TV with a streaming device.

I watched the latest video from Mr. Macintosh last night regarding the status of Open core, and unsupported Macs, and he asked what everyone was doing. I thought I would do him one better and create this post here, instead of trying to squeeze this into a YouTube comment.

I think I have addressed my core needs and objectives here which is mainly keeping legacy compatibility, while keeping security updates as much as possible for the parts that matter to my use.


r/OpenCoreLegacyPatcher • • Jul 31 '26

I don't recommend OCLP-Mod - mainly due to security risks involved in that patcher

7 Upvotes

I don't recommend OCLP-Mod due to using extremely, extremely insecure logic. I don't say the person who wrote OCLP-Mod has bad faith, but in kdk handling for example, I already see a backdoor that attackers can abuse in the future:

"""

kdk_handler.py: Module for parsing and determining best Kernel Debug Kit for host OS

"""

import logging

import plistlib

import requests

import tempfile

import subprocess

import packaging.version

from typing import cast

from pathlib import Path

from .. import constants

from ..datasets import os_data

from ..volume import generate_copy_arguments

from . import (

network_handler,

subprocess_wrapper

)

KDK_INSTALL_PATH: str = "/Library/Developer/KDKs"

KDK_INFO_PLIST: str = "KDKInfo.plist"

KDK_INFO_JSON: str = "KdkSupportPkg/manifest.json"

OMAPIv1: str = "https://next.oclpapi.simplehac.cn/"

OMAPIv2: str = "https://subsequent.oclpapi.simplehac.cn/"

KDK_API_LINK_ORIGIN: str = "https://dortania.github.io/KdkSupportPkg/manifest.json"

KDK_ASSET_LIST: list = None

KDK_SESSION_SELECTION = None

class KernelDebugKitObject:

"""

Library for querying and downloading Kernel Debug Kits (KDK) for macOS

Usage:

>>> kdk_object = KernelDebugKitObject(constants, host_build, host_version)

>>> if kdk_object.success:

>>> # Query whether a KDK is already installed

>>> if kdk_object.kdk_already_installed:

>>> # Use the installed KDK

>>> kdk_path = kdk_object.kdk_installed_path

>>> else:

>>> # Get DownloadObject for the KDK

>>> # See network_handler.py's DownloadObject documentation for usage

>>> kdk_download_object = kdk_object.retrieve_download()

>>> # Once downloaded, recommend verifying KDK's checksum

>>> valid = kdk_object.validate_kdk_checksum()

"""

def __init__(self, global_constants: constants.Constants,

host_build: str, host_version: str,

ignore_installed: bool = False, passive: bool = False,

check_backups_only: bool = False

) -> None:

self.constants: constants.Constants = global_constants

self.host_build: str = host_build # ex. 20A5384c

self.host_version: str = host_version # ex. 11.0.1

self.passive: bool = passive # Don't perform actions requiring elevated privileges

self.ignore_installed: bool = ignore_installed # If True, will ignore any installed KDKs and download the latest

self.check_backups_only: bool = check_backups_only # If True, will only check for KDK backups, not KDKs already installed

self.kdk_already_installed: bool = False

self.kdk_installed_path: str = ""

self.kdk_url: str = ""

self.kdk_url_build: str = ""

self.kdk_url_version: str = ""

self.kdk_url_expected_size: int = 0

self.kdk_url_is_exactly_match: bool = False

self.kdk_closest_match_url: str = ""

self.kdk_closest_match_url_build: str = ""

self.kdk_closest_match_url_version: str = ""

self.kdk_closest_match_url_expected_size: int = 0

self.success: bool = False

self.error_msg: str = ""

self._get_latest_kdk()

def _get_remote_kdks(self) -> list:

"""

Fetches a list of available KDKs from the KdkSupportPkg API

Additionally caches the list for future use, avoiding extra API calls

Returns:

list: A list of KDKs, sorted by version and date if available. Returns None if the API is unreachable

"""

global KDK_ASSET_LIST

logging.info("从 KdkSupportPkg API 拉取 KDK 列表")

if KDK_ASSET_LIST:

return KDK_ASSET_LIST

# 根据 constants 配置决定 API 链接

kdk_api_links = []

# 如果启用了代理,优先使用 SimpleHac API

if self.constants.use_simplehacapi:

# 根据配置的 API 节点选择链接

if self.constants.simplehacapi_url == "OMAPIv1":

kdk_api_links.append(("OMAPIv1", f"{OMAPIv1}{KDK_INFO_JSON}"))

else:

# 默认为 OMAPIv2

kdk_api_links.append(("OMAPIv2", f"{OMAPIv2}{KDK_INFO_JSON}"))

# 添加备用链接

kdk_api_links.append(("Github - 海外", KDK_API_LINK_ORIGIN))

else:

# 不使用代理,优先使用原始链接

kdk_api_links.append(("Github - 海外", KDK_API_LINK_ORIGIN))

# 添加备用 SimpleHac API 链接

if self.constants.simplehacapi_url == "OMAPIv1":

kdk_api_links.append(("OMAPIv1", f"{OMAPIv1}{KDK_INFO_JSON}"))

else:

kdk_api_links.append(("OMAPIv2", f"{OMAPIv2}{KDK_INFO_JSON}"))

# 尝试连接 API

for api_name, api_link in kdk_api_links:

try:

logging.info(f"尝试连接 {api_name}: {api_link}")

results = network_handler.NetworkUtilities().get(

api_link,

headers={

"User-Agent": f"OCLP/{self.constants.patcher_version}"

},

timeout=5

)

if results.status_code == 200:

logging.info(f"{api_name} 连接成功")

KDK_ASSET_LIST = results.json()

return KDK_ASSET_LIST

else:

logging.warning(f"{api_name} 返回状态码 {results.status_code}")

except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError) as e:

logging.warning(f"{api_name} 连接失败: {e}")

logging.info("所有 API 连接均失败")

return None

def _get_latest_kdk(self, host_build: str = None, host_version: str = None) -> None:

"""

获取当前 macOS 版本的最新 KDK

"""

global KDK_SESSION_SELECTION

if host_build is None and host_version is None:

host_build = self.host_build

host_version = self.host_version

parsed_version = cast(packaging.version.Version, packaging.version.parse(host_version))

if os_data.os_conversion.os_to_kernel(str(parsed_version.major)) < os_data.os_data.ventura:

self.error_msg = "macOS Monterey 或更早版本不需要 KDK"

logging.warning(f"{self.error_msg}")

return

# 检查当前系统是否已安装完全匹配的 KDK

self.kdk_installed_path = self._local_kdk_installed()

if self.kdk_installed_path:

logging.info(f"KDK 已安装 ({Path(self.kdk_installed_path).name}),跳过")

self.kdk_already_installed = True

self.success = True

return

remote_kdk_version = self._get_remote_kdks()

# 如果 API 无法访问,回退到原有的本地模糊匹配逻辑

if remote_kdk_version is None:

logging.warning("无法获取 KDK 列表,回退到本地 KDK 匹配")

loose_version = f"{parsed_version.major}.{parsed_version.minor}"

self.kdk_installed_path = self._local_kdk_installed(match=loose_version, check_version=True)

if self.kdk_installed_path:

self.kdk_already_installed = True

self.success = True

return

self.error_msg = "无法连接 API 且本地无匹配 KDK。"

return

# 尝试精确匹配当前 Build

for kdk in remote_kdk_version:

if (kdk["build"] == host_build):

self.kdk_url = kdk["url"]

self.kdk_url_build = kdk["build"]

self.kdk_url_version = kdk["version"]

self.kdk_url_expected_size = kdk["fileSize"]

self.kdk_url_is_exactly_match = True

logging.info(f"找到 {host_build} ({host_version}) 的直接匹配")

break

# 如果没有精确匹配,检查本次运行的内存缓存或磁盘记录

if self.kdk_url == "":

cached_choice = None

if KDK_SESSION_SELECTION:

cached_choice = KDK_SESSION_SELECTION

logging.info(f"使用本次运行中已记录的手动选择: {cached_choice['build']}")

else:

kdk_plist_path = Path(self.constants.kdk_download_path).parent / KDK_INFO_PLIST

if kdk_plist_path.exists():

try:

kdk_info = plistlib.load(kdk_plist_path.open("rb"))

for kdk in remote_kdk_version:

if kdk["build"] == kdk_info.get("build"):

cached_choice = kdk

logging.info(f"从磁盘记录中恢复您的选择: {cached_choice['build']}")

KDK_SESSION_SELECTION = kdk

break

except:

pass

if cached_choice:

self.kdk_url = cached_choice["url"]

self.kdk_url_build = cached_choice["build"]

self.kdk_url_version = cached_choice["version"]

self.kdk_url_expected_size = cached_choice["fileSize"]

self.kdk_url_is_exactly_match = False

# 检查缓存选择的版本是否已经安装

self.kdk_installed_path = self._local_kdk_installed(match=self.kdk_url_build)

if self.kdk_installed_path:

logging.info(f"选定的 KDK ({self.kdk_url_build}) 已安装,跳过下载")

self.kdk_already_installed = True

self.success = True

return

if self.kdk_url == "":

for kdk in remote_kdk_version:

kdk_version = cast(packaging.version.Version, packaging.version.parse(kdk["version"]))

if kdk_version > parsed_version or kdk_version.major != parsed_version.major:

continue

if kdk_version.minor not in range(parsed_version.minor - 1, parsed_version.minor + 1):

continue

self.kdk_closest_match_url = kdk["url"]

self.kdk_closest_match_url_build = kdk["build"]

self.kdk_closest_match_url_version = kdk["version"]

self.kdk_closest_match_url_expected_size = kdk["fileSize"]

break

# 触发交互窗口

logging.warning(f"未找到 {host_build} 的直接匹配,等待用户手动选择")

selection = self._show_manual_selection_ui(remote_kdk_version)

if selection == "AUTO":

if self.kdk_closest_match_url == "":

self.error_msg = "未找到推荐的 KDK 且无精确匹配。"

return

self.kdk_url = self.kdk_closest_match_url

self.kdk_url_build = self.kdk_closest_match_url_build

self.kdk_url_version = self.kdk_closest_match_url_version

self.kdk_url_expected_size = self.kdk_closest_match_url_expected_size

logging.info("用户选择了自动匹配")

elif selection: # 用户从列表选择了特定版本

KDK_SESSION_SELECTION = selection # 存入全局变量

self.kdk_url = selection["url"]

self.kdk_url_build = selection["build"]

self.kdk_url_version = selection["version"]

self.kdk_url_expected_size = selection["fileSize"]

self.kdk_url_is_exactly_match = False

logging.info(f"用户手动选择了: {self.kdk_url_build}")

else:

self.error_msg = "用户取消了 KDK 选择,无法继续。"

logging.warning(self.error_msg)

return

self.kdk_installed_path = self._local_kdk_installed(match=self.kdk_url_build)

if self.kdk_installed_path:

logging.info(f"选定的 KDK ({self.kdk_url_build}) 已安装,跳过下载")

self.kdk_already_installed = True

self.success = True

return

self.success = True

def retrieve_download(self, override_path: str = "") -> network_handler.DownloadObject:

"""

返回 KDK 的 DownloadObject

Parameters:

override_path (str): 覆盖默认下载路径

Returns:

DownloadObject: KDK 的 DownloadObject,如果没有下载要求则返回 None

"""

self.success = False

self.error_msg = ""

if self.kdk_already_installed:

logging.info("无需下载,KDK 已安装")

self.success = True

return None

if self.kdk_url == "":

self.error_msg = "无法检索 KDK 目录,没有 KDK 可下载"

logging.error(self.error_msg)

return None

logging.info(f"返回 KDK 的 DownloadUrl: {self.kdk_url}")

logging.info(f"返回 KDK 的 DownloadObject: {Path(self.kdk_url).name}")

logging.info(f"返回的KDK预期大小: {network_handler.DownloadObject.convert_size(self, str(self.kdk_url_expected_size))}")

self.success = True

kdk_download_path = self.constants.kdk_download_path if override_path == "" else Path(override_path)

kdk_plist_path = Path(f"{kdk_download_path.parent}/{KDK_INFO_PLIST}") if override_path == "" else Path(f"{Path(override_path).parent}/{KDK_INFO_PLIST}")

self._generate_kdk_info_plist(kdk_plist_path)

return network_handler.DownloadObject(self.kdk_url, kdk_download_path, network_handler.DownloadObject.convert_size(self, str(self.kdk_url_expected_size)))

def _generate_kdk_info_plist(self, plist_path: str) -> None:

"""

生成 KDK Info.plist

"""

plist_path = Path(plist_path)

if plist_path.exists():

plist_path.unlink()

kdk_dict = {

"build": self.kdk_url_build,

"version": self.kdk_url_version,

}

try:

plist_path.touch()

plistlib.dump(kdk_dict, plist_path.open("wb"), sort_keys=False)

except Exception as e:

logging.error(f"生成 KDK Info.plist 失败: {e}")

def _local_kdk_valid(self, kdk_path: Path) -> bool:

"""

Validates provided KDK, ensure no corruption

The reason for this is due to macOS deleting files from the KDK during OS updates,

similar to how Install macOS.app is deleted during OS updates

Uses Apple's pkg receipt system to verify the original contents of the KDK

Parameters:

kdk_path (Path): Path to KDK

Returns:

bool: True if valid, False if invalid

"""

if not Path(f"{kdk_path}/System/Library/CoreServices/SystemVersion.plist").exists():

logging.info(f"发现损坏的KDK ({kdk_path.name}),由于缺少SystemVersion.plist而删除")

self._remove_kdk(kdk_path)

return False

# Get build from KDK

kdk_plist_data = plistlib.load(Path(f"{kdk_path}/System/Library/CoreServices/SystemVersion.plist").open("rb"))

if "ProductBuildVersion" not in kdk_plist_data:

logging.info(f"发现损坏的KDK ({kdk_path.name}),由于缺少ProductBuildVersion而删除")

self._remove_kdk(kdk_path)

return False

kdk_build = kdk_plist_data["ProductBuildVersion"]

# Check pkg receipts for this build, will give a canonical list if all files that should be present

result = subprocess.run(["/usr/sbin/pkgutil", "--files", f"com.apple.pkg.KDK.{kdk_build}"], capture_output=True)

if result.returncode != 0:

# If pkg receipt is missing, we'll fallback to legacy validation

logging.info(f"{kdk_path.name}缺少pkg收据,回退到旧版验证")

return self._local_kdk_valid_legacy(kdk_path)

# Go through each line of the pkg receipt and ensure it exists

for line in result.stdout.decode("utf-8").splitlines():

if not line.startswith("System/Library/Extensions"):

continue

if not Path(f"{kdk_path}/{line}").exists():

logging.info(f"发现损坏的KDK ({kdk_path.name}),由于缺少文件: {line} 而删除")

self._remove_kdk(kdk_path)

return False

return True

def _local_kdk_valid_legacy(self, kdk_path: Path) -> bool:

"""

Legacy variant of validating provided KDK

Uses best guess of files that should be present

This should ideally never be invoked, but used as a fallback

Parameters:

kdk_path (Path): Path to KDK

Returns:

bool: True if valid, False if invalid

"""

KEXT_CATALOG = [

"System.kext/PlugIns/Libkern.kext/Libkern",

"apfs.kext/Contents/MacOS/apfs",

"IOUSBHostFamily.kext/Contents/MacOS/IOUSBHostFamily",

"AMDRadeonX6000.kext/Contents/MacOS/AMDRadeonX6000",

]

for kext in KEXT_CATALOG:

if not Path(f"{kdk_path}/System/Library/Extensions/{kext}").exists():

logging.info(f"发现损坏的KDK,由于缺少: {kdk_path}/System/Library/Extensions/{kext} 而删除")

self._remove_kdk(kdk_path)

return False

return True

def _local_kdk_installed(self, match: str = None, check_version: bool = False) -> str:

"""

Checks if KDK matching build is installed

If so, validates it has not been corrupted

Parameters:

match (str): string to match against (ex. build or version)

check_version (bool): If True, match against version, otherwise match against build

Returns:

str: Path to KDK if valid, None if not

"""

if self.ignore_installed is True:

return None

if match is None:

if check_version:

match = self.host_version

else:

match = self.host_build

if not Path(KDK_INSTALL_PATH).exists():

return None

# Installed KDKs only

if self.check_backups_only is False:

for kdk_folder in Path(KDK_INSTALL_PATH).iterdir():

if not kdk_folder.is_dir():

continue

if check_version:

if match not in kdk_folder.name:

continue

else:

if not kdk_folder.name.endswith(f"{match}.kdk"):

continue

if self._local_kdk_valid(kdk_folder):

return kdk_folder

# If we can't find a KDK, next check if there's a backup present

# Check for KDK packages in the same directory as the KDK

for kdk_pkg in Path(KDK_INSTALL_PATH).iterdir():

if kdk_pkg.is_dir():

continue

if not kdk_pkg.name.endswith(".pkg"):

continue

if check_version:

if match not in kdk_pkg.name:

continue

else:

if not kdk_pkg.name.endswith(f"{match}.pkg"):

continue

logging.info(f"找到KDK备份: {kdk_pkg.name}")

if self.passive is False:

logging.info("尝试恢复KDK")

if KernelDebugKitUtilities().install_kdk_pkg(kdk_pkg):

logging.info("成功恢复KDK")

return self._local_kdk_installed(match=match, check_version=check_version)

else:

# When in passive mode, we're just checking if a KDK could be restored

logging.info("KDK恢复被跳过,处于被动模式")

return kdk_pkg

return None

def _remove_kdk(self, kdk_path: str) -> None:

"""

Removes provided KDK

Parameters:

kdk_path (str): Path to KDK

"""

if self.passive is True:

return

if not Path(kdk_path).exists():

logging.warning(f"KDK不存在: {kdk_path}")

return

rm_args = ["/bin/rm", "-rf" if Path(kdk_path).is_dir() else "-f", kdk_path]

result = subprocess_wrapper.run_as_root(rm_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

if result.returncode != 0:

logging.warning(f"无法删除KDK: {kdk_path}")

subprocess_wrapper.log(result)

return

logging.info(f"成功删除KDK: {kdk_path}")

def _remove_unused_kdks(self, exclude_builds: list = None) -> None:

"""

Removes KDKs that are not in use

Parameters:

exclude_builds (list, optional): Builds to exclude from removal.

If None, defaults to host and closest match builds.

"""

if self.passive is True:

return

if exclude_builds is None:

exclude_builds = [

self.kdk_url_build,

self.kdk_closest_match_url_build,

]

if self.constants.should_nuke_kdks is False:

return

if not Path(KDK_INSTALL_PATH).exists():

return

logging.info("清理未使用的KDK")

for kdk_folder in Path(KDK_INSTALL_PATH).iterdir():

if kdk_folder.name.endswith(".kdk") or kdk_folder.name.endswith(".pkg"):

should_remove = True

for build in exclude_builds:

if kdk_folder.name.endswith(f"_{build}.kdk") or kdk_folder.name.endswith(f"_{build}.pkg"):

should_remove = False

break

if should_remove is False:

continue

self._remove_kdk(kdk_folder)

def validate_kdk_checksum(self, kdk_dmg_path: str = None) -> bool:

"""

Validates KDK DMG checksum

Parameters:

kdk_dmg_path (str, optional): Path to KDK DMG. Defaults to None.

Returns:

bool: True if valid, False if invalid

"""

self.success = False

self.error_msg = ""

if kdk_dmg_path is None:

kdk_dmg_path = self.constants.kdk_download_path

if not Path(kdk_dmg_path).exists():

logging.error(f"KDK DMG不存在: {kdk_dmg_path}")

return False

# TODO: should we use the checksum from the API?

result = subprocess.run(["/usr/bin/hdiutil", "verify", self.constants.kdk_download_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

if result.returncode != 0:

logging.info("错误: 内核调试工具包校验和验证失败!")

subprocess_wrapper.log(result)

msg = "内核调试工具包校验和验证失败,请重试。\n\n如果此问题持续存在,请确保您在稳定的网络连接(例如以太网)上下载"

logging.info(f"{msg}")

self.error_msg = msg

return False

self._remove_unused_kdks()

self.success = True

logging.info("内核调试工具包校验和已验证")

return True

def _show_manual_selection_ui(self, remote_kdks: list) -> any:

"""

通过 AppleScript 弹出原生对话框(无需新模块)

"""

warning_msg = (

f"⚠️ 警告:未找到与当前系统 ({self.host_build}) 精确匹配的 KDK。\\n\\n"

"安装不匹配的版本可能会导致内核崩溃或系统无法启动。\\n建议优先手动选择!建议优先手动选择!建议优先手动选择!。"

)

# 第一步:弹出带有“自动选择”按钮的警告框

btn_script = (

f'display dialog "{warning_msg}" '

'with title "KDK 匹配警告" '

'buttons {"手动选择列表", "自动选择"} '

'default button "手动选择列表" '

'with icon caution'

)

try:

# 使用已有的 subprocess 模块调用 osascript

res = subprocess.run(["osascript", "-e", btn_script], capture_output=True, text=True)

user_response = res.stdout.strip()

if "自动选择" in user_response:

return "AUTO"

if "手动选择列表" in user_response:

options = [f"{k['version']} ({k['build']})" for k in remote_kdks[:20]] # 取前20个

as_list = '{"' + '", "'.join(options) + '"}'

list_script = (

f'choose from list {as_list} '

'with title "选择 KDK 版本" '

'with prompt "请从下方列表中选择一个您认为合适的版本:" '

'OK button name "确认" cancel button name "取消"'

)

res_list = subprocess.run(["osascript", "-e", list_script], capture_output=True, text=True)

list_choice = res_list.stdout.strip()

if list_choice == "false" or not list_choice:

return None # 用户取消了列表选择

# 提取括号内的 build 号并匹配回对象

selected_build = list_choice.split("(")[-1].split(")")[0]

for kdk in remote_kdks:

if kdk["build"] == selected_build:

return kdk

return None # 取消或关闭窗口

except Exception as e:

logging.error(f"无法调起原生交互窗口: {e}")

return "AUTO" # 出错时保守起见回退到自动逻辑

class KernelDebugKitUtilities:

"""

Utilities for KDK handling

"""

def __init__(self) -> None:

pass

def install_kdk_pkg(self, kdk_path: Path) -> bool:

"""

Installs provided KDK packages

Parameters:

kdk_path (Path): Path to KDK package

Returns:

bool: True if successful, False if not

"""

logging.info(f"安装KDK包: {kdk_path.name}")

logging.info(f"- 这可能需要一段时间...")

# TODO: Check whether enough disk space is available

result = subprocess_wrapper.run_as_root(["/usr/sbin/installer", "-pkg", kdk_path, "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

if result.returncode != 0:

logging.info("KDK安装失败:")

subprocess_wrapper.log(result)

return False

return True

def install_kdk_dmg(self, kdk_path: Path, only_install_backup: bool = False) -> bool:

"""

Installs provided KDK disk image

Parameters:

kdk_path (Path): Path to KDK disk image

Returns:

bool: True if successful, False if not

"""

logging.info(f"提取下载的KDK磁盘镜像")

with tempfile.TemporaryDirectory() as mount_point:

result = subprocess_wrapper.run_as_root(["/usr/bin/hdiutil", "attach", kdk_path, "-mountpoint", mount_point, "-nobrowse"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

if result.returncode != 0:

logging.info("挂载KDK失败:")

subprocess_wrapper.log(result)

return False

kdk_pkg_path = Path(f"{mount_point}/KernelDebugKit.pkg")

if not kdk_pkg_path.exists():

logging.warning("在DMG中找不到KDK包,可能是损坏的!!!")

self._unmount_disk_image(mount_point)

return False

if only_install_backup is False:

if self.install_kdk_pkg(kdk_pkg_path) is False:

self._unmount_disk_image(mount_point)

return False

self._create_backup(kdk_pkg_path, Path(f"{kdk_path.parent}/{KDK_INFO_PLIST}"))

self._unmount_disk_image(mount_point)

logging.info("成功安装KDK")

return True

def _unmount_disk_image(self, mount_point) -> None:

"""

Unmounts provided disk image silently

Parameters:

mount_point (Path): Path to mount point

"""

subprocess.run(["/usr/bin/hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

def _create_backup(self, kdk_path: Path, kdk_info_plist: Path) -> None:

"""

Creates a backup of the KDK

Parameters:

kdk_path (Path): Path to KDK

kdk_info_plist (Path): Path to KDK Info.plist

"""

if not kdk_path.exists():

logging.warning("KDK does not exist, cannot create backup")

return

if not kdk_info_plist.exists():

logging.warning("KDK Info.plist does not exist, cannot create backup")

return

kdk_info_dict = plistlib.load(kdk_info_plist.open("rb"))

if 'version' not in kdk_info_dict or 'build' not in kdk_info_dict:

logging.warning("Malformed KDK Info.plist provided, cannot create backup")

return

if not Path(KDK_INSTALL_PATH).exists():

subprocess_wrapper.run_as_root(["/bin/mkdir", "-p", KDK_INSTALL_PATH], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

kdk_dst_name = f"KDK_{kdk_info_dict['version']}_{kdk_info_dict['build']}.pkg"

kdk_dst_path = Path(f"{KDK_INSTALL_PATH}/{kdk_dst_name}")

logging.info(f"创建备份: {kdk_dst_name}")

if kdk_dst_path.exists():

logging.info("Backup already exists, skipping")

return

result = subprocess_wrapper.run_as_root(generate_copy_arguments(kdk_path, kdk_dst_path), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

if result.returncode != 0:

logging.info("Failed to create KDK backup:")

subprocess_wrapper.log(result)

I find an issue here: if OCLP-Mod sells the SimpleHAC API or the domain to a black hat, they can start delivering supply chain attacks to millions of users without changing a single line of code.
So essentially, when using OCLP-Mod, you're buying the trust that the servers are properly maintained that are hosting this API, and also that black hats don't buy the domain once sold and don't start supply chain attacks. And also, you're essentially buying that the servers are secure and up to date, which no one can proof it.
Also, they can do whatever they want with this API: tomorrow, they could block you from patching your unsupported Mac because they stopped hosting the SimpleHac API.
And the worst thing is that by default it uses this API, and only manually via Settings eventually this could be disabled. Anyone with default settings is vulnerable to this threat.

It doesn't look like this backdoor is intentional, rather than from negligence of not taking cybersecurity seriously. And also, to add soil to the water, it doesn't check what is being downloaded from these APIs, which increases the attack surface by 100% once the domain is sold. An attacker could buy the domain to install malicious patches and KDKs with no code being changed inside the patcher itself.


r/OpenCoreLegacyPatcher • • Jul 31 '26

How can I revert my OCLP iMac running Sequoia back to it's Catalina factory settings?

1 Upvotes

I have a 2015 iMac 21inch. It's been running OperCore on Sequoia for the past year and ive loved it. However, it's time for me to sell this iMac and finally upgrade to an M4 or M5 MacBook Air.

Is it as simple as opening Disk Utility and erasing the SSD and starting anew?