Jump to content

Shmoo Mod Menu Errors


Red16

3 posts in this topic

Recommended Posts

Posted

My Tweak.xm - don’t steel my offsets

Spoiler

#include "Macros.h"

/*****************************/
// Please see sample.xm for sample menu code.
  
// title of your menu
static NSString *const title = @"TerrariaCheats"; 

// who made the hack?
static NSString *const credits = @"Rednick16";

// what font do you want the text to be? don't put anything for the default font
static NSString *const font = @"";

// should the menu have a blurred background? true or false
// FYI: this won't always look pretty
static const bool blur = true;

// blur style
// you MUST pick from these three: UIBlurEffectStyleExtraLight, UIBlurEffectStyleLight, or UIBlurEffectStyleDark
// *** If you opted for no blur background, this is ignored. However, you still need to fill it in. ***

static const UIBlurEffectStyle blurStyle = UIBlurEffectStyleDark;

// A complete list of fonts can be found here: http://iosfonts.com/
/******************************/

%hook AppDelegate
- (void)applicationDidBecomeActive:(id)arg0 {
    UIColor *themeColor = rgb(0xFFFFFF);
    UIWindow *main = [UIApplication sharedApplication].keyWindow.rootViewController.view;
    UIButton *openButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    openButton.frame = CGRectMake((main.frame.size.width/2)-15, (main.frame.size.height/2)+75, 30, 30);
    openButton.backgroundColor = [UIColor clearColor];
    openButton.layer.cornerRadius = 16;
    openButton.layer.borderWidth = 2;
    openButton.layer.borderColor = themeColor.CGColor;
    [openButton addTarget:self action:@selector(wasDragged:withEvent:) 
    forControlEvents:UIControlEventTouchDragInside];
    [openButton addTarget:self action:@selector(showMenu) 
    forControlEvents:UIControlEventTouchDownRepeat];

    if(!buttonAdded){
        timer(5){
            UIWindow *main = [UIApplication sharedApplication].keyWindow.rootViewController.view;
            menu = [[ModMenu alloc] initWithTitle:title credits:credits fontName:font theme:themeColor blur:blur blurStyle:blurStyle];
          
            addHack(@"infinity health", @"Infinity health", themeColor, {0x1002D8444}, {0xC0035FD3}, {0x682653A8});

            // add features here!

            [main addSubview:openButton];
            [main addSubview:menu];
            buttonAdded = true;
        });
    }
    %orig;
}

%new
- (void)showMenu {
    [menu show];
}


%new
- (void)wasDragged:(UIButton *)button withEvent:(UIEvent *)event
{
    UITouch *touch = [[event touchesForView:button] anyObject];

    CGPoint previousLocation = [touch previousLocationInView:button];
    CGPoint location = [touch locationInView:button];
    CGFloat delta_x = location.x - previousLocation.x;
    CGFloat delta_y = location.y - previousLocation.y;

    button.center = CGPointMake(button.center.x + delta_x, button.center.y + delta_y);
}
%end

void addHack(NSString *name, NSString *description, UIColor *theme, std::initializer_list<uint64_t> offsets, std::initializer_list<uint64_t> hackedHexes, std::initializer_list<uint64_t> originalHexes){
    if(menu == nil)
        return;
   
    std::vector<uint64_t> offsetVector;
    std::vector<uint64_t> hackedHexVector;
    std::vector<uint64_t> originalHexVector;    

    offsetVector.insert(offsetVector.begin(), offsets.begin(), offsets.end());
    hackedHexVector.insert(hackedHexVector.begin(), hackedHexes.begin(), hackedHexes.end());
    originalHexVector.insert(originalHexVector.begin(), originalHexes.begin(), originalHexes.end());
  
    Hack *h = [[Hack alloc] initWithHackName:name info:description fontName:font theme:theme offset:offsetVector hackedHex:hackedHexVector originalHex:originalHexVector];
    [menu addHack:h];
}



void addHook(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;  

    Hook *h = [[Hook alloc] initWithHookName:name info:description fontName:font theme:theme];
    [menu addHook:h];
}



void addSliderHook(NSString *name, NSString *description, UIColor *theme, float initialValue, float minValue, float maxValue){
    if(menu == nil)
        return;

    if(minValue > maxValue)
        return;

 
    SliderHook *sh = [[SliderHook alloc] initWithSliderHookName:name info:description fontName:font theme:theme initialValue:initialValue minValue:minValue maxValue:maxValue];
    [menu addHook:sh];
}



void addTextfieldHook(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return; 

    TextfieldHook *th = [[TextfieldHook alloc] initWithTextfieldHookName:name info:description fontName:font theme:theme];
    [menu addHook:th];
}



void addSwitch(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;

    Switch *s = [[Switch alloc] initWithSwitchName:name info:description fontName:font theme:theme];
    [menu addHook:s];
}



void writeData(uint64_t offset, uint64_t hex){
    if(menu == nil)
        return;   

    [menu writeTo:offset withHex:hex];
}

 


The error I am getting:

Spoiler

U-gay:/var/mobile/terrariacheats root# make package     
> Making all for tweak TerrariaCheats…                  
==> Preprocessing Tweak.xm…                             
==> Compiling ModMenu.mm (arm64)…                       
==> Compiling Hack.mm (arm64)…                          
==> Compiling Hook.mm (arm64)…                          
==> Compiling SliderHook.mm (arm64)…                    
==> Compiling TextfieldHook.mm (arm64)…                 
==> Compiling InfoView.mm (arm64)…                      
==> Compiling Switch.mm (arm64)…                        
==> Compiling Tweak.xm (arm64)…                         
In file included from Tweak.xm:1:                       

/var/mobile/terrariacheats/Macros.h:58:95: error: no matching function for call to 'getRealOffset'               
void *(*String_CreateString)(void *_this, const char *str) = (void *(*)(void *, const char *))getRealOffset();                                                           
                                     ^~~~~~~~~~~~~      
/var/mobile/terrariacheats/Macros.h:32:10: note: candidate function not viable: requires single argument 'offset', but no arguments were provided                         
uint64_t getRealOffset(uint64_t offset){                
         ^                                              
1 error generated.                                      

make[3]: *** [/var/theos/makefiles/instance/rules.mk:269: /var/mobile/terrariacheats/.theos/obj/debug/arm64/Tweak.xm.db442f46.o] Error 1                                  
rm /var/mobile/terrariacheats/.theos/obj/debug/arm64/Tweak.xm.mm                                                 
make[2]: *** [/var/theos/makefiles/instance/library.mk:33: /var/mobile/terrariacheats/.theos/obj/debug/arm64/TerrariaCheats.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: TerrariaCheats.all.tweak.variables] Error 2                 

U-gay:/var/mobile/terrariacheats root# make pckage      
make: *** No rule to make target 'pckage'.  Stop. 

 

 

Posted

Hey man this is basically saying that your phone does now recognize the file which tells it about 'pckage' the easiest way to fix this problem is by backing up and resesting your phone. 

I hope I helped in time

Thanks, 

Bokkie

Archived

This topic is now archived and is closed to further replies.

×
  • 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