feat: 集成 LLVM IR 混淆体系、Route 2 全量合规与系统调用调度加固
- defender: 扩展 IGDispatch/IGArchiveGuard/IGAntiHook/IGObjCBaseline/IGResolve,支持 Route 2 静态库桥接 (IGThreadID.c) 与防重签名检测 - llvm_passes: 新增 IGObfuscator LLVM IR 插件源码(控制流平坦化、字符串加密、间接跳转/调用、不透明常量/字段、MBA、函数外提、基本块拆分、反 Hook 序言) - tools & config: 新增 Xcode 归档编译/链接包装器、LLVM 自愈工具链 (ig_toolchain_resolver)、IPA 审计门禁、崩溃符号还原及最新 ig_llvm_policy.json(文件级匹配 + 3.0 全业务 Handler 平坦化) - tests & docs: 补齐 M0~M3、Pass 单测及系统调用调度/Route 2/LLVM 方案文档;.gitignore 忽略 *.bc 与 .obfuscate_extraction_cache.json
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
#include "IGAntiJailbreak.h"
|
||||
#include "syscall/IGSyscall.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#if IG_DIAGNOSTIC_STRINGS
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
/* access 的 amode:F_OK=0(仅测存在/可访问)。open 标志(BSD/Darwin 值)。 */
|
||||
#define IG_F_OK 0
|
||||
@@ -45,8 +47,13 @@ static void ig_jb_emit(IGFindingSink sink, void *ctx, int *hits,
|
||||
__builtin_memset(&f, 0, sizeof(f));
|
||||
f.status = st;
|
||||
f.reason = reason;
|
||||
#if IG_DIAGNOSTIC_STRINGS
|
||||
if (subject) snprintf(f.subject, sizeof(f.subject), "%s", subject);
|
||||
if (evidence) snprintf(f.evidence, sizeof(f.evidence), "%s", evidence);
|
||||
#else
|
||||
(void)subject;
|
||||
(void)evidence;
|
||||
#endif
|
||||
if (st == IG_DETECTED) (*hits)++;
|
||||
if (sink) sink(&f, ctx);
|
||||
}
|
||||
@@ -60,9 +67,13 @@ int ig_anti_jb_check_paths(const char *const *paths, size_t count,
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
if (!paths[i]) continue;
|
||||
if (ig_sys_access(paths[i], IG_F_OK) == 0) {
|
||||
#if IG_DIAGNOSTIC_STRINGS
|
||||
char ev[256];
|
||||
snprintf(ev, sizeof(ev), "直发 access 可访问越狱特征:%s", paths[i]);
|
||||
ig_jb_emit(sink, ctx, &hits, IG_DETECTED, IG_REASON_JAILBREAK_FILE, paths[i], ev);
|
||||
#else
|
||||
ig_jb_emit(sink, ctx, &hits, IG_DETECTED, IG_REASON_JAILBREAK_FILE, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,10 +84,15 @@ int ig_anti_jb_check_paths(const char *const *paths, size_t count,
|
||||
if (fd >= 0) {
|
||||
ig_sys_close(fd);
|
||||
ig_sys_unlink(sandbox_probe_path); /* 立即清理,不留痕 */
|
||||
#if IG_DIAGNOSTIC_STRINGS
|
||||
char ev[256];
|
||||
snprintf(ev, sizeof(ev), "能在沙盒外创建文件:%s", sandbox_probe_path);
|
||||
ig_jb_emit(sink, ctx, &hits, IG_DETECTED, IG_REASON_JAILBREAK_SANDBOX,
|
||||
sandbox_probe_path, ev);
|
||||
#else
|
||||
ig_jb_emit(sink, ctx, &hits, IG_DETECTED, IG_REASON_JAILBREAK_SANDBOX,
|
||||
NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user