Sign in to follow this  
Followers 0
d0pe

Bluescreen

18 posts in this topic

Hello ppl,

Im new to AutoIT but its quite fun tho :)

So, I made a fake bluescreen!

INCOMPLEATED>

#include <GUIConstants.au3>
HotKeySet("{Esc}", "terminate")
HotKeySet("{DEL}", "Bep")

GUICreate ('Bluescreen', @DesktopWidth + '50' , @DesktopHeight + '50')

GUISetBkColor (0x0000FF)
GUISetIcon('shell32.dll', 295)
    $w = GUICtrlCreateButton("Windows", 500, 220, 99, 24)
    GUIctrlSetBkColor($w, 0xC0C0C0)
        GUICtrlSetFont($w, 17, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($w, 0x0000FF)
        

    $m1 = GUICtrlCreateLabel ('An critical error has accurred.     To continue:', 280, 300, 700)
        GUICtrlSetFont($m1, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m1, 0xFFFFFF)

    $m2 = GUICtrlCreateLabel ('Press Enter to return to Windows, or', 280, 340, 700)
        GUICtrlSetFont($m2, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m2, 0xFFFFFF) 

    $m3 = GUICtrlCreateLabel ('Press Enter to return to Windows, or', 280, 340, 700)
        GUICtrlSetFont($m3, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m3, 0xFFFFFF) 
    
        
    $m4 = GUICtrlCreateLabel ('Press CTRL+ALT+DEL to restart your computer. If you do this,', 280, 370, 700, 23)
            GUICtrlSetFont($m4, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m4, 0xFFFFFF)
        
    $m5 = GUICtrlCreateLabel ('you will lose any unsaved information in all open applications.', 280, 395, 700, 23)
                GUICtrlSetFont($m5, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m5, 0xFFFFFF)


    $m6 = GUICtrlCreateLabel ('Error: Unknown Error', 280, 445, 700)
                GUICtrlSetFont($m6, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m6, 0xFFFFFF)


    $m7 = GUICtrlCreateLabel ('Press any key to continue _', 450, 540, 700, 25)
                GUICtrlSetFont($m7, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m7, 0xFFFFFF)
        

        
beep (700)
Func Bep()
beep (1000)
Sleep (2000)
EndFunc


Sleep ('2000')
GUISetState (@SW_SHOW)
Sleep(200000)



Func terminate()
Exit   
Endfunc

I guess I have used many codes I dont rly need in this simple script, but hey Im new and still learning :)

Anyways, I was wondering if some1 had an idea, to work out some more features on this script,

to improved and extande it :P hehe, just for fun :)

Sorry my bad English.

Regards

d0pe

Share this post


Link to post
Share on other sites



Hello ppl,

Im new to AutoIT but its quite fun tho :)

So, I made a fake bluescreen!

INCOMPLEATED>

#include <GUIConstants.au3>
HotKeySet("{Esc}", "terminate")
HotKeySet("{DEL}", "Bep")

GUICreate ('Bluescreen', @DesktopWidth + '50' , @DesktopHeight + '50')

GUISetBkColor (0x0000FF)
GUISetIcon('shell32.dll', 295)
    $w = GUICtrlCreateButton("Windows", 500, 220, 99, 24)
    GUIctrlSetBkColor($w, 0xC0C0C0)
        GUICtrlSetFont($w, 17, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($w, 0x0000FF)
        

    $m1 = GUICtrlCreateLabel ('An critical error has accurred.     To continue:', 280, 300, 700)
        GUICtrlSetFont($m1, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m1, 0xFFFFFF)

    $m2 = GUICtrlCreateLabel ('Press Enter to return to Windows, or', 280, 340, 700)
        GUICtrlSetFont($m2, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m2, 0xFFFFFF) 

    $m3 = GUICtrlCreateLabel ('Press Enter to return to Windows, or', 280, 340, 700)
        GUICtrlSetFont($m3, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m3, 0xFFFFFF) 
    
        
    $m4 = GUICtrlCreateLabel ('Press CTRL+ALT+DEL to restart your computer. If you do this,', 280, 370, 700, 23)
            GUICtrlSetFont($m4, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m4, 0xFFFFFF)
        
    $m5 = GUICtrlCreateLabel ('you will lose any unsaved information in all open applications.', 280, 395, 700, 23)
                GUICtrlSetFont($m5, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m5, 0xFFFFFF)


    $m6 = GUICtrlCreateLabel ('Error: Unknown Error', 280, 445, 700)
                GUICtrlSetFont($m6, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m6, 0xFFFFFF)


    $m7 = GUICtrlCreateLabel ('Press any key to continue _', 450, 540, 700, 25)
                GUICtrlSetFont($m7, 14, 400, -1, "MS Reference Sans Serif")
        GUICtrlSetColor($m7, 0xFFFFFF)
        

        
beep (700)
Func Bep()
beep (1000)
Sleep (2000)
EndFunc


Sleep ('2000')
GUISetState (@SW_SHOW)
Sleep(200000)



Func terminate()
Exit   
Endfunc

I guess I have used many codes I dont rly need in this simple script, but hey Im new and still learning :)

Anyways, I was wondering if some1 had an idea, to work out some more features on this script,

to improved and extande it :P hehe, just for fun :)

Sorry my bad English.

Regards

d0pe

It's been done before but nonethe less this is good practice for you

One tip - DO NOT use the "MS Reference Sans Serif" font, it is not a commonly installed font. "MS Sans Serif" would be okay. Always check the Help file >> Appendix >> Splash Fonts to see what fonts are useable in the various versions of Windows.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I made a more realistic one. It hides mouse (actually, it moves it to the bottom of the screen) and has the correct font.

Notice the 0x0000000000 things :)

HotKeySet("{ESC}", "Quit")
$window = GUICreate("Main", @DesktopWidth, @DesktopHeight)
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
Sleep(500+Random(1,1000))
GUISetBkColor(0x0000AA)
$text = "" & @CRLF & "A problem has been detected and Windows has been shut down to prevent damage" & @CRLF & "to your computer" & @CRLF & @CRLF & "The problem seems to be caused by the following file: " & @ScriptName & @CRLF & @CRLF & "FILE_ERROR" & @CRLF & @CRLF & "If this is the first time you've seen this Stop error screen," & @CRLF & "restart your computer. If this screen appears again, follow" & @CRLF & "these steps:" & @CRLF & @CRLF & "Check to make sure any new hardware or software is properly installed." & @CRLF & "If this is a new installation, ask your hardware or software manufacturer" & @CRLF & "for any Windows updates you might need." & @CRLF & @CRLF & "If problems continue, disable or remove any newly installed hardware" & @CRLF & "or software. Disable BIOS memory options such as caching or shadowing." & @CRLF & "If you need to use Safe Mode to remove or disable components, restart" & @CRLF & "your computer, press F8 to select Advanced Startup Options, and then" & @CRLF & "select Safe Mode." & @CRLF & @CRLF & "Technical information:" & @CRLF & @CRLF & "*** STOP: 0x00000000 (0xS0M3TH1NG,0x150WR0NG,0x3RR0R000,0x00000000)" & @CRLF & @CRLF & @CRLF & "***  " & @ScriptName & " - Address 4UT01T0V3 base at 4UT01T000, DateStamp t0d4yn0w" & @CRLF & @CRLF & "Beginning dump of physical memory" & @CRLF & "Physical memory dump complete." & @CRLF & "Contact your system administrator or technical support group for further" & @CRLF & "assistance."
$label = GUICtrlCreateLabel($text, 0, 0, @DesktopWidth, @DesktopHeight)
GUICtrlSetFont($label, 13, 25, -1, "Lucida Console")
GUICtrlSetColor($label, 0xFFFFFF)
Beep(1000, 250)
while $window
 MouseMove(@DesktopWidth, @DesktopHeight, 0)
wend
func Quit()
 Exit
endfunc

By the way, use esc to leave it.

Edited by Haavy

[font="Courier New"]This sentence is a lie. Or is it?[/font]Better leave AutoIt then

Share this post


Link to post
Share on other sites

I made a more realistic one. It hides mouse (actually, it moves it to the bottom of the screen) and has the correct font.

Notice the 0x0000000000 things :)

...

By the way, use esc to leave it.

Nice one, but urs has the start menu still there, atleast on my PC :)

Share this post


Link to post
Share on other sites

Nice!

Share this post


Link to post
Share on other sites

lol nice.

Looks odd when you have 2 monitors... only 1 screen is corrupt lol.

