Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Websockets.h"
- #include <thread>
- #include <iostream>
- #include "ProcMem.h"
- #include <string.h>
- #include <windows.h>
- #include <windowsx.h>
- #include <d3d9.h>
- #include <d3dx9.h>
- #include <Dwmapi.h>
- #pragma comment (lib, "winmm.lib") // Needed to play a sound
- #pragma comment (lib, "d3d9.lib")
- #pragma comment (lib, "d3dx9.lib")
- using namespace std;
- boost::mutex mtx;
- LPDIRECT3D9 d3d;
- LPDIRECT3DDEVICE9 d3ddev;
- LPD3DXFONT pFont;
- HWND hWnd;
- WNDCLASSEX wc;
- LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
- void hackFeaturesOne(svrtCSGO *hack);
- void hackFeaturesTwo(svrtCSGO *hack);
- void initD3D(HWND hWnd);
- void render_frame(void);
- void cleanD3D(void);
- void DrawString(int x, int y, DWORD color, LPD3DXFONT g_pFont, const char *fmt);
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- ZeroMemory(&wc, sizeof(WNDCLASSEX));
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = WindowProc;
- wc.hInstance = hInstance;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)RGB(0, 0, 0);
- wc.lpszClassName = L"WindowClass1";
- RegisterClassEx(&wc);
- hWnd = CreateWindowEx(NULL,
- L"WindowClass1", // name of the window class
- L"D3D Overlay", // title of the window
- WS_EX_TOPMOST | WS_POPUP, // window style
- 0, // x-position of the window
- 0, // y-position of the window
- 500, // width of the window
- 400, // height of the window
- NULL, // we have no parent window, NULL
- NULL, // we aren't using menus, NULL
- hInstance, // application handle
- NULL // used with multiple windows, NULL
- );
- SetWindowLong(hWnd, GWL_EXSTYLE, (int)GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TRANSPARENT);
- SetLayeredWindowAttributes(hWnd, RGB(0, 0, 0), 0, ULW_COLORKEY);
- SetLayeredWindowAttributes(hWnd, RGB(0, 0, 0), 255, LWA_ALPHA);
- ShowWindow(hWnd, nCmdShow); // display the window on the screen
- initD3D(hWnd);
- ::SetWindowPos(FindWindow(NULL, L"Counter-Strike: Global Offensive"), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- MSG msg;
- while (TRUE)
- {
- ::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- if (msg.message == WM_QUIT)
- break;
- render_frame();
- svrtCSGO hack; // Hack Object
- cout << "Waiting for CS:GO process..." << endl;
- while (!hack.isProcessRunning("csgo.exe"))
- {
- Sleep(500);
- }
- system("cls");
- if (hack.silentState == 1)
- {
- //ShowWindow(FindWindowA("ConsoleWindowClass", NULL), false);
- }
- hack.mem.Process("csgo.exe");
- PlaySound(TEXT("recycle.wav"), NULL, SND_FILENAME);
- // Run infinite loop for hacking actions
- while (1)
- {
- if (!hack.isProcessRunning("csgo.exe"))
- {
- exit(0);
- }
- // Exit cheat on F11
- if (GetKeyState(VK_F11) & 0x80)
- {
- Sleep(300);
- PlaySound(TEXT("recycle.wav"), NULL, SND_FILENAME);
- exit(0);
- }
- Sleep(0);
- }
- }
- cleanD3D();
- return msg.wParam;
- }
- LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message)
- {
- case WM_DESTROY:
- {
- PostQuitMessage(0);
- return 0;
- } break;
- }
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
- void initD3D(HWND hWnd)
- {
- d3d = Direct3DCreate9(D3D_SDK_VERSION);
- D3DPRESENT_PARAMETERS d3dpp;
- ZeroMemory(&d3dpp, sizeof(d3dpp));
- d3dpp.Windowed = TRUE;
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
- d3dpp.hDeviceWindow = hWnd;
- d3d->CreateDevice(D3DADAPTER_DEFAULT,
- D3DDEVTYPE_HAL,
- hWnd,
- D3DCREATE_SOFTWARE_VERTEXPROCESSING,
- &d3dpp,
- &d3ddev
- );
- D3DXCreateFont(d3ddev, 50, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial", &pFont);
- }
- void render_frame(void)
- {
- d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0);
- d3ddev->BeginScene();
- DrawString(20, 20, D3DCOLOR_ARGB(158, 80, 210, 0), pFont, "Test");
- d3ddev->EndScene();
- d3ddev->Present(NULL, NULL, NULL, NULL);
- }
- void cleanD3D(void)
- {
- d3ddev->Release();
- d3d->Release();
- }
- void DrawString(int x, int y, DWORD color, LPD3DXFONT g_pFont, const char *fmt)
- {
- RECT FontPos = { x, y, x + 120, y + 16 };
- char buf[1024] = { '\0' };
- va_list va_alist;
- va_start(va_alist, fmt);
- vsprintf_s(buf, fmt, va_alist);
- va_end(va_alist);
- g_pFont->DrawText(NULL, L"TEST", -1, &FontPos, DT_NOCLIP, color);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement