Jump to content
Nytro

[C++] Fake Blue Screen Of Death

Recommended Posts

Posted (edited)

Author: Uranium-239

#include <windows.h>

#define SCREEN(x) GetSystemMetrics(*x == 'X' ? SM_CXSCREEN : SM_CYSCREEN)

LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

char szClassName[ ] = "WindowsApp";

const char * BSOD_TEXT[] = {
"-A problem has been detected and Windows has been shut down to prevent damage",
"-to your computer.",
"*The problem seems to have been caused by the following file: SPCMDCON.SYS",
"*PAGE_FAULT_IN_NONPAGED_AREA",
"*If this is the first time you've seen this Stop error screen,",
"-restart your computer. If this screen appears again, follow",
"-these steps:",
"*Check to make sure any new hardware or software is properly installed.",
"*If this is a new installation, ask your hardware or software manufacturer",
"-for any Windows updates you may need",
"*If problems continue, disable or remove any newly installed hardware",
"-or software. Disable BIOS memory options such as caching or shadowing.",
"*If you need to use Safe Mode to remove or disable components, restart",
"-your computer, press F8 to select Advanced Startup Options, and then",
"-select Safe Mode.",
"*Technical Information:",
"**** STOP: 0x00000050 (0xFD3094C2,0x00000001,0xFBFE7617,0x00000000)",
"**** SPCMDCON.SYS - Address FBFE7617 base at FBFE5000, DateStamp 3d6dd67c"
};

void PRINT_TEXT(HDC hDC){
unsigned char k = 0;
unsigned short y_co = 30;
while(k <= 17){
if(BSOD_TEXT[k][0] == '*') y_co += 23;
TextOut(hDC,10,y_co+(k*23),BSOD_TEXT[k]+1,lstrlen(BSOD_TEXT[k])-1);
k++;
}
}

int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil){
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;

wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX);

wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;

wincl.hbrBackground = CreateSolidBrush(RGB(0,0,0x77));

if (!RegisterClassEx (&wincl))
return 0;

ShowCursor(FALSE);

hwnd = CreateWindowEx (
0,
szClassName,
"BSOD",
WS_POPUP,
0,
0,
SCREEN("X"),
SCREEN("Y"),
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);

ShowWindow (hwnd, nFunsterStil);

while(GetMessage (&messages, NULL, 0, 0)){
TranslateMessage(&messages);
DispatchMessage(&messages);
}

return messages.wParam;
}

HDC hDC;
PAINTSTRUCT ps;
HFONT hFont;

LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
switch(message){
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_PAINT:
hDC = BeginPaint(hwnd,&ps);

hFont = CreateFont(
26, 16, 0, 0,FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,DEFAULT_PITCH|FF_ROMAN,"Courier New"
);

SelectObject(hDC, hFont);
SetTextColor(hDC,RGB(0xFF,0xFF,0xFF));
SetBkColor(hDC,RGB(0,0,0x77));

PRINT_TEXT(hDC);

DeleteObject(hFont);

EndPaint(hwnd, &ps);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}

return 0;
}

Screenshot:

http://i30.tinypic.com/6qdsmw.jpg

Edited by Nytro

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...