Skip to content

Rudra-ravi/frida-skills / frida-native-hooks

frida-native-hooks

Verified

Build Frida native hooks for C/C++/Objective-C functions, exports, imports, symbols, memory, Interceptor, NativeFunction, Stalker, and CModule.

FileKindSize
SKILL.mdskill md3.5 KB
agents/openai.yamlconfig184 B
references/native-patterns.mdmarkdown1.4 KB

references/native-patterns.md

View on GitHub
# Native Patterns

## Export Hook

```js
const mod = Process.getModuleByName("libtarget.so");
const fn = mod.getExportByName("target");
Interceptor.attach(fn, {
  onEnter(args) {
    console.log("arg0", args[0]);
  },
  onLeave(retval) {
    console.log("ret", retval);
  }
});
```

## Import Hook

```js
for (const imp of Process.getModuleByName("app").enumerateImports()) {
  if (imp.name === "strcmp") console.log(imp);
}
```

## Pattern Scan

```js
const m = Process.getModuleByName("libtarget.so");
Memory.scan(m.base, m.size, "13 37 ?? ??", {
  onMatch(address) { console.log("match", address); },
  onError(reason) { console.log("scan error", reason); },
  onComplete() { console.log("scan done"); }
});
```

## Backtrace

```js
console.log(Thread.backtrace(this.context, Backtracer.ACCURATE)
  .map(DebugSymbol.fromAddress)
  .join("\n"));
```

## Replacement

```js
const openPtr = Process.getModuleByName("libc.so").getExportByName("open");
const open = new NativeFunction(openPtr, "int", ["pointer", "int"]);
Interceptor.replace(openPtr, new NativeCallback((pathPtr, flags) => {
  const path = pathPtr.readUtf8String();
  console.log("open", path);
  return open(pathPtr, flags);
}, "int", ["pointer", "int"]));
```

## Performance

- Avoid expensive stringification in hot hooks.
- Sample or gate logs when functions fire frequently.
- Use `CModule` or `replaceFast()` only after a normal hook proves the target and overhead problem.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall