Skip to content

Instantly share code, notes, and snippets.

@MageApocalyptic
MageApocalyptic / simpleceptor-arm.ts
Created January 24, 2025 07:05 — forked from oleavr/simpleceptor-arm.ts
Simplified Interceptor reimplemented in TypeScript
const THUMB_HOOK_REDIRECT_SIZE = 8;
const THUMB_BIT_REMOVAL_MASK = ptr(1).not();
const trampolines: NativePointer[] = [];
const replacements: NativePointer[] = [];
export function makeTrampoline(target: NativePointer): NativePointer {
const targetAddress = target.and(THUMB_BIT_REMOVAL_MASK);
const trampoline = Memory.alloc(Process.pageSize);