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

Function resolveTarget

scripts/function-stalker.js:118–134  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

116// --- resolve a target string to an absolute address -------------------------
117// "mod+0xoff" | "0xoff@mod" | "0xabs" | "symbolName"
118function resolveTarget(s) {
119 s = String(s).trim();
120 try {
121 if (s.includes("@")) {
122 const [off, mod] = s.split("@");
123 const m = Process.findModuleByName(mod.trim());
124 return m ? m.base.add(parseInt(off, 16)) : null;
125 }
126 if (s.includes("+")) {
127 const [mod, off] = s.split("+");
128 const m = Process.findModuleByName(mod.trim());
129 return m ? m.base.add(parseInt(off, 16)) : null;
130 }
131 if (/^0x[0-9a-f]+$/i.test(s)) return ptr(s);
132 return Module.findGlobalExportByName(s); // symbol name
133 } catch (e) { return null; }
134}
135
136// module name of a target string, for the exclude step
137function targetModuleName(s) {

Callers 2

targetModuleNameFunction · 0.85
installFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected