Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # SUPER MARIO BREAKER
- # TCPGecko Python Script for Super Mario Maker (WiiU)
- #
- from tcpgecko import TCPGecko
- import os
- ADDRESS = "192.168.0.10"
- def enum(**enums):
- return type('Enum', (), enums)
- Powerups = enum(
- NONE = 0x00,
- MUSHROOM = 0x01,
- FIRE_FLOWER = 0x02,
- WIERD_MUSHROOM = 0x03,
- UNKNOWN_4 = 0x04,
- SMW_FEATHER = 0x05,
- UNKNOWN_6 = 0x06,
- AMIIBO_MUSHROOM = 0x07,
- CLASSIC_MUSHROOM = 0x08
- )
- def cls():
- os.system('cls' if os.name=='nt' else 'clear')
- def printMenu():
- #cls()
- print("---=== SUPER MARIO BREAKER ===---\r\n")
- print("[1] #MakePSwitchesGreatAgain")
- print("[2] Powerup editor")
- print("\r\n---===========================---")
- return input("[X]> ")
- def byteToInt(bytes):
- if (len(bytes) > 4):
- raise BaseException("Invalid bytes length")
- a = 0
- for i in range(len(bytes)):
- a += bytes[i] * 0x100**(len(bytes)-i-1)
- #print("byteToInt: %x" % a)
- return a
- def main(tcp):
- #init
- print("Starting..")
- choise = ""
- # Main routine
- while choise != "quit":
- choise = printMenu()
- if choise == "1":
- pSwitchEditor(tcp)
- elif choise == "2":
- powerUpEditor(tcp)
- # Cleanup
- tcp.s.close()
- ### Payloads
- # Payload 1
- # #MakePSwitchesGreatAgain
- def pSwitchEditor(tcp):
- addr = [
- 0x1806CC24,
- 0x18081E24,
- 0x180FE87C,
- 0x1811389C,
- 0x1B89B7F4,
- 0x1B8BAA20,
- 0x1B9180A4,
- 0x1B9372D0,
- 0x1BD78DD0,
- 0x1BDA3AD0,
- 0x1BDC4A50,
- 0x1BDC77D0,
- 0x1BDC77D8,
- 0x1BE70D50
- ]
- for ad in addr:
- tcp.pokemem(ad, 0x00000002)
- # Payload 2
- # Powerup editor
- def powerUpEditor(tcp):
- addr = [
- 0x2B10408C,
- 0x2B1040A4,
- 0x2B105EFC,
- 0x2B105FE4,
- 0x2B105FF0,
- 0x2B108158,
- 0x2B150158,
- 0x2B1AAC0C,
- 0x2B1AAF0C
- ]
- print("---===== CURRENT POWERUP =====---")
- print("[0] ................. Small mario")
- print("[1] ................. Super mario")
- print("[2] .................. Fire mario")
- print("[3] ................. Wierd mario")
- print("[4] ................... UNKNOWN 4")
- print("[5] ................. SMW Feather")
- print("[6] ................... UNKNOWN 6")
- print("[7] ............. Amiibo mushroom")
- print("[8] ............ Classic mushroom")
- print("---===========================---")
- print("[9] ................. Manual mode")
- print("---===========================---")
- id = int(input("[I]> "))
- if id > 0 and id <= 8:
- for a in range(0x100):
- b = a * 0x100
- print("Testing offset %x" % b)
- c = tcp.readmem(addr[0] + b, 4)
- d = byteToInt(c)
- f = False
- if (d == id):
- print("Offset %x has id %i" % (b, id))
- for i in range(1, len(addr)):
- e = byteToInt(tcp.readmem(addr[i] + b, 4))
- if not (d == e or (d == 0 and e == 0xffffffff)):
- print("Failed at %x: %x" (addr[i]+b, e))
- f = False
- break
- if (i == len(addr) - 1):
- f = True
- break
- if not f:
- break
- print("Found offset %x" % b)
- offset = b
- break
- else:
- return
- elif id == 9:
- offset = int(input("[O]> "), 16)
- if (offset < 0):
- print("Invalid offset, please try again.")
- return
- print("---=== CHOOSE YOUR POWERUP ===---")
- print("[0] ................. Small mario")
- print("[1] ................. Super mario")
- print("[2] .................. Fire mario")
- print("[3] ................. Wierd mario")
- print("[4] ................... UNKNOWN 4")
- print("[5] ................. SMW Feather")
- print("[6] ................... UNKNOWN 6")
- print("[7] ............. Amiibo mushroom")
- print("[8] ............ Classic mushroom")
- print("---===========================---")
- id = int(input("[I]> "))
- for ad in addr:
- tcp.pokemem(ad + offset, id)
- if __name__ == "__main__":
- main(TCPGecko(ADDRESS))
Advertisement
Add Comment
Please, Sign In to add comment