When I run my protected Mach-O binary, I get an error message saying "malformed mach-o image: _TEXT segment maps start of file but is writable"¶
By default, the Virtual Machine registers and code share a section, making it both writable and executable. To place the registers and code in separate sections:
- See the C example in
/StealthMode/C/StealthCodeRegsArea.
Its Readme.txt explains how to create one Stealth Area for VM code and another for VM registers.
- Add this line in Advanced Options:
OPTION_PROTECTION_PRESERVE_SECTIONS_FLAGS=YES
-
Select Stealth Mode in Protection Options.
-
Protect the application again.