Hellotop2

Untitled

Feb 14th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.56 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3. using System.IO;
  4. using System.IO.Pipes;
  5. using System.Net;
  6. using System.Runtime.InteropServices;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WeAreDevs_API
  11. {
  12. public class ExploitAPI
  13. {
  14. private WebClient client = new WebClient();
  15. private ExploitAPI.BasicInject injector = new ExploitAPI.BasicInject();
  16. private string cmdpipe = "WeAreDevsPublicAPI_CMD";
  17. private string luacpipe = "WeAreDevsPublicAPI_LuaC";
  18.  
  19. [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
  20. [return: MarshalAs(UnmanagedType.Bool)]
  21. private static extern bool WaitNamedPipe(string name, int timeout);
  22.  
  23. private static bool NamedPipeExist(string pipeName)
  24. {
  25. try
  26. {
  27. int timeout = 0;
  28. if (!ExploitAPI.WaitNamedPipe(Path.GetFullPath(string.Format("\\\\\\\\.\\\\pipe\\\\{0}", (object) pipeName)), timeout))
  29. {
  30. switch (Marshal.GetLastWin32Error())
  31. {
  32. case 0:
  33. return false;
  34. case 2:
  35. return false;
  36. }
  37. }
  38. return true;
  39. }
  40. catch (Exception ex)
  41. {
  42. return false;
  43. }
  44. }
  45.  
  46. private void SMTP(string pipe, string input)
  47. {
  48. if (ExploitAPI.NamedPipeExist(pipe))
  49. {
  50. try
  51. {
  52. using (NamedPipeClientStream pipeClientStream = new NamedPipeClientStream(".", pipe, PipeDirection.Out))
  53. {
  54. pipeClientStream.Connect();
  55. using (StreamWriter streamWriter = new StreamWriter((Stream) pipeClientStream))
  56. {
  57. streamWriter.Write(input);
  58. streamWriter.Dispose();
  59. }
  60. pipeClientStream.Dispose();
  61. }
  62. }
  63. catch (IOException ex)
  64. {
  65. int num = (int) MessageBox.Show("Error occured sending message to the game!", "Connection Failed!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
  66. }
  67. catch (Exception ex)
  68. {
  69. int num = (int) MessageBox.Show(ex.Message.ToString());
  70. }
  71. }
  72. else
  73. {
  74. int num1 = (int) MessageBox.Show("Error occured. Did the dll properly inject?", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  75. }
  76. }
  77.  
  78. private string ReadURL(string url)
  79. {
  80. return this.client.DownloadString(url);
  81. }
  82.  
  83. public bool IsUpdated()
  84. {
  85. bool flag = false;
  86. string str = this.ReadURL("https://pastebin.com/raw/Ly9mJwH7");
  87. if (str.Length > 0)
  88. {
  89. flag = Convert.ToBoolean(str.Split(' ')[0]);
  90. }
  91. else
  92. {
  93. int num = (int) MessageBox.Show("Could not check for the latest version. Did your fireall block us?", "Error");
  94. }
  95. return flag;
  96. }
  97.  
  98. private bool DownloadLatestVersion()
  99. {
  100. if (System.IO.File.Exists("exploit-main.dll"))
  101. System.IO.File.Delete("exploit-main.dll");
  102. string str = this.ReadURL("https://pastebin.com/raw/Ly9mJwH7");
  103. if (str.Length > 0)
  104. this.client.DownloadFile(str.Split(' ')[1], "exploit-main.dll");
  105. return System.IO.File.Exists("exploit-main.dll");
  106. }
  107.  
  108. public bool LaunchExploit()
  109. {
  110. if (ExploitAPI.NamedPipeExist(this.cmdpipe))
  111. {
  112. int num1 = (int) MessageBox.Show("Dll already injected", "No problems");
  113. }
  114. else if (this.IsUpdated())
  115. {
  116. if (this.DownloadLatestVersion())
  117. {
  118. if (this.injector.InjectDLL())
  119. return true;
  120. int num2 = (int) MessageBox.Show("DLL failed to inject", "Error");
  121. }
  122. else
  123. {
  124. int num3 = (int) MessageBox.Show("Could not download the latest version! Did your firewall block us?", "Error");
  125. }
  126. }
  127. else
  128. {
  129. int num4 = (int) MessageBox.Show("Exploit currently patched. Try again tomorrow!", "Error");
  130. }
  131. return false;
  132. }
  133.  
  134. internal void SendCommand(string Command)
  135. {
  136. this.SMTP(this.cmdpipe, Command);
  137. }
  138.  
  139. public void SendScript(string Script)
  140. {
  141. foreach (string input in Script.Split("\r\n".ToCharArray()))
  142. {
  143. try
  144. {
  145. this.SMTP(this.luacpipe, input);
  146. }
  147. catch (Exception ex)
  148. {
  149. int num = (int) MessageBox.Show(ex.Message.ToString());
  150. }
  151. }
  152. }
  153.  
  154. public void DoKill(string username = "me")
  155. {
  156. this.SendCommand("kill " + username);
  157. }
  158.  
  159. public void CreateForceField(string username = "me")
  160. {
  161. this.SendCommand("ff " + username);
  162. }
  163.  
  164. public void RemoveForceField(string username = "me")
  165. {
  166. this.SendCommand("noff " + username);
  167. }
  168.  
  169. public void DoFloat(string username = "me")
  170. {
  171. this.SendCommand("float " + username);
  172. }
  173.  
  174. public void DoNoFloat(string username = "me")
  175. {
  176. this.SendCommand("nofloat " + username);
  177. }
  178.  
  179. public void RemoveLimbs(string username = "me")
  180. {
  181. this.SendCommand("nolimbs " + username);
  182. }
  183.  
  184. public void RemoveArms(string username = "me")
  185. {
  186. this.SendCommand("noarms " + username);
  187. }
  188.  
  189. public void RemoveLegs(string username = "me")
  190. {
  191. this.SendCommand("nolegs " + username);
  192. }
  193.  
  194. public void AddFire(string username = "me")
  195. {
  196. this.SendCommand("fire " + username);
  197. }
  198.  
  199. public void RemoveFire(string username = "me")
  200. {
  201. this.SendCommand("nofire " + username);
  202. }
  203.  
  204. public void AddSparkles(string username = "me")
  205. {
  206. this.SendCommand("sparkles " + username);
  207. }
  208.  
  209. public void RemoveSparkles(string username = "me")
  210. {
  211. this.SendCommand("nosparkles " + username);
  212. }
  213.  
  214. public void AddSmoke(string username = "me")
  215. {
  216. this.SendCommand("smoke " + username);
  217. }
  218.  
  219. public void DoBlockHead(string username = "me")
  220. {
  221. this.SendCommand("blockhead " + username);
  222. }
  223.  
  224. public void ForceBubbleChat(string username = "me")
  225. {
  226. this.SendCommand("chat " + username);
  227. }
  228.  
  229. public void ConsolePrint(string username = "me")
  230. {
  231. this.SendCommand("print " + username);
  232. }
  233.  
  234. public void ConsoleWarn(string username = "me")
  235. {
  236. this.SendCommand("warn " + username);
  237. }
  238.  
  239. private class BasicInject
  240. {
  241. [DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
  242. internal static extern IntPtr LoadLibraryA(string lpFileName);
  243.  
  244. [DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
  245. internal static extern UIntPtr GetProcAddress(IntPtr hModule, string procName);
  246.  
  247. [DllImport("kernel32.dll", SetLastError = true)]
  248. [return: MarshalAs(UnmanagedType.Bool)]
  249. internal static extern bool FreeLibrary(IntPtr hModule);
  250.  
  251. [DllImport("kernel32.dll")]
  252. internal static extern IntPtr OpenProcess(ExploitAPI.BasicInject.ProcessAccess dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId);
  253.  
  254. [DllImport("kernel32.dll", SetLastError = true)]
  255. internal static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
  256.  
  257. [DllImport("kernel32.dll", SetLastError = true)]
  258. internal static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out UIntPtr lpNumberOfBytesWritten);
  259.  
  260. [DllImport("kernel32.dll")]
  261. internal static extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr lpThreadAttributes, uint dwStackSize, UIntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, out IntPtr lpThreadId);
  262.  
  263. [DllImport("kernel32.dll", SetLastError = true)]
  264. internal static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int dwSize, out int lpNumberOfBytesRead);
  265.  
  266. public bool InjectDLL()
  267. {
  268. if (Process.GetProcessesByName("RobloxPlayerBeta").Length == 0)
  269. return false;
  270. Process process = Process.GetProcessesByName("RobloxPlayerBeta")[0];
  271. byte[] bytes = new ASCIIEncoding().GetBytes(AppDomain.CurrentDomain.BaseDirectory + "exploit-main.dll");
  272. IntPtr hModule = ExploitAPI.BasicInject.LoadLibraryA("kernel32.dll");
  273. UIntPtr procAddress = ExploitAPI.BasicInject.GetProcAddress(hModule, "LoadLibraryA");
  274. ExploitAPI.BasicInject.FreeLibrary(hModule);
  275. if (procAddress == UIntPtr.Zero)
  276. return false;
  277. IntPtr hProcess = ExploitAPI.BasicInject.OpenProcess(ExploitAPI.BasicInject.ProcessAccess.AllAccess, false, process.Id);
  278. if (hProcess == IntPtr.Zero)
  279. return false;
  280. IntPtr num = ExploitAPI.BasicInject.VirtualAllocEx(hProcess, (IntPtr) 0, (uint) bytes.Length, 12288U, 4U);
  281. UIntPtr lpNumberOfBytesWritten;
  282. IntPtr lpThreadId;
  283. return !(num == IntPtr.Zero) && ExploitAPI.BasicInject.WriteProcessMemory(hProcess, num, bytes, (uint) bytes.Length, out lpNumberOfBytesWritten) && !(ExploitAPI.BasicInject.CreateRemoteThread(hProcess, (IntPtr) 0, 0U, procAddress, num, 0U, out lpThreadId) == IntPtr.Zero);
  284. }
  285.  
  286. [Flags]
  287. public enum ProcessAccess
  288. {
  289. AllAccess = 1050235, // 0x0010067B
  290. CreateThread = 2,
  291. DuplicateHandle = 64, // 0x00000040
  292. QueryInformation = 1024, // 0x00000400
  293. SetInformation = 512, // 0x00000200
  294. Terminate = 1,
  295. VMOperation = 8,
  296. VMRead = 16, // 0x00000010
  297. VMWrite = 32, // 0x00000020
  298. Synchronize = 1048576, // 0x00100000
  299. }
  300. }
  301. }
  302. }
Advertisement
Add Comment
Please, Sign In to add comment