Skip to content

Commit b9fdaeb

Browse files
author
Rednick16
committed
image lookup fix & optimization
1 parent 4c7e0c7 commit b9fdaeb

File tree

16 files changed

+55
-15
lines changed

16 files changed

+55
-15
lines changed

demo/.DS_Store

0 Bytes
Binary file not shown.

demo/.theos/_/DEBIAN/control

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Package: com.rednick16.jailed.example
2+
Name: jailed_example
3+
Architecture: iphoneos-arm
4+
Description: An awesome MobileSubstrate tweak!
5+
Maintainer: Red16
6+
Author: Red16
7+
Section: Tweaks
8+
Depends: #mobilesubstrate (>= 0.9.5000)
9+
Version: 0.0.1
10+
Installed-Size: 0
98.2 KB
Binary file not shown.
15.8 KB
Binary file not shown.
16 KB
Binary file not shown.
206 Bytes
Binary file not shown.
32.2 KB
Binary file not shown.

demo/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Description: An awesome MobileSubstrate tweak!
66
Maintainer: Red16
77
Author: Red16
88
Section: Tweaks
9-
Depends: mobilesubstrate (>= 0.9.5000)
9+
Depends: #mobilesubstrate (>= 0.9.5000)

demo/jailed.mm

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
BOOL (*orig_didFinishLaunchingWithOptions)(id self, SEL selector, UIApplication* application, NSDictionary* launchOptions);
66
BOOL new_didFinishLaunchingWithOptions(id self, SEL selector, UIApplication* application, NSDictionary* launchOptions)
77
{
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+
815
// just objc hook example
916
// your code
1017
NSLog(@"orig_didFinishLaunchingWithOptions");
@@ -14,14 +21,27 @@ BOOL new_didFinishLaunchingWithOptions(id self, SEL selector, UIApplication* app
1421
const char* (*orig_dyld_get_image_name)(uint32_t image_index);
1522
const char* new_dyld_get_image_name(uint32_t image_index)
1623
{
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+
1731
// useless if not used correctly.
1832
NSLog(@"new_dyld_get_image_name");
1933
return orig_dyld_get_image_name(image_index);
2034
}
2135

2236
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);
2545
NSLog(@"new_applicationDidBecomeActive");
2646

2747
orig_applicationDidBecomeActive(self, selector, arg0);
-1.67 KB
Binary file not shown.

0 commit comments

Comments
 (0)