NHelper: {
    addHookerA: (
        soname: string,
        callback: (soModule: Module) => void,
    ) => SoHookerHandlerImpl;
    addHookerAfterSoLoad: (
        soname: string,
        callback: (soModule: Module) => void,
    ) => SoHookerHandlerImpl;
    addHookerB: (
        soname: string,
        callback: (soModule: Module) => void,
    ) => SoHookerHandlerImpl;
    addHookerBeforeSoInit: (
        soname: string,
        callback: (soModule: Module) => void,
    ) => SoHookerHandlerImpl;
    dumpSo: (so: string | Module, pkg_or_dir: string) => void;
    getBacktrace: (context: CpuContext, modeFlag?: boolean) => string;
    getJstringStr: (strPtr: NativePointer) => string;
    getModuleByAddr: (addrInMem: NativePointer) => Module;
    getStdStringStr: (strPtr: NativePointer) => string;
    hookAfterSoLoad: (
        soname: string,
        callback: (soModule: Module) => void,
    ) => void;
    hookBeforeSoInit: (
        soname: string,
        callback: (soModule: Module) => void,
    ) => void;
    newJstring: (str: string) => NativePointer;
    noDebugSymbol: () => void;
    patch_func_ret: (func_addr: any) => void;
    patch_nop: (addr: any) => void;
    printBacktrace: (
        TAG?: string,
        context: CpuContext,
        modeFlag?: boolean,
    ) => void;
    printMethodRegisterAddr: (method: any) => void;
    soHookerHandler: SoHookerHandlerImpl;
    stalker_trace: (
        so_module: Module,
        attach_range: any,
        watch_range?: any,
        watch_count?: number,
    ) => void;
    watch_access: (
        cbFunc?: (
            origFunc: NativeFunction<number, [NativePointer, number]>,
            cbCtx: CallbackContext,
            pathname: NativePointer,
            mode: number,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void;
    watch_dlsym: (
        soname: string,
        cbFunc?: (
            origFunc: NativeFunction<
                NativePointer,
                [NativePointer, NativePointer],
            >,
            cbCtx: CallbackContext,
            handle: NativePointer,
            symbol: NativePointer,
        ) => NativePointer,
        printBacktraceFlag?: boolean,
    ) => void;
    watch_fopen: (
        cbFunc?: (
            origFunc: NativeFunction<
                NativePointer,
                [NativePointer, NativePointer],
            >,
            cbCtx: CallbackContext,
            filename: NativePointer,
            mode: NativePointer,
        ) => NativePointer,
        printBacktraceFlag?: boolean,
    ) => void;
    watch_fork: (
        cbFunc?: (
            origFunc: NativeFunction<number, []>,
            cbCtx: CallbackContext,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void;
    watch_open: (
        cbFunc?: (
            origFunc: NativeFunction<number, [NativePointer, number]>,
            cbCtx: CallbackContext,
            pathname: NativePointer,
            flags: number,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void;
    watch_openat: (
        cbFunc?: (
            origFunc: NativeFunction<number, [number, NativePointer, number]>,
            cbCtx: CallbackContext,
            dirfd: number,
            pathname: NativePointer,
            mode: number,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void;
    watch_pthread_create: (
        soname?: string,
        cbFunc?: (
            origFunc: NativeFunction<
                number,
                [NativePointer, NativePointer, NativePointer, NativePointer],
            >,
            cbCtx: CallbackContext,
            thread: any,
            attr: any,
            start_routine: NativePointer,
            arg: any,
        ) => number,
    ) => void;
    watch_RegisterNatives: () => void;
    watch_so_load: (printBacktraceFlag?: boolean) => void;
    watch_strstr: (
        cbFunc?: (
            cbCtx: InvocationContext,
            haystack_str: string,
            needle_str: string,
        ) => boolean,
        printBacktraceFlag?: boolean,
    ) => void;
    watch_svc: (soname?: string) => void;
    writeFile: (outFilePath: string, buffer: string | ArrayBuffer) => void;
} = ...

Native 帮助工具模块

Type declaration

  • addHookerA: (soname: string, callback: (soModule: Module) => void) => SoHookerHandlerImpl
  • addHookerAfterSoLoad: (soname: string, callback: (soModule: Module) => void) => SoHookerHandlerImpl
  • addHookerB: (soname: string, callback: (soModule: Module) => void) => SoHookerHandlerImpl
  • addHookerBeforeSoInit: (soname: string, callback: (soModule: Module) => void) => SoHookerHandlerImpl
  • dumpSo: (so: string | Module, pkg_or_dir: string) => void
  • getBacktrace: (context: CpuContext, modeFlag?: boolean) => string
  • getJstringStr: (strPtr: NativePointer) => string
  • getModuleByAddr: (addrInMem: NativePointer) => Module
  • getStdStringStr: (strPtr: NativePointer) => string
  • hookAfterSoLoad: (soname: string, callback: (soModule: Module) => void) => void
  • hookBeforeSoInit: (soname: string, callback: (soModule: Module) => void) => void
  • newJstring: (str: string) => NativePointer
  • noDebugSymbol: () => void
  • patch_func_ret: (func_addr: any) => void
  • patch_nop: (addr: any) => void
  • printBacktrace: (TAG?: string, context: CpuContext, modeFlag?: boolean) => void
  • printMethodRegisterAddr: (method: any) => void
  • soHookerHandler: SoHookerHandlerImpl
  • stalker_trace: (
        so_module: Module,
        attach_range: any,
        watch_range?: any,
        watch_count?: number,
    ) => void
  • watch_access: (
        cbFunc?: (
            origFunc: NativeFunction<number, [NativePointer, number]>,
            cbCtx: CallbackContext,
            pathname: NativePointer,
            mode: number,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void
  • watch_dlsym: (
        soname: string,
        cbFunc?: (
            origFunc: NativeFunction<NativePointer, [NativePointer, NativePointer]>,
            cbCtx: CallbackContext,
            handle: NativePointer,
            symbol: NativePointer,
        ) => NativePointer,
        printBacktraceFlag?: boolean,
    ) => void
  • watch_fopen: (
        cbFunc?: (
            origFunc: NativeFunction<NativePointer, [NativePointer, NativePointer]>,
            cbCtx: CallbackContext,
            filename: NativePointer,
            mode: NativePointer,
        ) => NativePointer,
        printBacktraceFlag?: boolean,
    ) => void
  • watch_fork: (
        cbFunc?: (
            origFunc: NativeFunction<number, []>,
            cbCtx: CallbackContext,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void
  • watch_open: (
        cbFunc?: (
            origFunc: NativeFunction<number, [NativePointer, number]>,
            cbCtx: CallbackContext,
            pathname: NativePointer,
            flags: number,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void
  • watch_openat: (
        cbFunc?: (
            origFunc: NativeFunction<number, [number, NativePointer, number]>,
            cbCtx: CallbackContext,
            dirfd: number,
            pathname: NativePointer,
            mode: number,
        ) => number,
        printBacktraceFlag?: boolean,
    ) => void
  • watch_pthread_create: (
        soname?: string,
        cbFunc?: (
            origFunc: NativeFunction<
                number,
                [NativePointer, NativePointer, NativePointer, NativePointer],
            >,
            cbCtx: CallbackContext,
            thread: any,
            attr: any,
            start_routine: NativePointer,
            arg: any,
        ) => number,
    ) => void
  • watch_RegisterNatives: () => void
  • watch_so_load: (printBacktraceFlag?: boolean) => void
  • watch_strstr: (
        cbFunc?: (
            cbCtx: InvocationContext,
            haystack_str: string,
            needle_str: string,
        ) => boolean,
        printBacktraceFlag?: boolean,
    ) => void
  • watch_svc: (soname?: string) => void
  • writeFile: (outFilePath: string, buffer: string | ArrayBuffer) => void