nonogamer9

ToysGENESIS ProTracker: custom ProTracker files into Toy Story (Genesis)

May 31st, 2026
128
0
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.57 KB | Source Code | 0 0
  1. import os
  2. import tkinter as tk
  3. from tkinter import filedialog
  4. import shutil
  5. import zlib
  6.  
  7. def detect_rom_version(rom_path):
  8.     try:
  9.         with open(rom_path, 'rb') as f:
  10.             rom_data = f.read()
  11.        
  12.         crc32 = zlib.crc32(rom_data) & 0xFFFFFFFF
  13.         known_crcs = {
  14.             0x8328822B: 'US',
  15.         }
  16.         if crc32 in known_crcs:
  17.             return known_crcs[crc32]
  18.        
  19.         if len(rom_data) > 0x150 + 48:
  20.             title_bytes = rom_data[0x150:0x150 + 48]
  21.             title_str = title_bytes.decode('ascii', errors='ignore').strip().upper()
  22.            
  23.             if 'USA' in title_str:
  24.                 return 'US'
  25.            
  26.             if 'EUR' in title_str or 'EUROPE' in title_str:
  27.                 return 'EU'
  28.            
  29.             if '(EN,FR,DE)' in title_str or '(EN FR DE)' in title_str:
  30.                 return 'EU'
  31.        
  32.         if len(rom_data) > 0x1F0 + 3:
  33.             region_bytes = rom_data[0x1F0:0x1F0 + 3]
  34.             region_str = region_bytes.decode('ascii', errors='ignore').strip().upper()
  35.            
  36.             if region_str:
  37.                 first_char = region_str[0]
  38.                
  39.                 if first_char in '0123456789ABCDEF':
  40.                     region_code = int(first_char, 16)
  41.                     has_usa = (region_code & 4) != 0
  42.                     has_eu = (region_code & 8) != 0
  43.                    
  44.                     if has_usa and not has_eu:
  45.                         return 'US'
  46.                     elif has_eu and not has_usa:
  47.                         return 'EU'
  48.                     elif has_eu:
  49.                         return 'EU'
  50.                 elif first_char in ('J', 'U', 'E'):
  51.                     if 'U' in region_str and 'E' not in region_str:
  52.                         return 'US'
  53.                     elif 'E' in region_str and 'U' not in region_str:
  54.                         return 'EU'
  55.        
  56.         filename = os.path.basename(rom_path).upper()
  57.         if 'USA' in filename or 'US ' in filename or '(USA)' in filename:
  58.             return 'US'
  59.         if 'EUR' in filename or 'EUROPE' in filename or '(EU' in filename or '(PAL' in filename:
  60.             return 'EU'
  61.        
  62.     except Exception as e:
  63.         print(f"Could not read ROM header: {e}")
  64.    
  65.     return 'UNKNOWN'
  66.  
  67. def get_offsets(version):
  68.     if version == 'US':
  69.         return 0x299CE, 0x408F9
  70.     else:
  71.         return 0x2A2B8, 0x411E3
  72.  
  73. def select_file(title, file_types):
  74.     root = tk.Tk()
  75.     root.withdraw()
  76.     root.attributes('-topmost', True)
  77.     result = filedialog.askopenfilename(title=title, filetypes=file_types)
  78.     root.destroy()
  79.     return result
  80.  
  81. def extract_mode():
  82.     print("\n[Mode 1: Extract Music]")
  83.     print("Opening file dialog... Select your Toy Story ROM.")
  84.     rom_path = select_file("Select Toy Story ROM File", [("ROM files", "*.bin *.md *.gen *.smd"), ("All files", "*.*")])
  85.    
  86.     if not rom_path:
  87.         print("No ROM selected. Aborting.")
  88.         return
  89.  
  90.     version = detect_rom_version(rom_path)
  91.     if version == 'UNKNOWN':
  92.         choice = input("Could not auto-detect version. Enter '1' for EU or '2' for US: ").strip()
  93.         version = 'EU' if choice == '1' else 'US'
  94.    
  95.     start_addr, end_addr = get_offsets(version)
  96.     length = end_addr - start_addr + 1
  97.    
  98.     rom_dir = os.path.dirname(rom_path)
  99.     output_path = os.path.join(rom_dir, f'extracted_music_{version}.mod')
  100.    
  101.     try:
  102.         with open(rom_path, 'rb') as f:
  103.             f.seek(start_addr)
  104.             data = f.read(length)
  105.            
  106.         with open(output_path, 'wb') as f:
  107.             f.write(data)
  108.            
  109.         print(f"Success! Saved {len(data)} bytes to: {output_path}")
  110.     except Exception as e:
  111.         print(f"Extraction failed: {e}")
  112.  
  113. def inject_mode():
  114.     print("\n[Mode 2: Inject Mod File]")
  115.     print("Opening file dialog... Select the target Toy Story ROM.")
  116.     rom_path = select_file("Select target Toy Story ROM File", [("ROM files", "*.bin *.md *.gen *.smd"), ("All files", "*.*")])
  117.     if not rom_path:
  118.         print("No ROM selected. Aborting.")
  119.         return
  120.  
  121.     print("Opening file dialog... Select the .mod file you want to inject.")
  122.     mod_path = select_file("Select custom .mod file to inject", [("Tracker Modules", "*.mod"), ("All files", "*.*")])
  123.     if not mod_path:
  124.         print("No .mod file selected. Aborting.")
  125.         return
  126.  
  127.     version = detect_rom_version(rom_path)
  128.     if version == 'UNKNOWN':
  129.         choice = input("Could not auto-detect version. Enter '1' for EU or '2' for US: ").strip()
  130.         version = 'EU' if choice == '1' else 'US'
  131.        
  132.     start_addr, end_addr = get_offsets(version)
  133.     max_allowed_space = end_addr - start_addr + 1
  134.  
  135.     try:
  136.         mod_size = os.path.getsize(mod_path)
  137.         print(f"\nTarget ROM Region: {version}")
  138.         print(f"Available Space: {max_allowed_space} bytes")
  139.         print(f"Your .mod File Size: {mod_size} bytes")
  140.  
  141.         if mod_size > max_allowed_space:
  142.             print("ERROR: Your custom .mod file is too large for this specific ROM slot!")
  143.             print(f"It exceeds the allocation by {mod_size - max_allowed_space} bytes. Injection cancelled.")
  144.             return
  145.  
  146.         rom_dir = os.path.dirname(rom_path)
  147.         rom_name, rom_ext = os.path.splitext(os.path.basename(rom_path))
  148.         cloned_rom_path = os.path.join(rom_dir, f"{rom_name}_modded{rom_ext}")
  149.        
  150.         print(f"Cloning original ROM to: '{os.path.basename(cloned_rom_path)}'...")
  151.         shutil.copy2(rom_path, cloned_rom_path)
  152.  
  153.         with open(mod_path, 'rb') as f:
  154.             mod_data = f.read()
  155.  
  156.         with open(cloned_rom_path, 'r+b') as f:
  157.             f.seek(start_addr)
  158.             f.write(mod_data)
  159.            
  160.             if mod_size < max_allowed_space:
  161.                 padding_needed = max_allowed_space - mod_size
  162.                 f.write(b'\x00' * padding_needed)
  163.  
  164.         print(f"Success! Custom music injected into cloned file: {cloned_rom_path}")
  165.  
  166.     except Exception as e:
  167.         print(f"Injection failed: {e}")
  168.  
  169. if __name__ == "__main__":
  170.     print("=== ToysGENESIS ProTracker ===")
  171.     print("The Best Tool to Extract toy3.mod or play custom ProTracker files into Toy Story Genesis!")
  172.     print("Made by nonogamer9!")
  173.     print("1: Extract music (toy3.mod) from ROM")
  174.     print("2: Inject custom ProTracker files into a cloned ROM")
  175.     mode = input("Select an option (1 or 2): ").strip()
  176.    
  177.     if mode == '1':
  178.         extract_mode()
  179.     elif mode == '2':
  180.         inject_mode()
  181.     else:
  182.         print("Invalid selection. Exiting.")
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • Gitorga
    36 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Mavseggy
    16 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=lovawmcyco
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment