MCPcopy
hub / github.com/AloneMonkey/frida-ios-dump / getExportFunction

Function getExportFunction

dump.js:107–130  ·  view source on GitHub ↗
(type, name, ret, args)

Source from the content-addressed store, hash-verified

105}
106
107function getExportFunction(type, name, ret, args) {
108 var nptr;
109 nptr = Module.findExportByName(null, name);
110 if (nptr === null) {
111 console.log("cannot find " + name);
112 return null;
113 } else {
114 if (type === "f") {
115 var funclet = new NativeFunction(nptr, ret, args);
116 if (typeof funclet === "undefined") {
117 console.log("parse error " + name);
118 return null;
119 }
120 return funclet;
121 } else if (type === "d") {
122 var datalet = Memory.readPointer(nptr);
123 if (typeof datalet === "undefined") {
124 console.log("parse error " + name);
125 return null;
126 }
127 return datalet;
128 }
129 }
130}
131
132var NSSearchPathForDirectoriesInDomains = getExportFunction("f", "NSSearchPathForDirectoriesInDomains", "pointer", ["int", "int", "int"]);
133var wrapper_open = getExportFunction("f", "open", "int", ["pointer", "int", "int"]);

Callers 1

dump.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected