Last active
June 22, 2024 15:44
-
-
Save pixelomer/3c9ac9b7e8b3f77615dc2fcbd800ec7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Works on iOS 16 and later. Works by hooking backboardd. | |
// { Filter = { Executables = ( "backboardd" ); }; } | |
#import <UIKit/UIKit.h> | |
@interface BKTouchContact : NSObject { | |
CGPoint _normalLocation; | |
} | |
@end | |
@interface BKTouchContactSet : NSObject { | |
NSMutableArray<BKTouchContact *> *_contacts; | |
} | |
- (long long)count; | |
@end | |
%hook BKTouchContactSet | |
- (long long)count { | |
NSMutableArray *array = MSHookIvar<NSMutableArray *>(self, "_contacts"); | |
if (array.count > 0) { | |
// _normalLocation components range from 0 to 1 | |
BKTouchContact *contact = array[0]; | |
CGPoint point = MSHookIvar<CGPoint>(contact, "_normalLocation"); | |
// Use point here ... | |
} | |
return %orig; | |
} | |
%end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment