Skip to content

objc msg_send crashes on 0.3.6 when calling KWOpenSecureSignatureComponent #204

@interface95

Description

@interface95

Body

Summary

Upgrading from 0.3.4 to 0.3.6 causes the emulator to crash when invoking KWOpenSecureSignatureComponentatlasSignPlus: / atlasSafeEncrypt:.
The same project runs without errors on 0.3.4.

Environment

  • Chomper: 0.3.6 (works on 0.3.4)
  • Python: 3.9
  • OS: macOS 15 (Apple Silicon)
  • Using iOS rootfs shipped with the repo (rootfs/ios)
  • Unicorn: 2.1.4, Capstone: 5.0.6, LIEF: 0.17.0

Repro Steps

  1. Install chomper 0.3.6 (python3 -m pip install chomper==0.3.6)
  2. Load the target Mach-O (gifCommonFramework) with Chomper(arch=ARCH_ARM64, os_type=OS_IOS, rootfs_path="rootfs/ios")
  3. Instantiate KWOpenSecurityGuardParamContext, KWOpenSecureSignatureComponent, KWOpenAtlasEncryptComponent
  4. Call objc.msg_send(component, "atlasSignPlus:", context) (similar for atlasSafeEncrypt:)
  5. During _objc_msgSend, the emulator crashes with UcError: Invalid memory read (UC_ERR_READ_UNMAPPED)

Logs / Crash

The failing address changes slightly run‑to‑run, but the crash is always inside libobjc.A.dylib after _objc_autoreleasePoolPush/_Pop.

Additional Notes

  • Wrapping Objective-C calls in autorelease_pool() and using getBytes:length: for NSData didn’t resolve the crash on 0.3.6.
  • Downgrading to 0.3.4 (no other code changes) makes the same sequence succeed.
  • During module loading on 0.3.6, there are repeated warnings like readClass failed: "NSATSGlyphStorage", readClass failed: "UIWebPlugInView".

Could you advise how to stabilize this call sequence on 0.3.6, or if there is a known workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions