MCPcopy Create free account
hub / github.com/axhlzy/FridaDebugger / excludeAllButTargetsOnce

Function excludeAllButTargetsOnce

scripts/function-stalker.js:150–173  ·  view source on GitHub ↗
(targetMods)

Source from the content-addressed store, hash-verified

148// --- Stalker.exclude: confine instrumentation -------------------------------
149let excludedOnce = false;
150function excludeAllButTargetsOnce(targetMods) {
151 if (excludedOnce || !CONFIG.excludeAllButTargets) return;
152 excludedOnce = true;
153 const keepNames = new Set(targetMods.filter(Boolean));
154 let kept = [], n = 0;
155 try {
156 for (const m of Process.enumerateModules()) {
157 const isTarget = [...keepNames].some((name) => m.name.includes(name));
158 if (isTarget) { kept.push(m.name); continue; }
159 try { Stalker.exclude(m); n++; } catch (e) {}
160 }
161 } catch (e) {}
162 console.log(`${C.dim}[fstalk] excluded ${n} modules; instrumenting only: ${kept.join(", ") || "(none?)"}${C.reset}`);
163
164 const FUNC_SPAN = 0x400;
165 for (const name of (CONFIG.excludeFunctions || [])) {
166 let a = null; try { a = Module.findGlobalExportByName(name); } catch (e) {}
167 if (!a) { console.log(`${C.dim}[fstalk] fn-exclude: ${name} not found${C.reset}`); continue; }
168 try {
169 Stalker.exclude({ base: a, size: FUNC_SPAN });
170 console.log(`${C.dim}[fstalk] fn-exclude: ${name} @ ${resolve(a).text}${C.reset}`);
171 } catch (e) {}
172 }
173}
174
175// --- scope filter -----------------------------------------------------------
176function scopeSetFor(defaultModule) {

Callers 1

installFunction · 0.70

Calls 1

resolveFunction · 0.70

Tested by

no test coverage detected