Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <string>
- #include <iostream>
- #include <vector>
- #include "ConsoleColourProc.h"
- #include "MainImgui.h"
- #include "eyecrawl.h"
- #include "MinHook.h"
- using namespace std;
- #define DLL_EXPORT extern "C" __declspec(dllexport)
- #define FILTER true
- DWORD WINAPI LuaPipe(PVOID lvpParameter)
- {
- string WholeScript = "";
- HANDLE hPipe;
- char buffer[999999];
- DWORD dwRead;
- hPipe = CreateNamedPipe(TEXT("\\\\.\\pipe\\AtomWrapper"),
- PIPE_ACCESS_DUPLEX | PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
- PIPE_WAIT,
- 1,
- 999999,
- 999999,
- NMPWAIT_USE_DEFAULT_WAIT,
- NULL);
- while (hPipe != INVALID_HANDLE_VALUE)
- {
- if (ConnectNamedPipe(hPipe, NULL) != FALSE)
- {
- while (ReadFile(hPipe, buffer, sizeof(buffer) - 1, &dwRead, NULL) != FALSE)
- {
- buffer[dwRead] = '\0';
- try {
- try {
- WholeScript = WholeScript + buffer;
- }
- catch (...) {
- }
- }
- catch (std::exception e) {
- }
- catch (...) {
- }
- }
- Wrapper::Execute_Script(WholeScript);
- WholeScript = "";
- }
- DisconnectNamedPipe(hPipe);
- }
- }
- void ConsoleBypass(const char* Title) {
- DWORD superskiddoisachink;
- VirtualProtect((PVOID)&FreeConsole, 1, PAGE_EXECUTE_READWRITE, &superskiddoisachink);
- *(BYTE*)(&FreeConsole) = 0xC3;
- AllocConsole();
- SetConsoleTitleA(Title);
- freopen("CONOUT$", "w", stdout);
- freopen("CONIN$", "r", stdin);
- HWND ConsoleHandle = GetConsoleWindow();
- ::SetWindowPos(ConsoleHandle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
- ::ShowWindow(ConsoleHandle, SW_NORMAL);
- }
- int WrapGlobal(DWORD atom_rthread, lua_State* atom_lthread, const char* GlobalIdentity) {
- r_l_getglobal(atom_rthread, GlobalIdentity);
- Wrap(atom_rthread, atom_lthread, -1);
- lua_setglobal(atom_lthread, GlobalIdentity);
- //r_l_pop(atom_rthread, 1);
- return 1;
- }
- #include <windows.h>
- #include <string>
- #include <stdio.h>
- using std::string;
- #pragma comment(lib,"ws2_32.lib")
- HINSTANCE hInst;
- WSADATA wsaData;
- void mParseUrl(char *mUrl, string &serverName, string &filepath, string &filename);
- SOCKET connectToServer(char *szServerName, WORD portNum);
- int getHeaderLength(char *content);
- char *readUrl2(char *szUrl, long &bytesReturnedOut, char **headerOut);
- int r_httpget(lua_State *L)
- {
- if (!lua_isstring(L, 1))
- return 1;
- const int bufLen = 1024;
- const char *szUrl = lua_tostring(L, 1); // Don't mind this error, it will always error for some reason
- long fileSize;
- char *memBuffer, *headerBuffer;
- FILE *fp;
- memBuffer = headerBuffer = NULL;
- if (WSAStartup(0x101, &wsaData) != 0)
- return -1;
- memBuffer = readUrl2((char *)szUrl, fileSize, &headerBuffer);
- lua_pushstring(L, memBuffer);
- if (fileSize != 0)
- {
- fp = fopen("downloaded.file", "wb");
- fwrite(memBuffer, 1, fileSize, fp);
- fclose(fp);
- delete(memBuffer);
- delete(headerBuffer);
- }
- WSACleanup();
- return 1;
- }
- void mParseUrl(char *mUrl, string &serverName, string &filepath, string &filename)
- {
- string::size_type n;
- string url = mUrl;
- if (url.substr(0, 7) == "http://")
- url.erase(0, 7);
- if (url.substr(0, 8) == "https://")
- url.erase(0, 8);
- n = url.find('/');
- if (n != string::npos)
- {
- serverName = url.substr(0, n);
- filepath = url.substr(n);
- n = filepath.rfind('/');
- filename = filepath.substr(n + 1);
- }
- else
- {
- serverName = url;
- filepath = "/";
- filename = "";
- }
- }
- SOCKET connectToServer(char *szServerName, WORD portNum)
- {
- struct hostent *hp;
- unsigned int addr;
- struct sockaddr_in server;
- SOCKET conn;
- conn = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (conn == INVALID_SOCKET)
- return NULL;
- if (inet_addr(szServerName) == INADDR_NONE)
- {
- hp = gethostbyname(szServerName);
- }
- else
- {
- addr = inet_addr(szServerName);
- hp = gethostbyaddr((char*)&addr, sizeof(addr), AF_INET);
- }
- if (hp == NULL)
- {
- closesocket(conn);
- return NULL;
- }
- server.sin_addr.s_addr = *((unsigned long*)hp->h_addr);
- server.sin_family = AF_INET;
- server.sin_port = htons(portNum);
- if (connect(conn, (struct sockaddr*)&server, sizeof(server)))
- {
- closesocket(conn);
- return NULL;
- }
- return conn;
- }
- int getHeaderLength(char *content)
- {
- const char *srchStr1 = "\r\n\r\n", *srchStr2 = "\n\r\n\r";
- char *findPos;
- int ofset = -1;
- findPos = strstr(content, srchStr1);
- if (findPos != NULL)
- {
- ofset = findPos - content;
- ofset += strlen(srchStr1);
- }
- else
- {
- findPos = strstr(content, srchStr2);
- if (findPos != NULL)
- {
- ofset = findPos - content;
- ofset += strlen(srchStr2);
- }
- }
- return ofset;
- }
- char *readUrl2(char *szUrl, long &bytesReturnedOut, char **headerOut)
- {
- const int bufSize = 512;
- char readBuffer[bufSize], sendBuffer[bufSize], tmpBuffer[bufSize];
- char *tmpResult = NULL, *result;
- SOCKET conn;
- string server, filepath, filename;
- long totalBytesRead, thisReadSize, headerLen;
- mParseUrl(szUrl, server, filepath, filename);
- conn = connectToServer((char*)server.c_str(), 80);
- sprintf(tmpBuffer, "GET %s HTTP/1.0", filepath.c_str());
- strcpy(sendBuffer, tmpBuffer);
- strcat(sendBuffer, "\r\n");
- sprintf(tmpBuffer, "Host: %s", server.c_str());
- strcat(sendBuffer, tmpBuffer);
- strcat(sendBuffer, "\r\n");
- strcat(sendBuffer, "\r\n");
- send(conn, sendBuffer, strlen(sendBuffer), 0);
- totalBytesRead = 0;
- while (1)
- {
- memset(readBuffer, 0, bufSize);
- thisReadSize = recv(conn, readBuffer, bufSize, 0);
- if (thisReadSize <= 0)
- break;
- tmpResult = (char*)realloc(tmpResult, thisReadSize + totalBytesRead);
- memcpy(tmpResult + totalBytesRead, readBuffer, thisReadSize);
- totalBytesRead += thisReadSize;
- }
- headerLen = getHeaderLength(tmpResult);
- long contenLen = totalBytesRead - headerLen;
- result = new char[contenLen + 1];
- memcpy(result, tmpResult + headerLen, contenLen);
- result[contenLen] = 0x0;
- char *myTmp;
- myTmp = new char[headerLen + 1];
- strncpy(myTmp, tmpResult, headerLen);
- myTmp[headerLen] = NULL;
- delete(tmpResult);
- *headerOut = myTmp;
- bytesReturnedOut = contenLen;
- closesocket(conn);
- return(result);
- }
- namespace Hook{
- void* placeHook(DWORD address, void* hook, bool revert = false) {
- DWORD oldprot;
- if (!revert) {
- void* oldmem = new void*;
- void* result = new void*;
- memcpy(oldmem, (void*)address, sizeof(void*) * 4);
- VirtualProtect((LPVOID)address, 1, PAGE_EXECUTE_READWRITE, &oldprot);
- *(char*)address = 0xE9; *(DWORD*)(address + 1) = (DWORD)hook - address - 5;
- memcpy(result, oldmem, sizeof(void*) * 4);
- VirtualProtect((LPVOID)address, 1, oldprot, &oldprot);
- return result;
- }
- else {
- VirtualProtect((LPVOID)address, 1, PAGE_EXECUTE_READWRITE, &oldprot);
- memcpy((void*)address, hook, sizeof(void*) * 4);
- VirtualProtect((LPVOID)address, 1, oldprot, &oldprot);
- return NULL;
- }
- }
- }
- DWORD RLSorg = 0;
- DWORD hookaddr = 0x7fc5f0; //gettop addr
- int gettopd(DWORD rState)
- {
- RLSorg = rState;
- return (*(DWORD *)(rState + 32) - *(DWORD *)(rState + 20)) >> 4;
- }
- #define ASLR(OFFSET) (OFFSET - 0x400000 + (DWORD)GetModuleHandle(NULL))
- int atomwrapper_loadstring(lua_State* LS) {
- if (lua_gettop(LS) == 0) {
- luaL_error(LS, "'loadstring' needs 1 string argument.");
- return 0;
- }
- Wrapper::Execute_Script(std::string(lua_tostring(LS, -1)));
- return 0;
- }
- #define SetIdentity(rL, i) DWORD* identity = (DWORD*)(rL - 32); *identity ^= (i ^ (unsigned __int8)*identity) & 0x1F;
- void yeet(){
- MessageBox(NULL, "yeet", "yeet", NULL);
- }
- static int GlobalsIndex(lua_State* Thread) {
- int RThread = r_l_newthread(RLS);
- r_l_getglobal(RThread, lua_tostring(Thread, 2));
- if (r_l_type(RThread, -1) > R_LUA_TNIL) {
- Wrap(RThread, Thread, -1);
- return 1;
- }
- return 0;
- }
- int AtomHideConsole(lua_State* L) {
- ::ShowWindow(GetConsoleWindow(), SW_HIDE);
- return 1;
- }
- int AtomShowConsole(lua_State* L) {
- ::ShowWindow(GetConsoleWindow(), SW_SHOW);
- return 1;
- }
- int mouse1press_impl(int r_lua_State) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int mouse1release_impl(int r_lua_State) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int mouse1click_impl(int r_lua_State) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int mouse2press_impl(int r_lua_State) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int mouse2release_impl(int r_lua_State) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int mouse2click_impl(int r_lua_State) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int custom_getrenv(lua_State* L) {
- Wrap(RLS, L, -10002);
- return 1;
- }
- int custom_getgenv(lua_State* L) {
- lua_pushvalue(L, -10002);
- return 1;
- }
- int MouseButton1Down(lua_State* L) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int MouseButton2Down(lua_State* L) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int MouseButton1Up(lua_State* L) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int MouseButton2Up(lua_State* L) {
- INPUT input;
- input.type = INPUT_MOUSE;
- memset(&input.mi, 0, sizeof(MOUSEINPUT));
- input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
- SendInput(1, &input, sizeof(input));
- return 0;
- }
- int custom_copyclipboard(lua_State *Ls) {
- string name = lua_tostring(Ls, -1);
- OpenClipboard(0);
- EmptyClipboard();
- HGLOBAL hg = GlobalAlloc(GMEM_MOVEABLE, name.size());
- if (!hg) {
- CloseClipboard();
- }
- memcpy(GlobalLock(hg), name.c_str(), name.size());
- GlobalUnlock(hg);
- SetClipboardData(CF_TEXT, hg);
- CloseClipboard();
- GlobalFree(hg);
- return 1;
- }
- void toClipboard(const std::string &s) {
- OpenClipboard(0);
- EmptyClipboard();
- HGLOBAL hg = GlobalAlloc(GMEM_MOVEABLE, s.size());
- if (!hg) {
- CloseClipboard();
- return;
- }
- memcpy(GlobalLock(hg), s.c_str(), s.size());
- GlobalUnlock(hg);
- SetClipboardData(CF_TEXT, hg);
- CloseClipboard();
- GlobalFree(hg);
- }
- void fn_toclipboard(lua_State *L) {
- std::string tc = lua_tostring(L, -1);
- toClipboard(tc);
- MessageBoxA(NULL, "Successfully copied to your clipboard!", "Done!", NULL);
- }
- typedef int (WINAPI *INDEX2ADR_DEF)(uintptr_t, int);
- INDEX2ADR_DEF oldi2adr = NULL;
- void detectRobloxClosed() {
- while (true) {
- if (!FindWindowA(NULL, "Roblox")) {
- exit(1);
- }
- }
- }
- void initChecks() {
- __asm {
- jmp detectRobloxClosed;
- }
- }
- /*
- union r_Value
- {
- int b;
- double n;
- void* p;
- void* gc;
- };
- struct r_TValue
- {
- r_Value value;
- int tt;
- };
- r_TValue* r_gettop(int r_lua_State) {
- return *(r_TValue**)(r_lua_State + 16);
- }
- int setreadonly_impl(lua_State* r_lua_State) {
- if (r_l_gettop(RLS) < 1) {
- r_l_pushboolean(RLS, 0);
- r_l_pushstring(RLS, "2 or more arguments expected");
- return 2;
- }
- r_TValue* top = r_gettop(RLS);
- r_TValue* b = top - 1;
- r_TValue* obj = top - 2;
- if (obj->tt != R_LUA_TTABLE) {
- r_l_pushboolean(RLS, 0);
- r_l_pushstring(RLS, "table expected");
- return 2;
- }
- if (b->tt != R_LUA_TBOOLEAN) {
- r_l_pushboolean(RLS, 0);
- r_l_pushstring(RLS, "boolean expected");
- return 2;
- }
- *(unsigned char*)(obj->value_0 + 6) = b->value_0;
- r_l_pushboolean(RLS, 1);
- return 1;
- }
- int isreadonly_impl(lua_State* r_lua_State) {
- if (r_l_gettop(m_rL) < 1) {
- r_l_pushnil(m_rL);
- r_l_pushstring(m_rL, "1 or more arguments expected");
- return 2;
- }
- r_TValue* top = r_gettop(m_rL);
- r_TValue* obj = top - 1;
- if (obj->tt != RLUA_TTABLE) {
- r_l_pushnil(m_rL);
- r_l_pushstring(m_rL, "table expected");
- return 2;
- }
- r_l_pushboolean(m_rL, (int)*(unsigned char*)(obj->value_0 + 6));
- return 1;
- }
- */
- /*int a1 = rand() % 1 + 1;
- XorS(YEETKEY, "YIELD FUNCTION HANDLER");
- XorS(AESKEY, "VRN9fuJHcgmnV/9DLXUe2TE4qLHl80+AaiqbxfZSjW0wv6aoA"+'='+'=');
- std::vector<std::string> keyorder = {AESKEY.decrypt(), "SkSDoBk8yYidbKVWnRCSq4jvLoUQjTGNPkofz" };*/
- int SecureScript(lua_State* thread) {
- int begin = 0;
- std::string endstr = "";
- std::string str = lua_tostring(thread, -1);
- for (char& c : str) {;
- if (begin < 1) {
- cout << c << endl;
- endstr.push_back(c);
- begin++;
- }
- else {
- begin = 0;
- }
- cout << endstr << endl;
- }
- return 1;
- }
- int SecureEncrypt(lua_State* thread) {
- return 1;
- }
- int cerror(lua_State* thread) {
- return 1;
- }
- int movemouse(lua_State* thread) {
- int x = lua_tonumber(thread, -1);
- int y = lua_tonumber(thread, -2);
- POINT p;
- if (GetCursorPos(&p))
- {
- SetCursorPos(p.x + x, p.y + y);
- }
- return 1;
- }
- //int movemouse(lua_State* thread) {
- //
- // POINT p;
- // GetCursorPos(&p);
- // int curx = p.x;
- // int cury = p.y;
- //
- // int x = lua_tonumber(thread, -1);
- // int y = lua_tonumber(thread, -1);
- //
- // INPUT input;
- // input.type = INPUT_MOUSE;
- // memset(&input.mi, 0, sizeof(MOUSEINPUT));
- // input.mi.dx = curx + x;
- // input.mi.dy = cury + y;
- // input.mi.dwFlags = MOUSEEVENTF_MOVE;
- // SendInput(1, &input, sizeof(INPUT));
- //
- // return 1;
- //}
- int IndexGetRawMetatable(lua_State *L) {
- DWORD luaState = RLS;
- double Num = lua_tonumber(L, lua_upvalueindex(1));
- printf("index calledd1\n");
- r_l_rawgeti(luaState, LUA_REGISTRYINDEX, Num);
- r_l_getmetatable(luaState, -1);
- r_l_getfield(RLS, -1, lua_tostring(L, -1));
- UnWrap(L, luaState, -1);
- r_l_settop(RLS, 0);
- return 1;
- }
- int NewINdexGetRawmetatble(lua_State *L) {
- DWORD luaState = RLS;
- double Num = lua_tonumber(L, lua_upvalueindex(1));
- const char* key = lua_tostring(L, -2);
- printf("key: %s\n", key);
- r_l_rawgeti(luaState, LUA_REGISTRYINDEX, Num);
- r_l_getmetatable (luaState, -1);
- r_l_pushstring(luaState, key);
- UnWrap(L, RLS, -1);
- r_l_settable(luaState, -3);
- r_l_settop(RLS, -2);
- return 1;
- }
- int GetRawMetaTable(lua_State *L) {
- UnWrap(L, RLS, -1);
- if (r_l_getmetatable(RLS, -1) == 0) {
- lua_pushnil(L);
- return 0;
- }
- r_l_SRO(RLS, -1, 0);
- int num = r_l_lref (RLS, LUA_REGISTRYINDEX);
- lua_newtable(L);
- lua_newtable(L);
- lua_pushnumber(L, num);
- lua_pushcclosure(L, IndexGetRawMetatable, 1);
- lua_setfield(L, -2, "__index");
- lua_pushnumber(L, num);
- lua_pushcclosure(L, NewINdexGetRawmetatble, 1);
- lua_setfield(L, -2, "__newindex");
- lua_setmetatable(L, -2);
- return 1;
- }
- typedef struct r_TValue1 {
- int value_0;
- int value_1;
- int tt;
- int unk;
- };
- r_TValue1* r_gettop(int r_lua_State) {
- return *(r_TValue1**)(r_lua_State + 16);
- }
- int custom_setreadonly(lua_State* thread) {
- lua_gettable(thread, -1);
- r_l_SRO(RLS, 1, lua_toboolean(LS, -2));
- return 0;
- }
- int printtoconsole(lua_State* thread) {
- std::string msg = lua_tostring(thread, -1);
- cout << iblue << "[AtomWrapper] " + msg << endl;
- return 1;
- }
- int Lua_WrapGlobal(lua_State* thread) {
- std::string globalName = lua_tostring(thread, -1);
- WrapGlobal(RLS, LS, globalName.c_str());
- cout << iblue << "Wrapped Global: " + globalName << endl;
- return 1;
- }
- int error(lua_State* thread) {
- std::string errorstr = lua_tostring(thread, -1);
- int type = lua_tonumber(thread, -2);
- std::string finalerror = "warn('"; finalerror = finalerror + errorstr; finalerror = finalerror + "')";
- luaL_dostring(thread, finalerror.c_str());
- return 1;
- }
- int TestFunc(lua_State* L) {
- cout << "hi" << endl;
- return 1;
- }
- int main(){
- XorS(ConsoleName, "AtomWrapper | Level 6 Unrestricted Lua Wrapper");
- ConsoleBypass(ConsoleName.decrypt());
- cout << ipurple << "--Credits--\nDeveloper: RoboMat\nUpdating: ElKoax" << endl;
- DWORD stuff;
- VirtualProtect((LPVOID)&FindWindowA, 1, PAGE_EXECUTE_READWRITE, &stuff);
- *(char*)&FindWindowA = 0x90;
- VirtualProtect((LPVOID)&FindWindowA, 1, stuff, &stuff);
- cout << ipurple << "Hooking...";
- void* old = Hook::placeHook(ASLR(hookaddr), gettopd);
- do { Sleep(1); } while (RLSorg == 0);
- Hook::placeHook(ASLR(hookaddr), old, 1);
- RLS = RLSorg;
- std::cout << igreen << "Success!" << endl;
- LS = lua_open();
- Int3BreakPoints();
- luaL_openlibs(LS);
- SetIdentity(RLS, 6);
- cout << iblue << "Creating Environment...";
- //Globals
- WrapGlobal(RLS, LS, "game");
- WrapGlobal(RLS, LS, "Game");
- WrapGlobal(RLS, LS, "workspace");
- WrapGlobal(RLS, LS, "Workspace");
- WrapGlobal(RLS, LS, "Axes");
- WrapGlobal(RLS, LS, "BrickColor");
- WrapGlobal(RLS, LS, "CFrame");
- WrapGlobal(RLS, LS, "Color3");
- WrapGlobal(RLS, LS, "ColorSequence");
- WrapGlobal(RLS, LS, "ColorSequenceKeypoint");
- WrapGlobal(RLS, LS, "NumberRange");
- WrapGlobal(RLS, LS, "NumberSequence");
- WrapGlobal(RLS, LS, "NumberSequenceKeypoint");
- WrapGlobal(RLS, LS, "PhysicalProperties");
- WrapGlobal(RLS, LS, "Ray");
- WrapGlobal(RLS, LS, "Rect");
- WrapGlobal(RLS, LS, "Region3");
- WrapGlobal(RLS, LS, "Region3int16");
- WrapGlobal(RLS, LS, "TweenInfo");
- WrapGlobal(RLS, LS, "UDim");
- WrapGlobal(RLS, LS, "UDim2");
- WrapGlobal(RLS, LS, "Vector2");
- WrapGlobal(RLS, LS, "Vector2int16");
- WrapGlobal(RLS, LS, "Vector3");
- WrapGlobal(RLS, LS, "Vector3int16");
- WrapGlobal(RLS, LS, "Enum");
- WrapGlobal(RLS, LS, "Faces");
- WrapGlobal(RLS, LS, "Instance");
- WrapGlobal(RLS, LS, "math");
- WrapGlobal(RLS, LS, "warn");
- WrapGlobal(RLS, LS, "typeof");
- WrapGlobal(RLS, LS, "type");
- WrapGlobal(RLS, LS, "spawn");
- WrapGlobal(RLS, LS, "Spawn");
- WrapGlobal(RLS, LS, "print");
- WrapGlobal(RLS, LS, "printidentity");
- WrapGlobal(RLS, LS, "ypcall");
- WrapGlobal(RLS, LS, "Wait");
- WrapGlobal(RLS, LS, "wait");
- WrapGlobal(RLS, LS, "delay");
- WrapGlobal(RLS, LS, "Delay");
- WrapGlobal(RLS, LS, "tick");
- WrapGlobal(RLS, LS, "LoadLibrary");
- //Globals
- cout << iblue << "Starting userdata caching system...";
- std::cout << igreen << "Success!" << endl;
- cout << iblue << "Creating AtomWrapper Custom Global Tables...";
- std::cout << igreen << "Success!" << endl;
- XorS(FilterCheck, "_FILTERED = true");
- luaL_dostring(LS, FilterCheck.decrypt()); //filtered check
- lua_newtable(LS);
- lua_setglobal(LS, "_G");
- /*
- AtomWrapper Custom Globals
- */
- lua_newtable(LS);
- lua_setglobal(LS, "_AG");
- lua_register(LS, "WrapGlobal", Lua_WrapGlobal);
- lua_register(LS, "printconsole", printtoconsole);
- lua_register(LS, "getrawmetatable", GetRawMetaTable);
- lua_register(LS, "SecureScript", SecureScript);
- lua_register(LS, "SecureEncrypt", SecureEncrypt);
- lua_register(LS, "ShowConsole", AtomShowConsole);
- lua_register(LS, "HideConsole", AtomHideConsole);
- lua_register(LS, "loadstring", atomwrapper_loadstring);
- lua_register(LS, "HttpGet", r_httpget);
- lua_register(LS, "getrenv", custom_getrenv);
- lua_register(LS, "getgenv", custom_getgenv);
- lua_register(LS, "setreadonly", custom_setreadonly);
- lua_register(LS, "mousemoverel", movemouse);
- lua_register(LS, "error", error);
- luaL_dostring(LS, "function GetObjects(assetId)\r\n local obj = game:GetService(\"InsertService\"):LoadLocalAsset(assetId)\r\n return { obj };\r\nend\r\n\r\nfunction ensure(obj)\r\n for _,child in pairs(obj:GetChildren()) do\r\n if (child.ClassName == \"LocalScript\") then\r\n loadstring(child.Source)();\r\n ensure(child);\r\n else\r\n ensure(child);\r\n end\r\n end\r\nend\r\n\r\n");
- luaL_dostring(LS, "game.StarterGui:SetCore('SendNotification', {Duration = 10; Title='AtomWrapper'; Text='AtomWrapper Injected'})");
- Functions::RegisterDebugFunctions(LS);
- Functions::RegisterFuncs(LS);
- //Wrapper::Execute_Script(DownloadURL("https://pastebin.com/raw/Vszxg7Pc"));
- XorS(credits, "AtomWrapper is now ready for use created by RoboMat and ELKOAX");
- cout << igreen << credits.decrypt() << endl;
- // ShowWindow(GetConsoleWindow(), SW_HIDE);
- CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)LuaPipe, NULL, NULL, NULL);
- cout << iblue << "Starting ImGui thread..." << endl;
- CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)InitImgui, NULL, NULL, NULL);
- return 1;
- }
- unsigned int ProtectSections(HMODULE Module
- ) {
- MODULEINFO ModuleInfo;
- GetModuleInformation(GetCurrentProcess(), Module, &ModuleInfo, sizeof(ModuleInfo));
- uintptr_t Address = reinterpret_cast<uintptr_t>(Module);
- uintptr_t TermAddress = Address + ModuleInfo.SizeOfImage;
- MEMORY_BASIC_INFORMATION MemoryInfo;
- while (Address < TermAddress) {
- VirtualQuery(reinterpret_cast<void*>(Address), &MemoryInfo, sizeof(MemoryInfo));
- if (MemoryInfo.State == MEM_COMMIT && (MemoryInfo.Protect & (PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY))) {
- DWORD OldProtection;
- VirtualProtect(reinterpret_cast<void*>(Address), MemoryInfo.RegionSize, PAGE_EXECUTE_READ, &OldProtection);
- }
- Address = reinterpret_cast<uintptr_t>(MemoryInfo.BaseAddress) + MemoryInfo.RegionSize;
- }
- VirtualQuery(reinterpret_cast<void*>(MemoryInfo.AllocationBase), &MemoryInfo, sizeof(MemoryInfo));
- if (MemoryInfo.State != MEM_COMMIT || !(MemoryInfo.Protect & PAGE_EXECUTE_READ))
- return 0x400;
- return MemoryInfo.RegionSize - 0x400;
- }
- __forceinline void UnlinkModule(HINSTANCE Module
- ) {
- unsigned long PEB_DATA = 0;
- _asm {
- pushad;
- pushfd;
- mov eax, fs:[30h]
- mov eax, [eax + 0Ch]
- mov PEB_DATA, eax
- InLoadOrderModuleList :
- mov esi, [eax + 0Ch]
- mov edx, [eax + 10h]
- LoopInLoadOrderModuleList :
- lodsd
- mov esi, eax
- mov ecx, [eax + 18h]
- cmp ecx, Module
- jne SkipA
- mov ebx, [eax]
- mov ecx, [eax + 4]
- mov[ecx], ebx
- mov[ebx + 4], ecx
- jmp InMemoryOrderModuleList
- SkipA :
- cmp edx, esi
- jne LoopInLoadOrderModuleList
- InMemoryOrderModuleList :
- mov eax, PEB_DATA
- mov esi, [eax + 14h]
- mov edx, [eax + 18h]
- LoopInMemoryOrderModuleList :
- lodsd
- mov esi, eax
- mov ecx, [eax + 10h]
- cmp ecx, Module
- jne SkipB
- mov ebx, [eax]
- mov ecx, [eax + 4]
- mov[ecx], ebx
- mov[ebx + 4], ecx
- jmp InInitializationOrderModuleList
- SkipB :
- cmp edx, esi
- jne LoopInMemoryOrderModuleList
- InInitializationOrderModuleList :
- mov eax, PEB_DATA
- mov esi, [eax + 1Ch]
- mov edx, [eax + 20h]
- LoopInInitializationOrderModuleList :
- lodsd
- mov esi, eax
- mov ecx, [eax + 08h]
- cmp ecx, Module
- jne SkipC
- mov ebx, [eax]
- mov ecx, [eax + 4]
- mov[ecx], ebx
- mov[ebx + 4], ecx
- jmp Finished
- SkipC :
- cmp edx, esi
- jne LoopInInitializationOrderModuleList
- Finished :
- popfd;
- popad;
- }
- }
- BOOL APIENTRY DllMain(HMODULE Module, DWORD Reason, void* Reserved)
- {
- switch (Reason)
- {
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls(Module);
- UnlinkModule(Module);
- DWORD OldProtection;
- VirtualProtect(Module, 4096, PAGE_READWRITE, &OldProtection);
- ZeroMemory(Module, 4096);
- ProtectSections(Module);
- HANDLE hThread = NULL;
- HANDLE hDllMainThread = OpenThread(THREAD_ALL_ACCESS, NULL, GetCurrentThreadId());
- if (Reserved == NULL) {
- if (!(hThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)main, NULL, NULL, NULL))) {
- CloseHandle(hDllMainThread);
- return FALSE;
- }
- CloseHandle(hThread);
- }
- return TRUE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement