-
Notifications
You must be signed in to change notification settings - Fork 2
/
timapple.cpp
49 lines (39 loc) · 1.29 KB
/
timapple.cpp
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
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "gui/overlay.hpp"
#include "util/MemMan.hpp"
#include "util/attributes.hpp"
LRESULT Wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam)) {
return 0;
}
switch (msg) {
case WM_SYSCOMMAND: {
if ((wParam & 0xfff0) == SC_KEYMENU)
return 0;
break;
}
case WM_DESTROY: {
PostQuitMessage(0);
return 0;
}
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
// Memory and game related vars (used in entry and passed through overlay)
int procId = MemMan.getPid(L"cs2.exe");
if (procId == 0) exit(-1);
MemoryManagement::moduleData client;
client.module = MemMan.getModule(procId, L"client.dll");
client.base = MemMan.getModuleBase(procId, L"client.dll");
// Overlay
overlayESP overlayClass;
WNDCLASSEXW windowClass = overlayClass.createWindowClass(hInstance, Wndproc, L"Tim Apple");
HWND window = overlayClass.createWindow(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
overlayClass.makeFrameIntoClientArea();
overlayClass.makeDeviceAndSwapChain();
overlayClass.initWindow(nShowCmd);
overlayClass.renderLoop(client);
return 0;
}