frida-native-hooks
Skill3 starsChanged 6 months agoMITView on GitHub
Build Frida native hooks for C/C++/Objective-C functions, exports, imports, symbols, memory, Interceptor, NativeFunction, Stalker, and CModule.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- TaiMaBenJi/taima-skillsword for word, first seen Oct 11, 2026
Other versions1 project uses a version of this.
Word for word · 1
- TaiMaBenJi/taima-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- frida-agent-builderSkill
- frida-android-hooksSkill
- frida-anti-instrumentationSkill
- frida-codeshare-searchSkill
- frida-data-extractionSkill
- frida-gadget-injectionSkill
- frida-ios-hooksSkill
- frida-script-reviewSkill
- frida-setup-checklistSkill
- frida-tls-pinningSkill
- frida-tools-referenceSkill
- frida-tracing-discoverySkill
- frida-troubleshootingSkill
- frida-workflowSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when the target is a native function or memory behavior.
- Distinctive: line 22
If names are stripped, search imports/exports first, then symbols, strings, and byte patterns.
- Very specific: line 43
Use Interceptor.attach() for tracing and light argument/return mutation.
- Very specific: line 44
Use Interceptor.replace() when fully replacing behavior.
- Very specific: line 45
Use Interceptor.replaceFast() only for hot functions where lower overhead is required.
- Very specific: line 47
Call Interceptor.flush() only when a just-installed hook must be invoked immediately from the same script.
- Distinctive: line 52
When names are stripped, combine static strings, imports, cross-references from a disassembler, runtime module load logs, and …
- Very specific: line 53
Use Thread.backtrace() early to find who called a generic boundary such as open, connect, SSL_write, CCCrypt, strcmp, or memcmp.
- Distinctive: line 54
Use Stalker for bounded questions only: a specific thread, during a specific function call, with call/block summaries before …
- Very specific: line 55
Treat anti-Frida checks as native work when they involve /proc, ptrace, loaded module scans, thread names, ports, or symbol/string scans.
- Distinctive: line 59
Do not write a longer string into an existing buffer unless the buffer size is proven.
- Distinctive: line 60
Prefer allocating a new string and replacing the pointer argument.
- Distinctive: line 61
Keep allocated replacement strings reachable for the required lifetime:
- Very specific: line 84
Read references/native-patterns.md for templates covering exports, imports, pattern scans, backtraces, replacements, and performance notes.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Frida Native Hooks
Use this skill when the target is a native function or memory behavior.
Discovery First
- Identify process architecture and module:
console.log(Process.arch, Process.platform, Process.pointerSize); for (const m of Process.enumerateModules()) console.log(m.name, m.base, m.size); - Resolve addresses through Frida APIs when possible:
const mod = Process.getModuleByName("libtarget.so"); const fn = mod.getExportByName("target_function"); - If names are stripped, search imports/exports first, then symbols, strings, and byte patterns.
- On ARM/Thumb, prefer addresses returned by Frida APIs so instruction-set details are handled correctly.
Hook Pattern
const target = Process.getModuleByName("libc.so").getExportByName("open");
Interceptor.attach(target, {
onEnter(args) {
this.path = args[0].readUtf8String();
console.log("[open] path=", this.path);
},
onLeave(retval) {
console.log("[open] fd=", retval.toInt32());
}
});Replacement Rules
- Use
Interceptor.attach()for tracing and light argument/return mutation. - Use
Interceptor.replace()when fully replacing behavior. - Use
Interceptor.replaceFast()only for hot functions where lower overhead is required; call the original through the returned pointer. - Wrap original functions with
NativeFunctionusing the correct ABI, return type, and argument types. - Call
Interceptor.flush()only when a just-installed hook must be invoked immediately from the same script.
Practitioner Patterns
- Hook boundaries before internals: exported API, imported libc/crypto/TLS calls, file/network/syscall wrappers, then app-specific stripped functions.
- When names are stripped, combine static strings, imports, cross-references from a disassembler, runtime module load logs, and Stalker/caller summaries.
- Use
Thread.backtrace()early to find who called a generic boundary such asopen,connect,SSL_write,CCCrypt,strcmp, ormemcmp. - Use Stalker for bounded questions only: a specific thread, during a specific function call, with call/block summaries before instruction-level tracing.
- Treat anti-Frida checks as native work when they involve
/proc,ptrace, loaded module scans, thread names, ports, or symbol/string scans.
Memory Safety
- Do not write a longer string into an existing buffer unless the buffer size is proven.
- Prefer allocating a new string and replacing the pointer argument.
- Keep allocated replacement strings reachable for the required lifetime:
const keepalive = []; Interceptor.attach(target, { onEnter(args) { const s = Memory.allocUtf8String("replacement"); keepalive.push(s); args[0] = s; } }); - Copy
retval/argument data inside callbacks if it is needed later.
Native Investigation Checklist
- Module loaded before resolving address.
- Function signature verified from headers, decompiler, debug symbols, or observed calling convention.
- Pointer reads guarded for null and readability.
- Logs include enough context to prove the right call path.
- Mutation has a rollback path: detach, revert, restart, or remove Gadget config.
References
Read references/native-patterns.md for templates covering exports, imports, pattern scans, backtraces, replacements, and performance notes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

