# Obfuscatoolbox v4 Simple 🔐🧰 Base64 難読化専用版
import base64
import os

def base64_obf(text):
    return base64.b64encode(text.encode()).decode()

def process_file(in_path, out_path):
    if not os.path.isfile(in_path):
        print("⚠️ 入力ファイルが見つからないよ〜💦")
        return

    try:
        with open(in_path, "r", encoding="utf-8") as f:
            content = f.read()
    except Exception as e:
        print(f"⚠️ ファイル読み込みエラー: {e}")
        return

    try:
        result = f"exec(__import__('base64').b64decode('{base64_obf(content)}'))"
        with open(out_path, "w", encoding="utf-8") as f:
            f.write(result)
        print(f"✅ 難読化して保存したよっ!>> {out_path}")
    except Exception as e:
        print(f"⚠️ 処理中にエラーが起きちゃった: {e}")

def menu():
    print("\n✨ Obfuscatoolbox v4 Simple ✨ Base64 難読化専用!")
    print("1. Base64 難読化 → ファイル保存")
    print("2. 終了")

while True:
    menu()
    choice = input("番号を選んでね >> ")
    if choice == "1":
        in_file = input("📥 入力ファイルのパスを教えてね >> ")
        out_file = input("📤 出力ファイルのパスを決めてね >> ")
        process_file(in_file, out_file)
    elif choice == "2":
        print("🌙 またね〜!")
        break
    else:
        print("⚠️ 正しい番号を入力してねっ!")