import UnityPy import sys if len(sys.argv) < 3: sys.exit(1) mode = sys.argv[1] bundle_path = sys.argv[2] if mode == "extract": mesh_out = sys.argv[3] tex_out = sys.argv[4] env = UnityPy.load(bundle_path) m_done = False t_done = False for obj in env.objects: if obj.type.name == "Mesh" and not m_done: with open(mesh_out, "wb") as f: f.write(obj.get_raw_data()) m_done = True elif obj.type.name == "Texture2D" and not t_done: with open(tex_out, "wb") as f: f.write(obj.get_raw_data()) t_done = True print("EXTRACTION_DONE") elif mode == "find_id": env = UnityPy.load(bundle_path) m_id = "NONE" t_id = "NONE" for obj in env.objects: if obj.type.name == "Mesh" and m_id == "NONE": m_id = str(obj.path_id) elif obj.type.name == "Texture2D" and t_id == "NONE": t_id = str(obj.path_id) print(f"IDS:{m_id},{t_id}")