Files
iOSGuard/defender/anti_frida/IGAntiInject.h
T
shenleiandClaude Opus 4.8 599e1da5ce feat(defender): 可集成静态库 + readoor 接入方案(检测→分级→数据毒化闭环)
在 iOSGuard 侧产出可集成产物与接入文档,不修改 readoor 代码。

- defender/: anti_hook/anti_frida/anti_debug/anti_jailbreak 探针 + syscall 直发、
  policy 分级层、poison 数据依赖毒化、dispatch/resolve/call_bridge 等子模块
- poison: 三副本冗余、无分支掩码;健康恒等、毒化破坏 key(替代 if-exit 处置)
- policy: STRONG/MEDIUM/WEAK 分级,守误报底线,仅 DETECTED 参与、组合命中才毒化
- anti_jailbreak: IGSyscall 直发 svc 检测越狱文件(400)/沙盒逃逸(401),绕 libc hook
- tools/build_defender_lib.sh: 一键交叉编译打包 libIGDefender.a(arm64) + umbrella 头
- docs/18_READOOR_DEFENDER_INTEGRATION.md: 精确到文件/bridging/替换点/代码片段
- docs/05-17 + evidence + tests + macho_guard/static_sdk_redirect 工具链

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-12 22:16:47 +09:00

41 lines
1.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* IGAntiInject.h — 代码注入与 Frida 运行时检测探针。
*
* 覆盖(docs/05 §5.C「镜像/白名单」「已知工具线索」+ §4 P1 DYLD 逐项解析):
* 1. 镜像扫描:已加载镜像匹配已知注入/调试框架特征(substrate/frida/cycript/reveal…)→ 强证据。
* 2. Bundle 外非系统镜像:弱信号(可能是合法 dylib),作为组合证据上报。
* 3. DYLD_INSERT_LIBRARIES:逐条解析(非整串前缀),任何条目指向 Bundle 外路径即上报。
* 4. Frida 运行时:线程名特征(gum-js-loop/gmain/pool-frida…)+ 默认端口(弱信号)。
*
* 只采集证据,不处置。单一端口/名称命中不作独立判定,交上层组合。
*/
#ifndef IG_ANTI_INJECT_H
#define IG_ANTI_INJECT_H
#include "IGDefender.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* 注入检测:镜像特征扫描 + Bundle 外镜像 + DYLD_INSERT_LIBRARIES 逐项解析。
* bundle_path:App 主 bundle 路径(.app 目录);用于判定镜像/插入库是否在 Bundle 内。
* 传 NULL 则跳过「Bundle 外」判定,仅做特征匹配与 dyld env。
* 返回 DETECTED 条数。
*/
int ig_anti_inject_check(const char *bundle_path, IGFindingSink sink, void *ctx);
/*
* Frida 运行时检测:线程名特征 + 默认端口探测(弱信号)。
* probe_port 非 0 时才做端口连接探测(默认 27042);0 表示只做线程名扫描。
* 返回 DETECTED 条数。
*/
int ig_anti_frida_check(int probe_port, IGFindingSink sink, void *ctx);
#ifdef __cplusplus
}
#endif
#endif /* IG_ANTI_INJECT_H */