-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHosted+.h
295 lines (263 loc) · 7.82 KB
/
Hosted+.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/*
HOSTED+
Hosted+ is the superior address host, that has 200 addresses!
Credits:
mellonyt#1488 for giving me the addresses weekly, and allowing me to make this service with his addresses.
*/
#include <string>
#include <functional>
#pragma comment(lib, "libcurl_a.lib")
#include "cURL/curl.h"
#include "JSON/json.h"
#define aslr(x) (x - 0x400000 + (DWORD)GetModuleHandle(0))
#define noaslr(x) (x + 0x400000 - (DWORD)GetModuleHandle(0))
#define r_lua_tostring(rL,i) r_lua_tolstring(rL, (i), NULL)
#define r_lua_pop(rL,n) r_lua_settop(rL, -(n)-1)
#define r_lua_getglobal(rL,s) r_lua_getfield(rL, -10002, (s))
#define r_lua_newtable(rL) r_lua_createtable(rL, 0, 0)
int R_LUA_TNIL,
R_LUA_TLIGHTUSERDATA,
R_LUA_TNUMBER,
R_LUA_TBOOLEAN,
R_LUA_TSTRING,
R_LUA_TTHREAD,
R_LUA_TFUNCTION,
R_LUA_TTABLE,
R_LUA_TUSERDATA,
R_LUA_TPROTO,
R_LUA_TUPVALUE;
uintptr_t State;
//U can with the format std::function<(typedef),(args)> addrname;
namespace {
std::size_t callback(
const char* in,
std::size_t size,
std::size_t num,
std::string* out)
{
const std::size_t totalBytes(size * num);
out->append(in, totalBytes);
return totalBytes;
}
}
namespace HostedPlus {
std::string url = "http://hostedplus.ga";
std::string key = "PUT YOUR KEY HERE";
Json::Value json;
struct addresS {
uintptr_t address;
std::string callingconv;
bool retcheck;
bool isconflict;
std::string aob;
std::string mask;
std::string typedefs;
};
void Load();
template<class Ret, class... Args>
std::function<Ret(Args...)> Call(DWORD Address, std::string Convention)
{
if (Convention == "__stdcall")
{
typedef Ret(__stdcall* Fn_t)(Args...);
return (Fn_t)Address;
}
else if (Convention == "__cdecl")
{
typedef Ret(__cdecl* Fn_t)(Args...);
return (Fn_t)Address;
}
else if (Convention == "__fastcall")
{
typedef Ret(__fastcall* Fn_t)(Args...);
return (Fn_t)Address;
}
else if (Convention == "__thiscall")
{
typedef Ret(__thiscall* Fn_t)(Args...);
return (Fn_t)Address;
}
}
std::string ReadURL(const char* site)
{
CURL* curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, site);
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 60);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
int httpCode(0);
std::unique_ptr<std::string> httpData(new std::string());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, httpData.get());
curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpCode);
curl_easy_cleanup(curl);
if (httpCode == 200)
{
return *httpData;
}
else
{
return "";
}
}
Json::Value Get(const char* url)
{
std::string returned = ReadURL(url);
if(returned != "")
{
const auto rawlength = static_cast<int>((returned).length());
JSONCPP_STRING err;
Json::Value Root;
Json::CharReaderBuilder builder;
const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
if (!reader->parse((returned).c_str(), returned.c_str() + rawlength, &Root,&err))
{
return EXIT_FAILURE;
}
return Root;
}
else
{
return EXIT_FAILURE;
}
}
bool run()
{
url = url;
url += "/grab.php?key=";
url += key;
Json::Value got = Get(url.c_str());
if(got != EXIT_FAILURE)
{
HostedPlus::json = got;
HostedPlus::Load();
return true;
}
else
{
return false;
}
}
bool check()
{
if (json <= EXIT_FAILURE)
return run();
return true;
}
#include "../Console.h"
void HostedDumper()
{
if (check())
{
Json::Value Addresses = json["addresses"];
for (auto const& id : Addresses.getMemberNames()) {
std::cout << iyellow << id << ": " << iaqua << "0x" << std::uppercase << std::hex << Addresses[id.c_str()]["addr"].asInt() << " " << iwhite << Addresses[id.c_str()]["cc"].asString() << std::endl;
}
}
}
template<class Ret, class... Args>
auto CreateDef(std::string FuncName)
{//u need to add your own retcheck bypass to use this
if (check()) {
if(json["addresses"][FuncName.c_str()]["retcheck"] == true)
{
//return Call<Ret, Args...>(unprotect(aslr(json["addresses"][FuncName.c_str()]["addr"].asInt())), JSON["addresses"][FuncName.c_str()]["cc"].asString().c_str());
}
else
{
//return Call<Ret, Args...>(aslr(json["addresses"][FuncName.c_str()]["addr"].asInt())), json["addresses"][FuncName.c_str()]["cc"].asString().c_str();
}
}
}
auto GetRobloxState()
{
if (check())
{
volatile uintptr_t StackPad[16]{};
static uintptr_t DMPad[16]{};
auto GetDataModel = HostedPlus::Call<uintptr_t, uintptr_t, uintptr_t>(aslr(json["addresses"]["getdatamodel"]["addr"].asInt()), "__thiscall");
auto GetAddress = HostedPlus::Call<uintptr_t>(aslr(json["addresses"]["getdatamodel2"]["addr"].asInt()), "__cdecl");
GetDataModel(GetAddress(), (uintptr_t)DMPad);
uintptr_t DM = DMPad[0];
DM = DM + 0xC;
auto FindFirstChildOfClass = HostedPlus::Call<uintptr_t, uintptr_t, uintptr_t, const std::string&>(aslr(json["addresses"]["findfirstchildofclass"]["addr"].asInt()), "__thiscall");
static DWORD SC;
FindFirstChildOfClass(DM, (DWORD)&SC, "ScriptContext");
std::string Symbol = json["luastate"]["extra"]["symbol"].asString();
uintptr_t StateOffset = json["luastate"]["extra"]["scoffset"].asInt();
if (Symbol == "^")
{
return *(DWORD*)(SC + StateOffset) ^ (SC + StateOffset);
}
else if (Symbol == "*")
{
return *(DWORD*)(SC + StateOffset) * (SC + StateOffset);
}
else if (Symbol == "-")
{
return *(DWORD*)(SC + StateOffset) - (SC + StateOffset);
}
else if (Symbol == "+")
{
return *(DWORD*)(SC + StateOffset) + (SC + StateOffset);
}
else if (Symbol == "/")
{
return *(DWORD*)(SC + StateOffset) / (SC + StateOffset);
}
else
{
return 0;
}
return 1;
}
}
//Credits to mellon for the type scanner
void GetTypes()
{
auto type = HostedPlus::CreateDef<int,uintptr_t,int>("lua_type");
auto getfield = HostedPlus::CreateDef<int,uintptr_t,int,const char*>("lua_getfield");
auto settop = HostedPlus::CreateDef<int,uintptr_t,int>("lua_settop");
auto newthread = HostedPlus::CreateDef<int,uintptr_t>("lua_newthread");
auto pushstring = HostedPlus::CreateDef<int,uintptr_t,const char*>("lua_pushstring");
auto pushbool = HostedPlus::CreateDef<int,uintptr_t,int>("lua_pushboolean");
auto pushlightuserdata = HostedPlus::CreateDef<int,uintptr_t,int>("lua_pushlightuserdata");
getfield(State, -10002, "print");
R_LUA_TFUNCTION = type(State, -1);
settop(State, -(-1) - 1);
pushstring(State, "Lmao");
R_LUA_TSTRING = type(State, -1);
settop(State, -(1) - 1);
pushboolean(State, true);
R_LUA_TBOOLEAN = type(State, -1);
settop(State, -(1) - 1);
getfield(State, -10002, "game");
R_LUA_TUSERDATA = type(State, -1);
settop(State, -(1) - 1);
getfield(State, -10002, "jfddjdsjfdo.......sdijo");
R_LUA_TNIL = type(State, -1);
settop(State, -(1) - 1);
getfield(State, -10002,"table");
R_LUA_TTABLE = type(State, -1);
settop(State, -(1) - 1);
getfield(State, -10002, "workspace");
r_lua_getfield(State, -1, "Gravity");
R_LUA_TNUMBER = type(State, -1);
settop(State, -(1) - 1);
newthread(State);
R_LUA_TTHREAD = type(State, -1);
settop(State, -(1) - 1);
pushlightuserdata(State, nullptr);
R_LUA_TLIGHTUSERDATA = type(State, -1);
settop(State, -(1) - 1);
//big meme :kekw:
R_LUA_TPROTO = 10;
R_LUA_TUPVALUE = 11;
}
void Load()
{
GetTypes();
//blablalbalblalalbla
}
}