Jump to content

buildng a theos tweak ios 12.1.2


Go to solution Solved by Rook,

6 posts in this topic

Recommended Posts

Posted

the next step after this getting solved

is to create the tweak. i used the template v3.1 available from

however, i'm getting the following error when runing "make package install'

iPhone:~/bloodyharry root# make package install                                                                                                         
> Making all for tweak BloodyHarry…
==> Preprocessing Tweak.xm…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
==> Compiling Tweak.xm (armv7)…
==> Linking tweak BloodyHarry (armv7)…
ld: malformed file
/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd:2:42: error: unknown bit value
archs:           [ armv7, armv7s, arm64, arm64e, i386, x86_64 ]
                                         ^~~~~~
 file '/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/armv7/BloodyHarry.dylib] Error 1
rm /var/root/bloodyharry/.theos/obj/armv7/Tweak.xm.mm
make[2]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/armv7/BloodyHarry.dylib] Error 2
make[2]: *** Waiting for unfinished jobs....
==> Linking tweak BloodyHarry (arm64)…
ld: malformed file
/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd:2:42: error: unknown bit value
archs:           [ armv7, armv7s, arm64, arm64e, i386, x86_64 ]
                                         ^~~~~~
 file '/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/arm64/BloodyHarry.dylib] Error 1
rm /var/root/bloodyharry/.theos/obj/arm64/Tweak.xm.mm
make[2]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/arm64/BloodyHarry.dylib] Error 2
make[1]: *** [/var/theos/makefiles/instance/library.mk:24: internal-library-all_] Error 2
make: *** [/var/theos/makefiles/master/rules.mk:123: BloodyHarry.all.tweak.variables] Error 2

 

Posted (edited)

Copying the CydiaSubstrate binary to $THEOS/vendor/lib/CydiaSubstrate.framework solved the CydiaSubstrate.tbd (source)

this remains:

> Making all for tweak bloodyharry…
==> Preprocessing Tweak.xm…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
==> Compiling Tweak.xm (armv7)…
==> Linking tweak bloodyharry (armv7)…
ld: warning: text-based stub file /var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd and library file /var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate are out of sync. Falling back to library file for linking.
==> Generating debug symbols for bloodyharry…
==> Stripping bloodyharry (armv7)…
==> Linking tweak bloodyharry (arm64)…
ld: warning: text-based stub file /var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd and library file /var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate are out of sync. Falling back to library file for linking.
==> Generating debug symbols for bloodyharry…
==> Stripping bloodyharry (arm64)…
==> Merging tweak bloodyharry…
==> Signing bloodyharry…
> Making all in bloodyharrySettings…
> Making all for bundle bloodyharry…
==> Copying resource directories into the bundle wrapper…
==> Compiling bloodyharry.mm (arm64)…
==> Compiling bloodyharry.mm (armv7)…
==> Linking bundle bloodyharry (arm64)…
ld: framework not found Preferences
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [/var/theos/makefiles/instance/bundle.mk:37: /var/root/bloodyharry/.theos/obj/arm64/bloodyharry.bundle/bloodyharry] Error 1
make[3]: *** [/var/theos/makefiles/instance/bundle.mk:37: /var/root/bloodyharry/.theos/obj/arm64/bloodyharry.bundle/bloodyharry] Error 2
make[3]: *** Waiting for unfinished jobs....
==> Linking bundle bloodyharry (armv7)…
ld: framework not found Preferences
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [/var/theos/makefiles/instance/bundle.mk:37: /var/root/bloodyharry/.theos/obj/armv7/bloodyharry.bundle/bloodyharry] Error 1
make[3]: *** [/var/theos/makefiles/instance/bundle.mk:37: /var/root/bloodyharry/.theos/obj/armv7/bloodyharry.bundle/bloodyharry] Error 2
make[2]: *** [/var/theos/makefiles/instance/bundle.mk:26: internal-bundle-all_] Error 2
make[1]: *** [/var/theos/makefiles/master/rules.mk:123: bloodyharry.all.bundle.variables] Error 2
make: *** [/var/theos/makefiles/master/aggregate.mk:12: internal-all] Error 2

 

Updated by syto203
Posted (edited)

i tried 9.2,9.3,10.2 and 10.3 and none of them had the preferences framework. (edit: i tried the sdks from $theosinstaller sdk-version)

i did find this repo with sdks for 9.3-12.2 and that fixed it.

i used the 10.3 SDK

https://github.com/DavidSkrundz/sdks

on another topic the patch didn't work even thought it's exactly what was in the tutorial.

here is my tweak.xm only the first 2 keys are related to this game with the first 1 being the NOPing of the STR as referenced from here

On 8/22/2018 at 1:30 PM, HackedByTed2 said:

Compiling a hack with theos

Open your tweak.xm from your theos project & find this:


    if(GetPrefBool(@"key1")) {
      vm_writeData(0x123456, 0x123456); //The first value should be the offset & the second value the hackedHex
    }

If I wanted to change it to NOP I would change it to this:


    if(GetPrefBool(@"key1")) {
      vm_writeData(0x10092DEE8, 0x1F2003D5); // 
    }

 

How do I know it would be "0x1F2003D5"?

Well iOSGods has this awesome website: http://armconverter.com/

I typed "NOP" & in the  " ARM64 HEX" box I got the Hex of it.

You can convert any valid arm instruction here, so if you wanted to hack the LDR, you could have written this in the box:

LDR W8, [X23] & it would give you this value: 0xE80240B9

 

 

@import Foundation;
@import UIKit;
#import <substrate.h>
#import "vm_writeData.h"

// To MSHook Offsets, use https://iosgods.com/topic/22718-mshook-offsets/
// To Generate Tweak.xm and Preferences Plist https://iosgods.com/topic/24138-code-inject/

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.bloodyharry.syto203.plist"

inline bool GetPrefBool(NSString *key) {
		return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}


// Add your MS/Flex/MSHook Code here. Examples can be found on iOSGods.


%ctor {

	// Code Injection example
    if(GetPrefBool(@"key1")) {
      vm_writeData(0x10092DEE8,0x1F2003D5); // 
    }

    if(GetPrefBool(@"key2")) {
      vm_writeData(0x10092DED8,0x48018052); // 
    }

    if(GetPrefBool(@"key3")) {
      vm_writeData(0x1806B8, 0x381C); // ARMv7Offsets
      vm_writeData(0x2FA51C, 0x381C); // 
      vm_writeData(0x1001D98E0, 0x1F2003D5); // ARM64Offsets
      vm_writeData(0x10038DD0C, 0x1F2003D5); // 
    }

}



// Automatic Popup Code
void setup() {
    UIAlertController *igcredits = [UIAlertController alertControllerWithTitle:@"Made for iOSGods.com" message:@"Bloody Harry Cheats by syto203 for iOSGods.com!\n\nVisit the hack's official topic on iOSGods for more information and updates!" preferredStyle:UIAlertControllerStyleAlert];


    UIAlertAction *iosgods = [UIAlertAction actionWithTitle:@"Visit iOSGods.com!" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
        UIApplication *application = [UIApplication sharedApplication];
        NSURL *URL = [NSURL URLWithString:@"https://iosgods.com/forum/13-free-jailbroken-cydia-cheats/"];
        [application openURL:URL options:@{} completionHandler:^(BOOL success) {
            if (success) {
                //NSLog(@"Opened url");
            }
        }];
        
    }];
    
    UIAlertAction *clubs = [UIAlertAction actionWithTitle:@"Visit the Clubs!" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
        UIApplication *application = [UIApplication sharedApplication];
        NSURL *URL = [NSURL URLWithString:@"https://iosgods.com/clubs/"];
        [application openURL:URL options:@{} completionHandler:^(BOOL success) {
            if (success) {
                //NSLog(@"Opened url");
            }
        }];
    }];
    
    UIAlertAction *thankyou = [UIAlertAction actionWithTitle:@"Thank you!" style:UIAlertActionStyleCancel handler:nil];
    
    [igcredits addAction:iosgods];
    [igcredits addAction:clubs];
    [igcredits addAction:thankyou];


    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:igcredits animated:true completion:nil];
}

void unsubscribeToLaunchEvent(void);

static void didFinishLaunching(CFNotificationCenterRef center, void *observer,
                               CFStringRef name, const void *object, CFDictionaryRef info) {
    setup();
    unsubscribeToLaunchEvent();
}

const char *authObserver = "authObserver";

void subscribeToLaunchEvent() {
    CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), authObserver, &didFinishLaunching,
                                    (CFStringRef)UIApplicationDidFinishLaunchingNotification,
                                    NULL, CFNotificationSuspensionBehaviorDrop);
}

void unsubscribeToLaunchEvent() {
    CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), authObserver,
                                       (CFStringRef)UIApplicationDidFinishLaunchingNotification, NULL);
}

__attribute__((constructor)) static void initialize() {
    subscribeToLaunchEvent();
}

 

 

Updated by syto203
Posted
On 5/23/2019 at 3:53 AM, syto203 said:

the next step after this getting solved

is to create the tweak. i used the template v3.1 available from

however, i'm getting the following error when runing "make package install'


iPhone:~/bloodyharry root# make package install                                                                                                         
> Making all for tweak BloodyHarry…
==> Preprocessing Tweak.xm…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
==> Compiling Tweak.xm (armv7)…
==> Linking tweak BloodyHarry (armv7)…
ld: malformed file
/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd:2:42: error: unknown bit value
archs:           [ armv7, armv7s, arm64, arm64e, i386, x86_64 ]
                                         ^~~~~~
 file '/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/armv7/BloodyHarry.dylib] Error 1
rm /var/root/bloodyharry/.theos/obj/armv7/Tweak.xm.mm
make[2]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/armv7/BloodyHarry.dylib] Error 2
make[2]: *** Waiting for unfinished jobs....
==> Linking tweak BloodyHarry (arm64)…
ld: malformed file
/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd:2:42: error: unknown bit value
archs:           [ armv7, armv7s, arm64, arm64e, i386, x86_64 ]
                                         ^~~~~~
 file '/var/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/arm64/BloodyHarry.dylib] Error 1
rm /var/root/bloodyharry/.theos/obj/arm64/Tweak.xm.mm
make[2]: *** [/var/theos/makefiles/instance/library.mk:33: /var/root/bloodyharry/.theos/obj/arm64/BloodyHarry.dylib] Error 2
make[1]: *** [/var/theos/makefiles/instance/library.mk:24: internal-library-all_] Error 2
make: *** [/var/theos/makefiles/master/rules.mk:123: BloodyHarry.all.tweak.variables] Error 2

 

Did you ever find a fix for this its happening with me too

Posted (edited)

if you are building on an iDevice choose only one sdk from ios 11 if you are using an A11 device.(iphone x and iphone 8) and in the make file set the used archs to "ARCHS = arm64"

@Yueky

also refer to this

the fix was the last post before your question.

Updated by syto203

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines