Advertisement
Lover712

Updated Wearedevs API Source Code

Apr 4th, 2019
3,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.68 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. // Token: 0x02000002 RID: 2
  13. public class ExploitAPI
  14. {
  15. // Token: 0x06000001 RID: 1
  16. [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
  17. [return: MarshalAs(UnmanagedType.Bool)]
  18. private static extern bool WaitNamedPipe(string name, int timeout);
  19.  
  20. // Token: 0x06000002 RID: 2 RVA: 0x00002050 File Offset: 0x00000250
  21. private static bool NamedPipeExist(string pipeName)
  22. {
  23. bool result;
  24. try
  25. {
  26. int timeout = 0;
  27. if (!ExploitAPI.WaitNamedPipe(Path.GetFullPath(string.Format("\\\\\\\\.\\\\pipe\\\\{0}", pipeName)), timeout))
  28. {
  29. int lastWin32Error = Marshal.GetLastWin32Error();
  30. if (lastWin32Error == 0)
  31. {
  32. result = false;
  33. return result;
  34. }
  35. if (lastWin32Error == 2)
  36. {
  37. result = false;
  38. return result;
  39. }
  40. }
  41. result = true;
  42. }
  43. catch (Exception)
  44. {
  45. result = false;
  46. }
  47. return result;
  48. }
  49.  
  50. // Token: 0x06000003 RID: 3 RVA: 0x000020AC File Offset: 0x000002AC
  51. private void SMTP(string pipe, string input)
  52. {
  53. if (ExploitAPI.NamedPipeExist(pipe))
  54. {
  55. try
  56. {
  57. using (NamedPipeClientStream namedPipeClientStream = new NamedPipeClientStream(".", pipe, PipeDirection.Out))
  58. {
  59. namedPipeClientStream.Connect();
  60. using (StreamWriter streamWriter = new StreamWriter(namedPipeClientStream))
  61. {
  62. streamWriter.Write(input);
  63. streamWriter.Dispose();
  64. }
  65. namedPipeClientStream.Dispose();
  66. }
  67. return;
  68. }
  69. catch (IOException)
  70. {
  71. MessageBox.Show("Error occured sending message to the game!", "Connection Failed!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
  72. return;
  73. }
  74. catch (Exception ex)
  75. {
  76. MessageBox.Show(ex.Message.ToString());
  77. return;
  78. }
  79. }
  80. MessageBox.Show("Error occured. Did the dll properly inject?", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  81. }
  82.  
  83. // Token: 0x06000004 RID: 4 RVA: 0x00002178 File Offset: 0x00000378
  84. private string ReadURL(string url)
  85. {
  86. return this.client.DownloadString(url);
  87. }
  88.  
  89. // Token: 0x06000005 RID: 5 RVA: 0x00002188 File Offset: 0x00000388
  90. public bool IsUpdated()
  91. {
  92. bool result = false;
  93. string text = this.ReadURL("https://pastebin.com/raw/Ly9mJwH7");
  94. if (text.Length > 0)
  95. {
  96. result = Convert.ToBoolean(text.Split(new char[]
  97. {
  98. ' '
  99. })[0]);
  100. }
  101. else
  102. {
  103. MessageBox.Show("Could not check for the latest version. Did your fireall block us?", "Error");
  104. }
  105. return result;
  106. }
  107.  
  108. // Token: 0x06000006 RID: 6 RVA: 0x000021D8 File Offset: 0x000003D8
  109. private bool DownloadLatestVersion()
  110. {
  111. if (File.Exists("exploit-main.dll"))
  112. {
  113. File.Delete("exploit-main.dll");
  114. }
  115. string text = this.ReadURL("https://pastebin.com/raw/Ly9mJwH7");
  116. if (text.Length > 0)
  117. {
  118. this.client.DownloadFile(text.Split(new char[]
  119. {
  120. ' '
  121. })[1], "exploit-main.dll");
  122. }
  123. return File.Exists("exploit-main.dll");
  124. }
  125.  
  126. // Token: 0x06000007 RID: 7 RVA: 0x00002244 File Offset: 0x00000444
  127. public bool LaunchExploit()
  128. {
  129. if (ExploitAPI.NamedPipeExist(this.cmdpipe))
  130. {
  131. MessageBox.Show("Dll already injected", "No problems");
  132. }
  133. else if (this.IsUpdated())
  134. {
  135. if (this.DownloadLatestVersion())
  136. {
  137. if (this.injector.InjectDLL())
  138. {
  139. return true;
  140. }
  141. MessageBox.Show("DLL failed to inject", "Error");
  142. }
  143. else
  144. {
  145. MessageBox.Show("Could not download the latest version! Did your firewall block us?", "Error");
  146. }
  147. }
  148. else
  149. {
  150. MessageBox.Show("Exploit currently patched. Try again tomorrow!", "Error");
  151. }
  152. return false;
  153. }
  154.  
  155. // Token: 0x06000008 RID: 8 RVA: 0x000022C4 File Offset: 0x000004C4
  156. internal void SendCommand(string Command)
  157. {
  158. this.SMTP(this.cmdpipe, Command);
  159. }
  160.  
  161. // Token: 0x06000009 RID: 9 RVA: 0x000022D4 File Offset: 0x000004D4
  162. public void SendScript(string Script)
  163. {
  164. foreach (string input in Script.Split("\r\n".ToCharArray()))
  165. {
  166. try
  167. {
  168. this.SMTP(this.luacpipe, input);
  169. }
  170. catch (Exception ex)
  171. {
  172. MessageBox.Show(ex.Message.ToString());
  173. }
  174. }
  175. }
  176.  
  177. // Token: 0x0600000A RID: 10 RVA: 0x00002338 File Offset: 0x00000538
  178. public void SendLimitedLuaScript(string Script)
  179. {
  180. this.SMTP(this.luapipe, Script);
  181. }
  182.  
  183. // Token: 0x0600000B RID: 11 RVA: 0x00002347 File Offset: 0x00000547
  184. public void LuaC_getglobal(string service)
  185. {
  186. this.SendScript("getglobal " + service);
  187. }
  188.  
  189. // Token: 0x0600000C RID: 12 RVA: 0x0000235A File Offset: 0x0000055A
  190. public void LuaC_getfield(int index, string instance)
  191. {
  192. this.SendScript(string.Concat(new object[]
  193. {
  194. "getglobal ",
  195. index,
  196. " ",
  197. instance
  198. }));
  199. }
  200.  
  201. // Token: 0x0600000D RID: 13 RVA: 0x0000238A File Offset: 0x0000058A
  202. public void LuaC_setfield(int index, string property)
  203. {
  204. this.SendScript(string.Concat(new object[]
  205. {
  206. "setfield ",
  207. index,
  208. " ",
  209. property
  210. }));
  211. }
  212.  
  213. // Token: 0x0600000E RID: 14 RVA: 0x000023BA File Offset: 0x000005BA
  214. public void LuaC_pushvalue(int index)
  215. {
  216. this.SendScript("pushvalue " + index);
  217. }
  218.  
  219. // Token: 0x0600000F RID: 15 RVA: 0x000023D2 File Offset: 0x000005D2
  220. public void LuaC_pushstring(string text)
  221. {
  222. this.SendScript("pushstring " + text);
  223. }
  224.  
  225. // Token: 0x06000010 RID: 16 RVA: 0x000023E5 File Offset: 0x000005E5
  226. public void LuaC_pushnumber(int number)
  227. {
  228. this.SendScript("pushnumber " + number);
  229. }
  230.  
  231. // Token: 0x06000011 RID: 17 RVA: 0x00002400 File Offset: 0x00000600
  232. public void LuaC_pcall(int numberOfArguments, int numberOfResults, int ErrorFunction)
  233. {
  234. this.SendScript(string.Concat(new object[]
  235. {
  236. "pushnumber ",
  237. numberOfArguments,
  238. " ",
  239. numberOfResults,
  240. " ",
  241. ErrorFunction
  242. }));
  243. }
  244.  
  245. // Token: 0x06000012 RID: 18 RVA: 0x00002451 File Offset: 0x00000651
  246. public void LuaC_settop(int index)
  247. {
  248. this.SendScript("settop " + index);
  249. }
  250.  
  251. // Token: 0x06000013 RID: 19 RVA: 0x00002469 File Offset: 0x00000669
  252. public void LuaC_pushboolean(string value = "false")
  253. {
  254. this.SendScript("pushboolean " + value);
  255. }
  256.  
  257. // Token: 0x06000014 RID: 20 RVA: 0x0000247C File Offset: 0x0000067C
  258. public void LuaC_gettop()
  259. {
  260. this.SendScript("gettop");
  261. }
  262.  
  263. // Token: 0x06000015 RID: 21 RVA: 0x00002489 File Offset: 0x00000689
  264. public void LuaC_pushnil()
  265. {
  266. this.SendScript("pushnil");
  267. }
  268.  
  269. // Token: 0x06000016 RID: 22 RVA: 0x00002496 File Offset: 0x00000696
  270. public void LuaC_next(int index)
  271. {
  272. this.SendScript("next");
  273. }
  274.  
  275. // Token: 0x06000017 RID: 23 RVA: 0x000024A3 File Offset: 0x000006A3
  276. public void LuaC_pop(int quantity)
  277. {
  278. this.SendScript("pop " + quantity);
  279. }
  280.  
  281. // Token: 0x06000018 RID: 24 RVA: 0x000024BB File Offset: 0x000006BB
  282. public void DoBTools(string username = "me")
  283. {
  284. this.SendCommand("btools " + username);
  285. }
  286.  
  287. // Token: 0x06000019 RID: 25 RVA: 0x000024CE File Offset: 0x000006CE
  288. public void DoKill(string username = "me")
  289. {
  290. this.SendCommand("kill " + username);
  291. }
  292.  
  293. // Token: 0x0600001A RID: 26 RVA: 0x000024E1 File Offset: 0x000006E1
  294. public void CreateForceField(string username = "me")
  295. {
  296. this.SendCommand("ff " + username);
  297. }
  298.  
  299. // Token: 0x0600001B RID: 27 RVA: 0x000024F4 File Offset: 0x000006F4
  300. public void RemoveForceField(string username = "me")
  301. {
  302. this.SendCommand("noff " + username);
  303. }
  304.  
  305. // Token: 0x0600001C RID: 28 RVA: 0x00002507 File Offset: 0x00000707
  306. public void DoFloat(string username = "me")
  307. {
  308. this.SendCommand("float " + username);
  309. }
  310.  
  311. // Token: 0x0600001D RID: 29 RVA: 0x0000251A File Offset: 0x0000071A
  312. public void DoNoFloat(string username = "me")
  313. {
  314. this.SendCommand("nofloat " + username);
  315. }
  316.  
  317. // Token: 0x0600001E RID: 30 RVA: 0x0000252D File Offset: 0x0000072D
  318. public void RemoveLimbs(string username = "me")
  319. {
  320. this.SendCommand("nolimbs " + username);
  321. }
  322.  
  323. // Token: 0x0600001F RID: 31 RVA: 0x00002540 File Offset: 0x00000740
  324. public void RemoveArms(string username = "me")
  325. {
  326. this.SendCommand("noarms " + username);
  327. }
  328.  
  329. // Token: 0x06000020 RID: 32 RVA: 0x00002553 File Offset: 0x00000753
  330. public void RemoveLegs(string username = "me")
  331. {
  332. this.SendCommand("nolegs " + username);
  333. }
  334.  
  335. // Token: 0x06000021 RID: 33 RVA: 0x00002566 File Offset: 0x00000766
  336. public void AddFire(string username = "me")
  337. {
  338. this.SendCommand("fire " + username);
  339. }
  340.  
  341. // Token: 0x06000022 RID: 34 RVA: 0x00002579 File Offset: 0x00000779
  342. public void RemoveFire(string username = "me")
  343. {
  344. this.SendCommand("nofire " + username);
  345. }
  346.  
  347. // Token: 0x06000023 RID: 35 RVA: 0x0000258C File Offset: 0x0000078C
  348. public void AddSparkles(string username = "me")
  349. {
  350. this.SendCommand("sparkles " + username);
  351. }
  352.  
  353. // Token: 0x06000024 RID: 36 RVA: 0x0000259F File Offset: 0x0000079F
  354. public void RemoveSparkles(string username = "me")
  355. {
  356. this.SendCommand("nosparkles " + username);
  357. }
  358.  
  359. // Token: 0x06000025 RID: 37 RVA: 0x000025B2 File Offset: 0x000007B2
  360. public void AddSmoke(string username = "me")
  361. {
  362. this.SendCommand("smoke " + username);
  363. }
  364.  
  365. // Token: 0x06000026 RID: 38 RVA: 0x000025C5 File Offset: 0x000007C5
  366. public void DoBlockHead(string username = "me")
  367. {
  368. this.SendCommand("blockhead " + username);
  369. }
  370.  
  371. // Token: 0x06000027 RID: 39 RVA: 0x000025D8 File Offset: 0x000007D8
  372. public void ForceBubbleChat(string username = "me", string text = "WeAreDevs Website")
  373. {
  374. this.SendCommand("chat " + username + " " + text);
  375. }
  376.  
  377. // Token: 0x06000028 RID: 40 RVA: 0x000025F1 File Offset: 0x000007F1
  378. public void ConsolePrint(string text = "WeAreDevs Website")
  379. {
  380. this.SendCommand("print " + text);
  381. }
  382.  
  383. // Token: 0x06000029 RID: 41 RVA: 0x00002604 File Offset: 0x00000804
  384. public void ConsoleWarn(string text = "meWeAreDevs Website")
  385. {
  386. this.SendCommand("warn " + text);
  387. }
  388.  
  389. // Token: 0x0600002A RID: 42 RVA: 0x00002617 File Offset: 0x00000817
  390. public void SetWalkSpeed(string username = "me", int value = 100)
  391. {
  392. this.SendCommand("speed " + username + " " + value.ToString());
  393. }
  394.  
  395. // Token: 0x0600002B RID: 43 RVA: 0x00002636 File Offset: 0x00000836
  396. public void ToggleClickTeleport()
  397. {
  398. this.SendCommand("toggleclickteleport");
  399. }
  400.  
  401. // Token: 0x0600002C RID: 44 RVA: 0x00002643 File Offset: 0x00000843
  402. public void SetFogEnd(int value = 0)
  403. {
  404. this.SendCommand("fogend " + value);
  405. }
  406.  
  407. // Token: 0x0600002D RID: 45 RVA: 0x0000265B File Offset: 0x0000085B
  408. public void SetJumpPower(int value = 100)
  409. {
  410. this.SendCommand("jumppower " + value);
  411. }
  412.  
  413. // Token: 0x0600002E RID: 46 RVA: 0x00002673 File Offset: 0x00000873
  414. public void TeleportMyCharacterTo(string target_username = "me")
  415. {
  416. this.SendCommand("teleport " + target_username);
  417. }
  418.  
  419. // Token: 0x0600002F RID: 47 RVA: 0x00002686 File Offset: 0x00000886
  420. public void PlaySoundInGame(string assetid = "1071384374")
  421. {
  422. this.SendCommand("music " + assetid);
  423. }
  424.  
  425. // Token: 0x06000030 RID: 48 RVA: 0x00002699 File Offset: 0x00000899
  426. public void SetSkyboxImage(string assetid = "2143522")
  427. {
  428. this.SendCommand("skybox " + assetid);
  429. }
  430.  
  431. // Token: 0x04000001 RID: 1
  432. private WebClient client = new WebClient();
  433.  
  434. // Token: 0x04000002 RID: 2
  435. private ExploitAPI.BasicInject injector = new ExploitAPI.BasicInject();
  436.  
  437. // Token: 0x04000003 RID: 3
  438. private string cmdpipe = "WeAreDevsPublicAPI_CMD";
  439.  
  440. // Token: 0x04000004 RID: 4
  441. private string luacpipe = "WeAreDevsPublicAPI_LuaC";
  442.  
  443. // Token: 0x04000005 RID: 5
  444. private string luapipe = "WeAreDevsPublicAPI_Lua";
  445.  
  446. // Token: 0x02000003 RID: 3
  447. private class BasicInject
  448. {
  449. // Token: 0x06000032 RID: 50
  450. [DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true)]
  451. internal static extern IntPtr LoadLibraryA(string lpFileName);
  452.  
  453. // Token: 0x06000033 RID: 51
  454. [DllImport("kernel32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
  455. internal static extern UIntPtr GetProcAddress(IntPtr hModule, string procName);
  456.  
  457. // Token: 0x06000034 RID: 52
  458. [DllImport("kernel32.dll", SetLastError = true)]
  459. [return: MarshalAs(UnmanagedType.Bool)]
  460. internal static extern bool FreeLibrary(IntPtr hModule);
  461.  
  462. // Token: 0x06000035 RID: 53
  463. [DllImport("kernel32.dll")]
  464. internal static extern IntPtr OpenProcess(ExploitAPI.BasicInject.ProcessAccess dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId);
  465.  
  466. // Token: 0x06000036 RID: 54
  467. [DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)]
  468. internal static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
  469.  
  470. // Token: 0x06000037 RID: 55
  471. [DllImport("kernel32.dll", SetLastError = true)]
  472. internal static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out UIntPtr lpNumberOfBytesWritten);
  473.  
  474. // Token: 0x06000038 RID: 56
  475. [DllImport("kernel32.dll")]
  476. internal static extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr lpThreadAttributes, uint dwStackSize, UIntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, out IntPtr lpThreadId);
  477.  
  478. // Token: 0x06000039 RID: 57
  479. [DllImport("kernel32.dll", SetLastError = true)]
  480. internal static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int dwSize, out int lpNumberOfBytesRead);
  481.  
  482. // Token: 0x0600003A RID: 58 RVA: 0x000026EC File Offset: 0x000008EC
  483. public bool InjectDLL()
  484. {
  485. if (Process.GetProcessesByName("RobloxPlayerBeta").Length == 0)
  486. {
  487. return false;
  488. }
  489. Process process = Process.GetProcessesByName("RobloxPlayerBeta")[0];
  490. byte[] bytes = new ASCIIEncoding().GetBytes(AppDomain.CurrentDomain.BaseDirectory + "exploit-main.dll");
  491. IntPtr hModule = ExploitAPI.BasicInject.LoadLibraryA("kernel32.dll");
  492. UIntPtr procAddress = ExploitAPI.BasicInject.GetProcAddress(hModule, "LoadLibraryA");
  493. ExploitAPI.BasicInject.FreeLibrary(hModule);
  494. if (procAddress == UIntPtr.Zero)
  495. {
  496. return false;
  497. }
  498. IntPtr intPtr = ExploitAPI.BasicInject.OpenProcess(ExploitAPI.BasicInject.ProcessAccess.AllAccess, false, process.Id);
  499. if (intPtr == IntPtr.Zero)
  500. {
  501. return false;
  502. }
  503. IntPtr intPtr2 = ExploitAPI.BasicInject.VirtualAllocEx(intPtr, (IntPtr)0, (uint)bytes.Length, 12288u, 4u);
  504. UIntPtr uintPtr;
  505. IntPtr intPtr3;
  506. return !(intPtr2 == IntPtr.Zero) && ExploitAPI.BasicInject.WriteProcessMemory(intPtr, intPtr2, bytes, (uint)bytes.Length, out uintPtr) && !(ExploitAPI.BasicInject.CreateRemoteThread(intPtr, (IntPtr)0, 0u, procAddress, intPtr2, 0u, out intPtr3) == IntPtr.Zero);
  507. }
  508.  
  509. // Token: 0x02000004 RID: 4
  510. [Flags]
  511. public enum ProcessAccess
  512. {
  513. // Token: 0x04000007 RID: 7
  514. AllAccess = 1050235,
  515. // Token: 0x04000008 RID: 8
  516. CreateThread = 2,
  517. // Token: 0x04000009 RID: 9
  518. DuplicateHandle = 64,
  519. // Token: 0x0400000A RID: 10
  520. QueryInformation = 1024,
  521. // Token: 0x0400000B RID: 11
  522. SetInformation = 512,
  523. // Token: 0x0400000C RID: 12
  524. Terminate = 1,
  525. // Token: 0x0400000D RID: 13
  526. VMOperation = 8,
  527. // Token: 0x0400000E RID: 14
  528. VMRead = 16,
  529. // Token: 0x0400000F RID: 15
  530. VMWrite = 32,
  531. // Token: 0x04000010 RID: 16
  532. Synchronize = 1048576
  533. }
  534. }
  535. }
  536. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement