Jump to content

Bullet Force Mod Menu Source Code


261 posts in this topic

Recommended Posts

Updated (edited)

Updated GitHub: https://github.com/shmoo419/BulletForceModMenu

 

Offsets are removed. A simple, efficient menu based around arrays. Lots of global floats because for some reason, when I passed in a float via a parameter, it went to 0.0 on my device but not in iOS Simulator -_-

Individual calls to writedata are present because for instant reload and always headshot, more than one offset was needed. I tried keeping everything in the arrays but it eventually became a cluttered mess of if statements so I just went with individual calls.

I was able to get away with hardcoding frame values because I'm the only one using this menu.

Hidden Content

    #import <UIKit/UIKit.h>
    #import "writeData.h"
    #import "Macros.h"
    
    void makeZeroXLabel(CGFloat, CGFloat, CGFloat, CGFloat);
    
    int arrayCreationCount = 0;
    
    float labelSpacing = 5.0;
    float switchSpacing = 0.5;
    float bulletTypeAndGrenadeTypeSpacing = 8.0;
    
    float labelXValue = 8.0;
    float labelWidth = 270.0;
    float labelHeight = 21.0;
    
    float switchXValue = 319.0;
    float switchWidth = 51.0;
    float switchHeight = 31.0;
    
    float bulletTypeAndGrenadeTypeXValue = 102.0;
    float bulletTypeAndGrenadeTypeWidth = 173.0;
    float bulletTypeAndGrenadeTypeHeight = 30.0;
    
    NSArray *labelArray;
    NSArray *bulletArray;
    NSArray *grenadeArray;
    
    NSUserDefaults *defaults;
    
    UIBlurEffect *blurEffect;
    UIView *blurEffectView;
    
    UIButton *bulletChooserButton;
    UIButton *closeMenu;
    UIButton *set;
    
    UIView *closeButtonBackgroundView;
    UIView *separator;
    
    UIViewController *main;
    
    UILabel *writeToOffset;
    UILabel *zeroX;
    UILabel *typeStatus;
    
    UIScrollView *normalModsScrollView;
    UIScrollView *bulletTypeScrollView;
    UIScrollView *grenadeTypeScrollView;
    
    UISegmentedControl *pageSelector;
    
    UITextField *offsetTextField;
    UITextField *hexTextField;
    
    UITableView *bulletTypeChooser;
    UITableView *grenadeTypeChooser;
    
    uint64_t offsetArray[20] = {- removed -};
    uint64_t moddedHexArray[17] = {- removed -};
    uint64_t originalHexArray[20] = {- removed -};
    uint64_t chooserHexes[25] = {- removed -};
    
    %hook UnityAppController
    
    - (void)applicationDidBecomeActive:(id)arg1 {
    %orig;
    
    main = [UIApplication sharedApplication].keyWindow.rootViewController;
    
    bulletChooserButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    bulletChooserButton.frame = CGRectMake((main.view.frame.size.width/2)-15,(main.view.frame.size.height/2)+50,30,30);
    bulletChooserButton.backgroundColor = [UIColor clearColor];
    bulletChooserButton.layer.cornerRadius = 16;
    bulletChooserButton.layer.borderWidth = 2.0f;
    bulletChooserButton.layer.borderColor = [UIColor colorWithRed:254.00/255.00 green:184.00/255.00 blue:0.00/255.00 alpha:1.0f].CGColor;
    [bulletChooserButton addTarget:self action:@[member='selectorr'](showMenu) 
    forControlEvents:UIControlEventTouchDragInside];
    [main.view addSubview:bulletChooserButton];
    }
    
    %new
    - (void)showMenu {
        defaults = [NSUserDefaults standardUserDefaults];
    
        if(arrayCreationCount == 0){
    
        [self setupMenuGUI];
        [self setupSwitchesAndLabels];
        [self setupBulletTypeSection];
        [self setupGrenadeTypeSection];
        [self setupCloseButtonStuff];
        }
        
        arrayCreationCount++;
    }
    
    %new
    - (void)setupBulletTypeSection {
        bulletTypeScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 73, 376, 184)];
        bulletTypeScrollView.backgroundColor = [UIColor clearColor];
        bulletTypeScrollView.contentSize = CGSizeMake(376, 640);
        bulletTypeScrollView.hidden = true;
        [blurEffectView addSubview:bulletTypeScrollView];
        
        [self setupBulletTypeButtons];
    }
    
    %new
    - (void)setupGrenadeTypeSection {
        grenadeTypeScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 73, 376, 184)];
        grenadeTypeScrollView.backgroundColor = [UIColor clearColor];
        grenadeTypeScrollView.contentSize = CGSizeMake(376, 0);
        grenadeTypeScrollView.hidden = true;
        [blurEffectView addSubview:grenadeTypeScrollView];
        
        [self setupGrenadeTypeButtons];
    }
    
    %new
    - (void)setupSwitchesAndLabels {
        labelArray = @[@"No Recoil", @"Better Aim", @"Infinite Ammo", @"Modded Gravity", @"Anti Flashbang", @"Everyone Orange", @"Crosshairs Always Enabled", @"25555.0 Pickup Range", @"Sniper Light Shows Through Walls", @"Knife Button Always Shows", @"Knife Faster", @"Debug Rechamber Animation", @"Instant Reload", @"God Mode Lobby", @"Always Headshot", @"All Camos", @"Killstreaks Ready", @"Deaths Don't Count", @"Instant Grenade Explosion"];
        
        UISwitch *s;
        
        for(int i=0; i<[labelArray count]; i++){
            [normalModsScrollView addSubview:[self makeHackLabel:labelArray[i]]];
            
            s = [self makeHackSwitch:i];
            
            [normalModsScrollView addSubview:s];
            [self setSwitchStateBasedOnPrefs:i withSwitch:s];
            
            if([defaults boolForKey:[NSString stringWithFormat:@"%d", (int)s.tag]]){
                [self switchToggled:s];
            }
            
        }
    }
    
    %new
    - (void)setupBulletTypeButtons {
        bulletArray = @[@"Original", @"M4A1", @"Famas", @"AK 12", @"SCAR-H", @"MP5", @"870 MCS", @"M40A5", @"MPX", @"SAIGA 12K", @"MG4", @"AS VAL", @"RPG", @"M200", @"Compact .45", @"MP412 REX", @"M320 HE", @"M320 DART", @"Hand", @"Butterfly Knife", @"G18"];
        
        for(int i=0; i<[bulletArray count]; i++){
            [bulletTypeScrollView addSubview:[self makeTypeChooserButton:bulletArray[i] withTag:i]];
        }
    }
    
    %new
    - (void)setupGrenadeTypeButtons {
        bulletTypeAndGrenadeTypeSpacing = 8.0;
        
        grenadeArray = @[@"Original", @"Frag Grenade", @"Smoke Grenade", @"Flashbang"];
        
        int bulletArrayLength = (int)[bulletArray count];
        
        for(int i=0; i<[grenadeArray count]; i++){
            [grenadeTypeScrollView addSubview:[self makeTypeChooserButton:grenadeArray[i] withTag:i+bulletArrayLength]];
        }
    }
    
    %new
    - (void)setupMenuGUI {
        blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
        
        blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
        blurEffectView.frame = CGRectMake(145, 44, 376, 286);
        [main.view addSubview:blurEffectView];
        
        writeToOffset = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 376, 19)];
        writeToOffset.text = @"Write To A Custom Offset";
        writeToOffset.textAlignment = NSTextAlignmentCenter;
        [writeToOffset setFont:[UIFont systemFontOfSize:12]];
        [blurEffectView addSubview:writeToOffset];
        
        makeZeroXLabel(8, 28, 22, 21);
        [blurEffectView addSubview:zeroX];
        
        makeZeroXLabel(205, 28, 22, 21);
        [blurEffectView addSubview:zeroX];
        
        offsetTextField = [[UITextField alloc] initWithFrame:CGRectMake(29, 24, 140, 30)];
        offsetTextField.placeholder = @"OFFSET";
        offsetTextField.returnKeyType = UIReturnKeyDone;
        offsetTextField.tag = 0;
        [blurEffectView addSubview:offsetTextField];
        
        hexTextField = [[UITextField alloc] initWithFrame:CGRectMake(228, 24, 140, 30)];
        hexTextField.placeholder = @"HEX";
        hexTextField.returnKeyType = UIReturnKeyDone;
        hexTextField.tag = 1;
        [blurEffectView addSubview:hexTextField];
        
        set = [UIButton buttonWithType:UIButtonTypeCustom];
        set.frame = CGRectMake(157, 51, 63, 26);
        set.backgroundColor = [UIColor clearColor];
        [set setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [set setTitle:@"Set" forState:UIControlStateNormal];
        [set addTarget:self action:@[member='selectorr'](writeToCustomOffset) forControlEvents:UIControlEventTouchDown];
        [blurEffectView addSubview:set];
        
        pageSelector = [[UISegmentedControl alloc] initWithItems:@[@"Normal Mods", @"Bullet Type", @"Grenade Type"]];
        pageSelector.frame = CGRectMake(87, 257, 289, 29);
        [pageSelector setSelectedSegmentIndex:0];
        [pageSelector addTarget:self
                         action:@[member='selectorr'](changeView:)
               forControlEvents:UIControlEventValueChanged];
        [blurEffectView addSubview:pageSelector];
        
        normalModsScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 73, 376, 184)];
        normalModsScrollView.backgroundColor = [UIColor clearColor];
        normalModsScrollView.contentSize = CGSizeMake(376, 580);
        [blurEffectView addSubview:normalModsScrollView];
    }
    
    %new
    - (void)setupCloseButtonStuff {
        separator = [[UIView alloc] initWithFrame:CGRectMake(0, 73, 376, 1)];
        separator.backgroundColor = [UIColor blackColor];
        [blurEffectView addSubview:separator];
        
        closeButtonBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 258, 87, 28)];
        closeButtonBackgroundView.backgroundColor = rgb(0xaa0114);
        closeButtonBackgroundView.layer.cornerRadius = 5;
        [blurEffectView addSubview:closeButtonBackgroundView];
        
        closeMenu = [UIButton buttonWithType:UIButtonTypeCustom];
        closeMenu.frame = CGRectMake(0, 258, 87, 30);
        closeMenu.backgroundColor = [UIColor clearColor];
        [closeMenu setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [closeMenu setTitle:@"Close" forState:UIControlStateNormal];
        [closeMenu addTarget:self action:@[member='selectorr'](closeModMenu) forControlEvents:UIControlEventTouchDown];
        [blurEffectView addSubview:closeMenu];
    }
    
    %new
    - (void)setSwitchStateBasedOnPrefs:(int)tag withSwitch:(UISwitch *)s {
        s.on = [defaults boolForKey:[NSString stringWithFormat:@"%d", tag]];
    }
    
    %new
    - (void)switchToggled:(UISwitch *)sender {
        int switchTag = (int)sender.tag;
        
        //instant reload
        if(switchTag == 12){
            if(sender.on){
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
            else{
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
        }
        else if(switchTag == 13){
            if(sender.on){
                write(offsetArray[switchTag-1], moddedHexArray[switchTag-1]);
            }
            else{
                write(offsetArray[switchTag-1], originalHexArray[switchTag-1]);
            }
        }
        //always headshot
        else if(switchTag == 14){
            if(sender.on){
                write(- removed -, - removed -);
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
            else{
                write(- removed -, - removed -);
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
        }
        else{
            if(switchTag > 14){
                if(sender.on){
                    write(offsetArray[switchTag-2], moddedHexArray[switchTag-2]);
                }
                else{
                    write(offsetArray[switchTag-2], originalHexArray[switchTag-2]);
                }
            }
            else{
                if(sender.on){
                    write(offsetArray[switchTag], moddedHexArray[switchTag]);
                }
                else{
                    write(offsetArray[switchTag], originalHexArray[switchTag]);
                }
            }
        }
        
        [defaults setBool:sender.on forKey:[NSString stringWithFormat:@"%d", (int)sender.tag]];
    }
    
    %new
    - (void)changeView:(UISegmentedControl *)sender {
        [self showViewBasedOnSelectedIndex:(int)pageSelector.selectedSegmentIndex];
    }
    
    %new
    - (void)writeToCustomOffset {
        [offsetTextField resignFirstResponder];
        [hexTextField resignFirstResponder];
        
        write([offsetTextField.text longLongValue], [hexTextField.text longLongValue]);
        
        offsetTextField.text = @"";
        hexTextField.text = @"";
    }
    
    %new
    - (void)applyTypeChooserHack:(UIButton *)button {
        [typeStatus removeFromSuperview];
        
        NSAttributedString *typeStatusBold;
        NSString *text;
    
        if((int)button.tag>19){
            write(- removed -, chooserHexes[(int)button.tag]);
    
            text = [NSString stringWithFormat:@"Grenade type changed to %@", button.titleLabel.text];
        }
        else{
            write(- removed -, chooserHexes[(int)button.tag]);
    
            text = [NSString stringWithFormat:@"Bullet type changed to %@", button.titleLabel.text];
        }
        
        typeStatus = [[UILabel alloc] initWithFrame:CGRectMake(138, 6, 391, 21)];
        typeStatus.textColor = [UIColor redColor];
        typeStatus.textAlignment = NSTextAlignmentCenter;
        typeStatusBold = [[NSAttributedString alloc] initWithString:text
                                                         attributes:@{ NSFontAttributeName: [UIFont boldSystemFontOfSize:18.0] }];
        typeStatus.attributedText = typeStatusBold;
        
        [main.view addSubview:typeStatus];
        
        [self performSelector:@[member='selectorr'](removeLabel) withObject:@NO afterDelay:3];
    }
    
    %new
    - (void)showViewBasedOnSelectedIndex:(int)index {
        if(index == 0){
            bulletTypeScrollView.hidden = true;
            grenadeTypeScrollView.hidden = true;
            normalModsScrollView.hidden = false;
        }
        else if(index == 1){
            bulletTypeScrollView.hidden = false;
            grenadeTypeScrollView.hidden = true;
            normalModsScrollView.hidden = true;
        }
        else{
            bulletTypeScrollView.hidden = true;
            grenadeTypeScrollView.hidden = false;
            normalModsScrollView.hidden = true;
        }
    }
    
    %new
    - (UIButton *)makeTypeChooserButton:(NSString *)title withTag:(int)tag {
        UIButton *toReturn = [UIButton buttonWithType:UIButtonTypeCustom];
        toReturn.frame = CGRectMake(bulletTypeAndGrenadeTypeXValue, bulletTypeAndGrenadeTypeSpacing, bulletTypeAndGrenadeTypeWidth, bulletTypeAndGrenadeTypeHeight);
        toReturn.backgroundColor = [UIColor clearColor];
        toReturn.tag = tag;
        [toReturn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [toReturn setTitle:title forState:UIControlStateNormal];
        [toReturn addTarget:self action:@[member='selectorr'](applyTypeChooserHack:) forControlEvents:UIControlEventTouchDown];
    
        bulletTypeAndGrenadeTypeSpacing+=30.0f;
    
        return toReturn;
    }
    
    %new
    - (UISwitch *)makeHackSwitch:(int)tag {
        UISwitch *toReturn = [[UISwitch alloc] initWithFrame:CGRectMake(switchXValue, switchSpacing, switchWidth, switchHeight)];
        toReturn.transform = CGAffineTransformMakeScale(0.5, 0.5);
        toReturn.onTintColor = rgb(0x228b28);
        toReturn.tag = tag;
        [toReturn addTarget:self action:@[member='selectorr'](switchToggled:) forControlEvents:UIControlEventValueChanged];
    
        switchSpacing+=30.0f;
        
        return toReturn;
    }
    
    %new
    - (UILabel *)makeHackLabel:(NSString *)text {
        UILabel *toReturn = [[UILabel alloc] initWithFrame:CGRectMake(labelXValue, labelSpacing, labelWidth, labelHeight)];
        toReturn.text = text;
    
        labelSpacing+=30.0f;
        
        return toReturn;
    }
    
    %new
    - (void)removeLabel {
        [typeStatus removeFromSuperview];
    }
    
    %new
    - (void)closeModMenu {
        arrayCreationCount = 0;
        labelSpacing = 5.0;
        switchSpacing = 0.5;
        bulletTypeAndGrenadeTypeSpacing = 8.0;
    
        [blurEffectView removeFromSuperview];
    }
    %end
    
    void makeZeroXLabel(CGFloat x, CGFloat y, CGFloat w, CGFloat h){
        zeroX = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
        zeroX.text = @"0x";
    }

Updated by Guest
Posted

This is superb @Shmoo well done. And I know you pretty much spend a lot of time working on the GUI and though it is totally in individual because of the array.

 

But it's okay then. +Rep. :)

  • Our picks

    • Era Merge v1.0.1 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Era Merge By ANLOFT YAZILIM LIMITED SIRKETI
      Bundle ID: com.anloft.eramerge
      App Store Link: https://apps.apple.com/us/app/era-merge/id6783998492?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Ticket
      • 0 replies
    • Era Merge v1.0.1 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Era Merge By ANLOFT YAZILIM LIMITED SIRKETI
      Bundle ID: com.anloft.eramerge
      App Store Link: https://apps.apple.com/us/app/era-merge/id6783998492?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Ticket
      • 0 replies
    • Merge Cat Cafe: Decorate v1.1.50 [ +11 Cheats ] Currency Max
      Modded/Hacked App: Merge Cat Cafe: Decorate By StandEgg Co., Ltd
      Bundle ID: com.standegg.mergecatcafe2
      App Store Link: https://apps.apple.com/us/app/merge-cat-cafe-decorate/id6670415194?uo=4

      🤩 Hack Features

      - Gems Freeze
      - Coins Freeze
      - Booster Freeze
      - Box Items Freeze
      - Energy 0 Play Unlimited
      :::: VIP ::::
      - ADS NO
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Energy
      - Unlimited Booster
      - Unlimited Box Items
      • 0 replies
    • Merge Cat Cafe: Decorate v1.1.50 [ +11 Jailed ] Currency Max
      Modded/Hacked App: Merge Cat Cafe: Decorate By StandEgg Co., Ltd
      Bundle ID: com.standegg.mergecatcafe2
      App Store Link: https://apps.apple.com/us/app/merge-cat-cafe-decorate/id6670415194?uo=4

      🤩 Hack Features

      - Gems Freeze
      - Coins Freeze
      - Booster Freeze
      - Box Items Freeze
      - Energy 0 Play Unlimited
      :::: VIP ::::
      - ADS NO
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Energy
      - Unlimited Booster
      - Unlimited Box Items
      • 0 replies
    • Crossword Master - Word Puzzle v2.1.0 [ +3 Cheats  ] Currency Max
      Modded/Hacked App: Crossword Master - Word Puzzle By Easybrain Ltd
      Bundle ID: com.easybrain.crossword.puzzles
      App Store Link: https://apps.apple.com/us/app/crossword-master-word-puzzle/id6547858927?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coins
      - Unlimited Booster
      • 0 replies
    • Crossword Master - Word Puzzle v2.1.0 [ +3 Jailed ] Currency Max
      Modded/Hacked App: Crossword Master - Word Puzzle By Easybrain Ltd
      Bundle ID: com.easybrain.crossword.puzzles
      App Store Link: https://apps.apple.com/us/app/crossword-master-word-puzzle/id6547858927?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coins
      - Unlimited Booster
      • 0 replies
    • ZakuzakuSlash +5 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: ZakuzakuSlash By nekosuko
      Bundle ID: jp.nekosuko.zakuzakuslash
      App Store Link: https://apps.apple.com/us/app/zakuzakuslash/id6749934570?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - XP Multiplier
      - Unlimited Gold -> Will increase instead of decrease.
        • Thanks
        • Winner
        • Like
      • 2 replies
    • Piggy Land 3D v1.2.2 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Piggy Land 3D By PIXON PTE. LTD.
      Bundle ID: farm.piggy.animal.jam.away
      App Store Link: https://apps.apple.com/us/app/piggy-land-3d/id6762121301?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coin
      - Unlimited Booster
      - Custom Level
        • Like
      • 1 reply
    • Piggy Land 3D v1.2.2 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Piggy Land 3D By PIXON PTE. LTD.
      Bundle ID: farm.piggy.animal.jam.away
      App Store Link: https://apps.apple.com/us/app/piggy-land-3d/id6762121301?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coin
      - Unlimited Booster
      - Custom Level
      • 0 replies
    • Dwarfs Diggers: Idle Master v0.7.4 [ +4 Jailed ] Currency Freeze
      Modded/Hacked App: Dwarfs Diggers: Idle Master By BLACK BOX DIGITAL LLP
      Bundle ID: com.bbdigital.idle.dwarfs.master
      App Store Link: https://apps.apple.com/us/app/dwarfs-diggers-idle-master/id6769121279?uo=4

      🤩 Hack Features

      - Currency Freeze
      - Resources Freeze
      - Energy Freeze
      - Troop Drop Unlimited
        • Like
      • 3 replies
    • Dwarfs Diggers: Idle Master v0.7.4 [ +4 Cheats ] Currency Freeze
      Modded/Hacked App: Dwarfs Diggers: Idle Master By BLACK BOX DIGITAL LLP
      Bundle ID: com.bbdigital.idle.dwarfs.master
      App Store Link: https://apps.apple.com/us/app/dwarfs-diggers-idle-master/id6769121279?uo=4

      🤩 Hack Features

      - Currency Freeze
      - Resources Freeze
      - Energy Freeze
      - Troop Drop Unlimited
        • Like
      • 1 reply
    • Metal Slug Rush v1.0.0 [ +9 APK MOD ] Currency Max
      Mod APK Game Name: Metal Slug Rush
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.ringgames.msm

      🤩 Hack Features

      - Unlimited Gold
      - Unlimited Gems
      - Unlimited Energy
      - Unlimited Silver keys
      - Unlimited Golden Keys
      - Unlimited Special Keys
      - Unlimited Blueprint
      - Unlimited Token
      - Unlimited Ticket +3
        • Agree
        • Like
      • 1 reply
×
  • 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