├── README.md └── Tweak.xm /README.md: -------------------------------------------------------------------------------- 1 | # pg3d-menu-source-code 2 | source code for a pixel gun menu i worked on for way too long 3 | -------------------------------------------------------------------------------- /Tweak.xm: -------------------------------------------------------------------------------- 1 | #import "Menu.h" 2 | #import 3 | #import "Vector2.hpp" 4 | #import "Unity.h" 5 | #import "Vector3Header.hpp" 6 | 7 | float speedValue = [menu getFloat:@"Speed Modifier"]; 8 | float jumpValue = [menu getFloat:@"Jump Modifier"]; 9 | //上丙下丅丝专与不下 - PhotonPlayer 10 | void *(*Fly)(void *instance, bool isOn); 11 | void *(*XRay)(void *instance, bool isOn); 12 | void *(*Noclip)(void *instance, float radius); 13 | void *(*ChatSpam)(void *instance, void *msg, bool clanLogo, void *msg2); 14 | void *(*AddWeapon)(void *instance, int weaponRecord, int score, bool equipIfNeeded, bool fromProviding, int _ammoInClip, int _ammoInBackpack); 15 | //void *(*Component_GetTransform)(void *component); 16 | //Vector3 (*Transform_get_localScale)(void *transform); 17 | //void *(*Transform_set_localScale)(void *transform, Vector3 pos); 18 | //void *(*AddTryGun)(void *instance, int index); 19 | //Vector3 (*Transform_get_position)(void *transform); 20 | //void *(*Transform_set_position)(void *transform, Vector3 pos); 21 | //void *(*Component_get_gameObject)(void* component); 22 | void* il2cpp_string_new(const char* str) 23 | { 24 | 25 | static void* (*il2cpp_string_new_pointer)(const char* str) = 26 | (void* (*)(const char* str))[UIKeyPatch getRealOffset:@"0x104CC4BB4"]; //CreateString 27 | return il2cpp_string_new_pointer(str); 28 | } 29 | 30 | template std::string tostr(const T& t) { 31 | std::ostringstream os; 32 | os<:( 47 | void* weaponsounds = *(void **)[UIKeyPatch address:@"0x5B8" ptr:playermovec]; //一丏丘东丂丟丒万七 48 | if([menu getSwitchOnForSwitch:@"Silent Aim"]){ 49 | *(bool*)[UIKeyPatch address:@"0x149" ptr:weaponsounds] = true; //isRoundMelee 50 | *(float*)[UIKeyPatch address:@"0x13C" ptr:weaponsounds] = 10000.0; //radiusRoundMelee 51 | } 52 | if([menu getSwitchOnForSwitch:@"Ignore Shields"]){ 53 | *(bool*)[UIKeyPatch address:@"0xE8" ptr:weaponsounds] = true; //ignoreBarrier 54 | *(bool*)[UIKeyPatch address:@"0xEA" ptr:weaponsounds] = true; //ignoreReflector 55 | *(bool*)[UIKeyPatch address:@"0xE9" ptr:weaponsounds] = true; //ignoreSlyWolf 56 | } 57 | if([menu getSwitchOnForSwitch:@"Drop Coins"]){ 58 | *(bool*)[UIKeyPatch address:@"0x2B0" ptr:weaponsounds] = true; //isCoinDrop 59 | *(float*)[UIKeyPatch address:@"0x2B4" ptr:weaponsounds] = 1000000000000.0; //coinDropChance 60 | } 61 | 62 | if([menu getSwitchOnForSwitch:@"Double Jump"]){ 63 | *(bool*)[UIKeyPatch address:@"0x353" ptr:weaponsounds] = true; //isDoubleJump 64 | } 65 | if([menu getSwitchOnForSwitch:@"No Cat Spam Cooldown"]){ 66 | *(bool*)[UIKeyPatch address:@"0x548" ptr:weaponsounds] = false; //is3CatSpam 67 | } 68 | if([menu getSwitchOnForSwitch:@"Critical Hits"]){ 69 | *(int*)[UIKeyPatch address:@"0x358" ptr:weaponsounds] = 10000; //criticalHitChance 70 | } 71 | if([menu getSwitchOnForSwitch:@"1 Hit Kill"]){ 72 | *(bool*)[UIKeyPatch address:@"0x1A8" ptr:weaponsounds] = true; //isPoisoning 73 | *(float*)[UIKeyPatch address:@"0x1B0" ptr:weaponsounds] = 1000.0; //poisonDamageMultiplier 74 | } 75 | if([menu getSwitchOnForSwitch:@"Fully Charged"]){ 76 | *(float*)[UIKeyPatch address:@"0x194" ptr:weaponsounds] = 0.0f; //chargeTime 77 | } 78 | if([menu getSwitchOnForSwitch:@"Killed Target Explodes"]){ 79 | *(bool*)[UIKeyPatch address:@"0x298" ptr:weaponsounds] = true; //isKilledTargetExplode 80 | } 81 | //@"Default", @"Rockets", @"Lasers", @"Shotgun", @"Harpoon", @"Dash", @"Exploding Bullets" 82 | if([menu getIndexForString:@"Shoot..."] == 1/*Rockets*/){ 83 | *(bool*)[UIKeyPatch address:@"0xEB" ptr:weaponsounds] = true; //bazooka 84 | *(float*)[UIKeyPatch address:@"0x108" ptr:weaponsounds] = 10000.0; //bazookaExplosionRadius 85 | } 86 | if([menu getIndexForString:@"Shoot..."] == 2/*Lasers*/){ 87 | *(bool*)[UIKeyPatch address:@"0x16C" ptr:weaponsounds] = true; //railgun 88 | } 89 | if([menu getIndexForString:@"Shoot..."] == 3/*Shotgun*/){ 90 | *(bool*)[UIKeyPatch address:@"0x15A" ptr:weaponsounds] = true; //isShotgun 91 | } 92 | if([menu getIndexForString:@"Shoot..."] == 4/*Harpoon*/){ 93 | *(bool*)[UIKeyPatch address:@"0x23C" ptr:weaponsounds] = true; //harpoon 94 | } 95 | if([menu getIndexForString:@"Shoot..."] == 5/*Dash*/){ 96 | *(bool*)[UIKeyPatch address:@"0x22C" ptr:weaponsounds] = true; //isDash 97 | } 98 | if([menu getIndexForString:@"Shoot..."] == 6/*Exploding Bullets*/){ 99 | *(bool*)[UIKeyPatch address:@"0x159" ptr:weaponsounds] = true; //bulletExplode 100 | } 101 | if([menu getIndexForString:@"Shoot Effect..."] == 1/*Charm*/){ 102 | *(bool*)[UIKeyPatch address:@"0x208" ptr:weaponsounds] = true; //isCharm 103 | } 104 | if([menu getIndexForString:@"Shoot Effect..."] == 2/*Poison*/){ 105 | *(bool*)[UIKeyPatch address:@"0x1A8" ptr:weaponsounds] = true; //isPoison 106 | } 107 | if([menu getIndexForString:@"Shoot Effect..."] == 3/*Blindness*/){ 108 | *(bool*)[UIKeyPatch address:@"0x1FC" ptr:weaponsounds] = true; //isBlindEffect 109 | } 110 | if([menu getIndexForString:@"Shoot Effect..."] == 4/*Weakness*/){ 111 | *(bool*)[UIKeyPatch address:@"0x210" ptr:weaponsounds] = true; //isWeakness 112 | } 113 | if([menu getIndexForString:@"Shoot Effect..."] == 5/*JumpDisabler*/){ 114 | *(bool*)[UIKeyPatch address:@"0x1BD" ptr:weaponsounds] = true; //jumpDisabler 115 | } 116 | if([menu getSwitchOnForSwitch:@"Enemies are sheep"]){ 117 | *(bool*)[UIKeyPatch address:@"0x26C" ptr:weaponsounds] = true; //polymorpher 118 | } 119 | } 120 | 121 | if([menu getSwitchOnForSwitch:@"Chat Spam"]) { 122 | 123 | } 124 | if([menu getSwitchOnForSwitch:@"X-Ray Hack"]) { 125 | XRay(playermovec, true); 126 | } 127 | _PlayerMoveCUpdate(playermovec); 128 | } 129 | } 130 | 131 | 132 | void (*_FPCSUpdate) (void *firstperson); 133 | void FPCSUpdate (void *firstperson){ 134 | if(firstperson != NULL) { 135 | void* skinName = *(void **)[UIKeyPatch address:@"0x140" ptr:firstperson]; //三万不丗万专丁丞丅 136 | void* characterController = *(void **)[UIKeyPatch address:@"0x58" ptr:skinName]; //character 137 | if([menu getSwitchOnForSwitch:@"Noclip"]) { 138 | Noclip(characterController, INFINITY); 139 | }else{ 140 | Noclip(characterController, 0.35f); 141 | } 142 | 143 | } 144 | _FPCSUpdate(firstperson); 145 | } 146 | 147 | void (*_PlayerMoveCUpdateSkin) (void *playermovec); 148 | void PlayerMoveCUpdateSkin (void *playermovec){ 149 | if(playermovec != NULL) { 150 | _PlayerMoveCUpdateSkin(playermovec); 151 | } 152 | } 153 | 154 | std::string object; 155 | 156 | void setUp() { 157 | 158 | Fly = (void *(*)(void *, bool))[UIKeyPatch getRealOffset:@"0x101D44B2C"]; //丘不丌丅丌丄丝三丆 159 | XRay = (void *(*)(void *, bool))[UIKeyPatch getRealOffset:@"0x101D5B34C"]; //且丂丙丌上丕丛丞丙 160 | Noclip = (void *(*)(void *, float))[UIKeyPatch getRealOffset:@"0x104B3D32C"]; //radius 161 | ChatSpam = (void *(*)(void *, void*, bool, void*))[UIKeyPatch getRealOffset:@"0x101D41B4C"]; //SendChat 162 | AddCoins = (void *(*)(void *, int, bool, int))[UIKeyPatch getRealOffset:@"0x102DD1168"]; //丒与丒业不丆丆丐业 163 | //AddWeapon = (void *(*)(void *, int, int, bool, bool, int, int))[UIKeyPatch getRealOffset:@"0x102616398"]; //丏丒不丐世丐不与下 164 | //Component_GetTransform = (void *(*)(void *))[UIKeyPatch getRealOffset:@"0x104ADA2C8"]; //Component$$get_transform 165 | //Transform_get_localScale = (Vector3 (*)(void *))[UIKeyPatch getRealOffset:@"0x104B0A064"]; //Transform$$get_localScale 166 | //Transform_set_localScale = (void *(*)(void *, Vector3))[UIKeyPatch getRealOffset:@"0x104B0A110"]; //Transform$$set_localScale 167 | //AddTryGun = (void *(*)(void *, int))[UIKeyPatch getRealOffset:@"0x10261DCF4"]; //丒与丒业不丆丆丐业 168 | //Transform_get_position = (Vector3 (*)(void *))[UIKeyPatch getRealOffset:@"0x104B093A8"]; //Transform$$get_position 169 | //Transform_set_position = (void *(*)(void *, Vector3))[UIKeyPatch getRealOffset:@"0x104B09454"]; //Transform$$set_position 170 | [r16Hook hook:@"0x101D607D4" 171 | with:(void *)PlayerMoveCUpdate 172 | original:(void **)&_PlayerMoveCUpdate]; 173 | 174 | [r16Hook hook:@"0x102B81A10" 175 | with:(void *)FPCSUpdate 176 | original:(void **)&_FPCSUpdate]; 177 | 178 | [r16Hook hook:@"0x102DCDEBC" 179 | with:(void *)BankControllerUpdate 180 | original:(void **)&_BankControllerUpdate]; 181 | 182 | /*[r16Hook hook:@"0x10296CDD0" 183 | with:(void *)SpeedModif 184 | original:(void **)&_SpeedModif]; 185 | 186 | [r16Hook hook:@"0x102968C1C" 187 | with:(void *)JumpModif 188 | original:(void **)&_JumpModif]; */ 189 | 190 | [r16Hook hook:@"0x101D5A38C" 191 | with:(void *)PlayerMoveCUpdateSkin 192 | original:(void **)&_PlayerMoveCUpdateSkin]; //东且丕丕丕丕丈七世 193 | 194 | 195 | 196 | /*[menu addPatch:@"Level Spoofer" 197 | description:@"" 198 | offsets:@[@"0x102B66B24"] //丝丞与东丏丂下丏丄 199 | hexPatches:@[@"0x200880D2C0035FD6"]];*/ 200 | 201 | [menu addPatch:@"EXP Spoofer" 202 | description:@"" 203 | offsets:@[@"0x102B68378"] //丁三东丁业上丕丙丌 204 | hexPatches:@[@"0x001D90D2C0035FD6"]]; 205 | 206 | [menu addPatch:@"Armor Regen" 207 | description:@"" 208 | offsets:@[@"0x1029896EC"] //丞丄丂上三丁不丗丏 209 | hexPatches:@[@"0x200080D2C0035FD6"]]; 210 | 211 | [menu addPatch:@"Health Regen" 212 | description:@"" 213 | offsets:@[@"0x102989754"] //专丅万专不丙丒丟与 214 | hexPatches:@[@"0x200080D2C0035FD6"]]; 215 | 216 | [menu addPatch:@"High Speed" 217 | description:@"" 218 | offsets:@[@"0x10298A66C"] 219 | hexPatches:@[@"0x00F0271EC0035FD6"]]; 220 | 221 | [menu addPatch:@"High Jump" 222 | description:@"" 223 | offsets:@[@"0x1029864B8"] 224 | hexPatches:@[@"0x00F0271EC0035FD6"]]; 225 | 226 | [menu addPatch:@"Rapid Fire" 227 | description:@"" 228 | offsets:@[@"0x102C7B9BC"] 229 | hexPatches:@[@"0x00F0271EC0035FD6"]]; 230 | 231 | [menu addPatch:@"Accelerated Reload Speed" 232 | description:@"Decreases reload speed" 233 | offsets:@[@"0x10298C44C"] //业丌七丈下三丟七业 234 | hexPatches:@[@"0x00F0271EC0035FD6"]]; 235 | 236 | [menu addPatch:@"Extra Backpack Ammo" 237 | description:@"Increases ammo in your backpack (to reload)." 238 | offsets:@[@"0x1029897BC"] //丛丂丙不丟丁丕东万 239 | hexPatches:@[@"0x00F0271EC0035FD6"]]; 240 | 241 | [menu addPatch:@"Godmode" 242 | description:@"Found by Green16#5211." 243 | offsets:@[@"0x101D8CE14"] //丌丙世七丘丝与丏且 244 | hexPatches:@[@"0x000080D2C0035FD6"]]; 245 | 246 | [menu addPatch:@"Always Go" 247 | description:@"Always move when there is a timer." 248 | offsets:@[@"0x101D2FF1C"] //丞丗上丈三丏丑专丈 249 | hexPatches:@[@"0x200080D2C0035FD6"]]; 250 | 251 | [menu addPatch:@"No Recoil" 252 | description:@"Removes weapon recoil, making the crosshair not go up." 253 | offsets:@[@"0x10298E2C4"] //三丐专下丏丟下一不 254 | hexPatches:@[@"0x200080D2C0035FD6"]]; 255 | 256 | [menu addPatch:@"No Spread" 257 | description:@"Removes bullet spread, making bullets go directly where you shoot." 258 | offsets:@[@"0x101D9E214"] //丙丁丝丕下与丆七不 259 | hexPatches:@[@"0x000080D2C0035FD6"]]; 260 | 261 | [menu addPatch:@"Free Super Chests" 262 | description:@"Super chests cost 0 points, meaning they are free." 263 | offsets:@[@"0x1022433DC"] //丂不丘一丙丈丏丗与 264 | hexPatches:@[@"0x000080D2C0035FD6"]]; 265 | 266 | [menu addPatch:@"Critical Hits" 267 | description:@"All hits are Critical." 268 | offsets:@[@"0x102655480"] //NextHitCritical 269 | hexPatches:@[@"0x200080D2C0035FD6"]]; 270 | 271 | [menu addPatch:@"Freedom" 272 | description:@"Makes weapons and stuff free. Doesn't work with most categories (like weapons!)." 273 | offsets:@[@"0x102789034"] //丈丅专七下一丈与业 274 | hexPatches:@[@"0x000080D2C0035FD6"]]; 275 | 276 | [menu addPatch:@"BattlePass Freedom" 277 | description:@"Freedom for battlepass." 278 | offsets:@[@"0x1031D2D00", @"0x1031D2D68", @"0x1031D2DD0"] //get_PremiumPrice, get_LevelPrice, get_PremiumPriceWithLevels 279 | hexPatches:@[@"0x000080D2C0035FD6", @"0x000080D2C0035FD6", @"0x000080D2C0035FD6"]]; 280 | 281 | /*[menu addPatch:@"Freedom for Weapons" 282 | description:@"." 283 | offsets:@[@"0x102602C00", @"0x102602E58"] 284 | hexPatches:@[@"0x200080D2C0035FD6", @"0x800C80D2C0035FD6"]];*/ 285 | 286 | [menu addPatch:@"Friendly Fire" 287 | description:@"Makes its so you can kill your teammates." 288 | offsets:@[@"0x102C348CC"] //丘专丐丗丁专与丂丌 289 | hexPatches:@[@"0x000080D2C0035FD6"]]; 290 | 291 | [menu addPatch:@"Gem Drops" 292 | description:@"" 293 | offsets:@[@"0x101CBD048", @"0x101CB8810"] //一且且与丅丑丕丁丄, 东丒万上且丅丕且丞 294 | hexPatches:@[@"0x200080D2C0035FD6", @"0x200180D2C0035FD6"]]; 295 | 296 | [menu addPatch:@"Anti Self-Kill" 297 | description:@"Found by Chewy" 298 | offsets:@[@"0x101D8C58C", @"0x101D8C3B8", @"0x101D81864", @"0x101D8C518"] //丄七丌丑丂丟丌业业, 丝丁丂万丕丏丘丏不, 丗东世丐丟专东丙丕, 丛丘东丂丗与一丗专 299 | hexPatches:@[@"0xC0035FD6", @"0xC0035FD6", @"0xC0035FD6", @"0xC0035FD6"]]; 300 | 301 | [menu addIndexSwitch:@"Shoot..." 302 | description:@"" 303 | items:@[@"Default", @"Rockets", @"Lasers", @"Shotgun", @"Harpoon", @"Dash", @"Exploding Bullets"]]; 304 | 305 | [menu addIndexSwitch:@"Shoot Effect..." 306 | description:@"" 307 | items:@[@"Default", @"Charm", @"Poison", @"Blindness", @"Weakness", @"Disable Jumps"]]; 308 | 309 | [menu addSwitch:@"1 Hit Kill" 310 | description:@"Kicks you but you can 1 shot everybody (poison damage)"]; 311 | 312 | [menu addSwitch:@"Fly Hack" 313 | description:@"Permantly enables jetpack." ]; 314 | 315 | [menu addSwitch:@"Fully Charged" 316 | description:@"All charge weapons are fully charged." ]; 317 | 318 | [menu addSwitch:@"X-Ray Hack" 319 | description:@"Lets you see through walls." ]; 320 | 321 | [menu addSwitch:@"Silent Aim" 322 | description:@"SUPER OP." ]; 323 | 324 | [menu addSwitch:@"Ignore Shields" 325 | description:@"Your weapons will ignore Sly wolf, Reflector and Barriers."]; 326 | 327 | [menu addSwitch:@"Drop Coins" 328 | description:@"Enemy kills will drop coins."]; 329 | 330 | [menu addSwitch:@"Double Jump" 331 | description:@""]; 332 | 333 | [menu addSwitch:@"Noclip" 334 | description:@""]; 335 | 336 | [menu addSwitch:@"Killed Target Explodes" 337 | description:@""]; 338 | 339 | [menu addSwitch:@"Chat Spam" 340 | description:@""]; 341 | 342 | [menu addPatch:@"Rent Weapon" 343 | description:@"All weapons can be equipped (They say rented)" 344 | offsets:@[@"0x10261389C"] //丒丕丄业丙专丛丘世 345 | hexPatches:@[@"0x200080D2C0035FD6"]]; 346 | } 347 | 348 | void startAuthentication() { 349 | 350 | #import "r16Logo.h" 351 | 352 | menu.socialShareMessage = @"Im using Pixel Gun 3D Cheats by Greenphx & Green16"; 353 | menu.sharingIconBorderColor = rgba(0xffffff, 1.0); 354 | 355 | //only color that needs to be set 356 | r16Theme.baseColor = rgba(0x16549C, 0.9); 357 | //r16Theme.headerBackground = rgba(0x5f04cf, 1.0); 358 | //r16Theme.footerBackground = rgba(0x5f04cf, 1.0); 359 | //r16Theme.menuBackground = rgba(0x7300ff, 0.9); 360 | //r16Theme.keyOnColor = rgba(0x8423fa,1.0); 361 | //r16Theme.keyOffColor = rgba(0x7b00ff,0.9); 362 | //r16Theme.menuShadowColor = rgba(0x7200fc, 0.9); 363 | 364 | [menu closeTaps:1 width:270 365 | maxVisableToggles:5 366 | title:@"Pixel Gun 3D 21.4.4" 367 | credits:@"Made by Greenphx & Green16"]; 368 | setUp(); 369 | } 370 | 371 | 372 | static void didFinishLaunching(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef info) { 373 | timer(0.1){ 374 | startAuthentication(); 375 | }); 376 | } 377 | 378 | void launchEvent() { 379 | CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), NULL, &didFinishLaunching, (CFStringRef)UIApplicationDidFinishLaunchingNotification, NULL, CFNotificationSuspensionBehaviorDrop); 380 | } 381 | 382 | __attribute__((constructor)) static void initialize() { 383 | launchEvent(); 384 | } 385 | --------------------------------------------------------------------------------