TXM Variant Analysis: release vs research

Analysis of TXM (Trusted Execution Monitor) variants from iPhone17,3 26.3 (23D127) and PCC-CloudOS 26.3 (23D128) IPSWs.

Source Files

SourceVariantIM4P SizeSHA256
cloudosrelease1610253453eb476cfb53d8...
cloudosresearch16102893ad9e382d8c6353...
iphonerelease1610253453eb476cfb53d8...
iphoneresearch16102893ad9e382d8c6353...

Key finding: Both IPSWs contain identical TXM files (same SHA256). The TXM binary is shared across iPhone and cloudOS IPSWs.

Decompressed Binary Overview

PropertyRELEASERESEARCH
Compressed size160726 bytes160729 bytes
Decompressed size458784 bytes458784 bytes
CompressionBVX2 (LZFSE)BVX2 (LZFSE)
FormatMach-O 64-bit ARM64Mach-O 64-bit ARM64
SHA256bfc493e3c7b7dc00...62f40b9cd32a2a03...
File type2 (MH_EXECUTE)2 (MH_EXECUTE)
Load commands1111
Flags0x002000010x00200001

Mach-O Segments

Both variants have identical segment layout:

SegmentVM AddressVM SizeFile OffsetFile Size
__TEXT0xfffffff0170040000x100000x00x10000
__DATA_CONST0xfffffff0170140000xc0000x100000xc000
__TEXT_EXEC0xfffffff0170200000x440000x1c0000x44000
__TEXT_BOOT_EXEC0xfffffff0170640000xc0000x600000xc000
__DATA0xfffffff0170700000x40000x6c0000x4000
__LINKEDIT0xfffffff0170740000x40000x700000x20

Segment layout identical: True

Diff Summary

  • Total differing bytes: 3358 / 458784 (0.73%)
  • Diff regions (16-byte merge gap): 87

Diffs by Segment

SegmentRegionsBytes Changed% of Segment
__TEXT333045.04%
__TEXT_EXEC844090.15%

Diff Classification

1. Build Identifier String (Primary Difference)

The largest diff region (0x17c5 - 0x2496, 3282 bytes) is in the __TEXT segment string/const data area. The key difference is the build variant identifier:

OffsetRELEASERESEARCH
0x17c5lease.TrustedExecutionMonitor_Guarded-182.40.3search.TrustedExecutionMonitor_Guarded-182.40.3
0xcb7fleasesearch

Full build string:

  • RELEASE: release.TrustedExecutionMonitor_Guarded-182.40.3
  • RESEARCH: research.TrustedExecutionMonitor_Guarded-182.40.3

Because "research" (8 chars) is 1 byte longer than "release" (7 chars), all subsequent strings in __TEXT are shifted by +1 byte, causing a cascade of instruction-level diffs in code that references these strings.

2. String Reference Adjustments (Code Diffs)

The remaining diffs are in __TEXT_EXEC — all ADD instruction immediate adjustments compensating for the 1-byte string shift:

RELEASE:  add  x8, x8, #0x822   ; points to string at original offset
RESEARCH: add  x8, x8, #0x823   ; points to same string, shifted +1
  • ADD immediate adjustments: 84 regions (all in __TEXT_EXEC)
  • Other code diffs: 0 regions
  • String data regions: 3 regions in __TEXT (3304 bytes total)

Sample code diffs (first 10):

OffsetRELEASE instructionRESEARCH instruction
0x2572cadd x8, x8, #0x822add x8, x8, #0x823
0x25794add x8, x8, #0x861add x8, x8, #0x862
0x257d8add x0, x0, #0x877add x0, x0, #0x878
0x25980add x0, x0, #0x8d7add x0, x0, #0x8d8
0x25ac8add x0, x0, #0x8a1add x0, x0, #0x8a2
0x25af0add x4, x4, #0x8ebadd x4, x4, #0x8ec
0x25b78add x0, x0, #0x8f9add x0, x0, #0x8fa
0x25c34add x2, x2, #0x911add x2, x2, #0x912
0x25c58add x2, x2, #0x919add x2, x2, #0x91a
0x25c98add x0, x0, #0x927add x0, x0, #0x928

3. Functional Differences

None. All code diffs are string pointer adjustments caused by the 1-byte shift from "release" to "research". The two variants are functionally identical — same logic, same security policies, same code paths.

Security-Relevant Strings

Both variants contain identical security-relevant strings:

OffsetString
0xd31restricted execution mode
0x1919debug-enabled
0x1a4edarwinos-security-environment
0x1ad0security-mode-change-enable
0x1b4bamfi-only-platform-code
0x1bd6research-enabled
0x1c4csec-research-device-erm-enabled
0x1ccavmm-present
0x1d33sepfw-load-at-boot
0x1de8sepfw-never-boot
0x1e85osenvironment
0x1ec4device-recovery
0x1f81TrustCache
0x202aiboot-build-variant
0x20a9development
0x23daimage4 dispatch

Implications for Patching

  1. Either variant works — the code is functionally identical.
  2. fw_patch.py uses the research variant (txm.iphoneos.research.im4p) because the iboot-build-variant device tree property in PCC VMs is set to "research", and TXM validates this matches its own embedded variant string.
  3. String-based patch anchors that reference the build variant string ("release" / "research") will match at different offsets — patchers should use variant-agnostic anchors (e.g., mov w19, #0x2446 as in txm.py).
  4. The 3-byte IM4P size difference (161025 vs 161028 bytes) comes from the extra byte in "research" plus LZFSE compression variance.
  5. Both IPSWs ship the same TXM — no need to prefer one source over the other.

Conclusion

The TXM release and research variants are cosmetically different but functionally identical. The only real difference is the embedded build variant string ("release" vs "research"), which causes a 1-byte cascade in string offsets and corresponding ADD immediate adjustments in code. Both IPSWs (iPhone and cloudOS) ship the same pair of TXM binaries.