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>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
ff0aee7f47
commit
599e1da5ce
@@ -0,0 +1,226 @@
|
||||
#include "IGArchiveGuard.h"
|
||||
#include "../resolve/IGResolve.h"
|
||||
#include "../anti_hook/IGAntiHook.h"
|
||||
#include "../primitives/IGInline.h"
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <stdatomic.h>
|
||||
#include <string.h>
|
||||
#include <mach/mach.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include <mach-o/loader.h>
|
||||
#include <mach-o/nlist.h>
|
||||
|
||||
/* 仅混淆常量,不作为秘密。SDK GOT 由 dyld 在独立镜像滑移后绑定。 */
|
||||
static const unsigned char names[4][6] = {
|
||||
{0x5a,0x53,0x4c,0x59,0x52}, {0x5a,0x4e,0x59,0x5d,0x58},
|
||||
{0x5a,0x4b,0x4e,0x55,0x48,0x59}, {0x5a,0x5f,0x50,0x53,0x4f,0x59}
|
||||
};
|
||||
static pthread_once_t once = PTHREAD_ONCE_INIT;
|
||||
static _Thread_local int resolving;
|
||||
static _Atomic(uintptr_t) targets[4];
|
||||
static uintptr_t expected[4], bindingSlots[4];
|
||||
static unsigned char prefixes[4][16];
|
||||
static IGStatus initial[4];
|
||||
static int bindingReady;
|
||||
#ifdef IG_OBSERVATION
|
||||
static _Atomic(uint64_t) counters[12];
|
||||
#define COUNT(i, k) atomic_fetch_add_explicit(&counters[(i)*3+(k)], 1, memory_order_relaxed)
|
||||
#else
|
||||
#define COUNT(i, k) ((void)0)
|
||||
#endif
|
||||
|
||||
static int read_bytes(uintptr_t address, void *out, size_t size) {
|
||||
vm_size_t copied = 0;
|
||||
return vm_read_overwrite(mach_task_self(), address, size, (vm_address_t)out, &copied) == KERN_SUCCESS
|
||||
&& copied == size;
|
||||
}
|
||||
|
||||
/* 仅支持打包工具已审核的非认证 arm64 GOT;缺槽/重复槽均标为不可验证。 */
|
||||
static int locate_bindings(void) {
|
||||
unsigned found = 0, images = 0;
|
||||
for (uint32_t index = 0; index < _dyld_image_count(); index++) {
|
||||
const char *path = _dyld_get_image_name(index);
|
||||
const char *suffix = "/SSZipArchive.framework/SSZipArchive";
|
||||
size_t length = path ? ig_strlen(path) : 0, tail = ig_strlen(suffix);
|
||||
if (length < tail || ig_strcmp(path + length - tail, suffix)) continue;
|
||||
if (++images != 1) return 0;
|
||||
const struct mach_header_64 *header = (const void *)_dyld_get_image_header(index);
|
||||
if (!header || header->magic != MH_MAGIC_64 || header->cputype != CPU_TYPE_ARM64
|
||||
|| (header->cpusubtype & 0xffffff) != 0) return 0;
|
||||
uintptr_t slide = _dyld_get_image_vmaddr_slide(index);
|
||||
const struct segment_command_64 *linkedit = NULL;
|
||||
const struct symtab_command *symtab = NULL;
|
||||
const struct dysymtab_command *dysymtab = NULL;
|
||||
const uint8_t *command = (const void *)(header + 1);
|
||||
const uint8_t *end = command + header->sizeofcmds;
|
||||
for (uint32_t i = 0; i < header->ncmds; i++) {
|
||||
if (command + sizeof(struct load_command) > end) return 0;
|
||||
const struct load_command *lc = (const void *)command;
|
||||
if (lc->cmdsize < 8 || lc->cmdsize % 8 || lc->cmdsize > (size_t)(end-command)) return 0;
|
||||
if (lc->cmd == LC_SEGMENT_64) {
|
||||
if (lc->cmdsize < sizeof(struct segment_command_64)) return 0;
|
||||
const struct segment_command_64 *seg = (const void *)lc;
|
||||
if (sizeof(*seg) + (uint64_t)seg->nsects * sizeof(struct section_64) != lc->cmdsize) return 0;
|
||||
if (!ig_strcmp(seg->segname, SEG_LINKEDIT)) linkedit = seg;
|
||||
} else if (lc->cmd == LC_SYMTAB && lc->cmdsize == sizeof(*symtab)) symtab = (const void *)lc;
|
||||
else if (lc->cmd == LC_DYSYMTAB && lc->cmdsize == sizeof(*dysymtab)) dysymtab = (const void *)lc;
|
||||
command += lc->cmdsize;
|
||||
}
|
||||
if (!linkedit || !symtab || !dysymtab || command != end) return 0;
|
||||
uint64_t lo = linkedit->fileoff, hi = lo + linkedit->filesize;
|
||||
if (hi < lo || symtab->symoff < lo || (uint64_t)symtab->symoff + (uint64_t)symtab->nsyms*16 > hi
|
||||
|| symtab->stroff < lo || (uint64_t)symtab->stroff + symtab->strsize > hi
|
||||
|| dysymtab->indirectsymoff < lo
|
||||
|| (uint64_t)dysymtab->indirectsymoff + (uint64_t)dysymtab->nindirectsyms*4 > hi) return 0;
|
||||
uintptr_t base = slide + linkedit->vmaddr - lo;
|
||||
const struct nlist_64 *symbols = (const void *)(base + symtab->symoff);
|
||||
const char *strings = (const void *)(base + symtab->stroff);
|
||||
const uint32_t *indirect = (const void *)(base + dysymtab->indirectsymoff);
|
||||
command = (const void *)(header + 1);
|
||||
for (uint32_t i = 0; i < header->ncmds; i++) {
|
||||
const struct load_command *lc = (const void *)command;
|
||||
if (lc->cmd == LC_SEGMENT_64) {
|
||||
const struct segment_command_64 *seg = (const void *)lc;
|
||||
const struct section_64 *sections = (const void *)(seg + 1);
|
||||
for (uint32_t j = 0; j < seg->nsects; j++) {
|
||||
const struct section_64 *s = sections + j;
|
||||
if ((s->flags & SECTION_TYPE) != S_NON_LAZY_SYMBOL_POINTERS) continue;
|
||||
if (s->size % 8 || (uint64_t)s->reserved1 + s->size/8 > dysymtab->nindirectsyms) return 0;
|
||||
for (uint64_t k = 0; k < s->size/8; k++) {
|
||||
uint32_t symbol = indirect[s->reserved1 + k];
|
||||
if (symbol & (INDIRECT_SYMBOL_LOCAL | INDIRECT_SYMBOL_ABS)) continue;
|
||||
if (symbol >= symtab->nsyms) return 0;
|
||||
uint32_t strx = symbols[symbol].n_un.n_strx;
|
||||
if (strx >= symtab->strsize) return 0;
|
||||
const char *name = strings + strx;
|
||||
if (!memchr(name, 0, symtab->strsize-strx)) return 0;
|
||||
for (unsigned n = 0; n < 4; n++) {
|
||||
char expectedName[] = "_ig_a0";
|
||||
expectedName[5] += n;
|
||||
if (ig_strcmp(name, expectedName)) continue;
|
||||
if (found & (1u << n)) return 0;
|
||||
bindingSlots[n] = slide + s->addr + k*8;
|
||||
found |= 1u << n;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
command += lc->cmdsize;
|
||||
}
|
||||
}
|
||||
return found == 15 && images == 1;
|
||||
}
|
||||
|
||||
static void initialize(void) {
|
||||
bindingReady = locate_bindings();
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
IGResolveResult result = ig_resolve_verified(NULL, names[i], i < 2 ? 5 : 6, NULL, NULL);
|
||||
initial[i] = result.status;
|
||||
if (result.status != IG_CLEAR || !result.address) continue;
|
||||
if (!read_bytes((uintptr_t)result.address, prefixes[i], 16)) { initial[i] = IG_UNAVAILABLE; continue; }
|
||||
expected[i] = (uintptr_t)result.address;
|
||||
atomic_store_explicit(&targets[i], expected[i], memory_order_release);
|
||||
}
|
||||
}
|
||||
|
||||
static int prepare(void) {
|
||||
if (resolving) return 0;
|
||||
resolving = 1;
|
||||
int result = pthread_once(&once, initialize);
|
||||
resolving = 0;
|
||||
return result == 0;
|
||||
}
|
||||
|
||||
static IGStatus validate(unsigned index, uintptr_t *address) {
|
||||
if (initial[index] != IG_CLEAR) return initial[index];
|
||||
uintptr_t current = atomic_load_explicit(&targets[index], memory_order_acquire);
|
||||
if (!current || current != expected[index]) return IG_DETECTED;
|
||||
IGStatus status = ig_verify_function((void *)current, "archive-target", NULL, NULL);
|
||||
if (status != IG_CLEAR) return status;
|
||||
unsigned char bytes[16];
|
||||
if (!read_bytes(current, bytes, 16)) return IG_UNAVAILABLE;
|
||||
if (ig_memcmp(bytes, prefixes[index], 16)) return IG_DETECTED;
|
||||
*address = current;
|
||||
return IG_CLEAR;
|
||||
}
|
||||
|
||||
static IGStatus check_bindings(void) {
|
||||
#ifdef IG_ARCHIVE_TESTING
|
||||
/* 宿主 ABI fixture 不装载 SSZipArchive;此豁免不能编入业务包。 */
|
||||
return IG_CLEAR;
|
||||
#else
|
||||
if (!bindingReady) return IG_UNAVAILABLE;
|
||||
uintptr_t correct[4] = {(uintptr_t)&ig_a0, (uintptr_t)&ig_a1, (uintptr_t)&ig_a2, (uintptr_t)&ig_a3};
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
uintptr_t current;
|
||||
if (!read_bytes(bindingSlots[i], ¤t, sizeof(current))) return IG_UNAVAILABLE;
|
||||
if (current != correct[i]) return IG_DETECTED;
|
||||
}
|
||||
return IG_CLEAR;
|
||||
#endif
|
||||
}
|
||||
|
||||
static uintptr_t checked(unsigned index) {
|
||||
COUNT(index, 0);
|
||||
if (!prepare()) { COUNT(index, 2); errno = EDEADLK; return 0; }
|
||||
uintptr_t address = 0;
|
||||
IGStatus status = check_bindings();
|
||||
if (status == IG_CLEAR) status = validate(index, &address);
|
||||
if (status != IG_CLEAR) { COUNT(index, 2); errno = status == IG_DETECTED ? EACCES : ENOSYS; return 0; }
|
||||
COUNT(index, 1);
|
||||
return address;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) FILE *ig_a0(const char *path, const char *mode) {
|
||||
int incoming = errno;
|
||||
uintptr_t address = checked(0);
|
||||
if (!address) return NULL;
|
||||
errno = incoming;
|
||||
return ((FILE *(*)(const char *, const char *))address)(path, mode);
|
||||
}
|
||||
__attribute__((noinline)) size_t ig_a1(void *ptr, size_t size, size_t count, FILE *stream) {
|
||||
int incoming = errno;
|
||||
uintptr_t address = checked(1);
|
||||
if (!address) return 0;
|
||||
errno = incoming;
|
||||
return ((size_t (*)(void *, size_t, size_t, FILE *))address)(ptr, size, count, stream);
|
||||
}
|
||||
__attribute__((noinline)) size_t ig_a2(const void *ptr, size_t size, size_t count, FILE *stream) {
|
||||
int incoming = errno;
|
||||
uintptr_t address = checked(2);
|
||||
if (!address) return 0;
|
||||
errno = incoming;
|
||||
return ((size_t (*)(const void *, size_t, size_t, FILE *))address)(ptr, size, count, stream);
|
||||
}
|
||||
__attribute__((noinline)) int ig_a3(FILE *stream) {
|
||||
int incoming = errno;
|
||||
uintptr_t address = checked(3);
|
||||
if (!address) return EOF;
|
||||
errno = incoming;
|
||||
return ((int (*)(FILE *))address)(stream);
|
||||
}
|
||||
|
||||
int ig_archive_check(void) {
|
||||
int incoming = errno;
|
||||
if (!prepare()) { errno = incoming; return -1; }
|
||||
IGStatus status = check_bindings();
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
uintptr_t address;
|
||||
IGStatus current = validate(i, &address);
|
||||
if (current == IG_DETECTED || (current == IG_UNAVAILABLE && status == IG_CLEAR)) status = current;
|
||||
}
|
||||
errno = incoming;
|
||||
return status == IG_CLEAR ? 0 : status == IG_DETECTED ? 1 : -1;
|
||||
}
|
||||
#ifdef IG_OBSERVATION
|
||||
uint64_t ig_archive_counter(unsigned index) {
|
||||
return index < 12 ? atomic_load_explicit(&counters[index], memory_order_relaxed) : 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef IG_ARCHIVE_TESTING
|
||||
void ig_archive_test_override(unsigned index, void *address) {
|
||||
if (index < 4 && prepare()) atomic_store_explicit(&targets[index], (uintptr_t)address, memory_order_release);
|
||||
}
|
||||
void ig_archive_test_reentry(int enabled) { resolving = enabled; }
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef IG_ARCHIVE_GUARD_H
|
||||
#define IG_ARCHIVE_GUARD_H
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#define IG_ARCHIVE_EXPORT __attribute__((visibility("default")))
|
||||
IG_ARCHIVE_EXPORT FILE *ig_a0(const char *path, const char *mode);
|
||||
IG_ARCHIVE_EXPORT size_t ig_a1(void *ptr, size_t size, size_t count, FILE *stream);
|
||||
IG_ARCHIVE_EXPORT size_t ig_a2(const void *ptr, size_t size, size_t count, FILE *stream);
|
||||
IG_ARCHIVE_EXPORT int ig_a3(FILE *stream);
|
||||
/* 0=正常,1=检测异常,-1=不可验证;保留 errno。 */
|
||||
IG_ARCHIVE_EXPORT int ig_archive_check(void);
|
||||
#ifdef IG_OBSERVATION
|
||||
/* index/3 为函数,index%3 为 attempted/dispatched/rejected。 */
|
||||
IG_ARCHIVE_EXPORT uint64_t ig_archive_counter(unsigned index);
|
||||
#endif
|
||||
#ifdef IG_ARCHIVE_TESTING
|
||||
void ig_archive_test_override(unsigned index, void *address);
|
||||
void ig_archive_test_reentry(int enabled);
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,149 @@
|
||||
#include "IGDispatch.h"
|
||||
#include "../resolve/IGResolve.h"
|
||||
#include "../anti_hook/IGAntiHook.h"
|
||||
#include "../primitives/IGInline.h"
|
||||
#include <pthread.h>
|
||||
#include <stdatomic.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <mach/mach.h>
|
||||
|
||||
/* 编码只减少常量区明文,不作为秘密或强加密。缓存与基线仍可被同进程攻击者修改。 */
|
||||
static const unsigned char kNames[2][5] = {{0x4b,0x4e,0x55,0x48,0x59},
|
||||
{0x5f,0x50,0x53,0x4f,0x59}};
|
||||
static pthread_once_t gOnce=PTHREAD_ONCE_INIT;
|
||||
static _Atomic(uintptr_t) gSlots[2];
|
||||
static uintptr_t gExpected[2];
|
||||
static unsigned char gPrefixes[2][16];
|
||||
static IGStatus gInitialStatus[2]={IG_UNAVAILABLE,IG_UNAVAILABLE};
|
||||
static _Thread_local int gResolving;
|
||||
#ifdef IG_OBSERVATION
|
||||
static _Atomic(uint64_t) gAttempted[2], gDispatched[2];
|
||||
#define IG_COUNT(slot,index) atomic_fetch_add_explicit(&(slot)[index],1,memory_order_relaxed)
|
||||
#else
|
||||
#define IG_COUNT(slot,index) ((void)0)
|
||||
#endif
|
||||
|
||||
static int read_prefix(uintptr_t address, unsigned char out[16]) {
|
||||
vm_size_t copied=0;
|
||||
return vm_read_overwrite(mach_task_self(),address,16,(vm_address_t)out,&copied)==KERN_SUCCESS
|
||||
&& copied==16;
|
||||
}
|
||||
|
||||
static void initialize(void) {
|
||||
for (unsigned i=0;i<2;i++) {
|
||||
IGResolveResult r=ig_resolve_verified(NULL,kNames[i],5,NULL,NULL);
|
||||
gInitialStatus[i]=r.status;
|
||||
if (r.status!=IG_CLEAR || !r.address) continue;
|
||||
uintptr_t address=(uintptr_t)r.address;
|
||||
if (!read_prefix(address,gPrefixes[i])) { gInitialStatus[i]=IG_UNAVAILABLE; continue; }
|
||||
gExpected[i]=address;
|
||||
atomic_store_explicit(&gSlots[i],address,memory_order_release);
|
||||
}
|
||||
}
|
||||
|
||||
static int prepare(void) {
|
||||
/* dlsym/装载初始化过程中若重入受保护入口,拒绝而不是等待自身 once 锁。 */
|
||||
if (gResolving) return 0;
|
||||
gResolving=1;
|
||||
int rc=pthread_once(&gOnce,initialize);
|
||||
gResolving=0;
|
||||
return rc==0;
|
||||
}
|
||||
|
||||
static IGStatus validate(unsigned i, uintptr_t *address, int *reason) {
|
||||
if (gInitialStatus[i]!=IG_CLEAR) {
|
||||
*reason=IG_REASON_DISPATCH_UNAVAILABLE;
|
||||
return gInitialStatus[i];
|
||||
}
|
||||
uintptr_t current=atomic_load_explicit(&gSlots[i],memory_order_acquire);
|
||||
if (!current || current!=gExpected[i]) {
|
||||
*reason=IG_REASON_DISPATCH_TAMPER;
|
||||
return IG_DETECTED;
|
||||
}
|
||||
IGStatus status=ig_verify_function((void *)current,"dispatch-target",NULL,NULL);
|
||||
if (status!=IG_CLEAR) {
|
||||
*reason=status==IG_DETECTED ? IG_REASON_INLINE_HOOK : IG_REASON_VERIFICATION_UNAVAILABLE;
|
||||
return status;
|
||||
}
|
||||
unsigned char bytes[16];
|
||||
if (!read_prefix(current,bytes)) {
|
||||
*reason=IG_REASON_VERIFICATION_UNAVAILABLE;
|
||||
return IG_UNAVAILABLE;
|
||||
}
|
||||
if (ig_memcmp(bytes,gPrefixes[i],16)!=0) {
|
||||
*reason=IG_REASON_DISPATCH_TAMPER;
|
||||
return IG_DETECTED;
|
||||
}
|
||||
*address=current;
|
||||
return IG_CLEAR;
|
||||
}
|
||||
|
||||
static uintptr_t checked_address(unsigned i) {
|
||||
if (!prepare()) { errno=EDEADLK; return 0; }
|
||||
uintptr_t address=0; int reason=0;
|
||||
IGStatus status=validate(i,&address,&reason);
|
||||
if (status!=IG_CLEAR) { errno=status==IG_DETECTED ? EACCES : ENOSYS; return 0; }
|
||||
return address;
|
||||
}
|
||||
|
||||
__attribute__((used,noinline))
|
||||
ssize_t IG_dispatch_write(int fd, const void *buffer, size_t count) {
|
||||
int incoming=errno;
|
||||
IG_COUNT(gAttempted,0);
|
||||
uintptr_t address=checked_address(0);
|
||||
if (!address) return -1;
|
||||
IG_COUNT(gDispatched,0);
|
||||
errno=incoming;
|
||||
ssize_t (*function)(int,const void *,size_t)=(void *)address;
|
||||
return function(fd,buffer,count);
|
||||
}
|
||||
|
||||
__attribute__((used,noinline))
|
||||
int IG_dispatch_close(int fd) {
|
||||
int incoming=errno;
|
||||
IG_COUNT(gAttempted,1);
|
||||
uintptr_t address=checked_address(1);
|
||||
if (!address) return -1;
|
||||
IG_COUNT(gDispatched,1);
|
||||
errno=incoming;
|
||||
int (*function)(int)=(void *)address;
|
||||
return function(fd);
|
||||
}
|
||||
|
||||
int ig_dispatch_check(IGFindingSink sink, void *ctx) {
|
||||
int saved=errno, hits=0;
|
||||
int ready=prepare();
|
||||
for (unsigned i=0;i<2;i++) {
|
||||
uintptr_t address=0; int reason=IG_REASON_DISPATCH_UNAVAILABLE;
|
||||
IGStatus status=ready ? validate(i,&address,&reason) : IG_UNAVAILABLE;
|
||||
if (status==IG_CLEAR) continue;
|
||||
IGFinding f={0}; f.status=status; f.reason=reason;
|
||||
const char *label=i==0 ? "dispatch-write" : "dispatch-close";
|
||||
strncpy(f.subject,label,sizeof(f.subject)-1);
|
||||
strncpy(f.evidence,"调度地址、提供方或代码前缀校验未通过",sizeof(f.evidence)-1);
|
||||
if (status==IG_DETECTED) hits++;
|
||||
if (sink && sink(&f,ctx)!=0) break;
|
||||
}
|
||||
errno=saved;
|
||||
return hits;
|
||||
}
|
||||
|
||||
#ifdef IG_OBSERVATION
|
||||
IGDispatchObservation ig_dispatch_observation(void) {
|
||||
IGDispatchObservation value={
|
||||
atomic_load_explicit(&gAttempted[0],memory_order_relaxed),
|
||||
atomic_load_explicit(&gDispatched[0],memory_order_relaxed),
|
||||
atomic_load_explicit(&gAttempted[1],memory_order_relaxed),
|
||||
atomic_load_explicit(&gDispatched[1],memory_order_relaxed)
|
||||
};
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef IG_DISPATCH_TESTING
|
||||
void ig_dispatch_test_override(unsigned i, void *address) {
|
||||
if (i<2 && prepare()) atomic_store_explicit(&gSlots[i],(uintptr_t)address,memory_order_release);
|
||||
}
|
||||
void ig_dispatch_test_reentry(int enabled) { gResolving=enabled; }
|
||||
#endif
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef IG_DISPATCH_H
|
||||
#define IG_DISPATCH_H
|
||||
#include <sys/types.h>
|
||||
#include "../include/IGDefender.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* 固定签名试点:首次按线程安全方式解析;异常时不调用未经校验的地址。 */
|
||||
ssize_t IG_dispatch_write(int fd, const void *buffer, size_t count);
|
||||
int IG_dispatch_close(int fd);
|
||||
int ig_dispatch_check(IGFindingSink sink, void *ctx);
|
||||
|
||||
#ifdef IG_OBSERVATION
|
||||
/* 仅观察构建导出只读计数,不提供地址覆盖或关闭校验的接口。 */
|
||||
typedef struct {
|
||||
uint64_t write_attempted, write_dispatched;
|
||||
uint64_t close_attempted, close_dispatched;
|
||||
} IGDispatchObservation;
|
||||
IGDispatchObservation ig_dispatch_observation(void);
|
||||
#endif
|
||||
|
||||
#ifdef IG_DISPATCH_TESTING
|
||||
/* 只编入宿主测试,不允许在 App 发布包定义此宏。 */
|
||||
void ig_dispatch_test_override(unsigned index, void *address);
|
||||
void ig_dispatch_test_reentry(int enabled);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user