frida-objc-bridge
frida-objc-bridge copied to clipboard
Support fetching method definitions from inherited protocols
When registering a new class that implements a protocol and its inherited methods, frida is not able to find the method signature of the inherited methods.
e.g.
implementing - URLSession:task:didReceiveChallenge:completionHandler:
having just NSURLSessionDataDelegate
in protocols.
https://github.com/frida/frida-objc-bridge/blob/4fe30910c1af32b2220c09b64dc4340f9132fc64/index.js#L1505
something like this might solve the issue:
function findMethodDescriptionInProtocols(protocols: ObjC.Protocol[], methodName: string): ObjC.ProtocolMethodDescription {
let found = undefined;
for (const p of Object.values(protocols)) {
found = p.methods[methodName] ?? findMethodDescriptionInProtocols(Object.values(p.protocols), methodName);
if (found) { return found; }
}
}
Thank you for this awesome tool and your precious time.