meme / apple-tools

A collection of tools for working with Apple software/hardware
The Unlicense
275 stars 29 forks source link

mremap_encrypted: Cannot allocate memory #2

Closed kevindick closed 3 years ago

kevindick commented 3 years ago

mremap_encrypted fails with "Cannot allocate memory" when testing on M1 mac

Target binary is a universal app, thinned to arm64 with lipo.

image image
meme commented 3 years ago

Take a look at the context around https://github.com/apple/darwin-xnu/blob/main/bsd/kern/kern_mman.c#L1569, check Console.app log messages and match them up. Specifically the result value. Not sure if thinning causes issues.

kevindick commented 3 years ago

Thank you for the pointer, got a few leads now. Will do some more research and experimentation with how universal machos are launched and submit a pr if I can get working. Looks like thinning indeeds breaks something, interestingly it also intermittently triggers a kernel panic on launch when subbing the universal binary with the thinned binary in the .app package.