Wbfs //free\\ [CERTIFIED · OVERVIEW]
def list_games(self, device): """List all games on WBFS partition""" try: result = subprocess.run(['sudo', 'wbfs-tool', device, 'ls'], capture_output=True, text=True, check=True) print("\n📀 Games on WBFS drive:") print("-" * 50) print(result.stdout) except subprocess.CalledProcessError: print("❌ No WBFS partition found or unable to read.")
def interactive_menu(self): """Main interactive menu""" while True: print("\n" + "="*50) print("🎮 WBFS MANAGER - Wii Backup File System Tool") print("="*50) print("1. 📋 List all games on WBFS drive") print("2. ➕ Add game (ISO/WBFS) to WBFS drive") print("3. ➖ Remove game from WBFS drive") print("4. 💾 Extract game from WBFS to file") print("5. 🆕 Format drive/partition as WBFS (ERASE ALL)") print("6. 📊 Check disk usage") print("7. 🚪 Exit") choice = input("\nSelect option (1-7): ").strip() if choice == '1': device = input("Enter WBFS device (e.g., /dev/sdb1): ") self.list_games(device) elif choice == '2': device = input("Enter WBFS device: ") game_file = input("Enter path to ISO/WBFS file: ") self.add_game(device, game_file) elif choice == '3': device = input("Enter WBFS device: ") self.list_games(device) game_id = input("Enter Game ID to remove (e.g., SMNE01): ") self.remove_game(device, game_id) elif choice == '4': device = input("Enter WBFS device: ") self.list_games(device) game_id = input("Enter Game ID to extract: ") output = input("Output filename (e.g., game.iso): ") self.extract_game(device, game_id, output) elif choice == '5': device = input("Enter device to format (e.g., /dev/sdb): ") self.format_partition(device) elif choice == '6': device = input("Enter WBFS device: ") self.check_usage(device) elif choice == '7': print("👋 Goodbye!") break else: print("❌ Invalid choice. Please try again.") def main(): if os.geteuid() != 0: print("⚠️ This tool requires root privileges for most operations.") print("Please run with: sudo python3 wbfs_manager.py") sys.exit(1)
def auto_organize_games(self, source_dir, target_device): """ Automatically find all Wii games in a directory and add them to WBFS """ wbfs_extensions = {'.iso', '.wbfs'} games_found = [] # Recursively find all game files for root, dirs, files in os.walk(source_dir): for file in files: if Path(file).suffix.lower() in wbfs_extensions: full_path = os.path.join(root, file) games_found.append(full_path) def list_games(self, device): """List all games on WBFS
def check_usage(self, device): """Show used/free space on WBFS partition""" try: result = subprocess.run(['sudo', 'wbfs-tool', device, 'df'], capture_output=True, text=True, check=True) print("\n💾 Disk Usage:") print(result.stdout) except: print("❌ Could not read disk usage.")
print(f"🎮 Found {len(games_found)} games:") for i, game in enumerate(games_found, 1): size_mb = os.path.getsize(game) / (1024*1024) print(f" {i}. {Path(game).name} ({size_mb:.1f} MB)") ➖ Remove game from WBFS drive") print("4
def check_dependencies(self): """Check if required tools are installed""" deps = ['wbfs-tool', 'dd', 'parted'] missing = [] for dep in deps: if not shutil.which(dep) and dep != 'wbfs-tool': missing.append(dep) if missing: print(f"⚠️ Missing dependencies: {', '.join(missing)}") print("Install with: sudo apt install wbfs-tools parted coreutils")
def add_game(self, device, game_file): """Add a game (ISO or WBFS) to WBFS partition""" if not os.path.exists(game_file): print(f"❌ File not found: {game_file}") return print(f"Adding {game_file} to {device}...") try: subprocess.run(['sudo', 'wbfs-tool', device, 'add', game_file], check=True) print(f"✅ Game added successfully!") except subprocess.CalledProcessError as e: print(f"❌ Failed to add game: {e}") 📊 Check disk usage") print("7
def extract_game(self, device, game_id, output_file): """Extract a game from WBFS to ISO/WBFS file""" print(f"Extracting {game_id} to {output_file}...") try: subprocess.run(['sudo', 'wbfs-tool', device, 'extract', game_id, output_file], check=True) print(f"✅ Game extracted to {output_file}") except subprocess.CalledProcessError: print(f"❌ Extraction failed.")