Healthier than Apples.
macOS ARM64 game cheating framework. Raw Mach traps, hand-crafted MIG messages, zero hookable library calls.
Built for macOS 26+ on Apple Silicon. Educational/research purposes.
Carrot bypasses every layer of userland anti-cheat detection:
| Layer | Technique | What it bypasses |
|---|---|---|
task_for_pid |
Direct svc #0x80 (inline assembly) |
Hooks on the libsystem_kernel stub |
| Trap resolution | Parse MOVN instructions in stubs at runtime | Hardcoded trap numbers (SysWhispers-style) |
| VM read/write | mach_msg2_trap stub called as function pointer + hand-built MIG messages |
Hooks on mach_vm_read_overwrite, mach_vm_write, mach_msg, mach_msg2_internal |
| Stealth | Inject as dylib into a host process (Discord, browser, etc.) | Process-list-based detection |
Notable finding: On macOS 26, mach_msg_trap (trap -31) is completely defunct. Apple migrated kernel IPC to mach_msg2_trap (trap -47) with packed 64-bit argument pairs and MACH64_* flags. Carrot implements this new format.
#include <carrot/carrot.h>
// Attach to a game process
carrot_proc_t proc;
carrot_attach(pid, &proc);
// Read/write memory
int hp;
carrot_read_val(proc, addr, &hp);
hp = 9999;
carrot_write_val(proc, addr, &hp);
// Pointer chains (Cheat Engine style)
uint64_t final_addr;
carrot_resolve_chain(proc, base, (int64_t[]){0x20, 0x10, 0x0}, 3, &final_addr);
// AOB pattern scan with wildcards
carrot_scan_result_t results;
carrot_aob_scan(proc, start, end, "F2 82 ?? 8F 00", &results);
carrot_scan_result_free(&results);
carrot_detach(proc);make # builds libcarrot.dylib, examples, and runs tests
make test # tests only (21 tests, no sudo needed)
make cleaninclude/carrot/ Public API headers
types.h Error codes, opaque handles
process.h carrot_attach / carrot_detach
memory.h carrot_read / carrot_write
pointer.h Pointer chain resolution
scan.h AOB/pattern scanning
src/ Implementation
traps.c/h Raw SVC + trap resolution
mig.c/h MIG messages via mach_msg2_trap
process.c Process attachment
memory.c Memory primitives
pointer.c Chain walker
scan.c Pattern parser + remote scanner
examples/
game/ Target game (prints addresses, ticks HP/ammo/gold)
cheat/ CLI cheat using libcarrot
stealth/ Injectable dylib β runs inside a host process
inject.c Constructor-based injection, background cheat thread
host.c Dummy host for testing
tests/ 21 self-contained tests (runs against own process via task_self)
Inject the cheat into any process. The cheat operates from inside the host β no separate cheat process visible.
# Terminal 1: start target game
./build/game
# Terminal 2: inject into a host process
sudo CARROT_PID=<game_pid> CARROT_ADDR=<health_addr> \
DYLD_INSERT_LIBRARIES=./build/libstealth.dylib \
/Applications/Discord.app/Contents/MacOS/DiscordThe dylib starts a background thread that attaches to the game and enforces god mode. The host application runs normally.
Note: DYLD_INSERT_LIBRARIES is stripped by SIP for system binaries (/usr/bin/*, /bin/*). Use your own binaries or third-party apps as hosts.
This project documents several undocumented changes in macOS 26:
mach_msg_trap(trap -31) is defunct β hangs indefinitely, even with timeout flagsmach_msg2_trap(trap -47) is the only working kernel IPC path- Argument format: 8 packed uint64 pairs (
bits|size,remote|local,voucher|id,desc|rcv,rcvsz|prio,timeout) MACH64_SEND_MQ_CALL(0x200000000) flag is required for MIG callsmach_msg2_internal(the library wrapper) rejects some argument combinations that the raw trap acceptsNDR_recordhasfloat_rep=0(IEEE), not 1_kernelrpc_mach_port_deallocate_trapmoved from trap -25 to -18
- Hardened Runtime:
task_for_pidis kernel-blocked for notarized apps (noget-task-allowentitlement). Works against most Steam/non-App-Store games. - EndpointSecurity:
ES_EVENT_TYPE_AUTH_GET_TASKcan intercepttask_for_pidat the kernel level regardless of the calling method. No game anti-cheat currently deploys this on macOS. - Requires root:
task_for_pidon another process needssudo. - macOS 26+ only: The
mach_msg2_trapformat is specific to macOS 26. Earlier versions usedmach_msg_trap.
Educational research project. Use responsibly.