0xDEADDEAD
Diamond Üye
- Katılım
- 25 Ağu 2020
- Mesajlar
- 370
- Beğeniler
- 114
Arşivin içindeki deneme.exe berbat chatgpt kodu:
Python:
import os, random, string, sys
def generate_random_string(length=15):
characters = string.ascii_letters + string.digits
return "".join((random.choice(characters) for i in range(length)))
def replace_random_strings_in_file(file_path):
with open(file_path, "r") as file:
content = file.read()
count = content.count("!random_string!")
for _ in range(count):
random_str = generate_random_string()
content = content.replace("!random_string!", random_str, 1)
else:
with open(file_path, "w") as file:
file.write(content)
def get_executable_dir():
if getattr(sys, "frozen", False):
return os.path.dirname(sys.executable)
return os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
current_directory = get_executable_dir()
file_path = os.path.join(current_directory, "spoof.bat")
replace_random_strings_in_file(file_path)