Skip to content

Commit

Permalink
Fix compatibility with macOS 14 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtremeXT authored Jul 2, 2023
1 parent 42d59d2 commit af93868
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
NVMeFix Changelog
=================
#### v1.1.1
- Added constants for macOS 14 support
- Fixed macOS 14 compatibility

#### v1.1.0
- Added constants for macOS 13 support

Expand Down
6 changes: 3 additions & 3 deletions NVMeFix/NVMeFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ bool NVMeFixPlugin::solveSymbols(KernelPatcher& kp) {
/* movzx eax, byte ptr [rdi+0x10A] */
kextMembers.AppleNVMeRequest.command.fromFunc(kextFuncs.AppleNVMeRequest.GetOpcode.fptr,
0xf, 0, 7) &&
/* mov [rbx+0xC0], r12 or mov [rbx+0xC0], r15 */
/* mov [r14+0xC0], r15 (14.0+) or mov [rbx+0xC0], r15 (11.3-13.x) or mov [rbx+0xC0], r12 (<=11.2) */
(kextFuncs.IONVMeController.IssueIdentifyCommandNew.fptr ?
kextMembers.AppleNVMeRequest.prpDescriptor.fromFunc(kextFuncs.IONVMeController.IssueIdentifyCommandNew.fptr, 0x89, 7, 3) :
kextMembers.AppleNVMeRequest.prpDescriptor.fromFunc(kextFuncs.IONVMeController.IssueIdentifyCommandNew.fptr, 0x89, 7, getKernelVersion() >= KernelVersion::Sonoma ? 14 : 3) :
kextMembers.AppleNVMeRequest.prpDescriptor.fromFunc(kextFuncs.IONVMeController.IssueIdentifyCommand.fptr, 0x89, 4, 3));

/* cmp byte ptr [rdi+269h], 0 */
Expand Down Expand Up @@ -514,7 +514,7 @@ PluginConfiguration ADDPR(config) {
nullptr,
0,
KernelVersion::Mojave,
KernelVersion::Ventura,
KernelVersion::Sonoma,
[]() {
NVMeFixPlugin::globalPlugin().init();
}
Expand Down
2 changes: 1 addition & 1 deletion NVMeFix/NVMeFixPlugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class NVMeFixPlugin {
}

/* mov reg, [reg+disp] */
if (dis.opcode == opcode && dis.modrm_reg == reg && dis.modrm_rm == rm) {
if (dis.opcode == opcode && dis.modrm_reg == reg && dis.modrm_rm == (rm & 7) && dis.rex_b == ((rm & 8) >> 3)) {
offs = dis.disp.disp32 + add;
DBGLOG(Log::Disasm, "Offset 0x%x for %s", offs, name);
return true;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NVMeFix

[![Build Status](https://github.com/acidanthera/NVMeFix/workflows/CI/badge.svg?branch=master)](https://github.com/acidanthera/NVMeFix/actions) [![Scan Status](https://scan.coverity.com/projects/22192/badge.svg?flat=1)](https://scan.coverity.com/projects/22192)

***NOTE***: NVMeFix supports up to macOS Ventura (13). Due to significant changes on modern versions of macOS, there is plenty of effort which the developers do not have the time to work on. Contributions are welcome.
***NOTE***: NVMeFix supports up to macOS Sonoma (14), but some features might not be available on newer versions as of now, like the timeout panic fix.

NVMeFix is a set of patches for the Apple NVMe storage driver, IONVMeFamily.
Its goal is to improve compatibility with non-Apple SSDs. It may be used both on Apple and non-Apple
Expand Down

0 comments on commit af93868

Please sign in to comment.