- Small Sample
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
* Note that NOT ALL tweaks will work with the conversion process and some might only partially work.
.zip file. Extract it, and you'll have the binary file.xattr -sc Allemand && chmod +x AllemandThis will make it an executable file.
| -(void)presentFBShare{ | |
| // Create an object | |
| id<FBGraphObject> object = | |
| [FBGraphObject openGraphObjectForPostWithType:@"thebumapp:share" | |
| title:@"a bum" | |
| image:Nil | |
| url:@"http://www.facebook.com/TheBumApp" | |
| description:Nil]; | |
| // Create an action |
| void KTouchPointerWindowInstall(); | |
| void KTouchPointerWindowUninstall(); | |
| static BOOL installed; | |
| void KTouchPointerWindowInstall() | |
| { | |
| if (!installed) { | |
| installed = YES; | |
| Class _class = [UIWindow class]; |
| #include "keylogger.h" | |
| int main(int argc, const char *argv[]) { | |
| // Create an event tap to retrieve keypresses. | |
| CGEventMask eventMask = (CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventFlagsChanged)); | |
| CFMachPortRef eventTap = CGEventTapCreate( | |
| kCGSessionEventTap, kCGHeadInsertEventTap, 0, eventMask, CGEventCallback, NULL | |
| ); | |
| // Exit the program if unable to create the event tap. |
| #include <math.h> | |
| %hook SBAwayController | |
| @interface UIApplication () | |
| - (id)_accessibilityRunningApplications; | |
| @end | |
| @interface SBStatusBarDataManager | |
| + (id)sharedDataManager; |
| #import <substrate.h> | |
| #import <UIKit/UIKit.h> | |
| #import <Foundation/Foundation.h> | |
| %hook SBIconView | |
| // Hooking an instance method with an argument. | |
| - (void)setIsJittering:(BOOL)jittering { | |
| [self setAlpha:(jittering ? 0.5 : 1.0)]; | |
| } | |
| %end |
| @interface SBAppLayout : NSObject | |
| @end | |
| @interface SBFluidSwitcherItemContainer: UIView | |
| @end | |
| @interface SBFluidSwitcherViewController: UIViewController | |
| @property (readonly, nonatomic) NSArray *appLayouts; | |
| - (id)_itemContainerForAppLayoutIfExists:(id)arg0; | |
| - (void)killContainer:(id)arg0 forReason:(NSInteger)arg1; |
This lesson is target at reverse engineering iOS tweaks that have been written in Logos, and using the MobileSubstrate framework. Logos also has an "internal" generator configuration, and we will not be exploring that output today, however you should be able to figure out the differences yourself after completing this lesson.
Most modern tweaks are written in Logos. To understand the code we'll be looking at from reversed tweaks, we need to understand what a normal "hook" looks like in native code.
This is the example logos we'll be working with:
| curl -LO https://github.com/sbingner/llvm-project/releases/download/v10.0.0-1/linux-ios-arm64e-clang-toolchain.tar.lzma | |
| TMP=$(mktemp -d) | |
| tar --lzma -xvf linux-ios-arm64e-clang-toolchain.tar.lzma -C $TMP | |
| pushd $TMP/ios-arm64e-clang-toolchain/bin | |
| find * ! -name clang-10 -and ! -name ldid -and ! -name ld64 -exec mv {} arm64-apple-darwin14-{} \; | |
| find * -xtype l -exec sh -c "readlink {} | xargs -I{LINK} ln -f -s arm64-apple-darwin14-{LINK} {}" \; | |
| popd | |
| mkdir -p $THEOS/toolchain/linux/iphone | |
| mv $TMP/ios-arm64e-clang-toolchain/* $THEOS/toolchain/linux/iphone/ | |
| rm -rf $TMP linux-ios-arm64e-clang-toolchain.tar.lzma |