Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ImGui - standalone example application for DirectX 9
- // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
- #include <imgui.h>
- #include "imgui_impl_dx9.h"
- #include <d3d9.h>
- #define DIRECTINPUT_VERSION 0x0800
- #include <dinput.h>
- #include <tchar.h>
- #include <comdef.h>
- #include <string>
- #include <stdio.h>
- #include <cstdio>
- #define CURL_STATICLIB
- #include "curl/curl.h"
- #include <iostream>
- #include <string.h>
- #include <direct.h>
- #include <windows.h>
- #include <tlhelp32.h>
- #include <stdio.h>
- #include <Windows.h>
- #include <Psapi.h>
- #include <TlHelp32.h>
- static char userVal[15];
- static char passwordVal[25];
- static bool showMainPage = true;
- typedef HMODULE(WINAPI *pLoadLibraryA)(LPCSTR);
- typedef FARPROC(WINAPI *pGetProcAddress)(HMODULE, LPCSTR);
- typedef BOOL(WINAPI *PDLL_MAIN)(HMODULE, DWORD, PVOID);
- typedef struct _MANUAL_INJECT
- {
- PVOID ImageBase;
- PIMAGE_NT_HEADERS NtHeaders;
- PIMAGE_BASE_RELOCATION BaseRelocation;
- PIMAGE_IMPORT_DESCRIPTOR ImportDirectory;
- pLoadLibraryA fnLoadLibraryA;
- pGetProcAddress fnGetProcAddress;
- }MANUAL_INJECT, *PMANUAL_INJECT;
- int FindCSGO() {
- PROCESSENTRY32 entry;
- entry.dwSize = sizeof(PROCESSENTRY32);
- HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
- if (Process32First(snapshot, &entry) == TRUE)
- {
- while (Process32Next(snapshot, &entry) == TRUE)
- {
- if (strstr(entry.szExeFile, "csgo.exe") || strstr(entry.szExeFile, "CSGO.EXE"))
- {
- return entry.th32ProcessID;
- }
- }
- }
- CloseHandle(snapshot);
- return NULL;
- }
- DWORD WINAPI LoadDll(PVOID p)
- {
- PMANUAL_INJECT ManualInject;
- HMODULE hModule;
- DWORD i, Function, count, delta;
- PDWORD ptr;
- PWORD list;
- PIMAGE_BASE_RELOCATION pIBR;
- PIMAGE_IMPORT_DESCRIPTOR pIID;
- PIMAGE_IMPORT_BY_NAME pIBN;
- PIMAGE_THUNK_DATA FirstThunk, OrigFirstThunk;
- PDLL_MAIN EntryPoint;
- ManualInject = (PMANUAL_INJECT)p;
- pIBR = ManualInject->BaseRelocation;
- delta = (DWORD)((LPBYTE)ManualInject->ImageBase - ManualInject->NtHeaders->OptionalHeader.ImageBase); // Calculate the delta
- // Relocate the image
- while (pIBR->VirtualAddress)
- {
- if (pIBR->SizeOfBlock >= sizeof(IMAGE_BASE_RELOCATION))
- {
- count = (pIBR->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof(WORD);
- list = (PWORD)(pIBR + 1);
- for (i = 0; i<count; i++)
- {
- if (list[i])
- {
- ptr = (PDWORD)((LPBYTE)ManualInject->ImageBase + (pIBR->VirtualAddress + (list[i] & 0xFFF)));
- *ptr += delta;
- }
- }
- }
- pIBR = (PIMAGE_BASE_RELOCATION)((LPBYTE)pIBR + pIBR->SizeOfBlock);
- }
- pIID = ManualInject->ImportDirectory;
- // Resolve DLL imports
- while (pIID->Characteristics)
- {
- OrigFirstThunk = (PIMAGE_THUNK_DATA)((LPBYTE)ManualInject->ImageBase + pIID->OriginalFirstThunk);
- FirstThunk = (PIMAGE_THUNK_DATA)((LPBYTE)ManualInject->ImageBase + pIID->FirstThunk);
- hModule = ManualInject->fnLoadLibraryA((LPCSTR)ManualInject->ImageBase + pIID->Name);
- if (!hModule)
- {
- return FALSE;
- }
- while (OrigFirstThunk->u1.AddressOfData)
- {
- if (OrigFirstThunk->u1.Ordinal & IMAGE_ORDINAL_FLAG)
- {
- // Import by ordinal
- Function = (DWORD)ManualInject->fnGetProcAddress(hModule, (LPCSTR)(OrigFirstThunk->u1.Ordinal & 0xFFFF));
- if (!Function)
- {
- return FALSE;
- }
- FirstThunk->u1.Function = Function;
- }
- else
- {
- // Import by name
- pIBN = (PIMAGE_IMPORT_BY_NAME)((LPBYTE)ManualInject->ImageBase + OrigFirstThunk->u1.AddressOfData);
- Function = (DWORD)ManualInject->fnGetProcAddress(hModule, (LPCSTR)pIBN->Name);
- if (!Function)
- {
- return FALSE;
- }
- FirstThunk->u1.Function = Function;
- }
- OrigFirstThunk++;
- FirstThunk++;
- }
- pIID++;
- }
- if (ManualInject->NtHeaders->OptionalHeader.AddressOfEntryPoint)
- {
- EntryPoint = (PDLL_MAIN)((LPBYTE)ManualInject->ImageBase + ManualInject->NtHeaders->OptionalHeader.AddressOfEntryPoint);
- return EntryPoint((HMODULE)ManualInject->ImageBase, DLL_PROCESS_ATTACH, NULL); // Call the entry point
- }
- return TRUE;
- }
- DWORD WINAPI LoadDllEnd()
- {
- return 0;
- }
- int Inject(char* bytes, size_t len)
- {
- PIMAGE_DOS_HEADER pIDH;
- PIMAGE_NT_HEADERS pINH;
- PIMAGE_SECTION_HEADER pISH;
- HANDLE hProcess, hThread, hFile, hToken;
- PVOID buffer, image, mem;
- DWORD i, FileSize, ProcessId, ExitCode, read;
- TOKEN_PRIVILEGES tp;
- MANUAL_INJECT ManualInject;
- if (OpenProcessToken((HANDLE)-1, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
- {
- tp.PrivilegeCount = 1;
- tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
- tp.Privileges[0].Luid.LowPart = 20;
- tp.Privileges[0].Luid.HighPart = 0;
- AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
- CloseHandle(hToken);
- }
- buffer = VirtualAlloc(NULL, len, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
- if (!buffer)
- {
- MessageBoxA(NULL, "Allocation failed!", "obscurecheatz", MB_OK);
- printf("\nError: Unable to allocate memory for DLL data (%d)\n", GetLastError());
- return -1;
- }
- // Read the DLL
- memcpy(buffer, bytes, len);
- pIDH = (PIMAGE_DOS_HEADER)buffer;
- if (pIDH->e_magic != IMAGE_DOS_SIGNATURE)
- {
- printf("\nError: Invalid executable image.\n");
- MessageBoxA(NULL, "Invaild image!", "obscurecheatz", MB_OK);
- VirtualFree(buffer, 0, MEM_RELEASE);
- return -1;
- }
- pINH = (PIMAGE_NT_HEADERS)((LPBYTE)buffer + pIDH->e_lfanew);
- if (pINH->Signature != IMAGE_NT_SIGNATURE)
- {
- printf("\nError: Invalid PE header.\n");
- MessageBoxA(NULL, "Invaild PE!", "obscurecheatz", MB_OK);
- VirtualFree(buffer, 0, MEM_RELEASE);
- return -1;
- }
- if (!(pINH->FileHeader.Characteristics & IMAGE_FILE_DLL))
- {
- printf("\nError: The image is not DLL.\n");
- MessageBoxA(NULL, "Not DLL!", "obscurecheatz", MB_OK);
- VirtualFree(buffer, 0, MEM_RELEASE);
- return -1;
- }
- ProcessId = FindCSGO();
- if (!ProcessId) {
- printf("no csgo present");
- MessageBoxA(NULL, "Open CSGO first!", "obscurecheatz", MB_OK);
- return -1;
- }
- printf("\nOpening target process.\n");
- hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessId);
- if (!hProcess)
- {
- printf("\nError: Unable to open target process (%d)\n", GetLastError());
- MessageBoxA(NULL, "OpenProcess failed!", "obscurecheatz", MB_OK);
- VirtualFree(buffer, 0, MEM_RELEASE);
- CloseHandle(hProcess);
- return -1;
- }
- printf("\nAllocating memory for the DLL.\n");
- image = VirtualAllocEx(hProcess, NULL, pINH->OptionalHeader.SizeOfImage, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); // Allocate memory for the DLL
- if (!image)
- {
- printf("\nError: Unable to allocate memory for the DLL (%d)\n", GetLastError());
- MessageBoxA(NULL, "Allocation failed! (2)", "obscurecheatz", MB_OK);
- VirtualFree(buffer, 0, MEM_RELEASE);
- CloseHandle(hProcess);
- return -1;
- }
- // Copy the header to target process
- printf("\nCopying headers into target process.\n");
- if (!WriteProcessMemory(hProcess, image, buffer, pINH->OptionalHeader.SizeOfHeaders, NULL))
- {
- printf("\nError: Unable to copy headers to target process (%d)\n", GetLastError());
- MessageBoxA(NULL, "Copying headers failed!", "obscurecheatz", MB_OK);
- VirtualFreeEx(hProcess, image, 0, MEM_RELEASE);
- CloseHandle(hProcess);
- VirtualFree(buffer, 0, MEM_RELEASE);
- return -1;
- }
- pISH = (PIMAGE_SECTION_HEADER)(pINH + 1);
- // Copy the DLL to target process
- printf("\nCopying sections to target process.\n");
- for (i = 0; i<pINH->FileHeader.NumberOfSections; i++)
- {
- WriteProcessMemory(hProcess, (PVOID)((LPBYTE)image + pISH[i].VirtualAddress), (PVOID)((LPBYTE)buffer + pISH[i].PointerToRawData), pISH[i].SizeOfRawData, NULL);
- }
- printf("\nAllocating memory for the loader code.\n");
- mem = VirtualAllocEx(hProcess, NULL, 4096, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); // Allocate memory for the loader code
- if (!mem)
- {
- printf("\nError: Unable to allocate memory for the loader code (%d)\n", GetLastError());
- MessageBoxA(NULL, "Allocation failed! (3)", "obscurecheatz", MB_OK);
- VirtualFreeEx(hProcess, image, 0, MEM_RELEASE);
- CloseHandle(hProcess);
- VirtualFree(buffer, 0, MEM_RELEASE);
- return -1;
- }
- printf("\nLoader code allocated at %#x\n", mem);
- memset(&ManualInject, 0, sizeof(MANUAL_INJECT));
- ManualInject.ImageBase = image;
- ManualInject.NtHeaders = (PIMAGE_NT_HEADERS)((LPBYTE)image + pIDH->e_lfanew);
- ManualInject.BaseRelocation = (PIMAGE_BASE_RELOCATION)((LPBYTE)image + pINH->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress);
- ManualInject.ImportDirectory = (PIMAGE_IMPORT_DESCRIPTOR)((LPBYTE)image + pINH->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
- ManualInject.fnLoadLibraryA = LoadLibraryA;
- ManualInject.fnGetProcAddress = GetProcAddress;
- printf("\nWriting loader code to target process.\n");
- WriteProcessMemory(hProcess, mem, &ManualInject, sizeof(MANUAL_INJECT), NULL); // Write the loader information to target process
- WriteProcessMemory(hProcess, (PVOID)((PMANUAL_INJECT)mem + 1), LoadDll, (DWORD)LoadDllEnd - (DWORD)LoadDll, NULL); // Write the loader code to target process
- printf("\nExecuting loader code.\n");
- hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)((PMANUAL_INJECT)mem + 1), mem, 0, NULL); // Create a remote thread to execute the loader code
- if (!hThread)
- {
- printf("\nError: Unable to execute loader code (%d)\n", GetLastError());
- MessageBoxA(NULL, std::string("Unable to execute loader code! (" + std::to_string(GetLastError()) + ")").c_str(), "obscurecheatz", MB_OK);
- VirtualFreeEx(hProcess, mem, 0, MEM_RELEASE);
- VirtualFreeEx(hProcess, image, 0, MEM_RELEASE);
- CloseHandle(hProcess);
- VirtualFree(buffer, 0, MEM_RELEASE);
- return -1;
- }
- WaitForSingleObject(hThread, INFINITE);
- GetExitCodeThread(hThread, &ExitCode);
- if (!ExitCode)
- {
- VirtualFreeEx(hProcess, mem, 0, MEM_RELEASE);
- VirtualFreeEx(hProcess, image, 0, MEM_RELEASE);
- CloseHandle(hThread);
- CloseHandle(hProcess);
- VirtualFree(buffer, 0, MEM_RELEASE);
- MessageBoxA(NULL, "Thread didnt exit!", "obscurecheatz", MB_OK);
- return -1;
- }
- CloseHandle(hThread);
- VirtualFreeEx(hProcess, mem, 0, MEM_RELEASE);
- CloseHandle(hProcess);
- printf("\nDLL injected at %#x\n", image);
- if (pINH->OptionalHeader.AddressOfEntryPoint)
- {
- printf("\nDLL entry point: %#x\n", (PVOID)((LPBYTE)image + pINH->OptionalHeader.AddressOfEntryPoint));
- }
- VirtualFree(buffer, 0, MEM_RELEASE);
- return 0;
- exit(0);
- }
- struct string {
- char *ptr;
- size_t len;
- };
- void init_string(struct string *s) {
- s->len = 0;
- s->ptr = (char*)malloc(s->len + 1);
- if (s->ptr == NULL) {
- fprintf(stderr, "malloc() failed\n");
- exit(EXIT_FAILURE);
- }
- s->ptr[0] = '\0';
- }
- size_t writefunc(void *ptr, size_t size, size_t nmemb, struct string *s)
- {
- size_t new_len = s->len + size*nmemb;
- s->ptr = (char*)realloc(s->ptr, new_len + 1);
- if (s->ptr == NULL) {
- fprintf(stderr, "realloc() failed\n");
- exit(EXIT_FAILURE);
- }
- memcpy(s->ptr + s->len, ptr, size*nmemb);
- s->ptr[new_len] = '\0';
- s->len = new_len;
- return size*nmemb;
- }
- std::string GetHardWareID()
- {
- HW_PROFILE_INFOA hwProfileInfoA;
- if (GetCurrentHwProfileA(&hwProfileInfoA) != NULL)
- return std::string(hwProfileInfoA.szHwProfileGuid);
- }
- void injectionVoid()
- {
- CURL* c;
- c = curl_easy_init();
- if (!c)
- exit(1);
- struct string s;
- init_string(&s);
- curl_easy_setopt(c, CURLOPT_URL, "https://mestermc.hu/index.php");
- curl_easy_setopt(c, CURLOPT_WRITEFUNCTION, writefunc);
- curl_easy_setopt(c, CURLOPT_WRITEDATA, &s);
- curl_easy_perform(c);
- curl_easy_cleanup(c);
- Inject(s.ptr, s.len);
- }
- bool loginValue()
- {
- CURL* c;
- c = curl_easy_init();
- if (!c)
- exit(1);
- struct string s;
- init_string(&s);
- std::string variable = "http://obscure-files.000webhostapp.com/connection.php?username=" + std::string(userVal) + "&password=" + std::string(passwordVal) + "&hwid=" + GetHardWareID();
- printf("%s", variable.c_str());
- curl_easy_setopt(c, CURLOPT_URL, variable.c_str());
- curl_easy_setopt(c, CURLOPT_WRITEFUNCTION, writefunc);
- curl_easy_setopt(c, CURLOPT_WRITEDATA, &s);
- curl_easy_perform(c);
- curl_easy_cleanup(c);
- if (!strcmp(s.ptr, "success"))
- return true;
- else
- return false;
- }
- /* ============================================================================================================================== */
- // Data
- static LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
- static D3DPRESENT_PARAMETERS g_d3dpp;
- extern LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (ImGui_ImplDX9_WndProcHandler(hWnd, msg, wParam, lParam))
- return true;
- switch (msg)
- {
- case WM_SIZE:
- if (g_pd3dDevice != NULL && wParam != SIZE_MINIMIZED)
- {
- ImGui_ImplDX9_InvalidateDeviceObjects();
- g_d3dpp.BackBufferWidth = LOWORD(lParam);
- g_d3dpp.BackBufferHeight = HIWORD(lParam);
- HRESULT hr = g_pd3dDevice->Reset(&g_d3dpp);
- if (hr == D3DERR_INVALIDCALL)
- IM_ASSERT(0);
- ImGui_ImplDX9_CreateDeviceObjects();
- }
- return 0;
- case WM_SYSCOMMAND:
- if ((wParam & 0xfff0) == SC_KEYMENU) // Disable ALT application menu
- return 0;
- break;
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- }
- return DefWindowProc(hWnd, msg, wParam, lParam);
- }
- int main()
- {
- ImGuiIO& io = ImGui::GetIO();
- io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\Tahoma.ttf", 16.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
- ImGuiStyle * style = &ImGui::GetStyle();
- style->WindowPadding = ImVec2(15, 15);
- style->WindowRounding = 5.0f;
- style->FramePadding = ImVec2(5, 5);
- style->FrameRounding = 4.0f;
- style->ItemSpacing = ImVec2(12, 8);
- style->ItemInnerSpacing = ImVec2(8, 6);
- style->IndentSpacing = 25.0f;
- style->ScrollbarSize = 15.0f;
- style->ScrollbarRounding = 9.0f;
- style->GrabMinSize = 5.0f;
- style->GrabRounding = 3.0f;
- style->Colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f);
- style->Colors[ImGuiCol_TextDisabled] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
- style->Colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
- style->Colors[ImGuiCol_Border] = ImVec4(0.80f, 0.80f, 0.83f, 0.88f);
- style->Colors[ImGuiCol_BorderShadow] = ImVec4(0.92f, 0.91f, 0.88f, 0.00f);
- style->Colors[ImGuiCol_FrameBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_FrameBgActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_TitleBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 0.98f, 0.95f, 0.75f);
- style->Colors[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
- style->Colors[ImGuiCol_MenuBarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
- style->Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_ComboBg] = ImVec4(0.19f, 0.18f, 0.21f, 1.00f);
- style->Colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
- style->Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
- style->Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_Button] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_ButtonHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_ButtonActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_Header] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_HeaderHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_Column] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ColumnHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_ColumnActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
- style->Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_CloseButton] = ImVec4(0.40f, 0.39f, 0.38f, 0.16f);
- style->Colors[ImGuiCol_CloseButtonHovered] = ImVec4(0.40f, 0.39f, 0.38f, 0.39f);
- style->Colors[ImGuiCol_CloseButtonActive] = ImVec4(0.40f, 0.39f, 0.38f, 1.00f);
- style->Colors[ImGuiCol_PlotLines] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
- style->Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
- style->Colors[ImGuiCol_PlotHistogram] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
- style->Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
- style->Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.00f, 0.00f, 0.43f);
- style->Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f);
- // Create application window
- WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, LoadCursor(NULL, IDC_ARROW), NULL, NULL, _T("loader"), NULL };
- RegisterClassEx(&wc);
- HWND hwnd = CreateWindow(_T("loader"), _T("loader"), WS_OVERLAPPEDWINDOW | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 100, 100, 500, 500, NULL, NULL, wc.hInstance, NULL);
- // Initialize Direct3D
- LPDIRECT3D9 pD3D;
- if ((pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL)
- {
- UnregisterClass(_T("loader"), wc.hInstance);
- return 0;
- }
- ZeroMemory(&g_d3dpp, sizeof(g_d3dpp));
- g_d3dpp.Windowed = TRUE;
- g_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
- g_d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
- g_d3dpp.EnableAutoDepthStencil = TRUE;
- g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
- g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; // Present with vsync
- //g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // Present without vsync, maximum unthrottled framerate
- // Create the D3DDevice
- if (pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_d3dpp, &g_pd3dDevice) < 0)
- {
- pD3D->Release();
- UnregisterClass(_T("loader"), wc.hInstance);
- return 0;
- }
- // Setup ImGui binding
- ImGui_ImplDX9_Init(hwnd, g_pd3dDevice);
- // Load Fonts
- // (there is a default font, this is only if you want to change it. see extra_fonts/README.txt for more details)
- //ImGuiIO& io = ImGui::GetIO();
- //io.Fonts->AddFontDefault();
- //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f);
- //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
- //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
- //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
- //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
- ImVec4 clear_col = ImColor(114, 144, 154);
- // Main loop
- MSG msg;
- ZeroMemory(&msg, sizeof(msg));
- ShowWindow(hwnd, SW_SHOWDEFAULT);
- UpdateWindow(hwnd);
- while (msg.message != WM_QUIT)
- {
- if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- continue;
- }
- ImGui_ImplDX9_NewFrame();
- /*ImGuiStyle * style = &ImGui::GetStyle();
- style->WindowPadding = ImVec2(15, 15);
- style->WindowRounding = 5.0f;
- style->FramePadding = ImVec2(5, 5);
- style->FrameRounding = 4.0f;
- style->ItemSpacing = ImVec2(12, 8);
- style->ItemInnerSpacing = ImVec2(8, 6);
- style->IndentSpacing = 25.0f;
- style->ScrollbarSize = 15.0f;
- style->ScrollbarRounding = 9.0f;
- style->GrabMinSize = 5.0f;
- style->GrabRounding = 3.0f;
- style->Colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f);
- style->Colors[ImGuiCol_TextDisabled] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
- style->Colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
- style->Colors[ImGuiCol_Border] = ImVec4(0.80f, 0.80f, 0.83f, 0.88f);
- style->Colors[ImGuiCol_BorderShadow] = ImVec4(0.92f, 0.91f, 0.88f, 0.00f);
- style->Colors[ImGuiCol_FrameBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_FrameBgActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_TitleBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 0.98f, 0.95f, 0.75f);
- style->Colors[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
- style->Colors[ImGuiCol_MenuBarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
- style->Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_ComboBg] = ImVec4(0.19f, 0.18f, 0.21f, 1.00f);
- style->Colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
- style->Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
- style->Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_Button] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_ButtonHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_ButtonActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_Header] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
- style->Colors[ImGuiCol_HeaderHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_Column] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ColumnHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
- style->Colors[ImGuiCol_ColumnActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
- style->Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
- style->Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
- style->Colors[ImGuiCol_CloseButton] = ImVec4(0.40f, 0.39f, 0.38f, 0.16f);
- style->Colors[ImGuiCol_CloseButtonHovered] = ImVec4(0.40f, 0.39f, 0.38f, 0.39f);
- style->Colors[ImGuiCol_CloseButtonActive] = ImVec4(0.40f, 0.39f, 0.38f, 1.00f);
- style->Colors[ImGuiCol_PlotLines] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
- style->Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
- style->Colors[ImGuiCol_PlotHistogram] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
- style->Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
- style->Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.00f, 0.00f, 0.43f);
- style->Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f);
- style->WindowTitleAlign = ImVec2(0.5f, 0.5f);
- bool showMainPage = true;
- static char userVal[20];
- static char passVal[30];
- static bool pressed = false;
- const char* detectString = "UNDETECTED";
- ImGui::SetWindowPos(ImVec2(0.5f, 0.5f));
- ImGui::SetNextWindowSize(ImVec2(350, 500), ImGuiSetCond_FirstUseEver);
- if (ImGui::Begin("Loginpanel", NULL, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_NoMove))
- {
- if (showMainPage) {
- ImGui::Text("\t\t Welcome to obscurecheatz loader");
- if (detectString == "DETECTED")
- ImGui::Text("\t\t\t Status: " + _bstr_t(detectString));
- else if (detectString == "UNDETECTED")
- ImGui::Text("\t\t\t Status: " + _bstr_t(detectString));
- ImGui::Text("\t");
- {
- ImGui::Text("\t\t\t\ Your hardware-id:");
- ImGui::Text("\t" + _bstr_t(GetHardWareID().c_str()));
- ImGui::Text("\t");
- }
- {
- ImGui::Text("\t\t Login with your credentials");
- ImGui::Text("\t");
- }
- {
- ImGui::Text("\t\t\t\t Username");
- ImGui::PushItemWidth(-0.5);
- ImGui::InputText("##USERNAME", userVal, 20);
- }
- {
- ImGui::Text("\t\t\t\t Password");
- ImGui::PushItemWidth(-0.5);
- ImGui::InputText("##PASSWORD", passVal, 30, ImGuiInputTextFlags_Password);
- ImGui::Text("\t");
- }
- {
- ImGui::Text("\t ");
- ImGui::SameLine();
- if (ImGui::Button("Login", ImVec2(225, 0)))
- pressed = true;
- }
- }
- else
- {
- }
- {
- if (pressed) {
- if ((std::string)(userVal) == "" && (std::string)(passVal) == "" && pressed)
- {
- ImGui::Text("\t\t\t\ write smthn");
- }
- else {
- if ((std::string)(userVal) == "teszt" && (std::string)(passVal) == "teszt")
- {
- if (GetHardWareID() != "asd") {
- ImGui::Text("\t\t Successfully logged in!");
- showMainPage = false;
- downloadDLL();
- abort();
- }
- else {
- ImGui::Text("\t\t\t\t Invalid HWID!");
- abort();
- }
- }
- else {
- ImGui::Text("\t\tInvalid username or password!");
- abort();
- }
- }
- }
- else {
- ImGui::Text("\n");
- }
- }
- }
- ImGui::End();*/
- ImGui::SetWindowPos(ImVec2(500 / 2, 500 / 2), 0);
- if (ImGui::Begin("obscurecheatz - loader", NULL, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize))
- {
- ImGui::Text("Your hardware ID:");
- ImGui::Text(_bstr_t(GetHardWareID().c_str()));
- ImGui::Text("Login to obscurecheatz with your credentials (nice hek)");
- if (showMainPage == true)
- {
- ImGui::InputText("##USERNAME", userVal, sizeof(userVal));
- ImGui::SameLine();
- ImGui::Text("Username");
- ImGui::InputText("##PASSWORD", passwordVal, sizeof(passwordVal), ImGuiInputTextFlags_Password);
- ImGui::SameLine();
- ImGui::Text("Password");
- if (ImGui::Button("Log-In"))
- {
- if (loginValue() == true)
- {
- injectionVoid();
- }
- else
- {
- MessageBoxA(NULL, "Invalid login information!", "obscurecheatz", MB_OK);
- }
- exit(0);
- }
- }
- else {
- ImGui::Text("Please wait!");
- }
- }
- ImGui::End();
- // Rendering
- g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, false);
- g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
- g_pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, false);
- D3DCOLOR clear_col_dx = D3DCOLOR_RGBA((int)(clear_col.x*255.0f), (int)(clear_col.y*255.0f), (int)(clear_col.z*255.0f), (int)(clear_col.w*255.0f));
- g_pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, clear_col_dx, 1.0f, 0);
- if (g_pd3dDevice->BeginScene() >= 0)
- {
- ImGui::Render();
- g_pd3dDevice->EndScene();
- }
- g_pd3dDevice->Present(NULL, NULL, NULL, NULL);
- }
- ImGui_ImplDX9_Shutdown();
- if (g_pd3dDevice) g_pd3dDevice->Release();
- if (pD3D) pD3D->Release();
- UnregisterClass(_T("loader"), wc.hInstance);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement