Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.68 KB | None | 0 0
  1. #pragma once
  2. #include <Windows.h>
  3.  
  4. //_______________________________________________________________________________________________
  5.  
  6. /// DEFINES & ADDRESSES
  7.  
  8. int ScriptContextVftable;
  9.  
  10. #define WaveHeight_PropDescriptor (DWORD*)0x1640B08
  11. #define DisplayDistanceType_PropDescriptor (DWORD*)0x163794C
  12. #define FogColor_PropDescriptor (DWORD*)0x1638CB4
  13. #define FogStart_PropDescriptor (DWORD*)0x1638CE8
  14. #define FogEnd_PropDescriptor (DWORD*)0x1638D1C
  15.  
  16. #define SetParent 0x448160
  17. #define ReplicateProperty 0x510180
  18. #define SetWalkSpeed 0x6B6620
  19. #define SetMxHealth 0x6B5B50
  20. #define SetJmpPower 0x6B5730
  21. #define InitiateWindow;
  22.  
  23. //_______________________________________________________________________________________________
  24.  
  25. /// TYPEDEFS
  26.  
  27. typedef void(__thiscall *sfs)(int self, float c);
  28. typedef void(__thiscall *r)(int self, DWORD* r);
  29. typedef void(__thiscall *s)(int self, int newparent);
  30.  
  31. static sfs SetJumpPower = (sfs)SetJmpPower;
  32. static sfs SetWS = (sfs)SetWalkSpeed;
  33. static sfs SetMaxHealth = (sfs)SetMxHealth;
  34. static r Replicate = (r)ReplicateProperty;
  35. static s rSetParent = (s)SetParent;
  36.  
  37. //_______________________________________________________________________________________________
  38.  
  39. /// INSTANCE INTERACTION FUNCTIONS
  40.  
  41. int DataModel;
  42. int Workspace;
  43. int Players;
  44. int Lighting;
  45. int State;
  46. bool Changing;
  47. int rState = 0;
  48. bool rainbow = false;
  49. std::string* PlayerName;
  50.  
  51. int GetParent(int Instance) {
  52. return *(int*)(Instance + 0x34);
  53. }
  54.  
  55. std::string* GetName(int Instance) {
  56. return (std::string*)(*(int*)(Instance + 0x28));
  57. }
  58.  
  59. int FindFirstChild_PartOf(int Instance, std::string Name) {
  60. DWORD StartOfChildren = *(DWORD*)(Instance + 0x2C);
  61. DWORD EndOfChildren = *(DWORD*)(StartOfChildren + 4);
  62. for (int i = *(int*)StartOfChildren; i != EndOfChildren; i += 8)
  63. {
  64. if (strstr(GetName(*(int*)i)->c_str(), Name.c_str()))
  65. {
  66. return *(int*)i;
  67. }
  68. }
  69. return 0;
  70. }
  71.  
  72. int FindFirstChild(int Instance, std::string Name) {
  73. DWORD StartOfChildren = *(DWORD*)(Instance + 0x2C);
  74. DWORD EndOfChildren = *(DWORD*)(StartOfChildren + 4);
  75. for (int i = *(int*)StartOfChildren; i != EndOfChildren; i += 8)
  76. {
  77. std::string* CurrentName = GetName(*(int*)i);
  78. CurrentName->resize(Name.size());
  79. if (*CurrentName == Name)
  80. {
  81. return *(int*)i;
  82. }
  83. }
  84. return 0;
  85. }
  86.  
  87. const char* GetClass(int self)
  88. {
  89. return (const char*)(*(int(**)(void))(*(int*)self + 16))() + 4;
  90. }
  91.  
  92. int FindFirstClass(int Instance, const char* Name)
  93. {
  94. DWORD StartOfChildren = *(DWORD*)(Instance + 0x2C);
  95. DWORD EndOfChildren = *(DWORD*)(StartOfChildren + 4);
  96.  
  97. for (int i = *(int*)StartOfChildren; i != EndOfChildren; i += 8)
  98. {
  99. if (memcmp(GetClass(*(int*)i), Name, strlen(Name)) == 0)
  100. {
  101. return *(int*)i;
  102. }
  103. }
  104. }
  105.  
  106. int GetLocalPlayer(int Plr) {
  107. return *(int*)(Plr + 0x16C);
  108. }
  109.  
  110. int GetCharacter(std::string Name) {
  111. if (Name == "me") {
  112. int Character = FindFirstChild_PartOf(Workspace, *PlayerName);
  113. if (Character != 0) {
  114. return Character;
  115. }
  116. else
  117. {
  118. return 0;
  119. }
  120. }
  121. int Character = FindFirstChild_PartOf(Workspace, Name);
  122. if (Character != 0) {
  123. return Character;
  124. }
  125. else
  126. {
  127. return 0;
  128. }
  129. }
  130. int GetPlayer(std::string Name) {
  131. int Player = FindFirstChild_PartOf(Players, Name);
  132. if (Player != 0) {
  133. return Player;
  134. }
  135. else
  136. {
  137. return 0;
  138. }
  139. }
  140.  
  141. void Destroy(DWORD Instance) { // dont use
  142. __asm {
  143. mov ecx, Instance
  144. mov eax, [ecx]
  145. call dword ptr[eax + 20h]
  146. }
  147. }
  148.  
  149. //_______________________________________________________________________________________________
  150.  
  151. /// STRUCT INTERACTION FUNCTIONS
  152.  
  153. void SetHumanoidState(int self, int state) {
  154. int statePtr = *(int*)(self + 0x2D4);
  155. if (statePtr) {
  156. *(BYTE*)(self + state + 0x229) = 1;
  157. *(int*)(statePtr + 0x20) = state;
  158. }
  159. }
  160.  
  161. void SetFogEnd(int Lighting, float TFogEnd) {
  162. *(float*)(Lighting + 392) = TFogEnd;
  163. Replicate(Lighting, FogEnd_PropDescriptor);
  164. }
  165.  
  166. void SetFogStart(int Lighting, float TFogStart) {
  167. *(float*)(Lighting + 388) = TFogStart;
  168. Replicate(Lighting, FogStart_PropDescriptor);
  169. }
  170.  
  171. void SetFogColor(int Lighting, float R, float G, float B) {
  172. *(float*)(Lighting + 376) = R;
  173. *(float*)(Lighting + 380) = G;
  174. *(float*)(Lighting + 384) = B;
  175. Replicate(Lighting, FogColor_PropDescriptor);
  176. }
  177.  
  178. void SetWaveHeight(int Terrain, float Height) {
  179. *(float*)(Terrain + 300) = Height;
  180. Replicate(Terrain, WaveHeight_PropDescriptor);
  181. }
  182.  
  183. void SetDisplayDistanceType(int Humanoid, int Type) {
  184. int* Location = (int*)(Humanoid + 484);
  185. if (*Location != Type) {
  186. *Location = Type;
  187. Replicate(Humanoid, DisplayDistanceType_PropDescriptor);
  188. }
  189. }
  190.  
  191. //_______________________________________________________________________ -
  192.  
  193.  
  194. #pragma once
  195. #include <Windows.h>
  196. #include <iostream>
  197. #include <vector>
  198. #include <iterator>
  199. #include <sstream>
  200. //#include "detours.h"
  201. //#include "LUA.h"
  202. #include "ACM_DB.h"
  203. //#include "RobloxDatatypes.h"
  204.  
  205. bool isFF = false;
  206. bool ContextHooked = false;
  207. /*
  208. double PatchedWalkSpeed(int self) { // prevent walkspeed detection from client
  209. return 16;
  210. }
  211.  
  212. double PatchedJumpPower(int self) { // prevent jmppower detection from client
  213. return 50;
  214. }
  215.  
  216. DWORD* PatchedIdentity() {
  217. return (DWORD*)0x1630BB8;
  218. }
  219. */
  220.  
  221. std::vector<std::string> split(std::string s) {
  222. std::vector<std::string> elems;
  223. std::stringstream ss(s);
  224. std::istream_iterator<std::string> begin(ss);
  225. std::istream_iterator<std::string> end;
  226. std::vector<std::string> vstrings(begin, end);
  227. return vstrings;
  228. }
  229.  
  230. void DoCommand(std::string Cmd) {
  231. std::vector<std::string> In = split(Cmd);
  232. if (In.size() != 0) {
  233. if (In.at(0) == "noclip") {
  234. State = 11;
  235. Changing = true;
  236. }
  237.  
  238. else if (In.at(0) == "swim") {
  239. State = 4;
  240. Changing = true;
  241. }
  242.  
  243. else if (In.at(0) == "superjump") {
  244. State = 13;
  245. Changing = true;
  246. }
  247.  
  248. else if (In.at(0) == "airwalk") {
  249. State = 10;
  250. Changing = true;
  251. }
  252.  
  253. else if (In.at(0) == "jesusfly") {
  254. State = 12;
  255. Changing = true;
  256. }
  257.  
  258. else if (In.at(0) == "ragdoll") {
  259. State = 1;
  260. Changing = true;
  261. }
  262.  
  263. else if (In.at(0) == "disable") {
  264. Changing = false;
  265. }
  266.  
  267. else if (In.at(0) == "loadstring") {
  268. std::cout << "lol you believed it didnt you\n";
  269. }
  270.  
  271. else if (In.at(0) == "ws") {
  272. if (In.size() == 3) {
  273. float powa = ::atof(In.at(2).c_str());
  274. int Character = GetCharacter(In.at(1));
  275. if (Character != 0) {
  276. int Humanoid = FindFirstClass(Character, "Humanoid");
  277. if (Humanoid != 0) {
  278. SetWS(Humanoid, powa);
  279. }
  280. }
  281. }
  282. }
  283.  
  284. else if (In.at(0) == "jmppower") {
  285. if (In.size() == 3) {
  286. float powa = ::atof(In.at(2).c_str());
  287. int Character = GetCharacter(In.at(1));
  288. if (Character != 0) {
  289. int Humanoid = FindFirstClass(Character, "Humanoid");
  290. if (Humanoid != 0) {
  291. SetJumpPower(Humanoid, powa);
  292. }
  293. }
  294. }
  295. }
  296.  
  297. else if (In.at(0) == "god") {
  298. if (In.size() == 2) {
  299. int Character = GetCharacter(In.at(1));
  300. if (Character != 0) {
  301. int Humanoid = FindFirstClass(Character, "Humanoid");
  302. if (Humanoid != 0) {
  303. SetMaxHealth(Humanoid, HUGE_VAL);
  304. }
  305. }
  306. }
  307. }
  308.  
  309. else if (In.at(0) == "ungod") {
  310. if (In.size() == 2) {
  311. int Character = GetCharacter(In.at(1));
  312. if (Character != 0) {
  313. int Humanoid = FindFirstClass(Character, "Humanoid");
  314. if (Humanoid != 0) {
  315. SetMaxHealth(Humanoid, 100);
  316. }
  317. }
  318. }
  319. }
  320.  
  321. else if (In.at(0) == "kill") {
  322. if (In.size() == 2) {
  323. int Character = GetCharacter(In.at(1));
  324. if (Character != 0) {
  325. int Humanoid = FindFirstClass(Character, "Humanoid");
  326. if (Humanoid != 0) {
  327. SetMaxHealth(Humanoid, 0);
  328. }
  329. }
  330. }
  331. }
  332.  
  333. else if (In.at(0) == "punish") {
  334. if (In.size() == 2) {
  335. int Character = GetCharacter(In.at(1));
  336. if (Character != 0) {
  337. rSetParent(Character, Lighting);
  338. }
  339. }
  340. }
  341.  
  342. else if (In.at(0) == "unpunish") {
  343. if (In.size() == 2) {
  344. int Character = FindFirstChild(Lighting, In.at(1));
  345. if (Character != 0) {
  346. rSetParent(Character, Workspace);
  347. }
  348. }
  349. }
  350.  
  351. else if (In.at(0) == "hidename") {
  352. if (In.size() == 2) {
  353. int Character = GetCharacter(In.at(1));
  354. if (Character != 0) {
  355. int Humanoid = FindFirstClass(Character, "Humanoid");
  356. if (Humanoid != 0) {
  357. SetDisplayDistanceType(Humanoid, 2);
  358. }
  359. }
  360. }
  361. }
  362.  
  363. else if (In.at(0) == "showname") {
  364. if (In.size() == 2) {
  365. int Character = GetCharacter(In.at(1));
  366. if (Character != 0) {
  367. int Humanoid = FindFirstClass(Character, "Humanoid");
  368. if (Humanoid != 0) {
  369. SetDisplayDistanceType(Humanoid, 0);
  370. }
  371. }
  372. }
  373. }
  374.  
  375. else if (In.at(0) == "fog") {
  376. if (In.size() == 2) {
  377. float No = ::atof(In.at(1).c_str());
  378. SetFogStart(Lighting, No);
  379. SetFogEnd(Lighting, No + 15);
  380. }
  381. }
  382.  
  383. else if (In.at(0) == "rainbow") {
  384. if (In.size() == 2) {
  385. if (In.at(1) == "on") {
  386. rainbow = true;
  387. }
  388. else if (In.at(1) == "off") {
  389. rainbow = false;
  390. }
  391. }
  392. }
  393.  
  394. else if (In.at(0) == "fogcolor") {
  395. if (In.size() == 4) {
  396. float No1 = ::atof(In.at(1).c_str());
  397. float No2 = ::atof(In.at(2).c_str());
  398. float No3 = ::atof(In.at(3).c_str());
  399. SetFogColor(Lighting, No1, No2, No3);
  400. }
  401. }
  402.  
  403. else if (In.at(0) == "waterheight") {
  404. if (In.size() == 2) {
  405. float n = ::atof(In.at(1).c_str());
  406. int Terrain = FindFirstClass(Workspace, "Terrain");
  407. if (Terrain != 0) {
  408. SetWaveHeight(Terrain, n);
  409. }
  410. }
  411. }
  412.  
  413. /*
  414. else if (In.at(0) == "setcontext") {
  415. if (In.size() == 2) {
  416. if (ContextHooked == false) {
  417. typedef int*(__cdecl *getidentity)(int);
  418. getidentity GetIdentity = (getidentity)0x60FA10;
  419.  
  420. DetourTransactionBegin();
  421. DetourUpdateThread(GetCurrentThread());
  422. DetourAttach(&(LPVOID&)GetIdentity, (PBYTE)PatchedIdentity);
  423. DetourTransactionCommit();
  424. ContextHooked = true;
  425. }
  426. DWORD n = ::atoi(In.at(1).c_str());
  427. *(DWORD*)0x1630BB8 = n;
  428. }
  429. }
  430.  
  431. else if (In.at(0) == "music") {
  432. if (In.size() == 2) {
  433. lua_emptystack(lua_State);
  434. lua_getglobal(lua_State, "workspace");
  435. lua_getglobal(lua_State, "Instance");
  436. lua_getfield(lua_State, -1, "new");
  437. lua_pushstring(lua_State, "Sound");
  438. lua_pushvalue(lua_State, -4);
  439. lua_pcall(lua_State, 2, 1, 0);
  440.  
  441. lua_pushstring(lua_State, ("rbxassetid://" + In.at(1)).c_str());
  442. lua_setfield(lua_State, -2, "SoundId");
  443.  
  444. lua_pushstring(lua_State, "POSITRON_AUDIO");
  445. lua_setfield(lua_State, -2, "Name");
  446.  
  447. lua_pushnumber(lua_State, 1);
  448. lua_setfield(lua_State, -2, "Volume");
  449.  
  450. lua_getfield(lua_State, -1, "Play");
  451. lua_pushvalue(lua_State, -2);
  452. lua_pcall(lua_State, 1, 0, 0);
  453. lua_emptystack(lua_State);
  454. }
  455. }
  456.  
  457. else if (In.at(0) == "localply_ff_r") {
  458. lua_emptystack(lua_State);
  459. if (isFF == false) {
  460. isFF = true;
  461. lua_getglobal(lua_State, "game");
  462. lua_getfield(lua_State, -1, "Players");
  463. lua_getfield(lua_State, -1, "LocalPlayer");
  464. lua_getfield(lua_State, -1, "Character");
  465. if (!lua_isnil(lua_State, -1)) {
  466. lua_getglobal(lua_State, "Instance");
  467. lua_getfield(lua_State, -1, "new");
  468. lua_pushstring(lua_State, "ForceField");
  469. lua_pushvalue(lua_State, -4);
  470. lua_pcall(lua_State, 2, 0, 0);
  471. }
  472. }
  473. else {
  474. isFF = false;
  475. lua_getglobal(lua_State, "game");
  476. lua_getfield(lua_State, -1, "Players");
  477. lua_getfield(lua_State, -1, "LocalPlayer");
  478. lua_getfield(lua_State, -1, "Character");
  479. if (!lua_isnil(lua_State, -1)) {
  480. lua_getfield(lua_State, -1, "ForceField");
  481. if (!lua_isnil(lua_State, -1)) {
  482. lua_getfield(lua_State, -1, "Destroy");
  483. lua_pushvalue(lua_State, -2);
  484. lua_pcall(lua_State, 1, 0, 0);
  485. }
  486. }
  487. }
  488. lua_emptystack(lua_State);
  489. }
  490.  
  491. else if (In.at(0) == "localply_btools_r") {
  492. lua_emptystack(lua_State);
  493. lua_getglobal(lua_State, "game");
  494. lua_getfield(lua_State, -1, "Players");
  495. lua_getfield(lua_State, -1, "LocalPlayer");
  496. lua_getfield(lua_State, -1, "Backpack");
  497. if (!lua_isnil(lua_State, -1)) {
  498.  
  499. lua_getglobal(lua_State, "Instance");
  500. lua_getfield(lua_State, -1, "new");
  501. lua_pushstring(lua_State, "HopperBin");
  502. lua_pushvalue(lua_State, -4);
  503. lua_pcall(lua_State, 2, 1, 0);
  504. lua_pushnumber(lua_State, 2);
  505. lua_setfield(lua_State, -2, "BinType");
  506.  
  507. }
  508. lua_emptystack(lua_State);
  509. lua_getglobal(lua_State, "game");
  510. lua_getfield(lua_State, -1, "Players");
  511. lua_getfield(lua_State, -1, "LocalPlayer");
  512. lua_getfield(lua_State, -1, "Backpack");
  513. if (!lua_isnil(lua_State, -1)) {
  514.  
  515. lua_getglobal(lua_State, "Instance");
  516. lua_getfield(lua_State, -1, "new");
  517. lua_pushstring(lua_State, "HopperBin");
  518. lua_pushvalue(lua_State, -4);
  519. lua_pcall(lua_State, 2, 1, 0);
  520. lua_pushnumber(lua_State, 3);
  521. lua_setfield(lua_State, -2, "BinType");
  522.  
  523. }
  524. lua_emptystack(lua_State);
  525. lua_getglobal(lua_State, "game");
  526. lua_getfield(lua_State, -1, "Players");
  527. lua_getfield(lua_State, -1, "LocalPlayer");
  528. lua_getfield(lua_State, -1, "Backpack");
  529. if (!lua_isnil(lua_State, -1)) {
  530.  
  531. lua_getglobal(lua_State, "Instance");
  532. lua_getfield(lua_State, -1, "new");
  533. lua_pushstring(lua_State, "HopperBin");
  534. lua_pushvalue(lua_State, -4);
  535. lua_pcall(lua_State, 2, 1, 0);
  536. lua_pushnumber(lua_State, 4);
  537. lua_setfield(lua_State, -2, "BinType");
  538.  
  539. }
  540. lua_emptystack(lua_State);
  541. }
  542. */
  543.  
  544.  
  545. }
  546. }
  547.  
  548.  
  549.  
  550. // _________________________________________________________________________________________________
  551.  
  552.  
  553. // dllmain.cpp : Defines the entry point for the DLL application.
  554. #include "stdafx.h"
  555. #include <Windows.h>
  556. #include <iostream>
  557. #include <vector>
  558. #include <sstream>
  559. #include <WinInet.h>
  560. #include <fstream>
  561. #include <istream>
  562. #include <iterator>
  563. #include <algorithm>
  564. #include <string>
  565. #include <Psapi.h>
  566. #include <tlhelp32.h>
  567. #include "ACM_DB.h"
  568. #include "LUA.h"
  569. #include "Memscan.h"
  570. //#include "segments.h" // FUCK WINDOWS
  571. #include "form.h"
  572. #include "main.h"
  573. //#include "Memcheck.h"
  574. //#include "detours.h"
  575.  
  576. #define ACMERR 0xFF5
  577.  
  578. #pragma comment(lib, "wininet")
  579. #pragma comment(lib, "Dbghelp.lib")
  580. //#pragma comment(lib, "detours.lib")
  581. /*
  582. int lua_state = 0;
  583.  
  584. typedef void(__cdecl *retcheckf)();
  585. retcheckf retcheck = (retcheckf)0x53F0E0;
  586.  
  587. void rektretcheck() {
  588. return;
  589. }
  590.  
  591. */
  592.  
  593. void doRainbow() {
  594. if (rainbow == true) {
  595. if (rState == 0) {
  596. rState = 1;
  597. SetFogColor(Lighting, 255, 0, 0);
  598. }
  599. else if (rState == 1) {
  600. rState = 2;
  601. SetFogColor(Lighting, 0, 255, 0);
  602. }
  603. else if (rState == 2) {
  604. rState = 0;
  605. SetFogColor(Lighting, 0, 0, 255);
  606. }
  607. Sleep(300);
  608. }
  609. }
  610.  
  611. void doState() {
  612. if (Changing == true) {
  613. int LocalCharacter = GetCharacter(*PlayerName);
  614. if (LocalCharacter != 0) {
  615. int Humanoid = FindFirstClass(LocalCharacter, "Humanoid");
  616. if (Humanoid != 0) {
  617. SetHumanoidState(Humanoid, State);
  618. }
  619. }
  620. }
  621. }
  622.  
  623. char* mfm;
  624.  
  625. void Loop() {
  626. do {
  627. __try {
  628. doState();
  629. }
  630. __except (EXCEPTION_EXECUTE_HANDLER) {
  631. Sleep(1); // do absolutely fucking nothing
  632. }
  633. } while (true);
  634.  
  635. }
  636.  
  637. void rLoop() {
  638. do {
  639. __try {
  640. doRainbow();
  641. }
  642. __except (EXCEPTION_EXECUTE_HANDLER) {
  643. Sleep(1); // do absolutely fucking nothing
  644. }
  645. } while (true);
  646.  
  647. }
  648.  
  649. std::string Input() {
  650. std::string wotthefuck;
  651. getline(std::cin, wotthefuck);
  652. return wotthefuck;
  653. }
  654.  
  655. void Console(char* title) {
  656. AllocConsole();
  657. SetConsoleTitleA(title);
  658. freopen("CONOUT$", "w", stdout);
  659. freopen("CONIN$", "r", stdin);
  660. }
  661.  
  662. /*
  663. DWORD PatchedGetTop(int state) {
  664. if (lua_State == 0) {
  665. lua_State = state;
  666. }
  667. return (*(DWORD *)(state + 16) - *(DWORD *)(state + 28)) >> 4;
  668. }
  669. */
  670.  
  671.  
  672. int __stdcall DllMain(HMODULE DLL, DWORD Reason, void* Useless) {
  673. if (Reason == 1) {
  674. CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Main, 0, 0, 0);
  675. }
  676. return TRUE;
  677. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement