Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace RBLX_RLUAMAIN {
- typedef void(__fastcall* RBLOX_getfield_)(int RBLX_State, int idx, const char* k); // C
- typedef int(__stdcall* RBLOX_getmetatable_)(int RBLX_State, int idx); // C
- typedef void(__fastcall* RBLOX_pushstring_)(int RBLX_State, const char* s); // C
- typedef void(__stdcall* RBLOX_pushvalue_)(int RBLX_State, int idx); // C
- typedef int(__cdecl* RBLOX_pcall_)(int RBLX_State, int nargs, int nret, int errfunc); // C
- typedef void(__cdecl* RBLOX_setfield_)(int RBLX_State, int idx, const char* k); // C IDK HOW
- typedef void(__thiscall* RBLOX_pushnumber_)(int RBLX_State, double n); // C
- typedef const char*(__cdecl* RBLOX_tolstring_)(int RBLX_State, int idx, int asd); // C
- typedef int(__cdecl* RBLOX_toboolean_)(int RBLX_State, int idx); // C
- typedef void(__cdecl* RBLOX_settop_)(int RBLX_State, int top); // C
- typedef int(__cdecl* RBLOX_next_)(int lua_State, int something); // C
- typedef int*(__cdecl* RBLOX_getcontext_)();
- // im just dumb /shrug
- RBLOX_settop_ RBLOX_settop;
- RBLOX_getfield_ RBLOX_getfield;
- RBLOX_pushstring_ RBLOX_pushstring;
- RBLOX_pushvalue_ RBLOX_pushvalue;
- RBLOX_pcall_ RBLOX_pcall;
- RBLOX_setfield_ RBLOX_setfield;
- RBLOX_pushnumber_ RBLOX_pushnumber;
- RBLOX_tolstring_ RBLOX_tolstring;
- RBLOX_toboolean_ RBLOX_toboolean;
- RBLOX_getmetatable_ RBLOX_getmetatable;
- RBLOX_next_ RBLOX_next;
- RBLOX_getcontext_ RBLOX_getcontext;
- void RBLOX_POP(int RbxState, int n);
- void INTILIZING() {
- RBLOX_getmetatable = (RBLOX_getmetatable_)unprotect(aslr(RBLOX_GetMetatable));
- RBLOX_settop = (RBLOX_settop_)unprotect(aslr(RBLOX_Settop));
- RBLOX_getfield = (RBLOX_getfield_)unprotect(aslr(RBLOX_GetField));
- RBLOX_pushstring = (RBLOX_pushstring_)unprotect(aslr(RBLOX_Pushstring));
- RBLOX_pushvalue = (RBLOX_pushvalue_)unprotect(aslr(RBLOX_Pushvalue));
- RBLOX_pcall = (RBLOX_pcall_)unprotect(aslr(RBLOX_Pcall));
- RBLOX_setfield = (RBLOX_setfield_)unprotect(aslr(RBLOX_Setfield));
- RBLOX_pushnumber = (RBLOX_pushnumber_)unprotect(aslr(RBLOX_Pushnumber));
- RBLOX_tolstring = (RBLOX_tolstring_)unprotect(aslr(RBLOX_tolString));
- RBLOX_toboolean = (RBLOX_toboolean_)unprotect(aslr(RBLOX_toBoolean));
- RBLOX_next = (RBLOX_next_)unprotect(aslr(RBLOX_Next));
- // RBLOX_getcontext = (RBLOX_getcontext_)aslr(RBLOX_contextlevel);
- }
- // BYPASSES
- void jnz(int addr) {
- DWORD o_buff;
- VirtualProtect((void*)addr, 5, PAGE_EXECUTE_READWRITE, &o_buff);
- *(char*)addr = 0x75;
- VirtualProtect((void*)addr, 5, o_buff, &o_buff);
- }
- void jz(int addr) {
- DWORD o_buff;
- VirtualProtect((void*)addr, 5, PAGE_EXECUTE_READWRITE, &o_buff);
- *(char*)addr = 0x74;
- VirtualProtect((void*)addr, 5, o_buff, &o_buff);
- }
- void set() {
- jnz(aslr(RARJZ_Bypass));
- }
- void restore() {
- jz(aslr(RARJZ_Bypass));
- }
- int RBLX_GetMetatable(int RbxState, int idx) {
- set();
- int ret = RBLOX_getmetatable(RbxState, idx);
- restore();
- return ret;
- }
- void RBLX_Settop(int RbxState, int top) {
- set();
- RBLOX_settop(RbxState, top);
- restore();
- }
- void RBLX_Getfield(int RbxState, int idx, const char* k) {
- set();
- RBLOX_getfield(RbxState, idx, k);
- restore();
- }
- void RBLX_pushstring(int RbxState, const char* k) {
- set();
- RBLOX_pushstring(RbxState, k);
- restore();
- }
- void RBLX_pushvalue(int RbxState, int idx) {
- set();
- RBLOX_pushvalue(RbxState, idx);
- restore();
- }
- int RBLX_pcall(int RbxState, int nargs, int nret, int errfunc) {
- set();
- int ret = RBLOX_pcall(RbxState, nargs, nret, errfunc);
- restore();
- return ret;
- }
- void RBLX_pushnumber(int RbxState, double n) {
- set();
- RBLOX_pushnumber(RbxState, n);
- restore();
- }
- const char* RBLX_tostring(int RbxState, int idx) {
- set();
- const char* ret = RBLOX_tolstring(RbxState, idx, 0);
- restore();
- return ret;
- }
- int RBLX_toboolean(int RbxState, int idx) {
- set();
- int ret = RBLOX_toboolean(RbxState, idx);
- restore();
- return ret;
- }
- int RBLX_next(int RbxState, int something) {
- set();
- int ret = RBLOX_next(RbxState, something);
- restore();
- return ret;
- }
- void RBLX_pop(int RbxState, int n) {
- RBLX_Settop(RbxState, -(n)-1);
- }
- void RBLX_pushnil(int RbxState) {
- *(DWORD*)(*(DWORD*)(RbxState + 24) + 8) = 0;
- *(DWORD*)(RbxState + 24) += 16;
- }
- void RBLX_getglobal(int RbxState, const char* k) {
- RBLX_Getfield(RbxState, -10002, k);
- }
- void RBLX_setfield(int RbxState, int idx, const char* k) {
- RBLX_pushvalue(RbxState, idx);
- if (RBLX_GetMetatable(RbxState, -1)) {
- RBLX_Getfield(RbxState, -1, "__newindex");
- RBLX_pushvalue(RbxState, -3);
- RBLX_pushstring(RbxState, k);
- RBLX_pushvalue(RbxState, -6);
- RBLX_pcall(RbxState, 3, 0, 0);
- RBLX_pop(RbxState, 3);
- }
- else {
- RBLX_pop(RbxState, 1);
- set();
- RBLOX_setfield(RbxState, idx, k);
- restore();
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement