Skip to content

Commit

Permalink
Add psp_cmd_km_submit pattern for macOS 14.4
Browse files Browse the repository at this point in the history
Signed-off-by: Visual Ehrmanntraut <30368284+VisualEhrmanntraut@users.noreply.github.com>
  • Loading branch information
VisualEhrmanntraut committed Feb 3, 2024
1 parent e3f5358 commit fa92999
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
13 changes: 10 additions & 3 deletions NootRX/HWLibs.cpp
Expand Up @@ -78,9 +78,16 @@ bool HWLibs::processKext(KernelPatcher &patcher, size_t id, mach_vm_address_t sl
SolveRequestPlus solveRequest {"_CAILAsicCapsInitTable", orgCapsInitTable, kCAILAsicCapsInitTablePattern};
solveRequest.solve(patcher, id, slide, size);

RouteRequestPlus request = {"_psp_cmd_km_submit", wrapPspCmdKmSubmit, this->orgPspCmdKmSubmit,
kPspCmdKmSubmitPattern, kPspCmdKmSubmitMask};
PANIC_COND(!request.route(patcher, id, slide, size), "HWLibs", "Failed to route psp_cmd_km_submit");
if (getKernelVersion() > KernelVersion::Sonoma ||
(getKernelVersion() == KernelVersion::Sonoma && getKernelMinorVersion() >= 4)) {
RouteRequestPlus request = {"_psp_cmd_km_submit", wrapPspCmdKmSubmit, this->orgPspCmdKmSubmit,
kPspCmdKmSubmitPattern14_4, kPspCmdKmSubmitMask14_4};
PANIC_COND(!request.route(patcher, id, slide, size), "HWLibs", "Failed to route psp_cmd_km_submit (14.4+)");
} else {
RouteRequestPlus request = {"_psp_cmd_km_submit", wrapPspCmdKmSubmit, this->orgPspCmdKmSubmit,
kPspCmdKmSubmitPattern, kPspCmdKmSubmitMask};
PANIC_COND(!request.route(patcher, id, slide, size), "HWLibs", "Failed to route psp_cmd_km_submit");
}

if (NootRXMain::callback->chipType == ChipType::Navi22) {
RouteRequestPlus request = {"_smu_11_0_7_send_message_with_parameter", wrapSmu1107SendMessageWithParameter,
Expand Down
7 changes: 7 additions & 0 deletions NootRX/HWLibs.hpp
Expand Up @@ -46,6 +46,13 @@ static const UInt8 kPspCmdKmSubmitMask[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00};

static const UInt8 kPspCmdKmSubmitPattern14_4[] = {0x55, 0x48, 0x89, 0xE5, 0x41, 0x57, 0x41, 0x56, 0x41, 0x55, 0x41,
0x54, 0x53, 0x48, 0x83, 0xEC, 0x18, 0x49, 0x89, 0xCD, 0x49, 0x89, 0xD7, 0x49, 0x89, 0xF4, 0x49, 0x89, 0xFE, 0x48,
0x8D, 0x75, 0xD0, 0xC7, 0x06, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00};
static const UInt8 kPspCmdKmSubmitMask14_4[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00};

static const UInt8 kSmu1107SendMessageWithParameterPattern[] = {0x55, 0x48, 0x89, 0xE5, 0x41, 0x57, 0x41, 0x56, 0x41,
0x54, 0x53, 0x41, 0x89, 0xD6, 0x41, 0x89, 0xF7, 0x48, 0x89, 0xFB, 0x8B, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8D,
0x35};
Expand Down

1 comment on commit fa92999

@HankUng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Team
is it possible that you guys compile a kext compressed package for us (which can not code ,but would like to test Hacintosh)
thankyou a lot
I always waiting here today for your update

Please sign in to comment.