PACE Eden, the protection layer behind iLok, does not just encrypt the code in a macOS executable: it also takes over the process's startup. The target here is an x86_64 Mach-O audio application whose only usable launch path is a time-limited trial. The goal was a copy that starts and runs with no iLok, no wrapper files and no trial clock. Two sibling builds from the same codebase carried the same wrapper and were repaired the same way.
The code itself turned out to be easy to recover from the running process. The application's startup state was not. The wrapper replaces the list of C++ static initializers that dyld normally walks with a single pointer to its own code, so a plain memory dump produces a program that launches into a mostly zeroed world: toolbars tick with no items and draw no buttons, bundled VST plug-ins are never enumerated, and internal name tables are empty. Making the dumped code usable means finding the initializers the wrapper hid and running them again.
The executable is a thin x86_64 PIE. LC_MAIN points at file offset 0x55a0, exactly where __TEXT,__text starts, and the code section is 1,602,410 bytes (0x18736a). The segment table is more interesting than usual:
| Segment | vmaddr | file offset | file size | initprot | Contents |
|---|---|---|---|---|---|
__PAGEZERO | 0x0 | 0 | 0 | --- | guard |
__TEXT | 0x100000000 | 0 | 0x1f0000 | r-x | __text at +0x55a0, stubs, Objective-C metadata, __cstring |
__DATA | 0x1001f0000 | 0x1f0000 | 0x38000 | rw- | imports, __mod_init_func, __bss, __common |
__DATA | 0x100230000 | 0x228000 | 0x228 | rw- | __mod_term_func, __pbootstrap |
__DATA | 0x100231000 | 0x229000 | 0x48b000 | r-x | one section named __data, 4.7 MB, wrapper code and blob |
__LINKEDIT | 0x1006bc000 | 0x6b4000 | 0x2e580 | r-- | symbols, bindings, signature |
Three details identify the wrapper. First, a 552-byte segment exists solely to hold __mod_term_func and a section called __pbootstrap, whose second qword is the ASCII string kcaJ (the byte-reversed magic Jack) followed by version 1. Second, the multi-megabyte __data segment is marked executable but is not part of the application's own data layout. Third, both startup slots point into that segment: __mod_init_func holds 0x100231b4b and __mod_term_func holds 0x100231ca1, 342 bytes apart.
The application's own __mod_init_func array is gone: the section is exactly 8 bytes, one pointer, flagged S_MOD_INIT_FUNC_POINTERS so that dyld rebases it. A compiler emits one 8-byte pointer per initializer, so the original array was larger. The wrapper kept the list in encoded form inside its blob and left behind an entry that invokes its runtime, which runs the application's initializers internally. Nothing else in the file describes them.
__text is ciphertext on disk. Every 4 KB page of the section differs from the code in memory; in this build all 391 pages differ. PACE decrypts the whole section at load, so a dump taken after startup is complete and stable.
The constraint is when you take it. The wrapper looks for debuggers during the first seconds after launch and again when the trial dialog is confirmed, including int3 scanning and debug-register checks. Attaching before the trial dialog appears is detected: the process is killed or the debugger is refused. Attaching while the dialog is still on screen is safe, because the startup check has already run. From there:
lldb -p <pid> --batch \
-o "memory read --binary --force --outfile text.bin \
<base+0x55a0> <base+0x55a0+0x18736a>" \
-o "detach" -o "quit"With the standard 0x100000000 link base, base + 0x55a0 is simply the load address plus the section's file offset, because the __TEXT segment is mapped contiguously.
Some builds are signed with the hardened runtime (CodeDirectory flag 0x10000), which blocks debugserver's attach and strips DYLD_* from the environment. The way around it is to re-sign the binary ad hoc, which drops the flag, and dump from inside the process with an injected library. Its constructor starts a thread that sleeps long enough for decryption, then writes the section from its own address space:
static void *dumper(void *arg) {
sleep(10); // decryption is done; the trial dialog may still be up
intptr_t slide = _dyld_get_image_vmaddr_slide(0);
unsigned long base = 0x100000000UL + (unsigned long)slide;
FILE *f = fopen(getenv("MM_DUMP_OUT"), "wb");
fwrite((void *)(base + strtoul(getenv("MM_DUMP_OFF"), 0, 0)), 1,
strtoul(getenv("MM_DUMP_SIZE"), 0, 0), f);
fclose(f);
return NULL;
}
__attribute__((constructor)) static void init(void) {
pthread_t t;
pthread_create(&t, NULL, dumper, NULL);
pthread_detach(t);
}The full tool keeps the usual error checks; the structure above is the part that matters. The delay is independent of the dialog: decryption completes before the UI matters. A 10-second sleep, a slide lookup and one fwrite are enough, with no debugger and no task_for_pid.
Two observations support the result. The 1,602,410 bytes recovered this way were byte-identical to the __text of an independently produced memory dump, so two different extraction paths agreed. And the dump starts with ordinary function prologues (55 48 89 e5 …), not with the high-entropy pattern of the on-disk section.
The wrapped process also hosts a second copy of the executable as an anonymous JIT image with a different data layout, so runtime __DATA cannot be compared against the file. __text is identical in both.
The single __mod_init_func entry is why a naive dump is not enough. If it is replaced with a bare ret, as one third-party dump did, dyld returns immediately, PACE never initializes, and none of the application's static constructors run. In that dump the slot pointed at 0x1001efff6, ten bytes before the end of __TEXT, where a single 0xC3 byte sits in the segment's unused tail.
The consequences are not subtle. The toolbar's button configuration records, which are arrays of {selector, rect, flags} structures built in __bss, stay zero, so every toolbar reports zero items and draws nothing. The VST scanner object is never constructed, so bundled AIR plug-ins are never discovered. Product and serial tables, and the strings used by the mixer strip controls, stay empty. Each symptom maps to a group of missing constructors.
Calling PACE's entry instead is not an option once the wrapper is removed: without the Eden environment it reaches its license path and terminates the process. The only workable approach is to reconstruct the initializer list and call those functions directly.
The functions have no symbol names and nothing points at them. They can, however, be found by combining three properties, applied to every function that starts with the standard prologue 55 48 89 e5 and is neither the target of a direct E8 call nor stored as an address anywhere in the file.
Destructor registration. The import stub for __cxa_atexit is at 0x10018cc6a. Clang emits a registration call, often as a tail jump, in every translation unit that owns an object with a non-trivial destructor. The function containing each E8 or E9 to that stub is an initializer. A recovered example ends with:
0x1000acb67 5d pop rbp
0x1000acb68 e9fd000e00 jmp 0x10018cc6a ; __cxa_atexitDirect stores into globals. The toolbar record builders write several constants into __bss within their first 80 bytes, using RIP-relative addressing. A typical one starts by copying a pointer-sized constant and zeroing a field:
0x10000c1af 55 push rbp
0x10000c1b0 4889e5 mov rbp, rsp
0x10000c1b3 488b05ded8.. mov rax, [0x100219a98]
0x10000c1ba 4889053f7f.. mov [0x100224100], rax ; first byte of __bss
0x10000c1c1 0f57c0 xorps xmm0, xmm0String table construction. Inside one of the destructor-registering initializers there is a helper at 0x100189192 that turns a C string into an SSO std::string. Searching for callers of that helper which pass a lea rsi, <cstring> and never read rdi or rsi as inputs yields the remaining initializers that build name tables. One of them fills consecutive records at 0x1002255d0, 0x1002255f8 and so on, each followed by a packed 64-bit constant.
Taking the union of the three sets and checking that no candidate reads its argument registers in the first few instructions leaves exactly 16 functions in this build. Nine come from the global-store filter, six from destructor registration, and one from string tables. The two sibling builds yield 14 and 16, so the recovered set is build-specific and each build gets its own config.
The recovered functions need an array again, or something equivalent. Building a pointer array in __DATA is possible but awkward: it would need a writable slot large enough for 16 pointers and a relocation for each entry. A code trampoline is simpler and position-independent.
The wrapper's executable segment has 2,950 bytes of zero padding after its single section ends at 0x1006bb07a. The trampoline is placed at 0x1006bb080, inside the padding but before the segment's end at 0x1006bc000, and the patch verifies that the target range is zero before writing:
sub rsp, 8
call <initializer_1> ; E8 rel32, computed from the trampoline address
...
call <initializer_16>
add rsp, 8
retThe generated code is 89 bytes: 4 bytes of stack adjustment, 16 five-byte relative calls, and 5 bytes of epilogue. The calls are RIP-relative, so the trampoline works at any load slide. The trampoline is entered like a called function, with the stack 16-byte aligned plus a return address; sub rsp, 8 before the nested calls restores the alignment each constructor expects on entry. The calls run in the order recorded in the config, which is address order for the recovered sets.
The __mod_init_func slot is then overwritten with the trampoline's link-time address, 0x1006bb080. Because the section already holds initializer pointers, dyld rebases the new value exactly like the old one; no relocation records change. The wrapper's blob stays in the file but is no longer called, and the segment remains mapped r-x, so the trampoline is executable.
The full patcher performs the text replacement, the trampoline write and the slot update in one pass, gated by the executable's SHA-256 and size so that a config cannot be applied to the wrong build. It then deletes Contents/__Pace_Eden.bundle, Contents/PlugIns/__Pace_Eden and Contents/Resources/__Pace_Eden, and signs the binary and bundle ad hoc, inner binary first.
| Build | __text offset | __text size | Initializers | Trampoline |
|---|---|---|---|---|
| A | 0x55a0 | 0x18736a | 16 | 0x1006bb080 |
| B | 0x5990 | 0x179d05 | 14 | 0x1006a7040 |
| C | 0x2000 | 0x18693a | 16 | 0x1006b7040 |
After patching, the app launches with the PACE files deleted. The failures of the dumped build are gone: toolbars draw their buttons, bundled VST plug-ins are enumerated at startup, and the __bss tables built by the recovered constructors are populated. Those observations are the real test, because none of that state is recreated later if the initializers do not run.
The limits are worth stating plainly. Everything is specific to these builds: the text offsets, section layout, initializer addresses and trampoline addresses all shift between them, and the patcher rejects any binary whose size or hash does not match its config. The result is x86_64 only, so it runs natively on Intel Macs and through Rosetta on Apple Silicon. The signature is ad hoc; copying the app to another Mac through a download will attach a quarantine attribute, which has to be cleared, or the app has to be re-signed with a real Developer ID.
There is also no ground truth for the initializer list. The original array was overwritten and PACE's encoded copy has not been decoded, so the 16 functions are the ones the heuristics found and the application needs, not proof that the original array contained exactly 16 entries. A constructor whose only effect is invisible at runtime would be missed. Conversely, the filters can produce false friends such as adjusting thunks or destructors registered by other initializers, which is why each candidate was disassembled before being accepted. The single __mod_term_func entry still points into the wrapper segment and was left untouched; the builds run with it in place, but what that destructor does when PACE never initialized has not been established.
The part that generalizes is the structure: locate the wrapper's startup slot, dump the decrypted text from a trial process at the right moment, enumerate the app's static initializers from their code patterns, and re-run them from a slide-independent trampoline in executable slack. The wrapper protects the code, but it cannot hide the fact that the application still needs its constructors.