Dylib Injection Link -
A common technique is "method swizzling." Because Objective-C is a dynamic language, it maintains a dispatch table mapping selectors (method names) to implementations (code addresses). An injected library can modify these tables at runtime, replacing a legitimate method (such as a password validation check) with malicious code. This allows malware to operate stealthily; to the user and the operating system, the application appears to be functioning normally, while its logic has been subverted.
For the benevolent developer, dylib injection is an indispensable asset. It enables functionality that would otherwise be impossible within the constraints of a compiled application. A quintessential use case is the "plugin" architecture. Applications like Photoshop or Final Cut Pro use dynamic loading to allow third-party developers to extend functionality without recompiling the host app. dylib injection