Spaces:
Sleeping
Sleeping
Update uabe_packer.py
Browse files- uabe_packer.py +23 -12
uabe_packer.py
CHANGED
|
@@ -3,9 +3,11 @@ import sys
|
|
| 3 |
import UnityPy
|
| 4 |
|
| 5 |
def process_hybrid_packing(dummy_bundle_dir, hp_bundle_dir):
|
|
|
|
| 6 |
print("π [UABE PACKER] Memulai Prosedur Peretasan Biner Dinamis...")
|
| 7 |
|
| 8 |
-
# 1. Deteksi semua platform biner
|
|
|
|
| 9 |
platforms = [f for f in os.listdir(hp_bundle_dir) if os.path.isfile(os.path.join(hp_bundle_dir, f))]
|
| 10 |
|
| 11 |
if not platforms:
|
|
@@ -16,34 +18,42 @@ def process_hybrid_packing(dummy_bundle_dir, hp_bundle_dir):
|
|
| 16 |
hp_path = os.path.join(hp_bundle_dir, platform)
|
| 17 |
dummy_path = os.path.join(dummy_bundle_dir, platform)
|
| 18 |
|
| 19 |
-
# Jika platform ini tidak ada di dummy, kita
|
| 20 |
-
if not os.path.exists(dummy_path):
|
| 21 |
-
continue
|
| 22 |
-
|
| 23 |
print(f"π¦ Memproses Platform: {platform}")
|
| 24 |
|
| 25 |
try:
|
| 26 |
-
env_dummy = UnityPy.load(dummy_path)
|
| 27 |
env_hp = UnityPy.load(hp_path)
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
hp_cab = list(env_hp.cabs.keys())[0] if env_hp.cabs else None
|
| 31 |
|
| 32 |
if dummy_cab and hp_cab and dummy_cab != hp_cab:
|
| 33 |
print(f" π Meretas Identitas: {hp_cab} -> {dummy_cab}")
|
| 34 |
|
| 35 |
-
# Eksekusi Mutlak:
|
| 36 |
env_hp.cabs[dummy_cab] = env_hp.cabs.pop(hp_cab)
|
| 37 |
for obj in env_hp.objects:
|
| 38 |
if hasattr(obj, "assets_file"):
|
| 39 |
obj.assets_file.name = dummy_cab
|
| 40 |
|
| 41 |
-
# Simpan Baju Raksasa yang sudah "menyamar"
|
| 42 |
packed_data = env_hp.file.save(packer="lz4")
|
| 43 |
with open(dummy_path, "wb") as f:
|
| 44 |
f.write(packed_data)
|
| 45 |
|
| 46 |
-
# π― PATCHING PREFAB (
|
| 47 |
parent_dir = os.path.dirname(dummy_bundle_dir)
|
| 48 |
for root, dirs, files in os.walk(parent_dir):
|
| 49 |
for file in files:
|
|
@@ -58,11 +68,12 @@ def process_hybrid_packing(dummy_bundle_dir, hp_bundle_dir):
|
|
| 58 |
f.write(content)
|
| 59 |
print(f" π Alamat Peta di-patch: {file}")
|
| 60 |
except:
|
| 61 |
-
pass # Abaikan jika
|
| 62 |
except Exception as e:
|
| 63 |
print(f" β οΈ Gagal memproses platform {platform}: {str(e)}")
|
| 64 |
|
| 65 |
-
|
|
|
|
| 66 |
|
| 67 |
if __name__ == "__main__":
|
| 68 |
if len(sys.argv) < 3:
|
|
|
|
| 3 |
import UnityPy
|
| 4 |
|
| 5 |
def process_hybrid_packing(dummy_bundle_dir, hp_bundle_dir):
|
| 6 |
+
# Pesan ini harus presisi agar dibaca oleh server.js
|
| 7 |
print("π [UABE PACKER] Memulai Prosedur Peretasan Biner Dinamis...")
|
| 8 |
|
| 9 |
+
# 1. Deteksi semua platform biner (Android, iOS, StandaloneWindows64, dll)
|
| 10 |
+
# Kita ambil daftar file biner dari folder Raksasa (HP)
|
| 11 |
platforms = [f for f in os.listdir(hp_bundle_dir) if os.path.isfile(os.path.join(hp_bundle_dir, f))]
|
| 12 |
|
| 13 |
if not platforms:
|
|
|
|
| 18 |
hp_path = os.path.join(hp_bundle_dir, platform)
|
| 19 |
dummy_path = os.path.join(dummy_bundle_dir, platform)
|
| 20 |
|
| 21 |
+
# Jika platform ini tidak ada di folder dummy, kita buat tujuannya
|
|
|
|
|
|
|
|
|
|
| 22 |
print(f"π¦ Memproses Platform: {platform}")
|
| 23 |
|
| 24 |
try:
|
| 25 |
+
env_dummy = UnityPy.load(dummy_path) if os.path.exists(dummy_path) else None
|
| 26 |
env_hp = UnityPy.load(hp_path)
|
| 27 |
|
| 28 |
+
# Jika dummy tidak punya platform tersebut, kita ambil CAB default dari platform pertama yang ada
|
| 29 |
+
if not env_dummy:
|
| 30 |
+
# Cari CAB dari file biner dummy mana pun yang tersedia
|
| 31 |
+
existing_dummy_files = [f for f in os.listdir(dummy_bundle_dir) if os.path.isfile(os.path.join(dummy_bundle_dir, f))]
|
| 32 |
+
if existing_dummy_files:
|
| 33 |
+
tmp_dummy = UnityPy.load(os.path.join(dummy_bundle_dir, existing_dummy_files[0]))
|
| 34 |
+
dummy_cab = list(tmp_dummy.cabs.keys())[0]
|
| 35 |
+
else:
|
| 36 |
+
dummy_cab = None
|
| 37 |
+
else:
|
| 38 |
+
dummy_cab = list(env_dummy.cabs.keys())[0] if env_dummy.cabs else None
|
| 39 |
+
|
| 40 |
hp_cab = list(env_hp.cabs.keys())[0] if env_hp.cabs else None
|
| 41 |
|
| 42 |
if dummy_cab and hp_cab and dummy_cab != hp_cab:
|
| 43 |
print(f" π Meretas Identitas: {hp_cab} -> {dummy_cab}")
|
| 44 |
|
| 45 |
+
# Eksekusi Mutlak: Ganti Identitas CAB Raksasa dengan Identitas Dummy
|
| 46 |
env_hp.cabs[dummy_cab] = env_hp.cabs.pop(hp_cab)
|
| 47 |
for obj in env_hp.objects:
|
| 48 |
if hasattr(obj, "assets_file"):
|
| 49 |
obj.assets_file.name = dummy_cab
|
| 50 |
|
| 51 |
+
# Simpan Baju Raksasa yang sudah "menyamar" menimpa lokasi Dummy
|
| 52 |
packed_data = env_hp.file.save(packer="lz4")
|
| 53 |
with open(dummy_path, "wb") as f:
|
| 54 |
f.write(packed_data)
|
| 55 |
|
| 56 |
+
# π― PATCHING PREFAB (Dinamis mencari file .prefab di root folder Dummy)
|
| 57 |
parent_dir = os.path.dirname(dummy_bundle_dir)
|
| 58 |
for root, dirs, files in os.walk(parent_dir):
|
| 59 |
for file in files:
|
|
|
|
| 68 |
f.write(content)
|
| 69 |
print(f" π Alamat Peta di-patch: {file}")
|
| 70 |
except:
|
| 71 |
+
pass # Abaikan jika format biner
|
| 72 |
except Exception as e:
|
| 73 |
print(f" β οΈ Gagal memproses platform {platform}: {str(e)}")
|
| 74 |
|
| 75 |
+
# Kalimat kunci mutlak untuk server.js
|
| 76 |
+
print("β
[UABE PACKER] Injeksi selesai 100%!")
|
| 77 |
|
| 78 |
if __name__ == "__main__":
|
| 79 |
if len(sys.argv) < 3:
|