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"

<< Click to Display Table of Contents >>

Navigation:  Code Virtualizer > FAQ > General >

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"

Our Virtual Machine protection places the virtual machine registers mixed with the virtual machine code, generating a code section that is writable and executable at the same time. You can separate the VM registers from the VM code into different sections, avoiding a section that is writable and executable at the same time. The steps are:

 

1) Refer to the “C” example in the subfolder /StealthMode/C/StealthCodeRegsArea

 

You can also check the Readme.txt file in that subfolder for a description of the required steps. Basically you are creating a code stealh area (where the VM code will be placed) and a data stealth area (where the VM registers will be stored)

 

2) Add the following line in the “Advanced Options” panel:

 

OPTION_PROTECTION_PRESERVE_SECTIONS_FLAGS=YES

 

3) Set the option “Stealth Mode” in the “Protection Options panel”

 

4) Protect again