5
5
BOOL (*orig_didFinishLaunchingWithOptions)(id self, SEL selector, UIApplication* application, NSDictionary * launchOptions);
6
6
BOOL new_didFinishLaunchingWithOptions (id self, SEL selector, UIApplication* application, NSDictionary * launchOptions)
7
7
{
8
+ /*
9
+ * pointer checks handler
10
+ * outIndex - returns current func index
11
+ */
12
+ hookedf_add (reinterpret_cast <void *>(new_didFinishLaunchingWithOptions),
13
+ reinterpret_cast <void *>(orig_didFinishLaunchingWithOptions), NULL );
14
+
8
15
// just objc hook example
9
16
// your code
10
17
NSLog (@" orig_didFinishLaunchingWithOptions" );
@@ -14,14 +21,27 @@ BOOL new_didFinishLaunchingWithOptions(id self, SEL selector, UIApplication* app
14
21
const char * (*orig_dyld_get_image_name)(uint32_t image_index);
15
22
const char * new_dyld_get_image_name (uint32_t image_index)
16
23
{
24
+ /*
25
+ * pointer checks handler
26
+ * outIndex - returns current func index
27
+ */
28
+ hookedf_add (reinterpret_cast <void *>(new_dyld_get_image_name),
29
+ reinterpret_cast <void *>(orig_dyld_get_image_name), NULL );
30
+
17
31
// useless if not used correctly.
18
32
NSLog (@" new_dyld_get_image_name" );
19
33
return orig_dyld_get_image_name (image_index);
20
34
}
21
35
22
36
void (*orig_applicationDidBecomeActive)(id self, SEL selector, id arg0);
23
- void new_applicationDidBecomeActive (id self, SEL selector, id arg0) {
24
-
37
+ void new_applicationDidBecomeActive (id self, SEL selector, id arg0)
38
+ {
39
+ /*
40
+ * pointer checks handler
41
+ * outIndex - returns current func index
42
+ */
43
+ hookedf_add (reinterpret_cast <void *>(new_dyld_get_image_name),
44
+ reinterpret_cast <void *>(orig_dyld_get_image_name), NULL );
25
45
NSLog (@" new_applicationDidBecomeActive" );
26
46
27
47
orig_applicationDidBecomeActive (self, selector, arg0);
0 commit comments