CyberKit

D3FEND / Application Hardening

D3-DCE: Dead Code Elimination

Tactic: Harden. The harden tactic is used to increase the opportunity cost of computer network exploitation. Hardening differs from Detection in that it generally is conducted before a system is online and operational.

Definition

Removing unreachable or "dead code" from compiled source code.

How it works

Dead code is code that is considered unreachable by normal program execution. Dead code can be created by adding code under a condition that never evaluates to true. Dead code should be removed since this type of code can produce unexpected results, if accidentally or maliciously forced to execute. Dead code identification is typically performed by algorithms that implement program flows analysis looking for unreachable code. The dead code is eliminated by instructing compilers to remove the code through compiler flags, i.e., '-fdce' is used for Dead Code Elimination.

D3-DCE on d3fend.mitre.org

MITRE D3FEND 1.4.0, published under the MIT License, copyright 2022 The MITRE Corporation.