How opa334/trollstore works
Main components
• TrollStore (Main Application) – This is the primary user-facing app that allows you to install any IPA and manage updates, uninstalls, etc.
• Exploits/fastPathSign – Contains the exploit code (including templates and core trust bypass code) that leverages the CoreTrust bug to bypass signature verification.
• RootHelper – Provides helper utilities for running operations with elevated (root) privileges. It features functions (such as “spawnRoot” in the Shared module) to execute commands as root.
• Pwnify – Another helper tool or module, likely involved in privilege escalations or adjustments needed for the exploit to work.
• TrollStoreLite – A lightweight version of TrollStore, likely sharing many components but offering a stripped-down interface or different distribution mechanism.
• Shared – Contains common code such as utility functions and core service interfaces that are reused by multiple components.
• Additional elements: “ChOma” (a folder with unspecified role), “Victim” (contains a certificate/make_cert script, suggesting a test or demo target within the ecosystem).
Relationships and Interactions
– The main TrollStore app communicates with TrollHelper (the persistence helper) to ensure that once installed, apps are correctly marked as “System” apps and remain launchable.
– When installing an IPA, TrollStore calls into functionality provided by the Exploits (fastPathSign) to bypass signature checks. This module is responsible for “faking” signatures using provided entitlements.
– TrollStore leverages shared utilities (from the Shared folder, e.g. TSUtil which contains spawnRoot) to spawn privileged processes. RootHelper implements many of these functions.
– Pwnify may interact with the Trusted Core and RootHelper to adjust process privileges needed for exploitation, while TrollStoreLite provides an alternate (or simplified) UI and install mechanism.
– The “Victim” folder contains files for testing or simulating certificate creation. These may be used during development or demonstration of the exploit.
Architectural Patterns and Design Principles
– Modular / layered Design: Each functional area (UI, exploitation, privilege escalation, shared utilities) is logically separated into its own folder/component.
– Helper and Core Modules: There’s a clear demarcation between the main user interface (TrollStore) and helper modules (TrollHelper, RootHelper, Pwnify) that perform behind-the-scenes tasks.
– Direct exploitation boundaries: The Exploits folder focuses explicitly on bypassing system checks through carefully crafted code and templates.
– Use of Theos build environment: The Makefile structure in each folder indicates that all components are built using a similar toolchain (Theos) for iOS native development.
– Start by placing the main components as distinct, labeled blocks:
o TrollStore (Main App) at the center.
o TrollHelper and TrollStoreLite as adjacent blocks that are tightly coupled to TrollStore (for persistence and alternate distribution).
o Exploits (fastPathSign) as a block used by TrollStore to overcome system limitations.
o RootHelper (and its supporting Shared utilities) as a block that provides privilege escalation functionality.
o Pwnify as a related auxiliary module.
o “Victim” can be depicted as a test environment or certificate management tool.
o TrollStore interacts with TrollHelper (for persistence routines).
o TrollStore calls into Exploits to bypass signature checks.
o TrollStore leverages functions from Shared, which in turn depend on RootHelper.
o Pwnify may communicate with both RootHelper and Shared to manage privileges.
o Core application logic (TrollStore, TrollStoreLite) – for example, use a blue block.
o Exploitation-and-helper modules (TrollHelper, RootHelper, Pwnify, Exploits) – maybe in green.
o Shared utility components – perhaps yellow.