Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <iostream>
- #include <vector>
- #include <string>
- #include <iterator>
- #include <sstream>
- #include <algorithm>
- #include "customrbx.h"
- #include "aobscan.h"
- using namespace std;
- #define SCVFTable 0x00C57844
- class Vector3 {
- float X, Y, Z;
- public:
- Vector3(float x, float y, float z) {
- X = x;
- Y = y;
- Z = z;
- }
- };
- typedef float(__thiscall *s1)(int Object, int Object2);
- s1 SetInstParent = (s1)(0x1BE30 + (DWORD)GetModuleHandle(0));
- typedef float(__thiscall *s2)(int Object, Vector3 Position);
- s2 MoveTo = (s2)(0x38DBB0 + (DWORD)GetModuleHandle(0));
- typedef float(__thiscall *s3)(int Object, bool Anchored);
- s3 SetAnchored = (s3)(0x31F18A + (DWORD)GetModuleHandle(0));
- int MADX = 0x15037CC + (DWORD)GetModuleHandle(0);
- int MADY = MADX + 4;
- int MADZ = MADY + 4;
- HWND ParentWindow;
- HWND MainWindow;
- HWND LUAWINDOW;
- HWND LuaEditor;
- HWND Output;
- HWND Input;
- HMENU WindowMenu;
- HMODULE HInstance;
- #define MONO_CREDITS (WM_APP + 101)
- #define MONO_LUAENV (WM_APP + 102)
- #define LUA_EXECUTE (WM_APP + 103)
- #define OUTPUT_CLEAR (WM_APP + 104)
- #define EXECUTE_COMMAND (WM_APP + 105)
- #define QUICK_COMMAND_KILLALL (WM_APP + 106)
- int DataModel = 0;
- int Players = 0;
- int Workspace = 0;
- int Lighting = 0;
- int LocalPlayer = 0;
- string LocalPlayerName = "";
- HFONT textFont = CreateFont(18, 0, 0, 0, FW_LIGHT, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, VARIABLE_PITCH, TEXT("Segoe UI"));
- void Print(string Text)
- {
- int nLength = GetWindowTextLength(Output);
- SendMessage(Output, EM_SETSEL, (WPARAM)nLength, (LPARAM)nLength);
- SendMessage(Output, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)Text.c_str());
- SendMessage(Output, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)"\n");
- }
- vector<string> split(string s) {
- vector<string> elems;
- stringstream ss(s);
- istream_iterator<string> begin(ss);
- istream_iterator<string> end;
- vector<string> vstrings(begin, end);
- return vstrings;
- }
- vector<int> GetPlayers(string Name, int Me) {
- vector<int> Victims;
- string LN = RBX::GetName(LocalPlayer);
- transform(Name.begin(), Name.end(), Name.begin(), tolower);
- if (Name == "me") {
- Victims.push_back(Me);
- }
- else if (Name == "all") {
- vector<int> Children = RBX::GetChildren(Players);
- for (int i = 0; i < Children.size(); i++) {
- Victims.push_back(Children.at(i));
- }
- }
- else if (Name == "others") {
- vector<int> Children = RBX::GetChildren(Players);
- for (int i = 0; i < Children.size(); i++) {
- string N = RBX::GetName(Children.at(i));
- if (N != LN) {
- Victims.push_back(Children.at(i));
- }
- }
- }
- else {
- vector<int> Children = RBX::GetChildren(Players);
- for (int i = 0; i < Children.size(); i++) {
- string N = RBX::GetName(Children.at(i));
- transform(N.begin(), N.end(), N.begin(), tolower);
- if (N.substr(0, strlen(Name.c_str())) == Name) {
- Victims.push_back(Children.at(i));
- }
- }
- }
- return Victims;
- }
- int GetCharacter(int Player) {
- return RBX::FindFirstChild(Workspace, RBX::GetName(Player));
- }
- int ProcessCmd(string Cmd) {
- vector<string> Arguments = split(Cmd);
- if (Arguments.size() > 0) {
- if (Arguments.at(0) == "cmds") {
- Print(Commands);
- }
- else if (Arguments.at(0) == "clear") {
- SendMessage(Output, WM_SETTEXT, (WPARAM)"", (LPARAM)"Output cleared!\r\n");
- }
- }
- if (Arguments.size() > 1) {
- if (Arguments.at(0) == "kill") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Head = RBX::FindFirstChild(Char, "Head");
- if (Head != 0) {
- SetInstParent(Head, Lighting);
- }
- }
- }
- }
- else if (Arguments.at(0) == "rh") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Hum = RBX::FindFirstChild(Char, "Humanoid");
- if (Hum != 0) {
- SetInstParent(Hum, Lighting);
- }
- }
- }
- }
- else if (Arguments.at(0) == "punish") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- SetInstParent(Char, Lighting);
- }
- }
- }
- else if (Arguments.at(0) == "unpunish") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = RBX::FindFirstChild(Lighting, RBX::GetName(Victims.at(i)));
- if (Char != 0) {
- SetInstParent(Char, Workspace);
- }
- }
- }
- else if (Arguments.at(0) == "stools") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- int MyBackpack = RBX::FindFirstChild(LocalPlayer, "Backpack");
- if (MyBackpack != 0) {
- for (int i = 0; i < Victims.size(); i++) {
- int Backpack = RBX::FindFirstChild(Victims.at(i), "Backpack");
- if (Backpack != 0) {
- vector<int> Tools = RBX::GetChildren(Backpack);
- for (int x = 0; x < Tools.size(); x++) {
- SetInstParent(Tools.at(x), MyBackpack);
- }
- }
- }
- }
- }
- else if (Arguments.at(0) == "naked") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- vector<int> Children = RBX::GetChildren(Char);
- for (int x = 0; x < Children.size(); x++) {
- if (RBX::GetName(Children.at(x)) == "Pants" || RBX::GetName(Children.at(x)) == "Shirt") {
- SetInstParent(Children.at(x), Lighting);
- }
- }
- }
- }
- }
- else if (Arguments.at(0) == "rlimbs") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int RArm = RBX::FindFirstChild(Char, "Right Arm");
- if (RArm != 0) {
- SetInstParent(RArm, Lighting);
- }
- int LArm = RBX::FindFirstChild(Char, "Left Arm");
- if (LArm != 0) {
- SetInstParent(LArm, Lighting);
- }
- int RLeg = RBX::FindFirstChild(Char, "Right Leg");
- if (RLeg != 0) {
- SetInstParent(RLeg, Lighting);
- }
- int LLeg = RBX::FindFirstChild(Char, "Left Leg");
- if (LLeg != 0) {
- SetInstParent(LLeg, Lighting);
- }
- }
- }
- }
- else if (Arguments.at(0) == "rlegs") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int RLeg = RBX::FindFirstChild(Char, "Right Leg");
- if (RLeg != 0) {
- SetInstParent(RLeg, Lighting);
- }
- int LLeg = RBX::FindFirstChild(Char, "Left Leg");
- if (LLeg != 0) {
- SetInstParent(LLeg, Lighting);
- }
- }
- }
- }
- else if (Arguments.at(0) == "rarms") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int RArm = RBX::FindFirstChild(Char, "Right Arm");
- if (RArm != 0) {
- SetInstParent(RArm, Lighting);
- }
- int LArm = RBX::FindFirstChild(Char, "Left Arm");
- if (LArm != 0) {
- SetInstParent(LArm, Lighting);
- }
- }
- }
- }
- else if (Arguments.at(0) == "blockhead") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Head = RBX::FindFirstChild(Char, "Head");
- if (Head != 0) {
- int Mesh = RBX::FindFirstChild(Head, "Mesh");
- if (Mesh != 0) {
- SetInstParent(Mesh, Char);
- }
- }
- }
- }
- }
- else if (Arguments.at(0) == "normalhead") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Head = RBX::FindFirstChild(Char, "Head");
- if (Head != 0) {
- int Mesh = RBX::FindFirstChild(Char, "Mesh");
- if (Mesh != 0) {
- SetInstParent(Mesh, Head);
- }
- }
- }
- }
- }
- else if (Arguments.at(0) == "faceless") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Head = RBX::FindFirstChild(Char, "Head");
- if (Head != 0) {
- int Face = RBX::FindFirstChild(Head, "face");
- if (Face != 0) {
- SetInstParent(Face, Char);
- }
- }
- }
- }
- }
- else if (Arguments.at(0) == "face") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Head = RBX::FindFirstChild(Char, "Head");
- if (Head != 0) {
- int Face = RBX::FindFirstChild(Char, "face");
- if (Face != 0) {
- SetInstParent(Face, Head);
- }
- }
- }
- }
- }
- else if (Arguments.at(0) == "freeze") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Torso = RBX::FindFirstChild(Char, "Torso");
- if (Torso != 0) {
- SetAnchored(Torso, true);
- }
- }
- }
- }
- else if (Arguments.at(0) == "thaw") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Char = GetCharacter(Victims.at(i));
- if (Char != 0) {
- int Torso = RBX::FindFirstChild(Char, "Torso");
- if (Torso != 0) {
- SetAnchored(Torso, false);
- }
- }
- }
- }
- }
- if (Arguments.size() > 2) {
- if (Arguments.at(0) == "stealstat") {
- vector<int> Victims = GetPlayers(Arguments.at(1), LocalPlayer);
- for (int i = 0; i < Victims.size(); i++) {
- int Leaderstats = RBX::FindFirstChild(Victims.at(0), "leaderstats");
- if (Leaderstats != 0) {
- int Stat = RBX::FindFirstChild(Leaderstats, Arguments.at(2));
- if (Stat != 0) {
- int myLeaderstats = RBX::FindFirstChild(LocalPlayer, "leaderstats");
- if (myLeaderstats != 0) {
- int myStat = RBX::FindFirstChild(myLeaderstats, Arguments.at(2));
- SetInstParent(Stat, myLeaderstats);
- Sleep(50);
- SetInstParent(myStat, Leaderstats);
- }
- }
- }
- }
- }
- }
- return 0;
- }
- void RunCommand() {
- char buffer[256];
- GetWindowText(Input, buffer, sizeof(buffer));
- string cmd = (string)buffer;
- ProcessCmd(cmd);
- }
- int CreateLuaWindow() {
- LUAWINDOW = CreateWindowEx(0, "MonoSploit", "Lua Environment", WS_SYSMENU | WS_MINIMIZEBOX, 200, 200, 350, 350, NULL, NULL, HInstance, NULL);
- SetWindowPos(LUAWINDOW, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- LuaEditor = CreateWindowEx(NULL, "EDIT", "Coming soon!", WS_CHILD | WS_BORDER | ES_MULTILINE | WS_VISIBLE | ES_AUTOVSCROLL, 10, 10, 322, 260, LUAWINDOW, NULL, HInstance, 0);
- HWND Execute = CreateWindowEx(NULL, "BUTTON", "Execute", WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 10, 278, 322, 35, LUAWINDOW, (HMENU)LUA_EXECUTE, HInstance, 0);
- SendMessage(LuaEditor, WM_SETFONT, (WPARAM)textFont, MAKELPARAM(TRUE, 0));
- ShowWindow(LUAWINDOW, SW_SHOWNORMAL);
- return 0;
- }
- LRESULT CALLBACK DLLWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message) {
- case WM_CTLCOLORSTATIC:
- {
- HDC hEdit = (HDC)wParam;
- SetTextColor(hEdit, RGB(0, 0, 0));
- SetBkColor(hEdit, RGB(255, 255, 255));
- return (LRESULT)GetStockObject(WHITE_BRUSH);
- }
- case WM_COMMAND:
- switch (wParam) {
- case MONO_LUAENV:
- CreateLuaWindow();
- break;
- case OUTPUT_CLEAR:
- SendMessage(Output, WM_SETTEXT, (WPARAM)"", (LPARAM)"Output cleared!\r\n");
- break;
- case QUICK_COMMAND_KILLALL:
- ProcessCmd("kill all");
- break;
- case EXECUTE_COMMAND:
- RunCommand();
- break;
- case LUA_EXECUTE:
- char buffer[100000];
- GetWindowText(LuaEditor, buffer, sizeof(buffer));
- string source = (string)buffer;
- MessageBox(0, "This feature is not working yet :(", "Coming soon", 0);
- break;
- }
- break;
- case WM_DESTROY:
- if (hwnd == MainWindow) {
- ExitThread(0);
- }
- break;
- case WM_QUIT:
- if (hwnd == MainWindow) {
- ExitThread(0);
- }
- break;
- default:
- return DefWindowProc(hwnd, message, wParam, lParam);
- }
- }
- BOOL RegisterWindowClass(const char* wClassName) {
- WNDCLASSEX nClass;
- nClass.cbSize = sizeof(WNDCLASSEX);
- nClass.style = CS_DBLCLKS;
- nClass.lpfnWndProc = DLLWindowProc;
- nClass.cbClsExtra = 0;
- nClass.cbWndExtra = 0;
- nClass.hInstance = GetModuleHandle(NULL);
- nClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- nClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
- nClass.hCursor = LoadCursor(NULL, IDC_ARROW);
- nClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
- nClass.lpszMenuName = "MonoSploitMenu";
- nClass.lpszClassName = wClassName;
- if (!RegisterClassEx(&nClass))
- return 0;
- return 1;
- }
- BOOL StartMessageLoop() {
- MSG msg;
- BOOL bRet;
- while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
- {
- if (bRet == 0) {
- return 0;
- }
- else if (bRet == -1)
- {
- return 0;
- }
- else
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
- }
- BOOL InitiateWindow() {
- HInstance = GetModuleHandle(NULL);
- UnregisterClass("MonoSploit", HInstance);
- RegisterWindowClass("MonoSploit");
- WindowMenu = CreateMenu();
- HMENU aboutDropdown = CreatePopupMenu();
- AppendMenu(aboutDropdown, MF_STRING, MONO_LUAENV, "Lua Environment");
- AppendMenu(WindowMenu, MF_POPUP, (UINT_PTR)aboutDropdown, "View");
- MainWindow = CreateWindowEx(0, "MonoSploit", "MonoSploit (Alpha)", WS_SYSMENU | WS_MINIMIZEBOX, 100, 100, 570, 340, NULL, WindowMenu, HInstance, NULL);
- Output = CreateWindowEx(NULL, "EDIT", "", WS_CHILD | WS_BORDER | WS_VSCROLL | ES_MULTILINE | WS_VISIBLE | ES_READONLY | ES_AUTOVSCROLL, 10, 10, 440, 242, MainWindow, NULL, HInstance, 0);
- Input = CreateWindowEx(NULL, "EDIT", "", WS_CHILD | WS_BORDER | WS_VISIBLE | ES_WANTRETURN | ES_MULTILINE, 10, 258, 365, 22, MainWindow, WindowMenu, HInstance, 0);
- HWND CommandExecuteButton = CreateWindowEx(NULL, "BUTTON", "Execute", WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 380, 258, 70, 22, MainWindow, (HMENU)EXECUTE_COMMAND, HInstance, 0);
- HWND OutputClearButton = CreateWindowEx(NULL, "BUTTON", "Clear", WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 460, 10, 90, 25, MainWindow, (HMENU)OUTPUT_CLEAR, HInstance, 0);
- HWND KillAllButton = CreateWindowEx(NULL, "BUTTON", "Kill All", WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 460, 45, 90, 25, MainWindow, (HMENU)QUICK_COMMAND_KILLALL, HInstance, 0);
- SendMessage(Output, WM_SETFONT, (WPARAM)textFont, MAKELPARAM(TRUE, 0));
- SendMessage(Input, WM_SETFONT, (WPARAM)textFont, MAKELPARAM(TRUE, 0));
- ShowWindow(MainWindow, SW_SHOWNORMAL);
- SetWindowPos(MainWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- return StartMessageLoop();
- }
- DWORD WINAPI Init(LPVOID lpParam) {
- CreateThread(0, 0, (LPTHREAD_START_ROUTINE)InitiateWindow, 0, 0, 0);
- Sleep(500);
- Print("Loading...");
- DWORD VFTable = SCVFTable;
- DWORD BAddr = (DWORD)GetModuleHandle(NULL);
- DWORD NewVFTable = BAddr + VFTable;
- byte byt[4];
- byt[0] = NewVFTable & 0x000000ff;
- byt[1] = (NewVFTable & 0x0000ff00) >> 8;
- byt[2] = (NewVFTable & 0x00ff0000) >> 16;
- byt[3] = (NewVFTable & 0xff000000) >> 24;
- int SC = Memory::Scan(PAGE_READWRITE, byt, "xxxx");
- DataModel = RBX::GetParent(SC);
- Players = RBX::FindFirstChild(DataModel, "Players");
- Workspace = RBX::FindFirstChild(DataModel, "Workspace");
- Lighting = RBX::FindFirstChild(DataModel, "Lighting");
- LocalPlayer = RBX::GetLocalPlayer(Players);
- string LocalPlayerName = RBX::GetName(LocalPlayer);
- vector<string> Whitelist(arr, arr + sizeof(arr) / sizeof(arr[0]));
- int Whitelisted = 0;
- for (int i = 0; i < Whitelist.size(); i++) {
- if (Whitelist.at(i) == LocalPlayerName) {
- Whitelisted = 1;
- }
- }
- if (Whitelisted == 0) {
- exit(0);
- }
- while (1) {
- if (GetAsyncKeyState(VK_LCONTROL) & 0x8000) {
- if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
- int Char = GetCharacter(LocalPlayer);
- if (Char != 0) {
- Vector3 pos = Vector3(*(float*)MADX, *(float*)MADY, *(float*)MADZ);
- MoveTo(Char, pos);
- while (1) {
- if (!(GetAsyncKeyState(VK_LBUTTON))) {
- break;
- }
- Sleep(50);
- }
- }
- }
- }
- Sleep(50);
- }
- return 0;
- }
- BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwAttached, LPVOID lpUseless) {
- if (dwAttached == DLL_PROCESS_ATTACH) {
- CreateThread(0, 0, Init, 0, 0, 0);
- //Creates a new non-blocking thread when it's attached.
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement