ios hooking search classes ViewController // search classes name which have . ios hooking list class_methods ViewController // search all ViewController's method ios hooking search methods buttonClick: ios hooking search methods "- buttonClick:" ios hooking search methods "buttonClick" ios hooking search methods "[- buttonClick:]" git clone https://github.com/sensepost/objection.git code objection
"new ApiResolver(type): create a new resolver of the given type, allowing you to quickly find functions by name, with globs permitted." (新建ApiResolver(type):创建一个给定类型的新解析器,允许您通过名称快速查找函数,支持通配符。)
"Precisely which resolvers are available depends on the current platform and runtimes loaded in the current process." (可用的解析器取决于当前平台和当前进程中加载的运行时。)
"As of the time of writing, the available resolvers are:" (截止到写作时,可用的解析器如下:)
"module: Resolves exported and imported functions of shared libraries currently loaded. Always available." (module: 解析当前加载的共享库的导出和导入函数。始终可用。)
"objc: Resolves Objective-C methods of classes currently loaded. Available on macOS and iOS in processes that have the Objective-C runtime loaded. Use ObjC.available to check at runtime, or wrap your new ApiResolver('objc') call in a try-catch." (objc: 解析当前加载的类的Objective-C方法。在具有加载了Objective-C运行时的macOS和iOS进程中可用。在运行时使用ObjC.available进行检查,或将您的new ApiResolver('objc')调用包装在try-catch中。)
"The resolver will load the minimum amount of data required on creation, and lazy-load the rest depending on the queries it receives. It is thus recommended to use the same instance for a batch of queries, but recreate it for future batches to avoid looking at stale data." (解析器在创建时将加载所需的最少数据,并根据收到的查询进行延迟加载其余数据。因此,建议对一批查询使用相同的实例,但对未来的批次重新创建实例,以避免查看过期数据。)
"ObjC.available: a boolean specifying whether the current process has an Objective-C runtime loaded. Do not invoke any other ObjC properties or methods unless this is the case." (ObjC.available:一个布尔值,指示当前进程是否已加载Objective-C运行时。除非是这种情况,否则不要调用任何其他ObjC属性或方法。)
"ObjC.api: an object mapping function names to NativeFunction instances for direct access to a big portion of the Objective-C runtime API." (ObjC.api:一个将函数名称映射到NativeFunction实例的对象,用于直接访问Objective-C运行时API的大部分内容。)
"ObjC.classes: an object mapping class names to ObjC.Object JavaScript bindings for each of the currently registered classes. You can interact with objects by using dot notation and replacing colons with underscores, i.e.: [NSString stringWithString:@"Hello World"] becomes const { NSString } = ObjC.classes; NSString.stringWithString_("Hello World");. Note the underscore after the method name. Refer to iOS Examples section for more details." (ObjC.classes:一个将类名称映射到当前已注册类的每个ObjC.Object JavaScript绑定的对象。您可以使用点表示法与对象交互,并用下划线替换冒号,例如:[NSString stringWithString:@"Hello World"] 变成 const { NSString } = ObjC.classes; NSString.stringWithString_("Hello World");。请注意方法名称后面的下划线。有关更多详细信息,请参阅iOS示例部分。)
"ObjC.protocols: an object mapping protocol names to ObjC.Protocol JavaScript bindings for each of the currently registered protocols." (ObjC.protocols:一个将协议名称映射到当前已注册协议的每个ObjC.Protocol JavaScript绑定的对象。)
"ObjC.mainQueue: the GCD queue of the main thread" (ObjC.mainQueue:主线程的GCD队列)
"ObjC.schedule(queue, work): schedule the JavaScript function work on the GCD queue specified by queue. An NSAutoreleasePool is created just before calling work, and cleaned up on return." (ObjC.schedule(queue, work):在由queue指定的GCD队列上安排JavaScript函数work。在调用work之前,会创建一个NSAutoreleasePool,并在返回时进行清理。)
ApiResolver搜刮内存中的所有符号
枚举搜索所有类/所有方法/所有重载
Using ApiResolver come true code search
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
setImmediate(() => {
console.log("hello world! calleng! ObjC => ", ObjC.available) // test it whether there is a running environment
const resolver = new ApiResolver('objc');
const matches = resolver.enumerateMatches('*[ViewController *]'); //-[NSURL* *HTTP*] left section is classname, r is method name
// const first = matches[0];
// console.log(JSON.stringify(first))
matches.forEach((match)=>{
console.log(JSON.stringify(match))
})
})
// above this is searching by class name do it ,will get the result.
setImmediate(() => {
console.log("hello world! calleng! ObjC => ", ObjC.available) // test it whether there is a running environment
const resolver = new ApiResolver('objc');
const matches = resolver.enumerateMatches('*[* *buttonClick:]'); // [* buttonClick:] or [* *buttonClick:] is okay working
matches.forEach((match)=>{
console.log(JSON.stringify(match))
})
})
// about is searching by method name , do it will get result.
*/
setImmediate(() => {
console.log("hello world! calleng! ObjC => ", ObjC.available) // test it whether there is a running environment
const resolver = newApiResolver('objc');
const matches = resolver.enumerateMatches('*[* theLabel]'); // searching by Property
matches.forEach((match)=>{
console.log(JSON.stringify(match))
})
})
hook所有类/所有方法/所有重载
ios hooking watch class ViewController jobs list jobs kill 232233 ios hooking list class_methods ViewController ios hooking watch method "*[ViewController buttonClick:]" --dump-args --dump-backtrace --dump-return // (classname and method name )must type completely. add , [Parameters , CallStacks, Return Value.]at the tail.
new ObjC.Object(handle[, protocol]): create a JavaScript binding given the existing object at handle (a NativePointer). You may also specify the protocol argument if you’d like to treat handle as an object implementing a certain protocol only."
new ObjC.Object(handle[, protocol]): 基于指定的 NativePointer(句柄),创建一个 JavaScript 绑定。如果需要将该句柄视为仅实现特定协议的对象,则还可以指定 protocol 参数。"
ObjC.classes: an object mapping class names to ObjC.Object JavaScript bindings for each of the currently registered classes. You can interact with objects by using dot notation and replacing colons with underscores, i.e.: [NSString stringWithString:@"Hello World"] becomes const { NSString } = ObjC.classes; NSString.stringWithString_("Hello World");. Note the underscore after the method name. Refer to iOS Examples section for more details.
key code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
setImmediate(() => {
console.log("hello world! calleng! ObjC => ", ObjC.available) // test it whether there is a running environment
学习了 json ,stringFacy ? object c , objct, hook all class method and use ApiResolver to get the address , directly hook this address. the course is simple , the skill form the Objection get it. if have some question ask roysue.