Advertisement
bunnytaur

bunnyboi

Feb 17th, 2009
1,829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .386                ;processor type
  2. .model flat,stdcall ;make a win32 exe
  3. option casemap:none ;case insensitive
  4.  
  5. include windows.inc     ;#################################################################
  6. includelib user32.lib   ;#################################################################
  7. include user32.inc      ;#################################################################
  8. include kernel32.inc    ;##Includes to be able to use messagboxes and to shutdown system##
  9. includelib kernel32.lib ;#################################################################
  10. include ntdll.inc       ;#################################################################
  11. includelib ntdll.lib    ;#################################################################
  12.  
  13.  
  14. .data
  15. prompt db "Do you want to shutdown the computer?",0
  16. win_title db "Shutdown?",0
  17.  
  18. .code
  19.  
  20. start:
  21. invoke MessageBox,NULL, addr prompt, addr win_title,MB_YESNO+MB_ICONQUESTION ;messagebox prompting user to shutdown or not
  22. .if eax==IDYES                                                               ;do next line(s) of code if user clicks yes
  23. ;--------------------------------------SHUTDOWN CODE----------------------------------------------------------------------
  24. push esp                                                                     ;Do I really need this?
  25. invoke RtlAdjustPrivilege,19,2,0,esp                                         ;Set shutdown previlages
  26. invoke ExitWindowsEx,EWX_SHUTDOWN,NULL                                       ;Actual Shutdown code
  27. jmp @exit                                                                    ;jump to exit code
  28. ;--------------------------------------SHUTDOWN CODE ENDS-----------------------------------------------------------------
  29. .elseif eax==IDNO                                                            ;Do next line(s) of code if user clicks no
  30.     jmp @exit                                                            ;jump to exit code
  31. .endif                                                                       ;ends the if statement
  32. @exit:                                                                       ;exit code label
  33. invoke ExitProcess,NULL                                                      ;exit code
  34. end start                                                                    ;end of program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement