import subprocess
import sys
import os
from PyQt5 import QtWidgets, QtGui, QtCore
class ObfuscatorApp(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.selected_file = None
self.initUI()
def initUI(self):
self.setWindowTitle('CheatGlovbal | Obfuscator')
self.setGeometry(100, 100, 600, 300)
self.setStyleSheet("background-color: #1e1e1e; color: white; font-family: Arial;")
title = QtWidgets.QLabel("CheatGlobal | Obf", self)
title.setFont(QtGui.QFont('Arial', 24, QtGui.QFont.Bold))
title.setAlignment(QtCore.Qt.AlignCenter)
title.setStyleSheet("color: #00BFFF; padding: 20px;")
theme_label = QtWidgets.QLabel("Tema Seç:", self)
theme_label.setStyleSheet("color: #00BFFF; font-size: 14px;")
self.theme_combo = QtWidgets.QComboBox(self)
self.theme_combo.addItems(["Koyu", "Açık"])
self.theme_combo.setStyleSheet("""
QComboBox {
background-color: #333;
color: white;
border-radius: 5px;
padding: 5px;
}
QComboBox QAbstractItemView {
background-color: #444;
color: white;
}
""")
self.file_button = QtWidgets.QPushButton('Python/EXE Dosyasını Seç', self)
self.file_button.clicked.connect(self.openFileNameDialog)
self.file_button.setStyleSheet("""
QPushButton {
background-color: #00BFFF;
color: white;
border-radius: 8px;
font-weight: bold;
font-size: 14px;
padding: 10px;
}
QPushButton:hover {
background-color: #00a3cc;
}
""")
self.obfuscate_button = QtWidgets.QPushButton('Obfuscation Uygula', self)
self.obfuscate_button.clicked.connect(self.run_obfuscation)
self.obfuscate_button.setStyleSheet("""
QPushButton {
background-color: #FF8C00;
color: white;
border-radius: 8px;
font-weight: bold;
font-size: 14px;
padding: 10px;
}
QPushButton:hover {
background-color: #cc7000;
}
""")
self.status_label = QtWidgets.QLabel("", self)
self.status_label.setAlignment(QtCore.Qt.AlignCenter)
self.status_label.setStyleSheet("color: #ff4500; font-size: 14px; padding: 10px;")
layout = QtWidgets.QVBoxLayout()
layout.addWidget(title)
layout.addWidget(theme_label)
layout.addWidget(self.theme_combo)
layout.addWidget(self.file_button)
layout.addWidget(self.obfuscate_button)
layout.addWidget(self.status_label)
self.setLayout(layout)
self.show()
def openFileNameDialog(self):
options = QtWidgets.QFileDialog.Options()
file_filter = "Python/EXE Files (*.py *.exe)"
file_name, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Dosya Seç", "", file_filter, options=options)
if file_name:
self.selected_file = file_name
self.status_label.setText(f"Seçilen dosya: {file_name}")
else:
self.status_label.setText("Dosya seçilmedi.")
def run_obfuscation(self):
if not self.selected_file:
self.status_label.setText("Lütfen önce bir dosya seçin!")
return
file_extension = os.path.splitext(self.selected_file)[1]
output_dir = os.path.join(os.path.dirname(self.selected_file), "obfuscated_output")
if not os.path.exists(output_dir):
os.makedirs(output_dir)
try:
if file_extension == ".py":
obfuscate_cmd = f'pyarmor-7 obfuscate --output="{output_dir}" "{self.selected_file}"'
subprocess.run(obfuscate_cmd, shell=True, check=True)
self.status_label.setText(f"Obfuscation başarılı! Çıktı klasörü: {output_dir}")
elif file_extension == ".exe":
self.status_label.setText(".exe dosyaları için özel bir işlem uygulanamadı.")
except subprocess.CalledProcessError:
self.status_label.setText("Obfuscation sırasında hata oluştu.")
except Exception as e:
self.status_label.setText(f"Hata: {str(e)}")
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
window = ObfuscatorApp()
sys.exit(app.exec_())