Advertisement
Guest User

rip

a guest
Jan 24th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.55 KB | None | 0 0
  1. #pragma once
  2. #define _CRT_SECURE_NO_WARNINGS
  3. #include <windows.h>
  4. #include <string>
  5. #include <vector>
  6. #include <iostream>
  7. #include <intrin.h>
  8.  
  9. void Initiate();
  10. void CreateConsole();
  11. BOOLEAN DoesConsoleExist();
  12. int main();
  13. void HandleCommand(std::string command);
  14.  
  15. using namespace std;
  16. namespace Roblox {
  17.     std::string* PlayerName; // Your player's name
  18.     int DataModel;
  19.     int Players;
  20.     int Lighting;
  21.     int ScriptContext;
  22.     int Workspace;
  23.    
  24.     //ASLR Bypass
  25.  
  26.     int aslr(DWORD addr) {
  27.         DWORD dynamicbase = (DWORD)GetModuleHandle("RobloxPlayerBeta.exe");
  28.         DWORD newaddress = (addr - 0x400000 + dynamicbase);
  29.         return newaddress;
  30.     }
  31.  
  32.     //Typedefs
  33.  
  34.     typedef void(__thiscall *anchorObject)(int object, bool num);
  35.     typedef void(__thiscall *setParent)(int self, int newparent);
  36.  
  37.     //Addresses
  38.  
  39.     const int ScriptContext_address = aslr(0x0115D92C);//Class Informer Last "RBX::ScriptContext"
  40.     const int Anchored_address = aslr(0x74C82A);//IDA "Anchorered"
  41.     const int SetParent_address = aslr(0x420C20);//IDA "RobloxLocked" then go up to next function
  42.  
  43.     //Address/Typedef Joining
  44.  
  45.     anchorObject AnchorObject = (anchorObject)Anchored_address;
  46.     setParent SetParent = (setParent)SetParent_address;
  47.    
  48.     // ____________________________________________________________________
  49.     // Instance interaction stuff
  50.     std::string* GetName(int Instance) {
  51.         try {
  52.             return (std::string*)(*(int*)(Instance + 0x28));
  53.         }
  54.         catch (exception) {
  55.             printf("Error!\n");
  56.             Sleep(1);
  57.         }
  58.     }
  59.  
  60.     const char* GetClass(int self)
  61.     {
  62.         try {
  63.             return (const char*)(*(int(**)(void))(*(int*)self + 16))() + 4;
  64.         }
  65.         catch (exception) {
  66.             printf("Error!\n");
  67.             Sleep(1);
  68.         }
  69.         return "Error";
  70.     }
  71.     int GetService(const char* Name) {
  72.         try {
  73.             DWORD StartOfChildren = *(DWORD*)(DataModel + 0x2C);
  74.             DWORD EndOfChildren = *(DWORD*)(StartOfChildren + 4);
  75.  
  76.             for (int i = *(int*)StartOfChildren; i != EndOfChildren; i += 8)
  77.             {
  78.                 if (memcmp(GetClass(*(int*)i), Name, strlen(Name)) == 0)
  79.                 {
  80.                     return *(int*)i;
  81.                 }
  82.             }
  83.  
  84.             return 0;
  85.         }
  86.         catch (int e) {
  87.  
  88.         }
  89.  
  90.     }
  91.     int  GetParent(int object)
  92.     {
  93.         return *(int*)(object + 52);
  94.     }
  95.     int FindFirstChild_PartOf(int Instance, std::string Name) {
  96.         try {
  97.             DWORD StartOfChildren = *(DWORD*)(Instance + 0x2C);
  98.             DWORD EndOfChildren = *(DWORD*)(StartOfChildren + 4);
  99.             for (int i = *(int*)StartOfChildren; i != EndOfChildren; i += 8)
  100.             {
  101.                 if (strstr(GetName(*(int*)i)->c_str(), Name.c_str()))
  102.                 {
  103.                     return *(int*)i;
  104.                 }
  105.             }
  106.             return 0;
  107.         }
  108.         catch (exception) {
  109.             printf("Error!\n");
  110.             Sleep(1);
  111.         }
  112.     }
  113.  
  114.     int GetLocalPlayer(int Plr) {
  115.         try {
  116.             return *(int*)(Plr + 292); //"No local Player to chat from"
  117.         }
  118.         catch (exception) {
  119.             printf("Error!\n");
  120.             Sleep(1);
  121.         }
  122.     }
  123.     int FindFirstClass(int Instance, const char* Name)
  124.     {
  125.         try {
  126.             DWORD StartOfChildren = *(DWORD*)(Instance + 0x2C);
  127.             DWORD EndOfChildren = *(DWORD*)(StartOfChildren + 4);
  128.  
  129.             for (int i = *(int*)StartOfChildren; i != EndOfChildren; i += 8)
  130.             {
  131.                 if (memcmp(GetClass(*(int*)i), Name, strlen(Name)) == 0)
  132.                 {
  133.                     return *(int*)i;
  134.                 }
  135.             }
  136.             return 0;
  137.         }
  138.         catch (exception) {
  139.             printf("Error!\n");
  140.             Sleep(1);
  141.         }
  142.         return 0;
  143.     }
  144.     vector<DWORD> GetChildren(int instance) {
  145.         try {
  146.             vector<DWORD> rtn;
  147.             DWORD num4 = *(DWORD *)(*(DWORD *)(instance + 0x2C));
  148.             DWORD num3 = *(DWORD *)(*(DWORD *)(instance + 0x2C) + 4);
  149.             while (num4 != num3) {
  150.                 rtn.push_back(*(DWORD*)num4);
  151.                 num4 += 8;
  152.             }
  153.             return rtn;
  154.         }
  155.         catch (exception)
  156.         {
  157.             printf("ERROR!\n");
  158.         }
  159.         vector<DWORD> rtnn;
  160.         return rtnn;
  161.     }
  162.  
  163.     vector<DWORD> HandleExplorer(int object) {
  164.         try {
  165.             vector<DWORD> thing5 = GetChildren(object);
  166.             return thing5;
  167.         }
  168.         catch (...) {
  169.             Sleep(1);
  170.         }
  171.     }
  172.  
  173.     vector <DWORD> GetCharacterVector(std::string Name) {
  174.         try {
  175.             if (Name == "others") {
  176.                 vector <DWORD> players = GetChildren(Players);
  177.                 if (players.size() != 0) {
  178.                     string *playername = GetName(GetLocalPlayer(Players));
  179.                     for (unsigned i = 0; i < players.size(); ++i) {
  180.                         string CPLAYER = *GetName(players[i]);
  181.                         if (CPLAYER == *playername) {
  182.                             players.erase(players.begin() + i);
  183.                         }
  184.                     }
  185.                     return players;
  186.                 }
  187.                 else
  188.                 {
  189.                     vector <DWORD> Players;
  190.                     return Players;
  191.                 }
  192.             }
  193.             else if (Name == "all") {
  194.                 vector <DWORD> players = GetChildren(Players);
  195.                 if (players.size() != 0) {
  196.                     return players;
  197.                 }
  198.                 else
  199.                 {
  200.                     vector <DWORD> Players;
  201.                     return players;
  202.                 }
  203.             }
  204.         }
  205.         catch (exception) {
  206.             printf("Error!\n");
  207.             Sleep(1);
  208.         }
  209.     }
  210.     int GetCharacter(std::string Name) {
  211.         try {
  212.             if (Name == "me") {
  213.                 int Character = FindFirstChild_PartOf(Roblox::Workspace, *PlayerName);
  214.                 if (Character != 0) {
  215.                     return Character;
  216.                 }
  217.                 else
  218.                 {
  219.                     return 0;
  220.                 }
  221.             }
  222.             else {
  223.                 int Character = FindFirstChild_PartOf(Roblox::Workspace, Name);
  224.                 if (Character != 0) {
  225.                     return Character;
  226.                 }
  227.                 else
  228.                 {
  229.                     return 0;
  230.                 }
  231.             }
  232.         }
  233.         catch (exception) {
  234.             printf("Error!\n");
  235.             Sleep(1);
  236.         }
  237.         return 0;
  238.     }
  239.     int GetPlayer(std::string Name) {
  240.         try {
  241.             if (Name == "me") {
  242.                 int Character = FindFirstChild_PartOf(Players, *PlayerName);
  243.                 if (Character != 0) {
  244.                     return Character;
  245.                 }
  246.                 else
  247.                 {
  248.                     return 0;
  249.                 }
  250.             }
  251.             int Player = FindFirstChild_PartOf(Players, Name);
  252.             if (Player != 0) {
  253.                 return Player;
  254.             }
  255.             else
  256.             {
  257.                 return 0;
  258.             }
  259.         }
  260.         catch (exception) {
  261.             printf("Error!\n");
  262.             Sleep(1);
  263.         }
  264.         return 0;
  265.     }
  266. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement