MyProjects / Objective-C / pubg.xm
pubg.xm
Raw
@import Foundation;
@import UIKit;
@import iGMenu;
#import "IGAuth/IGAuth.h"
#import "Menu.h"
#import <substrate.h>

/* writeData & MS/MSHook example: https://pastebin.com/Vitfzqev */

void startAuthentication() {
    IGAuth *login = [[IGAuth alloc] init]; // Initiate iOSGods Authenticator
    
    // Use vipConnect for ViP hacks and use freeConnect generally or just for public hacks
    [login vipConnect:^{
    
    /* PUBG Cheats */
    	
    	[menu addSwitchWithIdentifier:APEncrypt("antenna") title:APEncrypt("Antenna Hack") description:APEncrypt("") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(0.99626296759) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@150];
        }];
    }];


    	[menu addSwitchWithIdentifier:APEncrypt("hide") title:APEncrypt("Hide Grass/Trees") description:APEncrypt("Enable on Menu Screen!") handler:^(BOOL on) {
        static APPatchedAddress *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(0.000005) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyValueAtIndex:1 newValue:@(0.5)];
        }];
    }];


 /*   	[menu addSwitchWithIdentifier:@"recoil" title:@"No Recoil" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }


        [APMemorySearch searchForValue:@(30) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(80) type:APMemorySearchTypeFloat range:0x32 handler:^(APMemorySearchResults *results) {
            		[results searchNearbyForValue:@(0.3) type:APMemorySearchTypeFloat range:0x32 handler:^(APMemorySearchResults *results) {
                    patched = [results modifyAllValuesWithNewValue:@487];
            	}];            
          	}];
        }];
    }];



        [menu addSwitchWithIdentifier:@"recoil" title:@"No Recoil #2" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(50528513) type:APMemorySearchTypeSignedInt32 handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(1) type:APMemorySearchTypeFloat range:0x32 handler:^(APMemorySearchResults *results) {
                 patched = [results modifyAllValuesWithNewValue:@0.001];     
			}];
		}];
    }];    	



        [menu addSwitchWithIdentifier:@"uaz" title:@"UAZ Speed Up" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
         if (patched && on == FALSE) {
             [patched revertPatch];
             return;
         }
      
        [APMemorySearch searchForValue:@(0.647058857) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@-999];
        }];
    }];
        
*/

    	[menu addSwitchWithIdentifier:APEncrypt("antstand") title:APEncrypt("Antenna When Standing") description:APEncrypt("") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(-1.68741035461) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@10000];
        }];
    }];
    


    	[menu addSwitchWithIdentifier:APEncrypt("antrunning") title:APEncrypt("Antenna When Running") description:APEncrypt("") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(7.131427) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@88888];
        }];
    }];

/*
    	[menu addSwitchWithIdentifier:APEncrypt("antscope") title:APEncrypt("8x Scope Antenna") description:APEncrypt("") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(7.1689529418945) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@999999999];
        }];
    }];
*/



    	[menu addSwitchWithIdentifier:APEncrypt("anthelmet") title:APEncrypt("Level 3 Helmet Antenna") description:APEncrypt("") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(7.4993133544922) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@999999];
        }];
    }];



/*    	[menu addSwitchWithIdentifier:APEncrypt("wallbreak") title:APEncrypt("Break Through Walls") description:APEncrypt("") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(454211153506199726) type:APMemorySearchTypeUnsignedInt64 handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@4542111537250231303];
        }];
    }];
*/



    	[menu addSwitchWithIdentifier:APEncrypt("antarmor") title:APEncrypt("Level 3 Armor Antenna") description:APEncrypt("") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(7.4993133544922) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@999];
        }];
    }];


/*    	
	[menu addSwitchWithIdentifier:APEncrypt("white") title:APEncrypt("White Players") description:APEncrypt("All players glow white! Makes it easier to spot. This seems to only work in lobby with the new update.") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(0.05499718338) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(1) type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@500];
            }];
        }];
    }];
*/
// its still Working
        [menu addSwitchWithIdentifier:@"kAntennas"
                            title:@"Antenna Heads"
                      description:@"Everyone has an antenna head. See players position in the vicinity."
                          handler:^(BOOL on) {

						  static APPatchedAddress *patch = nil;
						  if (patch) {
						  	if (on) {
						  		[patch applyPatch];
						  	} else {
						  		[patch revertPatch];
						  	}
						  	return;
						  }
                          if (on == FALSE) {
                          	return;
                          }

                              [APMemorySearch searchForValue:@(88.50576019287)
                              type:APMemorySearchTypeFloat
                           handler:^(APMemorySearchResults *results) {
                           	NSLog(@"MENU initial results: %d\n%@", (int)results.count, results);
                               [results searchNearbyForValue:@(1)
                                                        type:APMemorySearchTypeFloat
                                                       range:0x20
                                                     handler:^(APMemorySearchResults *results) {
                                                         NSLog(@"MENU results: %d\n%@", (int)results.count, results);
                                                         patch = [results modifyValueAtIndex:7 newValue:@(300)];

                                                     }];
                           }];

    	}];
/*		
    	[menu addSwitchWithIdentifier:@"new no recoil" title:@"new No Recoil" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }


        [APMemorySearch searchForValue:@(50) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(200) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
            	[results searchNearbyForValue:@(0.5) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
					[results searchNearbyForValue:@(40) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
						[results searchNearbyForValue:@(0.3) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {

							patched = [results modifyAllValuesWithNewValue:@300];
						}];
					}];
				}];            
          	}];
        }];
    }];



        [menu addSwitchWithIdentifier:@"new no recoil" title:@"new No Recoil #2" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(1) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(10000) type:APMemorySearchTypeSignedInt32 range:0x512 handler:^(APMemorySearchResults *results) {
				[results searchNearbyForValue:@(100000) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
                    patched = [results modifyAllValuesWithNewValue:@0.001];     
				}];
		   }];
        }];
    }];	 
*/

		[menu addSwitchWithIdentifier:@"headshot mode" title:@"headshot mode" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }


        [APMemorySearch searchForValue:@(-88.66608428955) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
			[results searchNearbyForValue:@(26) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
				[APMemorySearch searchForValue:@(26) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
					patched = [results modifyAllValuesWithNewValue:@-460];
				}];
			}];
		}];            
	}];

		[menu addSwitchWithIdentifier:@"headshot mode" title:@"headshot mode #2" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }


        [APMemorySearch searchForValue:@(-88.73961639404) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
			[results searchNearbyForValue:@(28) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
				[APMemorySearch searchForValue:@(28) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
					patched = [results modifyAllValuesWithNewValue:@-560];
				}];
			}];
		}];            
	}];	

		[menu addSwitchWithIdentifier:@"headshot mode" title:@"headshot mode #3" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }


        [APMemorySearch searchForValue:@(9.201618) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
			[results searchNearbyForValue:@(30.5) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
				[results searchNearbyForValue:@(25) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
					[APMemorySearch searchForValue:@(25) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
						[results searchNearbyForValue:@(30.5) type:APMemorySearchTypeFloat range:0x512 handler:^(APMemorySearchResults *results) {
							patched = [results modifyAllValuesWithNewValue:@251];
						}];
					}];
				}];            
			}];
		}];
	}];
	
    	[menu addSwitchWithIdentifier:APEncrypt("magic bullet") title:APEncrypt("magic bullet") description:APEncrypt("Your bullets are now enchanted with magic!") handler:^(BOOL on) {
        static APPatchedAddress *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(4740038608910024704) type:APMemorySearchTypeUnsignedInt64 handler:^(APMemorySearchResults *results) {
                patched = [results modifyValueAtIndex:0 newValue:@(5311743973423316992)];
        }];
    }];
	
    	[menu addSwitchWithIdentifier:APEncrypt("Aim Assist") title:APEncrypt("Aim Assist") description:APEncrypt("it will help you move and stay on target") handler:^(BOOL on) {
        static APPatchedAddress *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
		[APMemorySearch searchForValue:@(7947042217568109714) type:APMemorySearchTypeUnsignedInt64 handler:^(APMemorySearchResults *results) {
                patched = [results modifyValueAtIndex:0 newValue:@(4715268810975346688)];
        }];
    }];
	
    	[menu addSwitchWithIdentifier:APEncrypt("Bullet curving to enemy") title:APEncrypt("Bullet curving to enemy") description:APEncrypt("Bullet curves to target") handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(4715268810947428352) type:APMemorySearchTypeUnsignedInt64 handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@4715268810975346688];
        }];
    }];

		[menu addSwitchWithIdentifier:@"antiban" title:@"antiban" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }


        [APMemorySearch searchForValue:@(2.718519e-43) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
			[results searchNearbyForValue:@(3.7615819e-37) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
				[results searchNearbyForValue:@(2) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
					[results searchNearbyForValue:@(1) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
						[APMemorySearch searchForValue:@(1) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
							patched = [results modifyAllValuesWithNewValue:@0];
						}];
					}];
				}];            
			}];
		}];
	}];
/*
        [menu addSwitchWithIdentifier:@"wood and gold AKM" title:@"wood and gold AKM" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(101001) type:APMemorySearchTypeSignedInt32 handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@1101001007];
        }];
    }];
*/	

   /* 	[menu addSwitchWithIdentifier:@"black" title:@"Black Sky" description:@"The sky becomes black." handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(1.5) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(0.69773697853) type:APMemorySearchTypeFloat range:0x200 handler:^(APMemorySearchResults *results) {
            		[APMemorySearch searchForValue:@(1.5) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@0];
            	}];            
          	}];
        }];
    }];
    


    [menu addSwitchWithIdentifier:@"kFastCar" title:@"Fast Car" description:@"You got a fast car, I want a ticket to anywhere. Maybe we make a deal, maybe together we can get somewhere. Any place is better. Starting from zero got nothing to lose. Maybe we'll make something. Me myself I got nothing to prove" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(0.0005) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(0.0005) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@2];
            }];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"kFloatingCars" title:@"Floating Cars / Super Jump" description:@"Join training, get in a car and it will float up. Everyone can see it! Switch from driver to passenger to make the car drop from the sky." handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(-950) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            patched = [results modifyAllValuesWithNewValue:@100];
        }];
    }];

    
    [menu addSwitchWithIdentifier:@"kLongJump" title:@"Long Jump" description:@"You now have a usable long jump." handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(-950) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            patched = [results modifyAllValuesWithNewValue:@550];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"kFOV" title:@"insane view distance/fov" description:@"gives you extreme far FOV you see everything" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValues:@[ @220, @178, @15] type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            patched = [results modifyAllValuesWithNewValue:@1200];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"knNoGrassOrTrees2" title:@"no grass or trees v2" description:@"This one was weird for me at first but it worked, comment if it worked for you or not" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(0.80000001192F) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            patched = [results modifyAllValuesWithNewValue:0];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"knNoGrassOrTrees" title:@"no grass or trees" description:@"This one was weird for me at first but it worked, comment if it worked for you or not" handler:^(BOOL on) {
        static APPatchedAddress *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@137 type:APMemorySearchTypeSignedInt32 handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@1.3 type:APMemorySearchTypeFloat range:0x40 includeOriginalResults:FALSE handler:^(APMemorySearchResults *results) {
                patched = [results modifyValueAtIndex:0 newValue:@(-1)];
            }];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"kCHams" title:@"Chams" description:@"All players ahould glow white!" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(0.05499718338) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(1) type:APMemorySearchTypeFloat range:0x50 handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@500];
            }];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"kUAZ" title:@"UAZ/JEEP SPEED/DRIFTING" description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(0.647058857) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            patched = [results modifyAllValuesWithNewValue:@(-999999)];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"kUAZBelowWater" title:@"you will be able to drive the uaz/jeep below water as if on land." description:@"" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(150) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@85 type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                [results searchNearbyForValue:@45 type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                    [results searchNearbyForValue:@(-129) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                        [results searchNearbyForValue:@(-85) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                            patched = [results modifyAllValuesWithNewValue:@(99996)];
                        }];
                    }];
                }];
            }];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"kMagicBullet" title:@"Magic Bullet" description:@"Magic bullet works by you shooting anywhere near the enemy and the bullet hits them even when you miss. Can probably be mixed with aimbot!" handler:^(BOOL on) {
        static APPatchedGroup *patched1 = nil;
        static APPatchedGroup *patched2 = nil;
        if (patched1 && patched2) {
            patched1.active = on;
            patched2.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(1104805888) type:APMemorySearchTypeSignedInt32 handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(180) type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                patched1 = [results modifyAllValuesWithNewValue:@75];
                
                [APMemorySearch searchForValue:@15 type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
                    [results searchNearbyForValue:@28 type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                        [results searchNearbyForValue:@16 type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                            [results searchNearbyForValue:@26 type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                                [results searchNearbyForValue:@8 type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                                    [results searchNearbyForValue:@1 type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                                        patched2 = [results modifyAllValuesWithNewValue:@111];
                                    }];
                                }];
                            }];
                        }];
                    }];
                }];
            }];
        }];
    }];
    
    [menu addSwitchWithIdentifier:@"kMagicBulletv2" title:@"Magic Bullet v2" description:@"Magic bullet works by you shooting anywhere near the enemy and the bullet hits them even when you miss. Can probably be mixed with aimbot!" handler:^(BOOL on) {
        static APPatchedGroup *patched = nil;
        if (patched) {
            patched.active = on;
            return;
        } else if (on == FALSE) {
            return;
        }
        [APMemorySearch searchForValue:@(90.77570343018) type:APMemorySearchTypeFloat handler:^(APMemorySearchResults *results) {
            [results searchNearbyForValue:@(8.0) type:APMemorySearchTypeFloat range:0x20 handler:^(APMemorySearchResults *results) {
                patched = [results modifyAllValuesWithNewValue:@100];
            }];
        }];
    }];

    */

    /* End of PUBG Cheats */


    /* More switches and examples here: https://pastebin.com/hwBc2R5x */
    

    menu.sharingIconBorderColor = [UIColor whiteColor];
    menu.socialShareMessage = APEncrypt("I'm using PUBG MOBILE Cheats by DiDA from iOSGods.com. @iOSGodsCom");
    APTheme.baseColor = rgba(0xFF0000, .7);

    /* For futher customizations, you can specify custom colors for every part of the menu! See: https://pastebin.com/08bEfsiG */
    

    [menu openAfter:0 width:260 maxVisibleToggles:5
    title:APEncrypt("Made for iOSGods.com")
    credits:APEncrypt("Made by DiDA for iOSGods.com!")
        gesture:APGestureThreeFingerSwipeDown // Just in case someone wants to still use gestures instead of the button
        onFirstLaunch:^{

    [menu listenChanges:^(id <APPatchItem> item) {
    
        NSString *identifier = item.identifier;
        NSString *state;
        if (item.currentState == APPatchItemStateActive) {
            state = @"enabled";
        } else {
            state = @"disabled";
        }
        if (item.type == APPatchItemTypeTextField) {
            UIKeyTextField *textField = (UIKeyTextField *)item;
            float value = textField.text.floatValue;
 
            NSLog(@"Value of text field %@ (%@): %f", identifier, state, value);
        }
        if (item.type == APPatchItemTypeKeySlider) {
            UIKeySlider *slider = (UIKeySlider *)item;
          
            float value = slider.value;
            NSLog(@"Value of slider %@ (%@): %f", identifier, state, value);
        }
        if (item.type == APPatchItemTypeSwitch) {
            UIViewSwitcher *switcher = (UIViewSwitcher *)item;
            BOOL value = switcher.isOn;
 
            NSLog(@"Value of switch %@ (%@): %d", identifier, state, value);
        }
    }];

        /* Do something after the menu appears here */

        NSLog(@"iGMM Initialized");
        }];
    }]; // iGAuth
}

