Advertisement
Josiahiscool73

ai python executor for the dll

Jun 23rd, 2025
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.04 KB | None | 0 0
  1. import tkinter as tk
  2. from tkinter import scrolledtext, messagebox
  3. import ctypes
  4. import psutil
  5. import threading
  6. import time
  7. import os
  8.  
  9. # --- Configuration ---
  10. DLL_NAME = "Executor.dll" # The name of your C++ exploit DLL
  11. PIPE_NAME = r'\\.\pipe\DolphinExecutorPipe' # The named pipe for communication
  12.  
  13. # --- Windows API Definitions using ctypes ---
  14. # Constants
  15. PROCESS_ALL_ACCESS = (0x000F0000 | 0x00100000 | 0xFFF)
  16. MEM_COMMIT = 0x1000
  17. MEM_RESERVE = 0x2000
  18. PAGE_EXECUTE_READWRITE = 0x40
  19.  
  20. # Kernel32 functions
  21. kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
  22.  
  23. OpenProcess = kernel32.OpenProcess
  24. OpenProcess.argtypes = [ctypes.c_uint, ctypes.c_bool, ctypes.c_uint]
  25. OpenProcess.restype = ctypes.c_void_p
  26.  
  27. VirtualAllocEx = kernel32.VirtualAllocEx
  28. VirtualAllocEx.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t, ctypes.c_uint, ctypes.c_uint]
  29. VirtualAllocEx.restype = ctypes.c_void_p
  30.  
  31. WriteProcessMemory = kernel32.WriteProcessMemory
  32. WriteProcessMemory.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t, ctypes.POINTER(ctypes.c_size_t)]
  33. WriteProcessMemory.restype = ctypes.c_bool
  34.  
  35. GetModuleHandleA = kernel32.GetModuleHandleA
  36. GetModuleHandleA.argtypes = [ctypes.c_char_p]
  37. GetModuleHandleA.restype = ctypes.c_void_p
  38.  
  39. GetProcAddress = kernel32.GetProcAddress
  40. GetProcAddress.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
  41. GetProcAddress.restype = ctypes.c_void_p
  42.  
  43. CreateRemoteThread = kernel32.CreateRemoteThread
  44. CreateRemoteThread.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint, ctypes.c_void_p]
  45. CreateRemoteThread.restype = ctypes.c_void_p
  46.  
  47. CloseHandle = kernel32.CloseHandle
  48. CloseHandle.argtypes = [ctypes.c_void_p]
  49. CloseHandle.restype = ctypes.c_int
  50.  
  51.  
  52. class ExecutorApp:
  53. def __init__(self, root):
  54. self.root = root
  55. self.root.title("Dolphin Executor")
  56. self.root.geometry("500x350")
  57. self.root.configure(bg="#2E2E2E")
  58. self.root.resizable(False, False)
  59.  
  60. self.injected = False
  61. self.roblox_pid = None
  62.  
  63. # --- UI Elements ---
  64. self.title_label = tk.Label(root, text="Dolphin Executor", bg="#2E2E2E", fg="#00BFFF", font=("Arial", 16, "bold"))
  65. self.title_label.pack(pady=5)
  66.  
  67. self.script_editor = scrolledtext.ScrolledText(root, width=58, height=15, bg="#1E1E1E", fg="white", insertbackground="white", font=("Consolas", 10))
  68. self.script_editor.pack(pady=5, padx=10)
  69. self.script_editor.insert(tk.INSERT, "-- Paste your Lua script here")
  70.  
  71. self.button_frame = tk.Frame(root, bg="#2E2E2E")
  72. self.button_frame.pack(pady=5)
  73.  
  74. self.inject_button = tk.Button(self.button_frame, text="Inject", command=self.inject_thread, bg="#4CAF50", fg="white", font=("Arial", 10, "bold"), relief=tk.FLAT)
  75. self.inject_button.grid(row=0, column=0, padx=10)
  76.  
  77. self.execute_button = tk.Button(self.button_frame, text="Execute", command=self.execute_script, bg="#008CBA", fg="white", font=("Arial", 10, "bold"), relief=tk.FLAT)
  78. self.execute_button.grid(row=0, column=1, padx=10)
  79.  
  80. self.status_label = tk.Label(root, text="Status: Ready", bg="#2E2E2E", fg="white", font=("Arial", 9))
  81. self.status_label.pack(side=tk.BOTTOM, fill=tk.X, ipady=2)
  82.  
  83. def find_roblox_pid(self):
  84. """Finds the process ID of RobloxPlayerBeta.exe."""
  85. for proc in psutil.process_iter(['pid', 'name']):
  86. if proc.info['name'] == 'RobloxPlayerBeta.exe':
  87. return proc.info['pid']
  88. return None
  89.  
  90. def inject_thread(self):
  91. """Starts the injection process in a separate thread to keep the UI responsive."""
  92. threading.Thread(target=self.inject_logic).start()
  93.  
  94. def inject_logic(self):
  95. """Handles the core DLL injection logic."""
  96. if self.injected:
  97. self.update_status("Already injected.", "yellow")
  98. return
  99.  
  100. self.update_status("Searching for Roblox...", "orange")
  101. self.roblox_pid = self.find_roblox_pid()
  102.  
  103. if not self.roblox_pid:
  104. self.update_status("Roblox process not found.", "red")
  105. return
  106.  
  107. self.update_status(f"Roblox found (PID: {self.roblox_pid}). Injecting...", "orange")
  108.  
  109. dll_path = os.path.abspath(DLL_NAME)
  110. if not os.path.exists(dll_path):
  111. self.update_status(f"Error: {DLL_NAME} not found in the same directory.", "red")
  112. messagebox.showerror("DLL Not Found", f"The required DLL '{DLL_NAME}' was not found.")
  113. return
  114.  
  115. # 1. Get a handle to the process
  116. h_process = OpenProcess(PROCESS_ALL_ACCESS, False, self.roblox_pid)
  117. if not h_process:
  118. self.update_status(f"Error: Could not open process. Try running as admin.", "red")
  119. return
  120.  
  121. # 2. Allocate memory for the DLL path in the target process
  122. dll_path_bytes = dll_path.encode('ascii')
  123. path_alloc_mem = VirtualAllocEx(h_process, None, len(dll_path_bytes) + 1, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)
  124. if not path_alloc_mem:
  125. self.update_status("Error: Could not allocate memory.", "red")
  126. CloseHandle(h_process)
  127. return
  128.  
  129. # 3. Write the DLL path to the allocated memory
  130. bytes_written = ctypes.c_size_t(0)
  131. if not WriteProcessMemory(h_process, path_alloc_mem, dll_path_bytes, len(dll_path_bytes), ctypes.byref(bytes_written)):
  132. self.update_status("Error: Could not write to process memory.", "red")
  133. CloseHandle(h_process)
  134. return
  135.  
  136. # 4. Get the address of LoadLibraryA
  137. h_kernel32 = GetModuleHandleA(b"kernel32.dll")
  138. load_library_addr = GetProcAddress(h_kernel32, b"LoadLibraryA")
  139.  
  140. # 5. Create a remote thread to load the DLL
  141. h_thread = CreateRemoteThread(h_process, None, 0, load_library_addr, path_alloc_mem, 0, None)
  142. if not h_thread:
  143. self.update_status("Error: Failed to create remote thread.", "red")
  144. CloseHandle(h_process)
  145. return
  146.  
  147. CloseHandle(h_thread)
  148. CloseHandle(h_process)
  149. self.injected = True
  150. self.update_status("Injection successful!", "green")
  151.  
  152.  
  153. def execute_script(self):
  154. """Sends the script from the text box to the injected DLL via a named pipe."""
  155. if not self.injected:
  156. self.update_status("You must inject before executing.", "yellow")
  157. messagebox.showwarning("Not Injected", "Please press the 'Inject' button first.")
  158. return
  159.  
  160. script_content = self.script_editor.get("1.0", tk.END)
  161. if not script_content.strip():
  162. self.update_status("Cannot execute empty script.", "yellow")
  163. return
  164.  
  165. try:
  166. self.update_status("Executing script...", "orange")
  167. # Connect to the named pipe created by the DLL
  168. pipe = open(PIPE_NAME, 'w')
  169. pipe.write(script_content)
  170. pipe.close()
  171. self.update_status("Script sent to Roblox.", "green")
  172. except FileNotFoundError:
  173. self.update_status(f"Error: Pipe '{PIPE_NAME}' not found. Is DLL running?", "red")
  174. self.injected = False # Assume DLL crashed or failed
  175. except Exception as e:
  176. self.update_status(f"Pipe Error: {e}", "red")
  177. self.injected = False
  178.  
  179.  
  180. def update_status(self, message, color):
  181. """Updates the status label with a given message and color."""
  182. self.status_label.config(text=f"Status: {message}", fg=color)
  183.  
  184.  
  185. if __name__ == "__main__":
  186. # Check for admin rights, as they are often required for OpenProcess
  187. try:
  188. is_admin = (os.getuid() == 0)
  189. except AttributeError:
  190. is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
  191.  
  192. if not is_admin:
  193. messagebox.showwarning("Admin Rights", "This program may require administrator privileges to function correctly.")
  194.  
  195. root = tk.Tk()
  196. app = ExecutorApp(root)
  197. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement