Skip to content

Initial macOS patcher#677

Merged
RDIL merged 7 commits intomasterfrom
reece/macos-patcher
Mar 22, 2026
Merged

Initial macOS patcher#677
RDIL merged 7 commits intomasterfrom
reece/macos-patcher

Conversation

@RDIL
Copy link
Copy Markdown
Member

@RDIL RDIL commented Mar 17, 2026

Scope

Adds a new patcher, specifically for macOS. Extracted from #676.

This can be refined as we go but it's a pretty solid start.

Test Plan

  • Confirm that the patcher succeeds on the app store build of the game
  • Confirm that the patcher succeeds on the steam build of the game

Checklist


General

  • I've run Prettier to format any changed files
  • I've verified that my changes work, and included a test plan

@thecatontheceiling
Copy link
Copy Markdown
Contributor

Have you considered going all in on the C++ version and replacing the C# one?

@RDIL
Copy link
Copy Markdown
Member Author

RDIL commented Mar 18, 2026

@thecatontheceiling the only drawback to that would be losing the easy gui via winforms. Even this version isn't perfect in that regard since it's CLI-only.

@RDIL
Copy link
Copy Markdown
Member Author

RDIL commented Mar 18, 2026

also msvc sucks so i really don't want to mess with it lol

This comment was marked as spam.

@AnthonyFuller
Copy link
Copy Markdown
Contributor

Can we not use this clanker.

VM_PROT_READ | VM_PROT_WRITE),
},

// Set "OnlineResources_Disable" to 0 (enable dynamic resources).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a note: this probably won't affect anything since we also disable OnlineResources_ForceOfflineOnFailure, but does this work on official? It doesn't have a DRP for MacOS (or iOS, or Switch 2).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No clue, haven't tried yet

Copy link
Copy Markdown
Contributor

@AnthonyFuller AnthonyFuller left a comment

Choose a reason for hiding this comment

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

I can't say I'm well versed in MacOS semantics, but it looks solid from a couple read throughs. Just some minor comments.

static constexpr uint8_t kNop[] = {0x1F, 0x20, 0x03, 0xD5};

// Distance from the configdomain string buffer to the dynres config variables.
static constexpr int64_t kDynresEnableOffsetFromConfig = -0x40;
Copy link
Copy Markdown
Contributor

@AnthonyFuller AnthonyFuller Mar 22, 2026

Choose a reason for hiding this comment

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

Not a fan of these hardcoded offsets - I suggest finding the config command function and calling that instead. I doubt it'll pose an issue though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If this breaks I'll re-evaluate

Copy link
Copy Markdown
Contributor

@VolkerSchlegel VolkerSchlegel left a comment

Choose a reason for hiding this comment

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

Not well versed with MacOS stuff at all, but C++-wise it looks good to me.

if (kr == KERN_FAILURE) {
fprintf(stderr,
"Hint: run with sudo, or disable SIP if targeting "
"an iOS-on-Mac app.\n");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This error message is too generic imo, the patcher won't target "an iOS-on-Mac app", but Hitman and Hitman only, so I suggest we remove that part (unless using the iOS version of MacOS and patching that is also withing scope?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The macOS build is just a wrapper around the iOS build.

@RDIL RDIL merged commit b65f75e into master Mar 22, 2026
5 checks passed
@RDIL RDIL deleted the reece/macos-patcher branch March 22, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants