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:
@@ -32,6 +32,21 @@ class FrameworkRewriteTests(unittest.TestCase):
|
||||
m = Macho(data)
|
||||
self.assertEqual(m.ncmds, Macho(self.data).ncmds+1)
|
||||
self.assertEqual(data[32768:212992], self.data[32768:212992])
|
||||
def test_explicit_fopen_subset(self):
|
||||
data, report = rewrite(self.data, SHA, {'_fopen': '_rd_a0'})
|
||||
self.assertEqual(report['total_symbols'], 1)
|
||||
self.assertEqual(len(report['changes']), 2)
|
||||
self.assertEqual({r['source'] for r in report['changes']}, {'_fopen'})
|
||||
self.assertIn(b'_fread\0', data)
|
||||
self.assertIn(b'_fwrite\0', data)
|
||||
self.assertIn(b'_fclose\0', data)
|
||||
self.assertTrue(report['machine_code_unchanged'])
|
||||
|
||||
def test_unknown_or_empty_subset_rejected(self):
|
||||
for mapping in ({}, {'_fopen': '_unexpected'}, {'_open': '_rd_a0'}):
|
||||
with self.subTest(mapping=mapping), self.assertRaises(ValueError):
|
||||
rewrite(self.data, SHA, mapping)
|
||||
|
||||
def test_wrong_hash(self):
|
||||
with self.assertRaises(ValueError): rewrite(self.data, '0'*64)
|
||||
def test_repeat_rejected(self):
|
||||
@@ -95,7 +110,7 @@ class ArchiveBindingIntegrationTests(unittest.TestCase):
|
||||
def test_real_dyld_binding_and_got_tamper(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
root = Path(folder)
|
||||
guard = root/'IGArchiveGuard.framework/IGArchiveGuard'
|
||||
guard = root/'RDCoreIO.framework/RDCoreIO'
|
||||
sdk = root/'SSZipArchive.framework/SSZipArchive'
|
||||
guard.parent.mkdir(); sdk.parent.mkdir()
|
||||
common = ['xcrun','--sdk','macosx','clang','-arch','arm64','-mmacosx-version-min=13.0','-O2']
|
||||
|
||||
Reference in New Issue
Block a user