void alertDismissed() {
    float secondsToWaitForAlertToAnimateOut = 0.5;
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(secondsToWaitForAlertToAnimateOut * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        startAuthentication();
    });
}

void setup() {
    // If you want a message displayed when your target app gets updated, uncomment the line below and add your current exact app version. The templatescripts.sh should automatically do this for you. :)
    //[IGAppVersionChecker checkThatCurrentAppDoesNotExceedVersion:@"0.9.5"];

    SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindowWidth:250];

    [alert addButton: APEncrypt("Visit iOSGods.com!") actionBlock: ^(void) {
        [[UIApplication sharedApplication] openURL: [NSURL URLWithString: APEncrypt("https://iosgods.com/forum/13-free-jailbroken-cydia-cheats/")]];
    }];

    [alert addButton: APEncrypt("Visit the Clubs!") actionBlock: ^(void) {
        [[UIApplication sharedApplication] openURL: [NSURL URLWithString: APEncrypt("https://iosgods.com/clubs/")]];
    }];

    alert.shouldDismissOnTapOutside = NO; // Dismiss alert when tapped outside? YES or NO
    alert.customViewColor = [UIColor colorWithRed:0.16 green:0.40 blue:0.75 alpha:1.0]; // Overwrite SCLAlertView colors
    //[alert addTimerToButtonIndex:3 reverse:YES]; // Adds countdown timer for user to see

    [alert showSuccess: nil // Success, Error, Notice, Warning, Info, Edit, Custom, Waiting
              subTitle: APEncrypt("PUBG MOBILE Cheats by DiDA for iOSGods.com!\n\nYou must login to your iOSGods account to activate this cheat. Read the hack's official topic on iOSGods for more information & updates!")
      closeButtonTitle: APEncrypt("Thank you!") // The text on the button which closes the popup
              duration: 60.0f]; // Seconds until the popup auto closes.
        [alert alertIsDismissed:^{
            alertDismissed();
        }];
}

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();
}