you can use functions (do a search on multiple monitor) to get the total widht of the two screens and then set the widht of your window according to that.

Share this post


Link to post
Share on other sites

you can use functions (do a search on multiple monitor) to get the total widht of the two screens and then set the widht of your window according to that.

How do you do that?


[font="Courier New"]This sentence is a lie. Or is it?[/font]Better leave AutoIt then

Share this post


Link to post
Share on other sites

lol nice.

Looks odd when you have 2 monitors... only 1 screen is corrupt lol.

if you get a blue screen on your PC, does it show on both monitors?

Share this post


Link to post
Share on other sites

Déjà vu.


Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator[center] VW Bug user[/center]Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral

Share this post


Link to post
Share on other sites

Looks good, only problem is you have 'Sleep(200000)'.

This means that the script will terminate after 200000 milliseconds.

You should replace that with an infinite loop so your program will only exit when told to. In this case, pressing escape.

While 1=1 ;When does 1 not equal 1?
      Sleep(1000) ;idle around
Wend

Oh, and it's 'occured', not 'accured' :)


My scripts:AppLauncherTRAY - Awesome app launcher that runs from the system tray NEW VERSION! | Run Length Encoding - VERY simple compression in pure autoit | Simple Minesweeper Game - Fun little game :)My website

Share this post


Link to post
Share on other sites

if you get a blue screen on your PC, does it show on both monitors?

Ive had it happen. The primary monitor is blue, the other one justs turns black (off).


www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Share this post


Link to post
Share on other sites

How do you do that?

Here it is, it returns an array X, Y, W, H

I'm not the autor of this neat piece of code and sorry i don't remember where i got it:

Func _MonitorInfo()
    Const $DISPLAY_DEVICE = "int;char[32];char[128];int;char[128];char[128]"
    Const $ENUM_CURRENT_SETTINGS = -1
    Const $ENUM_REGISTRY_SETTINGS = -2
    Const $MONITORINFO = "int;int[4];int[4];int"
    Const $DEVMODE = "byte[32];short;short;short;short;int;int[2];int;int;short;short;short;short;short;byte[32];short;ushort;int;int;int;int"
    Dim $MonitorPos[1][5]
    $dll = DllOpen("user32.dll")
    $dev = 0
    $id = 0
    Dim $dd = DllStructCreate($DISPLAY_DEVICE)
    DllStructSetData($dd, 1, DllStructGetSize($dd))
    $EnumDisplays = DllCall($dll, "int", "EnumDisplayDevices", "ptr", 0, "int", $dev, "ptr", DllStructGetPtr($dd), "int", 0)
    $StateFlag = Number(StringMid(Hex(DllStructGetData($dd, 4)), 3))
    While $EnumDisplays[0] <> 0
        If ($StateFlag <> 0x00000008) And ($StateFlag <> 0) Then ;ignore virtual mirror displays
            ;get information about the display's position and the current display mode
            Dim $dm = DllStructCreate($DEVMODE)
            DllStructSetData($dm, 4, DllStructGetSize($dm))
            $EnumDisplaysEx = DllCall($dll, "int", "EnumDisplaySettingsEx", "str", DllStructGetData($dd, 2), "int", $ENUM_CURRENT_SETTINGS, "ptr", DllStructGetPtr($dm), "int", 0)
            If $EnumDisplaysEx[0] = 0 Then
                DllCall($dll, "int", "EnumDisplaySettingsEx", "str", DllStructGetData($dd, 2), "int", $ENUM_REGISTRY_SETTINGS, "ptr", DllStructGetPtr($dm), "int", 0)
            EndIf
            ;get the monitor handle and workspace
            Dim $hm
            Dim $mi = DllStructCreate($MONITORINFO)
            DllStructSetData($mi, 1, DllStructGetSize($mi))
            If Mod($StateFlag, 2) <> 0 Then ; $DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
                ;display is enabled. only enabled displays have a monitor handle
                $hm = DllCall($dll, "hwnd", "MonitorFromPoint", "int", DllStructGetData($dm, 7, 1), "int", DllStructGetData($dm, 7, 2), "int", 0)
                If $hm[0] <> 0 Then
                    DllCall($dll, "int", "GetMonitorInfo", "hwnd", $hm[0], "ptr", DllStructGetPtr($mi))
                EndIf
            EndIf
            ;format information about this monitor
            If $hm[0] <> 0 Then
                $id += 1
                ReDim $MonitorPos[$id+1][5]
                $MonitorPos[$id][0] = Number(Hex($hm[0]))
                $MonitorPos[$id][1] = DllStructGetData($mi, 3, 1)
                $MonitorPos[$id][2] = DllStructGetData($mi, 3, 2)
                $MonitorPos[$id][3] = DllStructGetData($mi, 3, 3) - $MonitorPos[$id][1]
                $MonitorPos[$id][4] = DllStructGetData($mi, 3, 4) - $MonitorPos[$id][2]
            EndIf
        EndIf
        $dev += 1
        $EnumDisplays = DllCall($dll, "int", "EnumDisplayDevices", "ptr", 0, "int", $dev, "ptr", DllStructGetPtr($dd), "int", 0)
        $StateFlag = Number(StringMid(Hex(DllStructGetData($dd, 4)), 3))
    WEnd
    $MonitorPos[0][0] = $id
    ; free memory
    $dd = 0
    $dm = 0
    $mi = 0
    Return $MonitorPos
EndFunc ; ==> _MonitorInfo

Share this post


Link to post
Share on other sites

Here it is, it returns an array X, Y, W, H

I'm not the autor of this neat piece of code and sorry i don't remember where i got it:

...
Slow reply :)

What is $MonitorPos[$id][0]?


[font="Courier New"]This sentence is a lie. Or is it?[/font]Better leave AutoIt then

Share this post


Link to post
Share on other sites

Slow reply :)

What is $MonitorPos[$id][0]?

So you have for example $MonitorPos[$i][$j]

First dimension is the monitor number and second contain position (X, Y) and dimension (W, H)

Example:

Monitor 1 : x=0, y=0, w=1024, h=768

Monitor 2 : x=1024, y=0, w=1024, h=768

Try it you will understand

How i use it, easy to get the total widht of the two monitors, i add it monitor 1 widht + monitor 2 widht = 2048 in this case then you can define a gui for example with a widht of 2048

Share this post


Link to post
Share on other sites

So you have for example $MonitorPos[$i][$j]

First dimension is the monitor number and second contain position (X, Y) and dimension (W, H)

Example:

Monitor 1 : x=0, y=0, w=1024, h=768

Monitor 2 : x=1024, y=0, w=1024, h=768

Try it you will understand

How i use it, easy to get the total widht of the two monitors, i add it monitor 1 widht + monitor 2 widht = 2048 in this case then you can define a gui for example with a widht of 2048

I understood the x,y,w,h thing but those are the 1, 2, 3 and 4 part of the array ($MonitorPos[$id][1-4] = x, y, w, h). But what is the zero?($MonitorPos[$id][0] = ?)

[font="Courier New"]This sentence is a lie. Or is it?[/font]Better leave AutoIt then

Share this post


Link to post
Share on other sites

But what is the zero?($MonitorPos[$id][0] = ?)

I am not 100% sure, because I never use arrays unless I have to.

But I think that means there are not augments set.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

I am not 100% sure, because I never use arrays unless I have to.

But I think that means there are not augments set.

$monitors[$id][0] is set to Number(Hex($hm[0])), which is 10001 in my case.

Earlier in the function:

$hm = DllCall($dll, "hwnd", "MonitorFromPoint", "int", DllStructGetData($dm, 7, 1), "int", DllStructGetData($dm, 7, 2), "int", 0)
If $hm[0] <> 0 Then
DllCall($dll, "int", "GetMonitorInfo", "hwnd", $hm[0], "ptr", DllStructGetPtr($mi))
EndIf

I think this is the screen number (the second screen is 10002 or 20002) but I can not test this as I only have one monitor.

After playing around with it I found that

$hm[0] is 0x00010001

Hex($hm[0]) is 00010001

So basically, we need to know what

DllCall($dll, "hwnd", "MonitorFromPoint", "int", DllStructGetData($dm, 7, 1), "int", DllStructGetData($dm, 7, 2), "int", 0)

and

DllCall($dll, "int", "GetMonitorInfo", "hwnd", $hm[0], "ptr", DllStructGetPtr($mi))

is.

Oh no! Such a long post and no smilies... better make some then :)

:)


[font="Courier New"]This sentence is a lie. Or is it?[/font]Better leave AutoIt then

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0