Overview

[PIE (Position Independent Executables)](../../../Document/0x04h-Testing-Code-Quality.md#position-independent-code) are designed to enhance security by allowing executables to be loaded at random memory addresses, mitigating certain types of attacks.

In the context Mach-O file format of iOS applications:

This test case checks if the main executable is compiled with PIE.

Steps

  1. Use MASTG-TECH-0058 to extract the relevant binaries from app package.
  2. Use MASTG-TECH-0118 on the main binary and grep for "pic" or the corresponding keyword used by the selected tool.

Observation

The output should list if PIC is enabled or disabled.

Evaluation

The test case fails if PIC is disabled.