[macOS笔记]Mac增强插件——mySIMBL/MacForge

285 阅读1分钟

mySIMBL

原理解析

参考:[macOS笔记]Mac增强插件——SIMBL

  • mySIMBL主要用于GUI管理Plugin,依赖SIMBLManager.framework
  • SIMBLManager.framework:通过STPrivilegedTask执行root操作
    • AGENT_install:安装SIMBLAgent.app的API
    • OSAX_install:安装SIMBL.osax的API
    • AMFI_toggle:开关AMFI的API
    • SIP_bypass:绕过SIP的API
  • SIMBLAgent.app
    • 配置SIMBLAgent.app为Launch Agent,登录启动
    • 启动监听Carbon应用事件kEventAppLaunched
    • 解析inEvent的kEventParamProcessID,获取APP的进程pid
    • 通过Scripting Bridge向APP进程,发送SIMeload的AppleEvent
  • SIMBL.osax
    • 拦截SIMeload的AppleEvent
    • 加载Plugin
  1. STPrivilegedTask:github.com/sveinbjornt…
  2. 参考chunkwm的实现,most Carbon APIs were considered deprecated

MacForge

Initial commit:

github.com/MacEnhance/…

  • MacPlus主要用于GUI管理Plugin,依赖mach_inject_bundle_stub
  • mach_inject_bundle_stub依赖mach_inject_bundle
  • mach_inject_bundle依赖mach_inject
  • 使用mach_inject ₁注入进程
  1. mach_inject:github.com/rentzsch/ma…

1.2.0-1

github.com/MacEnhance/…